Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27926

Random Short Answer Question in Moodle 2.1 generates an error page



    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.1
    • None
    • Quiz
    • None
    • qa.moodle.net
    • Hide

      Create a random short answer question in Moodle 2.1 and try to save it and preview it.

      Create a random short answer question in Moodle 2.1 and try to save it and preview it.


      When creating a random short answer question in Moodle 2.1, I seem to always get the following error page:

      Invalid get_string() identifier: 'randomsamatchnumber' or component 'quiz'
      line 5910 of /lib/moodlelib.php: call to debugging()
      line 6500 of /lib/moodlelib.php: call to core_string_manager->get_string()
      line 44 of /question/type/randomsamatch/edit_randomsamatch_form.php: call to get_string()
      line 165 of /question/type/edit_question_form.php: call to qtype_randomsamatch_edit_form->definition_inner()
      line 152 of /lib/formslib.php: call to question_edit_form->definition()
      line 80 of /question/type/edit_question_form.php: call to moodleform->moodleform()
      line 231 of /question/type/questiontypebase.php: call to question_edit_form->__construct()
      line 197 of /question/question.php: call to question_type->create_editing_form()
      Skip to main content

      It does create a question, but when I try to preview it I get the following error:

      Coding error detected, it must be fixed by a programmer: Unknown question type (no definition) randomsamatch

      More information about this error

      Stack trace:
      line 234 of /question/engine/bank.php: coding_exception thrown
      line 671 of /question/type/questiontypebase.php: call to question_bank::load_question_definition_classes()
      line 658 of /question/type/questiontypebase.php: call to question_type->make_question_instance()
      line 275 of /question/engine/bank.php: call to question_type->make_question()
      line 265 of /question/engine/bank.php: call to question_bank::make_question()
      line 39 of /question/preview.php: call to question_bank::load_question()

      (this was a reason I failed QA test MDLQA-1032)


        Issue Links



              timhunt Tim Hunt
              rsturley Steve Turley
              Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
              0 Vote for this issue
              0 Start watching this issue