maths / moodle-qtype_stack

Stack question type for Moodle
GNU General Public License v3.0
141 stars 150 forks source link

Bespoke validation functions returning TIMEDOUT error unexpectedly #1121

Open LukeLongworth opened 7 months ago

LukeLongworth commented 7 months ago

Problem: I am getting a TIMEDOUT error with my bespoke validation function for an unknown reason. To try and diagnose it, I recreated the error in a very simple question: image image Then at the PRT I just check whether ans1 = 1.

In this form, the question works exactly as intended, but when I un-comment the line that calls an integral, I get a TIMEDOUT error in the validation. This feels very strange to me. The only way I can recreate this error is by calling the defint function to integrate an exponential function with an argument of the form (constant*f(x)). I'm not even assigning values to a variable, I'm simply calling the function in the Question variables

Things that cause this to break:

Things that don't cause this to break:

These issues do not persist when I call the problem function somewhere outside of the Question variables (e.g. in the Question text or General Feedback). I am not sure where to find the source code that calls bespoke validation functions, so I don't have any suggestions as to where the issue arises except that it seems to be about the defint function, sorry!

sangwinc commented 7 months ago

@LukeLongworth I'm very sorry but I can't reproduce this on my test server! Can you email me your question and I'll try to break one of the older (live) servers.

Just to note that Maxima has an interactive integrator. Try the following on a desktop Maxima system

integrate(x^n,x);

It is possible this interactivity is causing the timeout.

LukeLongworth commented 5 months ago

I've returned to this issue and have some updates:

Firstly, it doesn't seem to be defint after all, as I've discovered some extra functions that cause the issue:

Secondly, this issue is persisting in STACK version 2024012900 in a different installation. Santiago kindly added me to an IDEMS test server so I could check, and I am observing the exact same behaviour, both when I import an existing question and create a new one. I've included this question (imported once from each server) below. I observe this this on both my work device and on my phone.

custom validation glitch.zip.zip

sangwinc commented 5 months ago

@LukeLongworth, I can't reproduce the error, either on my development machine or on our public demo server https://stack-demo.maths.ed.ac.uk/demo/ which is also running 2024012900. What value does your server have for the "timeout" in the STACK settings? Perhaps a zoom call is needed to sort this all out?

sangwinc commented 2 months ago

@LukeLongworth Since I can't reproduce this, and we've released a new version since it was opened I'm closing it. Please let me know if this is still an issue and I'll help fix it.

LukeLongworth commented 2 months ago

@sangwinc I think the issue is still ongoing, but we only upgrade annually. If this is still an issue once we upgrade in January I'll let you know.

I didn't hear back from our IT team about "timeout" in the STACK settings. I'll chase that up and let you know what they say.