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

Slashes displayed in correct answers for short answer questions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 1.8.3, 1.9
    • 1.8.2
    • Questions
    • None
    • Fedora, Apache, PHP 5.1.6, MySQL 5.0.37, latest Moodle 1.8.2+
    • MOODLE_18_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

      When reviewing quiz attempts (mod/quiz/review.php), correct answers for short answer questions are displayed with slashes before quotes (see attachment).

      To get rid of this I did:

      — question/type/shortanswer/questiontype.php ORIGINAL
      +++ question/type/shortanswer/questiontype.php MODIFIED
      @@ -378,7 +378,7 @@
      // MDL-7496
      if ($correctanswer)

      { echo ('<div class="correctness">'); - print_string('correctansweris', 'quiz', s($correctanswer)); + print_string('correctansweris', 'quiz', s($correctanswer, TRUE)); // TRUE added, otherwise slashes remained in the answer echo ('</div>'); }
      } else {
      @@ -387,7 +387,7 @@
      print_string('incorrect', 'quiz');
      if ($correctanswer) { echo ('<div class="correctness">');- print_string('correctansweris', 'quiz', s($correctanswer));+ print_string('correctansweris', 'quiz', s($correctanswer, TRUE)); // TRUE added, otherwise slashes remained in the answer echo ('</div>'); }

      }

        1. screenshot-1.jpg
          12 kB
          Joseph Rézeau
        2. screenshot-2.jpg
          116 kB
          Mary Kaplan
        3. slashed_answers_short-answer_qtype.png
          6 kB
          Daniel Miksik

            timhunt Tim Hunt
            mixik Daniel Miksik (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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