Allowing students to edit multiple source files

Re: Allowing students to edit multiple source files

by Richard Lobb -
Number of replies: 0
Hi Carlos

Good to know it's working.

My caveat about loading issues was mostly just me covering my butt in case something weird happened.

There are occasionally problems loading the Ace editor in some environments, such as with very slow or misconfigured servers, clogged networks or disabled JavaScript caching. The loading of Ace in this case is more complicated than usual because there are three separate instances of the UserInterfaceWrapper class being created, each of which is requesting the Ace editor. I've never run three UserInterfaceWrappers in a UI before, although we've run with two instances on many occasions in our own labs. So I was being super-cautious, warning you that you're proceeding at your own risk here. I think problems are unlikely but I'm never prepared to say the're impossible.

I'd be very surprised if resource usage is a problem compared to attachments and support files, unless you have very large files. Attachments and support files are cached on the Jobe server, so are (usually) uploaded only once. But in this question model, they are sent encoded in the Json student-answer response every time. However, the extra size of the response is almost irrelevant compared to the compile time cost. And you might even win fractionally if every student submits a different answer because with attachments there are two round trips to the Jobe server if an attachment isn't in Jobe's cache (one on the assumption the file is there already and the second, with the file, when a 404 response is received). But g++ compile times are huge compared to all such overheads unless you have huge files. Certainly the cost of running via Python rather than directly through PHP is completely swamped.

I have no particular observations about your question except to ask if you have considered the use of the Ace-in-line filter extension? It works hand-in-hand with CodeRunner to allow you to display editable or (in this case) read-only code inside the Ace editor within your question text. Looks much nicer.

One other thought occurs: if you were to write questions with lots of test cases, this model would be inefficient because each test is a separate Jobe task, with its own compile-and-build. You can avoid the multiple compiles by use of a combinator template, which receives all the test cases in a single run. But it adds a level of complexity.

Richard