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

Moving files in answer->feedback when moving questions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.1
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      the answer->feedback is not included in the file moving process

      for example
      in multichoice/questiontype.php
      function find_file_links($question, $courseid){
      $urls = array();
      // find links in the answers table.
      $urls += question_find_file_links_from_html($question->options->correctfeedback, $courseid);
      $urls += question_find_file_links_from_html($question->options->partiallycorrectfeedback, $courseid);
      $urls += question_find_file_links_from_html($question->options->incorrectfeedback, $courseid);
      foreach ($question->options->answers as $answer)

      { $urls += question_find_file_links_from_html($answer->answer, $courseid); }

      //set all the values of the array to the question id
      if ($urls)

      { $urls = array_combine(array_keys($urls), array_fill(0, count($urls), array($question->id))); }

      $urls = array_merge_recursive($urls, parent::find_file_links($question, $courseid));
      return $urls;
      }

      should be modified by something like

      foreach ($question->options->answers as $answer)

      { $urls += question_find_file_links_from_html($answer->answer, $courseid); $urls += question_find_file_links_from_html($answer->feedback, $courseid); }

      and similarly in function replace_file_links()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                ppichet Pierre Pichet
                Tester:
                Jamie Pratt
                Participants:
                Component watchers:
                Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/08