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

mod_quiz_get_quizzes_by_courses is not returning required data when the quiz is closed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.2
    • Fix Version/s: 3.1.6, 3.2.3
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide
      1. Create one quiz activity, configured it so is not available until the next week for example (time restriction).
      2. Enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token for one student in the course where the quiz is.
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a couple of CURL REST call simulating a WS client with the student user
        • You need to replace the wstoken, courseid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=4&wsfunction=mod_quiz_get_quizzes_by_courses&wstoken=1b9cc9f44630b554bb2c9428b8744338' | python -m "json.tool"

      5. Confirm that
        • In the response you see these fields (amont others):
          'attempts', 'timelimit', 'grademethod', 'decimalpoints', 'questiondecimalpoints', 'sumgrades', 'grade', 'preferredbehaviour', 'hasfeedback'
      Show
      Create one quiz activity, configured it so is not available until the next week for example (time restriction). Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for one student in the course where the quiz is. Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a couple of CURL REST call simulating a WS client with the student user You need to replace the wstoken, courseid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=4&wsfunction=mod_quiz_get_quizzes_by_courses&wstoken=1b9cc9f44630b554bb2c9428b8744338' | python -m "json.tool" Confirm that In the response you see these fields (amont others): 'attempts', 'timelimit', 'grademethod', 'decimalpoints', 'questiondecimalpoints', 'sumgrades', 'grade', 'preferredbehaviour', 'hasfeedback'
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58628-master

      Description

      When the quiz is closed, Moodle don't return some required information required to display attempts information, this was originally reported in: MOBILE-2086

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Tim Hunt
              Integrator:
              David Monllaó
              Tester:
              Marcus Green
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/May/17