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

Multilang Activity Name Not Handled for Manual Completion Checkbox

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Please test on BOTH Boost and Clean themes!

      Test 1

      1. Enable Site Admin > Plugins > Filters > Multi-Language Content, and also turn on Apply to: Content and headings.
      2. Enable Completion tracking in a course.
      3. In that course, create an forum with name
        <span class="multilang" lang="en">hello there</span><span class="multilang" lang="es">hola ahí</span> & " '
        (note the ampersand, the single and double quotation mark).
      4. For that forum, set Activity completion to "Students can manually mark the activity as completed".
      5. Enrol a student in that course.
      6. As that student, go to a course and click the activity completion toggle.
      7. Hover over the checkbox and verify the formatted activity name is being used ("Completed: hello there & " '. Select to mark as not complete")
      8. Click the activity completion toggle again.
      9. Hover over the checkbox and verify the formatted activity name is being used ("Not completed: hello there & " '. Select to mark as complete")
      Test 2
      1. Create an Activity with HTML entities in the name, such as:

        A &quot;Test&quot; Activity &amp; Perhaps More & Then Some

      2. Enable course's Completion Tracking and an activity's manual Activity Completion.
      3. Hover over the activity's completion checkbox and confirm the string does not show the following, but instead you see

        A "Test" Activity & Perhaps More & Then Some

      Show
      Please test on BOTH Boost and Clean themes! Test 1 Enable Site Admin > Plugins > Filters > Multi-Language Content, and also turn on Apply to: Content and headings. Enable Completion tracking in a course. In that course, create an forum with name <span class="multilang" lang="en">hello there</span><span class="multilang" lang="es">hola ahí</span> & " ' (note the ampersand, the single and double quotation mark). For that forum, set Activity completion to "Students can manually mark the activity as completed". Enrol a student in that course. As that student, go to a course and click the activity completion toggle. Hover over the checkbox and verify the formatted activity name is being used ("Completed: hello there & " '. Select to mark as not complete") Click the activity completion toggle again. Hover over the checkbox and verify the formatted activity name is being used ("Not completed: hello there & " '. Select to mark as complete") Test 2 Create an Activity with HTML entities in the name, such as: A &quot;Test&quot; Activity &amp; Perhaps More & Then Some Enable course's Completion Tracking and an activity's manual Activity Completion. Hover over the activity's completion checkbox and confirm the string does not show the following, but instead you see A "Test" Activity & Perhaps More & Then Some
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
    • Pull 3.6 Branch:
    • Pull Master Branch:
      MDL-64198-master

      Description

      Steps to reproduce
      ===============

      1. Enable Site Admin > Plugins > Filters > Multi-Language Content, and also turn on Apply to: Content and headings.
      2. Create an activity with a multilingual name, such as: "<span class="multilang" lang="en">hello there</span><span class="multilang" lang="es">hola ahí</span>".
      3. Enable Completion Tracking and the activity's Activity Completion (manual).
      4. Turn off course editing.
      5. Hover over the completion checkbox to see a properly formatted string, based on the currently selected language (i.e. Completed: hello there. Select to mark as not complete.).
      6. Now click the toggle, and hover over the checkbox again to see the unformatted name being used (i.e. "Not completed: <span class="multilang" lang="en">hello there</span><span class="multilang" lang="es">hola ahí</span> Select to mark as complete)..

      Actual result
      ==========

      After clicking the completion checkbox at least once, the form.togglecompletion's button title (and img alt text) will contain the unformatted activity name with all of the multilang spans showing.

      Expected result
      ============

      The button title (and img alt text) should not show any content from multilang spans other than the one for the currently selected language, as is shown on the initial page load.

      Other points
      ==========

      The name initially loads fine on first page load because in course_section_cm_completion() of /course/renderer.php, $mod->get_formatted_name() is called.

      But there is no call to a similar or equivalent function in /course/completion.js, so once the user clicks to toggle the completion through JS, the name doesn't display correctly.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jan/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h