Beginner Moodle/CodeRunner setup issues

Beginner Moodle/CodeRunner setup issues

by Matt Godfrey -
Number of replies: 4

Kia ora

last week I managed to install Moodle and CodeRunner and am just trying to get familiar with how it works by making a course and some questions. 

I found this video somewhat helpful: https://www.youtube.com/watch?v=Wpp5L3gNfoQ&t=26s

But at 2:40 into this video. I'm supposed to be able to choose the question type. But that list is not populated with any options. 

I've never used Moodle or CodeRunner before, so I may have missed an installation step somewhere. 


In reply to Matt Godfrey

Re: Beginner Moodle/CodeRunner setup issues

by Paul McKeown -
Hi,

It sounds like the post install task to setup the system level Coderunner question types/prototypes hasn't run. This is common on test systems where cron may not be setup and therefore the task doesn't get run automatically.

To install the prototype go to Site Administration -> Server -> Adhoc Tasks and run the Coderunner post install task.

Unfortunately, in v5.0+, these prototypes can't be added to the Moodle database until the Coderunner install is fully complete and therefore needs to be run post install...

Cheers,
Paul
In reply to Paul McKeown

Re: Beginner Moodle/CodeRunner setup issues

by Matt Godfrey -
Thanks. I saw that there was something in the Adhoc tasks section. So when I manually ran php admin/cli/cron.php , it resolved the issue and the question types are now available.

That script take about 3 minutes to run but the moodle documentation says the cron job should be set for every minute. So I'm not too sure what I should set it as in crontab. I don't think cron script should be run if it's still running from the time before unless it already knows it's running. 
In reply to Matt Godfrey

Re: Beginner Moodle/CodeRunner setup issues

by Richard Lobb -
Just use the recommended 1 minute interval. Moodle's cron library allows some concurrency (by default, 3 concurrent scheduled tasks and 3 concurrent ad hoc tasks) and has locks to prevent issues.
In reply to Richard Lobb

Re: Beginner Moodle/CodeRunner setup issues

by Paul McKeown -
Hi,

Following on from Richard's response.

The main cron.php job is like a heart-beat. It runs every minute (typically) and kicks off any jobs that need running. It runs all the jobs scheduled for that minute, in order, and waits for them to finish. If they don't all get done in the minute, the main cron misses a beat, ie, it won't fire again until it's last run has finished.

Typically you can get away with one cron job but you can add more if needed (by adding multiple cron.php and/or adhoc_task.php lines in your crontab). See the Scaling up cron with multiple processes section in the Moodle cron docs (here).

I suspect that your first run picked up all the Moodle install related ad-hoc tasks (not just Coderunner) and hence it took a while. Now that things are setup, the normal day-to-day cron jobs won't be so taxing.

On tests systems I rarely even setup cron and simply run the adhoc tasks from the web admin pages (Server -> Ad hoc tasks), eg, when I notice the Coderunner prototypes are missing. So, if you're just playing around on a test system you don't necessarily need to bother too much with cron (unless you are testing something that uses scheduled tasks - and even then you can got to Sever -> Scheduled tasks and kick them off manually).

Cheers,
Paul