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

Multilang Activity Name Not Handled for Manual Completion Checkbox

XMLWordPrintable

    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MDL-64198-master
    • 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

      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.

            lucaboesch Luca Bösch
            nyanginator Nicholas Yang
            Mark Nelson Mark Nelson
            Jake Dallimore Jake Dallimore
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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