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

Editing a Calculated question should process format_string before truncating question name

XMLWordPrintable

    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MDL-58920-calculated-question-edit-name-multilang
    • 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

      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"

            lucaboesch Luca Bösch
            lucaboesch Luca Bösch
            Tim Hunt Tim Hunt
            Andrew Lyons Andrew Lyons
            Mark Nelson Mark Nelson
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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