Moodle 4

Moodle 4

by Thomas Karp -
Number of replies: 21

Hi,

has anybody updated to Moodle 4 already?

 I tried, but coderunner questions didn‘t work. I got some DB errors. After returning to 3.11 everything was fine again.

Kind regards, Tom

In reply to Thomas Karp

Re: Moodle 4

by Richard Lobb -
I've started to look into it and I have the main functionality working. But Moodle 4.0 has made a lot of major changes and it will be at least several weeks before a version of CodeRunner for Moodle 4.0 is officially released through the Moodle plugin repository. There will perhaps be a beta release on github in the development branch in a week or two if you want to be a beta tester?
In reply to Richard Lobb

Re: Moodle 4

by Thomas Karp -
I don't have to switch to Moodle 4.0 quickly, so waiting several weeks is no problem.
But if it helps to do some beta testing I can do that of course.

Thanks for working on the plugin!!!
In reply to Richard Lobb

Re: Moodle 4

by Thomas Karp -
I have seen that there were changes in the development branch for Moodle 4.0. Does it make sense to test already?
In reply to Thomas Karp

Re: Moodle 4

by Richard Lobb -
Well that was very timely. I just this minute pushed to the development branch what I hope is a release candidate for Moodle 4.0. I've got all the test suite working and apart from some rough edges in the bulk tester I don't know of any bugs. But it hasn't been subjected to much in the way of user testing yet. I'd be thrilled if you'd check it out on your system. Many thanks for offering.
In reply to Richard Lobb

Re: Moodle 4

by Thomas Karp -
I had problems updating to Moodle 4.0 on my shared hosting (not because of coderunner). Probably I will have to switch to another server.
I tried Moodle 4 with coderunner (development branch) on the server where I am running jobe. Because I can't update my production site, I can't do massive testing yet. But first tests with some simple Java and Python questions did work.

Thank you very much for updating coderunner very quickly. It seems to work for me!

Guess Moodle 4.0 has to wait a little bit for me. Not all plugins I use work already, and moving to another server will be more work than I hoped I have to invest to update...
In reply to Thomas Karp

Re: Moodle 4

by Richard Lobb -
Many thanks for checking it out Thomas. I can't really do massive testing with Moodle 4 either. We're certainly not upgrading our production servers in the middle of the semester. We will consider upgrading for semester 2 which starts in early July, though I'm a little nervous even there. Not so much because of CodeRunner but because Moodle 4 is still very new and while it has lots of exciting features I suspect it still hasa few rough edges. I failed to import a course into it the other day and I don't think the problems were CodeRunner related though I need to more closely.
In reply to Richard Lobb

Re: Moodle 4

by Thomas Karp -
Hi,
I just want to give feedback:
I spent a little bit of time setting up a new Moodle 4.0 site since upgrading did not work with the webspace I used.
Moodle 4.0 is now my production site. I use it only with few students, but until now every coderunner test (Java and Python) they had to do, did work!!!

Thank you very much for the great tool !!!
In reply to Richard Lobb

Re: Moodle 4

by Łukasz Szeremeta -
I would like to ask when you are planning to release a stable version of CodeRunner on Moodle 4.0? Could you specify any timeframe?
In reply to Łukasz Szeremeta

Re: Moodle 4

by Richard Lobb -
I've released a 4.0-compatible CodeRunner plugin in the Moodle plugins directory. I'm calling it a Release Candidate rather than Stable as we're not yet running Moodle 4.0 in our institution and so I haven't tested under typical student load. All normal tests pass, however. When some institutions report back (here, for example) that the plugin has been in production use for some weeks without any significant issues I'll upgrade it to Stable.
In reply to Richard Lobb

Re: Moodle 4

by Łukasz Szeremeta -

Great, thanks 🙂

I don't know if this question is ok but when are you planning to switch to Moodle 4.0 in your institution?

In reply to Łukasz Szeremeta

Re: Moodle 4

by Richard Lobb -
The IT department plans to switch the main University Moodle server to Moodle 4 for the start of the 2023 academic year: February 2023. We aim to switch our departmental server, which runs the biggest CodeRunner courses, to Moodle 4.0 for the summer school this year, which starts late November.
In reply to Łukasz Szeremeta

Re: Moodle 4

by Tim Hunt -
The Open University will almost certainly go to Moodle 4.0 this December (2022).

We have put the latest CodeRunner on our test server, with a copy of all our live questions, and everything seems to be working so far.
In reply to Thomas Karp

Re: Moodle 4

by Abhijit A.M. -
Getting following errors on upgrading coderunner in Moodle. 4.0
Upgrade of coderunner is failing with this error:
Upgrading to new version
qtype_coderunner

Error reading from database

More information about this error

Debug info: Unknown column 'q.category' in 'on clause'
SELECT q.id
FROM mdl_question q JOIN mdl_question_categories cats
ON q.category = cats.id
WHERE cats.contextid=?
AND cats.name='CR_PROTOTYPES'
AND q.name LIKE '%PROTOTYPE_%'
[array (
0 => 1,
)]
Error code: dmlreadexception

Stack trace:

line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 1273 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 65 of /question/type/coderunner/db/upgradelib.php: call to mysqli_native_moodle_database->get_records_sql()
line 43 of /question/type/coderunner/db/upgradelib.php: call to delete_existing_prototypes()
line 437 of /question/type/coderunner/db/upgrade.php: call to update_question_types()
line 709 of /lib/upgradelib.php: call to xmldb_qtype_coderunner_upgrade()
line 1935 of /lib/upgradelib.php: call to upgrade_plugins()
line 719 of /admin/index.php: call to upgrade_noncore()



Coderunner version.php

$plugin->version = 2022022300;
$plugin->requires = 2019111800;
$plugin->cron = 0;
$plugin->component = 'qtype_coderunner';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '4.2.3';

$plugin->dependencies = array(
'qbehaviour_adaptive_adapted_for_coderunner' => 2021112300
);
In reply to Abhijit A.M.

Re: Moodle 4

by Richard Lobb -
Your version of CodeRunner is 2022022300, but this is not compatible with Moodle 4. There is not yet an official release of CodeRunner for Moodle 4, but the development branch on github (https://github.com/trampgeek/moodle-qtype_coderunner/tree/development) is a release candidate that works for at least a couple of other users (see above). Please try this, and report back to say if you have any problems or not.
In reply to Richard Lobb

Re: Moodle 4

by Vladimir Ilyin -
I installed the right version and it works fine with new questions. But my previos questions, which I made on Moodle3 do not work. Can I fix it?
In reply to Vladimir Ilyin

Re: Moodle 4

by Richard Lobb -
The previous questions should work. I have thousands of them, all working fine. Please describe how you moved the questions across and exactly what goes wrong.
In reply to Richard Lobb

Re: Moodle 4

by Vladimir Ilyin -
I installed Moodle4 on a new server.
Backed up course from the old one with Moodle3 and restore on the new with 4.
Then I installed coderunner. It did not work, because it was version fh Moodle3. I reinstalled the correct version.

And now when I open question or test with it I get a lot error lines like this

Notice: Undefined property: stdClass::$coderunnertype in /var/www/html/moodle/question/type/questiontypebase.php on line 1015

Notice: Undefined property: stdClass::$prototypetype in /var/www/html/moodle/question/type/questiontypebase.php on line 1015

Notice: Undefined property: stdClass::$allornothing in /var/www/html/moodle/question/type/questiontypebase.php on line 1015
In reply to Vladimir Ilyin

Re: Moodle 4

by Richard Lobb -
The problem here is the order in which things happened. It's not related to the version of Moodle or the plugin.

Every question type has its own code for backing up and restoring its questions. This includes copying all the question-specific info to the question type's own database table(s).

It seems you did a course restore onto a Moodle system that didn't have CodeRunner installed. So the question-specific processing didn't take place and all the extra info was lost. The only way to recover is to go back to the course backup and repeat the restore.

Note that this is true of all plugins: you need to install any required plugins before restoring a course that requires them. The system should have warned you it couldn't properly restore the course, but the severity of the warning is perhaps somewhat understated.
In reply to Richard Lobb

Re: Moodle 4

by Laurent Berger -
I have got same problem with moodle 4. I read https://github.com/trampgeek/moodle-qtype_coderunner :
"You can then complete the installation by logging onto the server through the web interface as an administrator and following the prompts to upgrade the database as appropriate."
and I think i need to be an admnistrator on my web server to install coderunner from git; I 'm not an administrator so How can i install coderunner plugins?