Open dmouriss opened 5 years ago
So if I get things right, the first thing to do is actually test the code server side with node js?
Original comment by @bmesuere on Thu Apr 21 2016 at 20:34.
The jslogger
script should be tested with node js. It generates a traceback in json format that is used to create the python tutor ui. It is already on the server in the dodona home directory. The following command is used to call the jslogger script.
node --expose-debug-as=Debug ~/jslogger.js --jsondump=true <file>
Original comment by @dmouriss on Thu Apr 21 2016 at 20:47.
But if the JS engine on the server and the client aren't the same, wouldn't this be confusing for students? For example for browser-specific errors?
Original comment by @bmesuere on Thu Apr 21 2016 at 20:55.
The python tutor has to 'compile' the code into a json traceback. And I'm not sure this is easily done client side since the scripts needs a Debug object that you can get by passing the expose-debug flag in node js. I don't have any idea if this is possible in regular javascript.
Were we not planning to move the judge serverside and use node js? That would solve it, I guess. Otherwise we could look into ways to build the traceback ourselves.
P.S: We also had that problem on pythia, the tutor used a different python version, so the results in the tutor did not always match the results in the tests. But this was something that was quite rare. Do you think it will be more common with javascript?
Original comment by @dmouriss on Thu Apr 21 2016 at 22:01.
Yes, error messages are browserspecific and ES6 support is mixed. I already had someone asking why something worked locally (using node and webstorm) but not in Firefox.
Original comment by @bmesuere on Thu Apr 21 2016 at 22:13.
@bmesuere @dmouriss if the Online JavaScript Tutor (OJT) works the same way as the Online Python Tutor (OPT), there is no other option than providing server-side support; this is how the OPT/OJT work
Original comment by @pdawyndt on Wed Apr 27 2016 at 18:43.
For the moment the tutor loads the code from the file
testcode.js
located in the root directory. This can be seen by surfing to /tutor/....The view executes
jslogger.js
(for the moment located in the home directory of the webshare) with node js. This generates a json file that contains the necessary information for the tutor. This json string is loaded in the javascript of the view and the javascript to build the tutor ui is executed.These are som things that need to be done:
jslogger.js
script (either by passing the code as a string or creating a temp file)Original issue by @dmouriss on Thu Apr 21 2016 at 17:30.