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

Images in question don't display

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.2
    • 1.9.3
    • Quiz
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      When you set an image in a question from the combo 'Image to display' (not in the html) the image is not displayed in the quiz.

      If you set the debuging messages you'll get this notice:
      Notice: Undefined variable: courseid in /www/moodle/lib/questionlib.php on line 1508

      There's an error in the function get_question_image($question) from the moodle/lib/questionlib.php

      The solution:
      around line 1508
      $img = get_file_url("$courseid/{$question->image}");
      should be
      $img = get_file_url("$coursefilesdir/{$question->image}");

      So just need to change $courseid to $coursefilesdir

      We test the solution on a 1.9.2 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              yordonez Yolanda Ordoñez Rufat
              Petr Skoda Petr Skoda
              Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/Oct/08