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

Rewrite the PLUGINFILE urls in the question answer texts when viewing the answer text outside an attempt (e.g. offlinequiz previews)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2, 2.5.1
    • Fix Version/s: 2.6
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. To test this, you need some questions with images in the questiontext.

      2. Make those questions into a quiz, and attempt it a few times as different students.

      3. Go to the question bank, and turn on the "Show question text in the question list" option. The files show show up in the question text.

      4. Go to the quiz statistics report. Go into the detailed statistics for one of the questions. The question text will be displayed there. Verify that the image is still visible.

      Now to verify that this was implemented in a backwards compatible way. This change was done as two three commits.

      Checkout the code after just the first commit, and then cherry-pick the third commit on top of that.

      5. Repeat 3. Verify that the images still apper, but there is debugging output.

      6. Repeat 4. Verify that the images still apper, but there is debugging output.

      Show
      1. To test this, you need some questions with images in the questiontext. 2. Make those questions into a quiz, and attempt it a few times as different students. 3. Go to the question bank, and turn on the "Show question text in the question list" option. The files show show up in the question text. 4. Go to the quiz statistics report. Go into the detailed statistics for one of the questions. The question text will be displayed there. Verify that the image is still visible. Now to verify that this was implemented in a backwards compatible way. This change was done as two three commits. Checkout the code after just the first commit, and then cherry-pick the third commit on top of that. 5. Repeat 3. Verify that the images still apper, but there is debugging output. 6. Repeat 4. Verify that the images still apper, but there is debugging output.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      lib/questionlib.php contains code s.t. the images in the questiontext of a question can be displayed outside an attempt context.
      PLUGINFILE URLs are rewritten to special links. The function question_pluginfile() contains special code to call
      a special plugin function of the activity module wanting to display the question. This function then serves the image file.

      So far (Moodle 2.2.2), this is not possible for images questionanswer texts, although images can now be added to question answers (e.g. in multichoice questions).

      Improvement: Find and implement a proper solution for activity modules to serve image files in questiontexts and answertexts of questions.

        Attachments

        1. netbeanssshot.png
          netbeanssshot.png
          28 kB
        2. quiz-image-error.png
          quiz-image-error.png
          57 kB
        3. quiz-question-bank-image.png
          quiz-question-bank-image.png
          249 kB
        4. quiz-question-bank-no-image.png
          quiz-question-bank-no-image.png
          90 kB
        5. quiz-statistics-image.png
          quiz-statistics-image.png
          206 kB
        6. quiz-statistics-no-image.png
          quiz-statistics-no-image.png
          56 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13