Moodle
  1. Moodle
  2. MDL-26748

Inline images, etc. broken in answer feedback for Essay question type

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.3
    • Component/s: Files API, Questions
    • Labels:
    • Environment:
      Any
    • Database:
      Any
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16665

      Description

      Images or other attachments in the answer feedback html for Essay questions will not display during the review of a quiz attempt. This appears to occur because of a bug in the Moodle code for this question type. The 'component' and 'filearea' names in the 'quiz_rewrite_question_urls' call in the 'print_question_formulation_and_controls' method in $CFG->dirroot/question/type/essay/questiontype.php do not match the names used in the 'import_or_save_files' call in the 'save_question_options' method in the same file. Looking at the code for other question types, it seems as if the 'quiz_rewrite_question_urls' call should be modified to follow the component and filearea names in the 'import_or_save_files call' (i.e. 'question' and
      'answerfeedback' instead of 'qtype_essay' and 'feedback'). If this is done, it seems to fix the problem.

        Activity

        Hide
        Tim Hunt added a comment -

        Thanks for finding this and the other similar issues.

        Show
        Tim Hunt added a comment - Thanks for finding this and the other similar issues.
        Hide
        Tim Hunt added a comment -

        Thanks. Your suggested fix is indeed correct. PULL request created, which means that this fix should be included in next week's weekly build.

        To test, create an essay with images in the Feedback field (as opposed to General feedback, but feel free to test that too). Then attempt the question as a student and ensure the images are visible on the review page.

        Note that if you have been testing bugs like MDL-26735, you will need that bug fix or the images here will not work.

        Show
        Tim Hunt added a comment - Thanks. Your suggested fix is indeed correct. PULL request created, which means that this fix should be included in next week's weekly build. To test, create an essay with images in the Feedback field (as opposed to General feedback, but feel free to test that too). Then attempt the question as a student and ensure the images are visible on the review page. Note that if you have been testing bugs like MDL-26735 , you will need that bug fix or the images here will not work.
        Hide
        Helen Foster added a comment -

        Confirming that this issue is fixed in this week's 2.0.2+.

        Show
        Helen Foster added a comment - Confirming that this issue is fixed in this week's 2.0.2+.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: