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

questiontext images not displayed in randomsamatch generated questions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.5
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      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)

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Oct/11