jcrodriguez-dis / moodle-mod_vpl

Virtual Programming Lab for Moodle (Module)
GNU General Public License v3.0
97 stars 84 forks source link

Pre-evaluate craches but evaluate works #173

Open alexandreMesle opened 4 months ago

alexandreMesle commented 4 months ago

Hi everybody,

Thanks for this awesome plugin, it has changed my life. For years it worked like a charm, but strange javascript errors appareared some weeks ago in the IDE.

First of all, the url https://mymoodleinstallation.com/editor/userpreferences.json.php is called and is reported in the developper toolbar console. The workaround is ugly but easy, I just had to replace the ../editor/userpreferences.json.php with /mod/vpl/editor/userpreferences.json.php in javascript calls, clear the javascript cache and the 404 error disappeared.

Unfortunately, it is not enough to make the preevaluation work again. When someone tries to preevaluate, I get the javascript error jQuery.Deferred exception: VPLUtil.requestAction is not a function TypeError: VPLUtil.requestAction is not a function in the jquery-3.4.1.min.js:2 file.

Since I am not skilled in javascript, I do not really understand what goes wrong. Maybe the javascript asset compilation failed to include some javascript files from the VPL question plugin ? Does someone have a workaround ?

Before you ask, I'm still under version 3. Moodle upgrades are a pain in the neck if not installed with git, especially if you have a lot of plugins (if your wonder why, remember one must not copy the new files over the old ones). I will have to wait for the holidays before trying to do it. Maybe is it related to this issue. But it does not explain why this issue appeared out of nowhere...

Thanks and have a nice day !

jcrodriguez-dis commented 4 months ago

Dear Alexandre, Thank you for reaching out and sharing the details of the challenges you're encountering with the plugin. It's great to hear about the positive impact it has had on your experience so far. Let's work together to troubleshoot the errors you've described.

To better assist you, could you please specify the exact versions of Moodle and the Virtual Programming Lab (VPL) plugin you are currently using? Knowing the specific versions can greatly help in identifying potential compatibility issues or bugs that might be causing these problems.

Best regards, Juan Carlos

alexandreMesle commented 4 months ago

Dear @jcrodriguez-dis,

Thanks for your answer, my moodle version is 3.9.3 (yeah, I am veeeeeeeeery late, but I can't touch the moodle core before the next holidays).

Virtual programming lab is in version 4.2.3-Legacy and works fine.

Question VPL in version 1.7.1. Downgrading the plugin could help, this way we could make sure it is a version issue. But since some plugin upgrades has side effects on the database, I am not sure it would be a good idea. Do you think I could do it ?

Regards, Alexandre.

jcrodriguez-dis commented 4 months ago

Dear @alexandreMesle,

Given the complexity of the situation and the potential risk associated with downgrading plugins, especially when database modifications are involved, I would recommend a more cautious approach to ensure that we do not inadvertently introduce new issues or lose data.

Before considering a downgrade of the VPL plugin, I strongly suggest reaching out to @Astor-Bizard, the developer of the VPL Question plugin. They might also have insights into whether the problem you're experiencing is known and if there are any patches or updates available that can resolve the issue without requiring a downgrade.

If a downgrade is necessary (I think may be safe until VPL 3.5), please ensure that you take backups of both your Moodle database and files. This step is critical to safeguard your data and allow for recovery in case the downgrade process does not go as planned or if unexpected issues arise.

Best regards, Juan Carlos

Astor-Bizard commented 4 months ago

Hello @alexandreMesle ,

I strongly recommend to upgrade the qtype_vplquestion plugin to a version compatible with VPL 4.2+. I have updated the plugin record on https://moodle.org/plugins/qtype_vplquestion to specify that is is compatible with Moodle 3.9.

Best regards, Astor