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

Restore of match question type fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.17
    • 1.9.12
    • Questions
    • Solaris + Oracle
    • Oracle
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE
    • 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
    • Easy
    • 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).

      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()

            timhunt Tim Hunt
            sarjona Sara Arjona (@sarjona)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.