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

questiontext images not displayed in randomsamatch generated questions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0.5
    • 2.0
    • Questions
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Hide

      1. In a question category, create a number of shortanswer questions, all including an image in their question text.
      2. In that question category, create a Random Short-Answer Matching question using those questions.
      3. View the Random Short-Answer Matching question. The images which should be displayed in the left column (sub-questions) are absent.

      Show
      1. In a question category, create a number of shortanswer questions, all including an image in their question text. 2. In that question category, create a Random Short-Answer Matching question using those questions. 3. View the Random Short-Answer Matching question. The images which should be displayed in the left column (sub-questions) are absent.

      randomsamatch question type does not display images which are contained in the text of the short-answer questions it uses

      diagnostic
      ransomsamatch question type "Extends 'match' as there are quite a few simularities...", but there is a problem
      in question/type/match/questiontype.php function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options)
      line 287
      $text = quiz_rewrite_question_urls($subquestion->questiontext, 'pluginfile.php', $context->id, 'qtype_match', 'subquestion', array($state->attempt, $state->question), $subquestion->id);
      should be re-written as:
      $text = quiz_rewrite_question_urls($subquestion->questiontext, 'pluginfile.php', $context->id, 'question', 'questiontext', array($state->attempt, $state->question), $subquestion->id);

      the only solution I see at this stage is to NOT rely on the match function print_question_formulation_and_controls() but to re-write that function inside of question/type/randomsamatch/questiontype.php, with the correction mentioned above: 'question', 'questiontext'...

      Tested successfully on Moodle 2.0.4+ (Build: 20110916).

      NOTE: this does not apply to moodle 1.9 since - unfortunately - it is not possible to use images in a match question in that moodle version (except with a workaround)

            timhunt Tim Hunt
            rezeau Joseph Rézeau
            Joseph Rézeau Joseph Rézeau
            Sam Hemelryk Sam Hemelryk
            Rossiani Wijaya Rossiani Wijaya
            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.