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

'gradereport_user_get_grade_items'-functions 'gradeformatted'-field returns html scrap

    XMLWordPrintable

Details

    • Hide
      1. Add a scale (our example 'Hyväksytty', 'Hylätty')
      2. Add a grading item with scale grading to the course
      3. Add a grade to a student with the grading item containing scale
      4. Call WS's 'gradereport_user_get_grade_items' API
      5. Check that in returned result contains 'gradeformatted' -field and that contains and only contains the original scale item added in step 1, and that it doesn't contain any html scrap (in our example either 'Hyväksytty' or 'Hylätty' depending which scale grade was graded to student). 
      Show
      Add a scale (our example 'Hyväksytty', 'Hylätty') Add a grading item with scale grading to the course Add a grade to a student with the grading item containing scale Call WS's 'gradereport_user_get_grade_items' API Check that in returned result contains 'gradeformatted' -field and that contains and only contains the original scale item added in step 1, and that it doesn't contain any html scrap (in our example either 'Hyväksytty' or 'Hylätty' depending which scale grade was graded to student). 
    • 4

    Description

      WS API's 'gradereport_user_get_grade_items' -functions 'gradeformatted' -field's content changed when we updated Moodle from 3.11+ -> 4.0+.

      The function has been returning for years just plain scale-values. For example we have "Hylätty" (Finnish for disqualified) or "Hyväksytty" (Finnish for qualified). Values are actively used also in integration logic.

      After installing newest 4.0+ the function returns values with some html scrap like "<i class=\"icon fa fa-check text-success fa-fw inline\"  title=\"Pass\" role=\"img\" aria-label=\"Pass\"></i>Hyväksytty"

      It could be that there was put originally some unwanted formatting in the scale fields but those couldn't been seen in UI.

      Unfortunately there isn't any workaround. Those values can't be modified at UI page /grade/edit/scale/edit.php because scales have been in use.

      If API's behavior can't be restored or a workaround through UI can't be provided some other reliable workaround can be used (even in database if right field to be provided) if just guarantied there won't be side-effects.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              teemuajalin Teemu Ajalin
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: