RunestoneInteractive / RunestoneComponents

Packaging of the Runestone tools for publishing educational materials using github pages
http://runestoneinteractive.org
Other
101 stars 225 forks source link

Losing data when editing exercises #1153

Closed cigas closed 3 years ago

cigas commented 3 years ago

What Course are you in CS152HOSP2021

What Page were you on Instructor/Assignments

What is your username cigas

Describe the bug Edit an exercise Generate HTML Load Code/Run View Differences Click OK (in Chrome) KABLOOEY! There's a funky URL resulting in a Bad Gateway error. Any unsaved data is gone.

https://user-images.githubusercontent.com/11619455/112088323-a1efd180-8b5d-11eb-869d-7cd00897d724.mp4

Javascript Errors Here's the URL that got generated

https://runestone.academy/runestone/admin/assignments?editRST=..+actex%3A%3A+CS152_list_delete_first_a%0D%0A++++%3Apractice%3A+T%0D%0A++++%3Aautograde%3A+unittest%0D%0A++++%3Anocodelens%3A%0D%0A%0D%0A++++Write+a+non-fruitful+function+called+%60%60list_delete_first%28aList%29%60%60+that+takes+a+list+of+strings+as+an+argument%0D%0A++++and+deletes+the+first+element.+The+function+does+not+return+anything+it+just+modifies+the+list.%0D%0A++++%7E%7E%7E%7E%0D%0A%0D%0A++++def+list_delete_first%28aList%29%3A%0D%0A++++++++%23+your+code+here%0D%0A++++++++bogus+%3D+3+%23+Can%27t+see+the+tests+until+there+is+some+code.+%0D%0A++++++++%23+HI+BRAD%21%0D%0A++++%3D%3D%3D%3D%0D%0A%0D%0A++++from+unittest.gui+import+TestCaseGui%0D%0A%0D%0A++++class+myTests%28TestCaseGui%29%3A%0D%0A+++++++++def+_my_del%28self%2CaList%29%3A%0D%0A+++++++++++++del+aList%5B0%5D%0D%0A%0D%0A+++++++++def+setUp%28self%29%3A%0D%0A+++++++++++++self.lists+%3D+%5B%5B%27William%27%2C+%27Gibson%27%5D%2C%5B%27x%27%2C%27y%27%2C%27z%27%5D%2C%5B%27a%27%2C%27b%27%2C%27c%27%2C%27d%27%2C%27e%27%2C%27f%27%5D%2C%5B%27all+gone%27%5D%5D%0D%0A+++++++++++++self.notes+%3D+%5Bstr%28s%29+for+s+in+self.lists%5D%0D%0A+++++++++++++self.results+%3D+%5Bs%5B1%3A%5D+for+s+in+self.lists%5D%0D%0A%0D%0A+++++++++def+testOne%28self%29%3A%0D%0A+++++++++++++for+i+in+range%28len%28self.lists%29%29%3A%0D%0A+++++++++++++++++list_delete_first%28self.lists%5Bi%5D%29%0D%0A+++++++++++++++++self.assertEqual%28self.lists%5Bi%5D%2C+self.results%5Bi%5D%2C+self.notes%5Bi%5D%29%0D%0A%0D%0A++++myTests%28%29.main%28%29&qrawhtml=%0D%0A%3Cdiv+class%3D%22runestone+explainer+ac_section+alert+alert-warning%22%3E%0D%0A%3Cdiv+data-component%3D%22activecode%22+id%3DCS152_list_delete_first_a+data-question_label%3D%221%22%3E%0D%0A%3Cdiv+id%3DCS152_list_delete_first_a_question+class%3D%22ac_question+col-md-12%22%3E%0D%0A%3Cp%3EWrite+a+non-fruitful+function+called+%3Ccode+class%3D%22docutils+literal+notranslate%22%3E%3Cspan+class%3D%22pre%22%3Elist_delete_first%28aList%29%3C%2Fspan%3E%3C%2Fcode%3E+that+takes+a+list+of+strings+as+an+argument%0D%0Aand+deletes+the+first+element.+The+function+does+not+return+anything+it+just+modifies+the+list.%3C%2Fp%3E%0D%0A%0D%0A%3C%2Fdiv%3E%0D%0A%3Ctextarea+data-lang%3D%22python%22+id%3D%22CS152_list_delete_first_a_editor%22+%0D%0A++++data-hidecode%3D%22true%22++data-timelimit%3D25000+data-coach%3D%22true%22++++%0D%0A++++data-audio%3D%27%27++++++%0D%0A++++++++data-gradebutton%3Dtrue+++data-wasm%3D%2F_static+%0D%0A+++++style%3D%22visibility%3A+hidden%3B%22%3E%0D%0A%0D%0Adef+list_delete_first%28aList%29%3A%0D%0A++++%23+your+code+here%0D%0A++++bogus+%3D+3+%23+Can%27t+see+the+tests+until+there+is+some+code.%0D%0A++++%23+HI+BRAD%21%0D%0A%3D%3D%3D%3D%0D%0A%0D%0Afrom+unittest.gui+import+TestCaseGui%0D%0A%0D%0Aclass+myTests%28TestCaseGui%29%3A%0D%0A+++++def+_my_del%28self%2CaList%29%3A%0D%0A+++++++++del+aList%5B0%5D%0D%0A%0D%0A+++++def+setUp%28self%29%3A%0D%0A+++++++++self.lists+%3D+%5B%5B%27William%27%2C+%27Gibson%27%5D%2C%5B%27x%27%2C%27y%27%2C%27z%27%5D%2C%5B%27a%27%2C%27b%27%2C%27c%27%2C%27d%27%2C%27e%27%2C%27f%27%5D%2C%5B%27all+gone%27%5D%5D%0D%0A+++++++++self.notes+%3D+%5Bstr%28s%29+for+s+in+self.lists%5D%0D%0A+++++++++self.results+%3D+%5Bs%5B1%3A%5D+for+s+in+self.lists%5D%0D%0A%0D%0A+++++def+testOne%28self%29%3A%0D%0A+++++++++for+i+in+range%28len%28self.lists%29%29%3A%0D%0A+++++++++++++list_delete_first%28self.lists%5Bi%5D%29%0D%0A+++++++++++++self.assertEqual%28self.lists%5Bi%5D%2C+self.results%5Bi%5D%2C+self.notes%5Bi%5D%29%0D%0A%0D%0AmyTests%28%29.main%28%29%0D%0A%3C%2Ftextarea%3E%0D%0A%3C%2Fdiv%3E%0D%0A%3C%2Fdiv%3E%0D%0A

bnmnetp commented 3 years ago

It appears that with whatever version of Chrome you are using the button type for the expand differences is now being interpreted as a submit request. I'll try to have a fix in by Saturday. In the meantime you should avoid pressing the Expand Differences button when you are editing.

bnmnetp commented 3 years ago

Fixed in Runestone fork of skulpt. Released soon.