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

Incorrect type for "grade" field in core_course_get_course_module WS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course, create a quiz activity
      2. Add at least one question and set the Maximum grade to a float number, 9.50 for example
      3. Enrol a user as teacher in the course
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the user token.
        • You need to replace the wstoken, cmid (with the activity course module id) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'cmid=81&wsfunction=core_course_get_course_module&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool"

      7. Confirm that you receive the module information including the grade and that the grade returned is a float.
      Show
      Create a course, create a quiz activity Add at least one question and set the Maximum grade to a float number, 9.50 for example Enrol a user as teacher in the course As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user token. You need to replace the wstoken, cmid (with the activity course module id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'cmid=81&wsfunction=core_course_get_course_module&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool" Confirm that you receive the module information including the grade and that the grade returned is a float.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59019-master

      Description

      The "grade" field (maximum possible grade of the module) should be a PARAM_FLOAT because some modules like quiz or workshops expect a FLOAT value while others (like assign, lesson, lti) expect an integer.

      I know that the policy is not to backport this changes, but this is a serious bug

        Attachments

        1. index.js
          0.4 kB
          David Mudrák (@mudrd8mz)

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            jleyva Juan Leyva
            Peer reviewer:
            Andrew Nicols
            Integrator:
            Dan Poltawski
            Tester:
            David Mudrák (@mudrd8mz)
            Participants:
            Component watchers:
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Nov/17