Affects Version/s: 3.9.4
Fix Version/s: None
We ran into an issue when non-editing teacher tries to grade students' forum posts and received "invalidresponse" error.
Each non-editing teacher is assigned to just one group, and the non-editing teacher is only seeing posts from the assigned group. (this is the expected behaviour)
However, when non-editing teacher tries to grade the posts, all students' post shows up and caused Moodle to generate invalidreponse error because he/she is not able to view the post from another group.
To replicate the issue:
- Create a course
- Create 2 students and 2 groups (group A and B).
- Assign student 1 to group A, and student 2 to group B
- Create 2 non-editing teachers (aka TA)
- Assign TA 1 to group A, and TA 2 to group B
- Create a forum activity with "Each person posts one discussion"
- Have both students post a topic in the forum
- TA1 sees posts from group A only
- TA1 tries to "Grade users"
- TA1 will see principal/teacher/manager and other non-editing teacher first.
- TA1 will then see student 1's post and able to grade
- TA1 click next student
- TA1 will receive invalidresponse because student 2 is not in the same group as TA1.
discussions => Invalid response value detected: posts => Invalid response value detected: userposts => Invalid response detected: timecreated => Invalid response value detected: Invalid external api response: the value is "" of PHP type "NULL", the server was expecting "int" type
Error code: invalidresponse
*line 459 of /lib/externallib.php: invalid_response_exception thrown
*line 267 of /lib/externallib.php: call to external_api::clean_returnvalue()
*line 81 of /lib/ajax/service.php: call to external_api::call_external_function()