-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long draggable items break quiz statistics. #60
Comments
100 chars is not very long, especially if we consider that a draggable item could contain HTML code for multimedia. Perhaps there's a nother way to shorten the text before it gets inserted into the response analysis table. I'll try to find time to investigate. |
I took a brief look at the code, but it's pretty complex inside the "question/classes/statistics/responses". I can't fix it quickly I'm afraid. |
In the ordering questoin type, the two pleces you control this are
The bit you are currently creating as question_utils::to_plain_text($answer->answer, $answer->answerformat) is what is becoming subqid. LOL. Looking at git history, I see I wrote this code. Sorry. |
Also, Gordon, while I am writing, it would nice if you could review some of the pull requests that are waiting here. Thanks. |
Ordering question type allows to create questions with draggable items longer than quiz statistics overview can handle.
'subqid' field is varchar(100). In lib/db/install.xml 'question_response_analysis' table is defined as follows:
Error:
Error writing to database
[More information about this error|http://docs.moodle.org/35/en/error/moodle/dmlwriteexception]
×Debug info: Data too long for column 'subqid' at row 1
INSERT INTO mdl_question_response_analysis (hashcode,whichtries,questionid,variant,subqid,aid,response,credit,timemodified) VALUES(?,?,?,?,?,?,?,?,?)
[array (
0 => '1afcbec028f7ca4b759200c2b2aa39303f30bdba',
1 => 'lasttry',
2 => '2443',
3 => 1,
4 => 'This is the second item. This item is quite long and you may enter this item and save the ordering question but you will get an error when you try to check statistics of the quiz and recalculate the data.',
5 => 2,
6 => 'Position 2',
7 => 0.33333333333333331,
8 => 1615364109,
)]
Error code: dmlwriteexception
×Stack trace: * line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
To reproduce this error:
It would be nice to not allow users to create content that the system cannot handle.
Ordering question item must be limited to 100.
Reproduced in LTS Moodle 3.5 and 3.9.
In Moodle tracker:
https://tracker.moodle.org/browse/MDL-71085
The text was updated successfully, but these errors were encountered: