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

Restore of match question type fails

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.12
    • Fix Version/s: 1.9.17
    • Component/s: Questions
    • Labels:
    • Environment:
      Solaris + Oracle
    • Database:
      Oracle
    • Testing Instructions:
      Hide

      Import activities to a course with match questions (we attach you the one that we've used).

      This needs to be tested on Oracle (which the original reporter has already done) and one other DB (e.g. Postgres, which I have done).

      Show
      Import activities to a course with match questions (we attach you the one that we've used). This needs to be tested on Oracle (which the original reporter has already done) and one other DB (e.g. Postgres, which I have done).
    • Workaround:
      Hide

      At the moment, to fix the problem we have replaced the line 576 in the question/type/match/questiontype.php:

      $db_match_sub = get_record ("question_match_sub","question",$new_question_id,
      "questiontext",$match_sub->questiontext,
      "answertext",$match_sub->answertext);

      for the following source:
      -----------------------------------
      global $CFG;
      $questiontextfield = 'questiontext';
      if ($CFG->dbfamily == 'oracle'){
      $questiontextfield = 'TO_CHAR('.$questiontextfield.')';
      }
      $db_match_sub = get_record ("question_match_sub","question",$new_question_id,
      $questiontextfield,$match_sub->questiontext,
      "answertext",$match_sub->answertext);
      -----------------------------------------

      Is not the better solution but, at the moment, it works

      Show
      At the moment, to fix the problem we have replaced the line 576 in the question/type/match/questiontype.php: $db_match_sub = get_record ("question_match_sub","question",$new_question_id, "questiontext",$match_sub->questiontext, "answertext",$match_sub->answertext); for the following source: ----------------------------------- global $CFG; $questiontextfield = 'questiontext'; if ($CFG->dbfamily == 'oracle'){ $questiontextfield = 'TO_CHAR('.$questiontextfield.')'; } $db_match_sub = get_record ("question_match_sub","question",$new_question_id, $questiontextfield,$match_sub->questiontext, "answertext",$match_sub->answertext); ----------------------------------------- Is not the better solution but, at the moment, it works
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Pull from Repository:

      Description

      When we try to import quizzes in a course and it has some match question, the restore process fails. When we activate the debug option the following error is showed:

      ORA-00932: inconsistent datatypes: expected - got CLOB

      SELECT * FROM mlquestion_match_sub WHERE question = '4768' AND questiontext = 'Nicotina' AND answertext = 'Crea addicció'
      line 686 of lib/dmllib.php: call to debugging()
      line 481 of lib/dmllib.php: call to get_recordset_sql()
      line 421 of lib/dmllib.php: call to get_record_sql()
      line 576 of question/type/match/questiontype.php: call to get_record()
      line 484 of question/restorelib.php: call to question_match_qtype->restore_map()
      line 217 of question/restorelib.php: call to restore_questions()
      line 134 of question/restorelib.php: call to restore_question_category()
      line 3573 of backup/restorelib.php: call to restore_question_categories()
      line 8599 of backup/restorelib.php: call to restore_create_questions()
      line 66 of backup/restore_execute.html: call to restore_execute()
      line 170 of backup/restore.php: call to include_once()

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Mar/12