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

questiontext images not displayed in randomsamatch generated questions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0.5
    • 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.

    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)

      Attachments

        Activity

          People

            timhunt Tim Hunt
            rezeau Joseph Rézeau
            Joseph Rézeau Joseph Rézeau
            Sam Hemelryk Sam Hemelryk
            Rossiani Wijaya Rossiani Wijaya
            Safat Shahin, Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Oct/11