How to use Input UIs -> Ace_mini_ide

How to use Input UIs -> Ace_mini_ide

by Christian Milani -
Number of replies: 4

Hello,

I am a Moodle admin in my university and a teacher asked me to allow students to run the code before submitting it.

He asked me to enable under "Customisation" this option:

Every time i try to use it the ajax will return an error and this alert is shown on the page

this is what is returned from the ajax:

[{"error":true,"exception":{"message":"Invalid parameter value detected","errorcode":"invalidparameter","link":"https:\/\/MOODLEURL\/question\/question.php?returnurl=%2Fquestion%2Fedit.php%3Fcourseid%3D195&courseid=195&id=718","moreinfourl":"https:\/\/docs.moodle.org\/311\/en\/error\/debug\/invalidparameter"}}]

Unfortunately in the documentation I didn't find anything on this  "Ace_mini_ide"

What's the difference between using this option and using "Submit Buttons" -> "Precheck"? He didn't want to allow the students to see all the errors printed by the precheck.

Have a nice day

christain

In reply to Christian Milani

Re: How to use Input UIs -> Ace_mini_ide

by Richard Lobb -
Sorry Christian, the Ace_mini_ide UI was the start of an experiment some time, which I abandoned. It was never meant to escape into the wild. It's nowhere near workable.

However, we have since then developed a working version called scratchpad_UI that lets the student run any code they like (usually their answer, with test code appended). It looks like this (once the Scratchpad section has been opened and used):



The Run button submits to the Jobe sandbox server more-or-less directly, using CodeRunner's web service. Student runs of this sort are not recorded - they're not "submissions" in the ordinary sense. They are logged in the activities log but without any detailed information.

This new UI, which works with any language, is currently only in the development branch, but we've used it with a class of around 1000 students since February and it's solid. It has been very successful - arguably far too successful as students are reluctant to then move to an IDE.

There's one tiny bug to fix and then I'll merge it into master and push to github. Perhaps in a couple of weeks?

Waiting for that is probably your best option, if I'm understanding your teacher's requirements.

Other options, if you don't want to run the risk of a plugin upgrade in the middle of a course:

  • If it's a Python course, use the Python3 scratchpad question type explained on the home page of coderunner.org,nz (scroll to the bottom section). This does require a recent version of the CodeRunner plugin, however. It's essentially a prototype for the Scratchpad UI, but works only with Python.
  • If you just want to be able to run programs on the Moodle site, set up a special "sandpit" question type, as described (for Python, but it works for other languages) here.
  • Customise the behaviour of the Precheck button to get closer to what is wanted. The built-in functionality allows you to set the Precheck button to (a) simply run the code the student provides, displaying any output (which should be empty if the precheck is to "pass") (b) running the student code together with the example test cases (c) running the student code with a selected subset of the test cases. If you want other behaviour the template can be customised to check if it's doing a precheck (there's a {{ IS_PRECHECK }} template variable in Twig) and do something different, but I doubt this helps in your case.
In reply to Richard Lobb

Re: How to use Input UIs -> Ace_mini_ide

by Christian Milani -
Hello Richard,

Thanks a lot for the detailed answer and for a possible solution!

He is teaching R and we are using a python3 script to run R, I found this solution last year in the forums. Do you think it might work?

have a nice day
christian
In reply to Christian Milani

Re: How to use Input UIs -> Ace_mini_ide

by Richard Lobb -
Can you clarify what you mean by "this solution", please?
In reply to Richard Lobb

Re: How to use Input UIs -> Ace_mini_ide

by Christian Milani -
The solution to check R code with coderunner by using a python3 script that run R.

I'll try to use the precheck, it should work.

thanks again!
christian