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

Inline images, etc. broken in answer fields for Multiple Choice question type



    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 2.0.1
    • Files API, Questions
    • None
    • Any
    • Any
    • Easy


      This may seem like a feature request, but we ask that it be treated as a backward compatibility issue instead. Multiple Choice questions have never offered html editing in the browser for the answer fields, only for the question wording, feedback, etc. There is no easy way in the browser to attach images or other files to these answer fields. Despite this, if you type html into the text fields provided it mostly works,
      so for our purposes we have always treated them as html fields. However, the new Moodle File API has now underscored the different nature of these fields, and produced a problem for us with regard to images and other attachments in the html. Using the old file attachment strategy, we uploaded files to known locations on the server, and created standard links to them in the html we placed in these answer fields, and that worked fine. Now however, we must store these files in the Moodle repository and use a special tag in the html which we must rely on Moodle to update with the correct url at display time. Unfortunately, Moodle does not do this for these fields, so the links are broken after question creation. What Moodle doesn't do is call the method 'quiz_rewrite_question_urls' for each answer field from the 'print_question_formulation_and_controls' method in $CFG->dirroot/question/type/multichoice/questiontype.php. This may be intentional, but on the other hand, the Moodle code that handles browser editing for this question type does include attachment support for these fields, there's just no way to add any attachments in the user interface. We don't suggest that anything be done to the editing interface, just that the backend code be fixed to call 'quiz_rewrite_question_urls' for each answer field, so that attachments will continue to work in these fields just as they have in the past.


        Issue Links



              timhunt Tim Hunt
              respondus Respondus, Inc.
              0 Vote for this issue
              0 Start watching this issue




                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.