notenoughtshortanswerquestions

notenoughtshortanswerquestions

by Visvanath Ratnaweera -
Number of replies: 2
Picture of Particularly helpful Moodlers Picture of Translators
Every time a start a particular quiz the following error comes up:
===
Fehler in der Kodierung gefunden, den nur ein Programmierer korrigieren kann: notenoughtshortanswerquestions

Weitere Informationen über diesen Fehler http://docs.moodle.org/31/de/error/debug/codingerror
Debug info:
Error code: codingerror
Stack trace:
line 130 of /question/type/randomsamatch/question.php: coding_exception thrown
line 41 of /question/type/randomsamatch/question.php: call to qtype_randomsamatch_question_loader->load_questions()
line 353 of /question/behaviour/behaviourbase.php: call to qtype_randomsamatch_question->start_attempt()
line 981 of /question/engine/questionattempt.php: call to question_behaviour->init_first_step()
line 571 of /question/engine/questionusage.php: call to question_attempt->start()
line 254 of /mod/quiz/locallib.php: call to question_usage_by_activity->start_all_questions()
line 2279 of /mod/quiz/locallib.php: call to quiz_start_new_attempt()
line 111 of /mod/quiz/startattempt.php: call to quiz_prepare_and_start_new_attempt()
===

Moodle 3.1.14+ (Build: 20180927)
Debian Jessie (8.11)
PHP 5.6.39-0+deb8u1

We haven't noticed this in any other quiz. The same quiz, the same set of questions, runs in a couple of other places without any trouble.

Amazingly found nothing in the forum under 'notenoughtshortanswerquestions'. Any clue?
Average of ratings: -
In reply to Visvanath Ratnaweera

Re: notenoughtshortanswerquestions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It looks like someone is trying to use the 'Random short-answer matching' question type, but they have not set it up right.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: notenoughtshortanswerquestions

by Jean-Michel Védrine -

Yep, the 'Random short answer matching' question type when the question is loaded, needs to construct a matching question from the short answer questions available in a question category (including or not subcategories depending of the random short answer matching question settings) if there is not enough short answer questions in the specified category, this error is thrown.

For instance this can happen if short answers questions are deleted in that category after the Random short answer question is created. This is why this test is done at the start of each attempt.

Average of ratings: Useful (1)