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

Scale values do not support multilang filter

    XMLWordPrintable

Details

    • Improvement
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 3.6
    • None
    • Gradebook
    • MOODLE_36_STABLE
    • MDL-63078-master
    • Hide

      Prerequisites

      1. Add a second language pack to your Moodle instance, e.g. French ("fr").
      2. Enable the "Multi-Language Content" filter for "Content and headings".

      Test

      1. In Site Administration > Grades > Scales, Add a new scale, with name <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> passed/failed scale and Scale <span lang="en" class="multilang">passed</span><span lang="fr" class="multilang">succès</span>,<span lang="en" class="multilang">failed</span><span lang="fr" class="multilang">échec</span>.
      2. In a course, add an assignment.
      3. Confirm that in the Grade section of Adding a new Assignment page, if you choose Scale as Type, the scale name is correctly shown regarding the selected page language.
      4. When grading a student's assignment make sure the scale values are correctly shown, too.

      Import/export grades

      1. Go to the course.
      2. Go to the assignment.
      3. Go to Grades | Export | Plain text file.
      4. Click Download.
      5. Copy and paste the output in a raw txt file (grades.txt).
      6. Confirm that the grades are correctly shown regarding the selected page language.
      7. Go to Grades | Import | CSV file.
      8. Upload the previously created file (grades.txt).
      9. Check the Force import checkbox.
      10. Click Upload grades button.
      11. Confirm that you are in the Import preview page.
      12. Select Email address in the Map from select.
      13. Select Email address in the Map to select.
      14. Select Assignment: Multilang test in the Assignment: Multilang test.
      15. Click Upload grades and confirm the Grade import success message is displayed.
      16. Go to Grades | View | Grader report.
      17. Confirm that the grades are correctly shown regarding the selected page language.

      Ratings

      1. Add a forum to the course.
      2. Set Ratings | Average ratings to Average of ratings, Type to Scale and Scale to EN passed/failed scale.
      3. Click on Save and display button.
      4. Click on Add a new discussion topic button.
      5. Fill and post the discussion topic.
      6. Log in as another user who has editing teacher rights.
      7. Go to that post in the discussion topic.
      8. Confirm that the grading options are correctly shown regarding the selected page language.
      9. Click on the help icon next to the rating select.
      10. Confirm that the scale name and values in the Scales page are correctly shown regarding the selected page language.
      Show
      Prerequisites Add a second language pack to your Moodle instance, e.g. French ("fr"). Enable the "Multi-Language Content" filter for "Content and headings". Test In Site Administration > Grades > Scales , Add a new scale, with name <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> passed/failed scale and Scale <span lang="en" class="multilang">passed</span><span lang="fr" class="multilang">succès</span>,<span lang="en" class="multilang">failed</span><span lang="fr" class="multilang">échec</span>. In a course, add an assignment. Confirm that in the Grade section of Adding a new Assignment page, if you choose Scale as Type, the scale name is correctly shown regarding the selected page language. When grading a student's assignment make sure the scale values are correctly shown, too. Import/export grades Go to the course. Go to the assignment. Go to Grades | Export | Plain text file . Click Download . Copy and paste the output in a raw txt file (grades.txt). Confirm that the grades are correctly shown regarding the selected page language. Go to Grades | Import | CSV file . Upload the previously created file (grades.txt). Check the Force import checkbox. Click Upload grades button. Confirm that you are in the Import preview page. Select Email address in the Map from select. Select Email address in the Map to select. Select Assignment: Multilang test in the Assignment: Multilang test . Click Upload grades and confirm the Grade import success message is displayed. Go to Grades | View | Grader report . Confirm that the grades are correctly shown regarding the selected page language. Ratings Add a forum to the course. Set Ratings | Average ratings to Average of ratings , Type to Scale and Scale to EN passed/failed scale . Click on Save and display button. Click on Add a new discussion topic button. Fill and post the discussion topic. Log in as another user who has editing teacher rights. Go to that post in the discussion topic. Confirm that the grading options are correctly shown regarding the selected page language. Click on the help icon next to the rating select. Confirm that the scale name and values in the Scales page are correctly shown regarding the selected page language.

    Description

      Multilang filter does not work in some gradebook elements:

      • If we define a Grade category name using multilang, it is not properly shown in the gradebook.
      • If we define a scale with multilang values, they are not properly shown in the combo, neither in the activity nor in the gradebook.

      In MDL-36255 grade category names are fixed. This issue is about scales.

      The main objective of this issue is to apply filters to both the name and the elements of a scale. Following the solution adopted for the categories (MDL-36255), two methods are added to the grade_scale class:

      • get_items(): to apply the filters to the scale values;
      • get_name(): to apply the filters to the scale name.

      Thus, when the name or values of a scale are displayed on a page, these functions must be invoked.

      In addition, instead of using calls to static functions to retrieve an instance of a scale, mechanisms specific to a class are used.

      Attachments

        Issue Links

          Activity

            People

              lucaboesch Luca Bösch
              vmdef Victor Déniz Falcón
              Victor Déniz Falcón Victor Déniz Falcón
              David Monllaó David Monllaó
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: