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

Attempting to grade forums outside of their display period causes invalid response value error

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull 3.9 Branch:
      MDL-68900-m39
    • Pull 3.10 Branch:
      MDL-68900-m310
    • Pull Master Branch:
      MDL-68900-master
    • Testing Instructions:
      Hide
      1. Create a course C1.
      2. Create two users, t1 and s1.
      3. Enrol t1 in C1 as a teacher and enrol s1 in C1 as a student.
      4. Login as t1.
      5. Create a Q&A forum in C1.
      6. Enable and set up the grading in the forum.
         
      7. Add a new question (discussion).
      8. Login as s1.
      9. Reply to the first post of the question created in 7.
      10. Login as t1.
      11. Go to the question created in 7.
      12. Edit the first post of the discussion.
      13. Set the display end period of the first post of the discussion in the past and save changes.
      14. Go to the forum main page.
      15. Verify the question is greyed out and you can see the "Timed" button beneath the question, which will show the information related to dates and accessibility. 
      16. You should see "Grade users" button like in below screenshot.
      17. Click "Grade users" button (Note: Make sure grading is enabled in forum activity)
      18. Select the user s1 from the grading panel.
      19. Confirm you can see the user response on the timed post.
      20. Assign a grade to the user.
      21. Confirm that you can see the grade assigned to the user without any error.
      Show
      Create a course C1. Create two users, t1 and s1. Enrol t1 in C1 as a teacher and enrol s1 in C1 as a student. Login as t1. Create a Q&A forum in C1. Enable and set up the grading in the forum.   Add a new question (discussion). Login as s1. Reply to the first post of the question created in 7. Login as t1. Go to the question created in 7. Edit the first post of the discussion. Set the display end period of the first post of the discussion in the past and save changes. Go to the forum main page. Verify the question is greyed out and you can see the "Timed" button beneath the question, which will show the information related to dates and accessibility.  You should see "Grade users" button like in below screenshot. Click "Grade users" button (Note: Make sure grading is enabled in forum activity) Select the user s1 from the grading panel. Confirm you can see the user response on the timed post. Assign a grade to the user. Confirm that you can see the grade assigned to the user without any error.

      Description

      It appears that grading is not available if the question post is not visible.

      FULL STEPS

      • Create a Q&A forum
      • Add a question as a teacher
      • Add a response as a student
      • Change the question post to have a display period in the past
      • Click Grade users button
      • Advance beyond teacher/question post to first student post

      EXPECTED

      • User interface to grade is available

      ACTUALLY HAPPENS

      • Invalid response value detected error (debug output below)

      I was also able to reproduce this on sandbox.moodle.net.

      discussions => Invalid response value detected (posts => Invalid response value detected (userposts => Invalid response value detected (timecreated => Invalid response value detected (Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): timecreated => Invalid response value detected (Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): userposts => Invalid response value detected (timecreated => Invalid response value detected (Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): timecreated => Invalid response value detected (Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): posts => Invalid response value detected (userposts => Invalid response value detected (timecreated => Invalid response value detected (Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): timecreated => Invalid response value detected (Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): userposts => Invalid response value detected (timecreated => Invalid response value detected (Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): timecreated => Invalid response value detected (Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type): Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type
      Error code: invalidresponse

      • line 442 of /lib/externallib.php: invalid_response_exception thrown
      • line ? of unknownfile: call to external_api::clean_returnvalue()
      • line 250 of /lib/externallib.php: call to call_user_func()
      • line 79 of /lib/ajax/service.php: call to external_api::call_external_function()

        Attachments

        1. Editing-Forum.png
          21 kB
          sumit negi
        2. example.patch
          3 kB
          Mathew May
        3. grade_users.png
          101 kB
          sumit negi
        4. image-2020-09-15-12-07-43-110.png
          17 kB
          sumit negi
        5. image-2020-09-15-12-23-40-404.png
          22 kB
          sumit negi
        6. MDL-68900.jpg
          36 kB
          Anna Carissa Sadia
        7. timedpost.png
          113 kB
          sumit negi

          Issue Links

            Activity

              People

              Assignee:
              sumit.negi sumit negi (Inactive)
              Reporter:
              meltonml Michelle Melton
              Peer reviewer:
              Mathew May Mathew May
              Integrator:
              Víctor Déniz Falcón Víctor Déniz Falcón
              Tester:
              Anna Carissa Sadia Anna Carissa Sadia
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              18 Vote for this issue
              Watchers:
              22 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Nov/20

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 25 minutes
                  3d 25m