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

Editing a Calculated question should process format_string before truncating question name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.3, 3.3
    • Fix Version/s: 3.2.4, 3.3.1
    • Component/s: Questions, Quiz
    • Labels:
    • Testing Instructions:
      Hide
      • Set up Moodle with at least another language pack.
      • Install a filter plugin which allows language dependent display like multilang or multilang2, have the filter activated.
      • Create a calculated question (Question bank → Questions → Create new question → Calculated), it name, make sure you create wild cards along, name the question ("Question name") with a multilang name it e.g. <span class="multilang" lang="en">Question 1</span><span class="multilang" lang="ru">Вопрос 1</span>, in "Question text" insert "Do the addition of {a} and {b}", in "Answer 1 formula" insert "{a} + {b}" and "Grade" 100%. Push the "Save changes" button on the bottom of the page and you'll be redirected to the next page.
      • In that page, change Wild card {a} and Wild card {b} to "Will use a new shared dataset" and change "Synchronise the data from shared datasets with other questions in a quiz" to "Synchronize" and continue with the "Next page" button on the bottom of the page and you'll be redirected to the next page.
      • In that page, on "Add item" push the "Add" button next to "Add item 1 new set(s) of wild card(s) values". The pages reloads and then has the "Save changes" button on the bottom of the page. Push that "Save changes" button.
      • This has redirected you to the question bank. Click the cog to edit that question.
      • Check on the "Shared wild cards" table that the question name in the "Used in Question" column is displayed in your language
      Show
      Set up Moodle with at least another language pack. Install a filter plugin which allows language dependent display like multilang or multilang2, have the filter activated. Create a calculated question (Question bank → Questions → Create new question → Calculated), it name, make sure you create wild cards along, name the question ("Question name") with a multilang name it e.g. <span class="multilang" lang="en">Question 1</span><span class="multilang" lang="ru">Вопрос 1</span> , in "Question text" insert "Do the addition of {a} and {b}", in "Answer 1 formula" insert "{a} + {b}" and "Grade" 100%. Push the "Save changes" button on the bottom of the page and you'll be redirected to the next page. In that page, change Wild card {a} and Wild card {b} to "Will use a new shared dataset" and change "Synchronise the data from shared datasets with other questions in a quiz" to "Synchronize" and continue with the "Next page" button on the bottom of the page and you'll be redirected to the next page. In that page, on "Add item" push the "Add" button next to "Add item 1 new set(s) of wild card(s) values". The pages reloads and then has the "Save changes" button on the bottom of the page. Push that "Save changes" button. This has redirected you to the question bank. Click the cog to edit that question. Check on the "Shared wild cards" table that the question name in the "Used in Question" column is displayed in your language
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58920-calculated-question-edit-name-multilang

      Description

      The table with the "Shared wild cards" presented on editing calculated questions sometimes messes up the whole Moodle layout.
      That's the case when multilang question names exist which contain <span class="multilang" lang="XX"> and then get truncated. Unclosed tags mess up the code, then.
      Before truncating, format_string should be applied to circumvent this behaviour.

      WHAT YOU EXPECTED
      See screenshot "Filter applied"

      WHAT ACTUALLY HAPPENS
      See screenshot "Filter not applied"

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lucaboesch Luca Bösch
                Reporter:
                lucaboesch Luca Bösch
                Peer reviewer:
                Tim Hunt
                Integrator:
                Andrew Nicols
                Tester:
                Mark Nelson
                Participants:
                Component watchers:
                Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Jul/17