jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.49k stars 743 forks source link

export issues #2251

Closed Andrey-TEALS closed 5 years ago

Andrey-TEALS commented 5 years ago

Hi everybody!

Thank you for a great product!

I trying to find a reason why students can't export projects. I am also open to hints what might be wrong on my end (I do not see any discussion on Internet for my issue). Below are additional details.

I am working with remote students and when they export project into xml, import fails. Yet, everything works on my end (as usual with developers!). I believe they use Chrome (>=58.0)

I looked inside trying to fix them by hand. File with next tags before looks like this: `

`

My exported file has extra list tags:

`

`

I made manual change and xml file is successfully loaded. Unfortunately this have not fully addressed my issue as I see that export did lost some blocks (they are on student's screen shorts).

What could be wrong on my end?

Thanks you for looking.

Andrey

jmoenig commented 5 years ago

Hi Audry, bummer! I've seen this happen - but so far only very rarely. The last time I saw it was two weeks ago when someone was actually using IE. I'd love to look into this and maybe make it so that at least the projects load even when the costumes-list is missing (another possible reason might be low memory situations, although that's just a speculation that probably doesn't make much sense). Could you maybe send me one or several of the brokern XMLs (either via a Dropbox link or you can also paste them in here). That would help me address this issue a lot. Thanks! Jens

jguille2 commented 5 years ago

Hi, I only want to note, that it seems the same issue that #2224.

It was using "Save to the cloud", but the problem seems the same. Certainly, we must take care of this.

Andrey-TEALS commented 5 years ago

Hi,

I agree, #2224 do match my description. Yey! I am not alone :) I said that students use Chrome, but looking close (after reading #2224) I see that screenshort is actually from IE. I hope that switching to Chrome would help me today.

I changed extention from XML to LOG (editor is refusing XML documents) PROJECT 9 11-8-2018.log

Here is original problem (I have not shared it before). This is result of pressing "Share" pastedimage 1

Screenshort and project file are for the same code.

I have another similar project, and I see that in both cases "loop forever" is empty. This might be a hint for a root cause?

Thank you!

jmoenig commented 5 years ago

So, this is good. I think the root of the problem is IE. That is very consistent with what happened in the other cases. Let me look into this. Thanks!

The problem is that once the project has been exported in a broken state by IE, switching back to a standards-compliant current browser like Chrome, Edge, Firefox, Opera etc. will no longer help, because the project is already broken. I guess we can special case for those broken projects, and maybe make it so we find why IE behaves like that in the case of costume lists. This looks fixable!

Andrey-TEALS commented 5 years ago

Just want to let you know of the results: switching to Chrome did help with sharing projects! Export to xml is abandoned as it was a backup. One student tried to reuse prior project (from IE), it is shared successfully, but when opened has same "list" issue.

Thanks you for help!

cycomachead commented 5 years ago

One student tried to reuse prior project (from IE), it is shared successfully, but when opened has same "list" issue.

When you open the shared project, the URL will contain #present:.... If you change the present to dl, Snap! will download the XML instead of trying to load it, which should let you recover the project manually.

jmoenig commented 5 years ago

I'm just now preparing a patch that will let you/your students open such corrupted projects anyway, hang on for a few days at max!

Andrey-TEALS commented 5 years ago

Here is python utility that could help to convert (in zip archive)

`>python fixer.py -h usage: fixer.py [-h] [-i] [-f PROJECT_XML_FILE]

fix SNAP project when it complains about list tag

optional arguments: -h, --help show this help message and exit -i, --in-place make changes to original file -f PROJECT_XML_FILE, --project-xml-file PROJECT_XML_FILE name of the project file `

fixer.zip

to execute (careful, file is replaced): python fixer.py -f "project.xml" -i

jmoenig commented 5 years ago

thanks, @Andrey-TEALS ! BTW I did end up patching the upcoming maintenance release of Snap! with a fix that doesn't require you to edit or modify the XML files. It's already online for testing: https://snap.berkeley.edu/snapsource/dev and you should be able to load those projects that have been corrupted by IE with it. It won't complain, but if you open a JS console you'll see notificiations about the issues it encountered.