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

Incorrect context passed to format_string in some question types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.3, 3.6.1, 3.7
    • Fix Version/s: 3.5.5, 3.6.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a quiz with a matching questions, where the match answers use the mutlilang filter. (e.g. choice '<span lang="en" class="multilang">Cat</span> <span lang="fr" class="multilang">Chat</span>'
      2. At system level, set Multilang filter to be 'Off, but available', and apply to 'content and headings'.
      3. At the system level set filter_multilang_force_old to 'Off'
      4. In Quiz context, set Multilang filter to 'On'.
      5. View the quiz.
      6. Verify that the multilang finter has worked on the choices - only one word in English should be shown.
      Show
      Create a quiz with a matching questions, where the match answers use the mutlilang filter. (e.g. choice '<span lang="en" class="multilang">Cat</span> <span lang="fr" class="multilang">Chat</span>' At system level, set Multilang filter to be 'Off, but available', and apply to 'content and headings'. At the system level set filter_multilang_force_old to 'Off' In Quiz context, set Multilang filter to 'On'. View the quiz. Verify that the multilang finter has worked on the choices - only one word in English should be shown.
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
    • Pull 3.6 Branch:
    • Pull Master Branch:

      Description

      While lookin into MDL-61286 I noticed that several question types call format_string with the wrong context. Questions belong (via question categories) to a particular context. However, they may be displayed in a different context, and it is the context where they are being displayed that should be used to control filters.

      (E.g. a question from the couse question bank may be displayed in a quiz. It is the quiz context that should be used for format_string. This is probably not the best example to show why this is importnat.)

        Attachments

          Activity

            People

            • Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Damyon Wiese
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Mar/19

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 32 minutes
                32m