I would get the response 'Incorrect score received' which lead me to think that the error was with the value in the "scoreGiven" field.
I think it should be a more generic error, such as "invalid value in the score payload", even better if it specified which was the problematic field.
My problem was that I hadn't enrolled in the course (is_user_gradable_in_course returned false I guess) which is a completely different problem than "Incorrect score received". I believe the error "user is not enrolled in course" would have been a lot more helpful in my scenario.
I ran into a problem with this and spent a few hours troubleshooting the problem, I thought the issue was on my my code, but it was with a problem on how I'd set up things in moodle itself.
Thanks Miguel for the feedback. I agree it would gain on clarity. This code is now part of the core moodle code, so the fix would need to go there. I'll see if I can break that down a bit out there.
Hi! My suggestion is on moodle-ltiservice_gradebookservices/classes/local/resources/scores.php this function:
I would get the response 'Incorrect score received' which lead me to think that the error was with the value in the "scoreGiven" field. I think it should be a more generic error, such as "invalid value in the score payload", even better if it specified which was the problematic field. My problem was that I hadn't enrolled in the course (is_user_gradable_in_course returned false I guess) which is a completely different problem than "Incorrect score received". I believe the error "user is not enrolled in course" would have been a lot more helpful in my scenario.
I ran into a problem with this and spent a few hours troubleshooting the problem, I thought the issue was on my my code, but it was with a problem on how I'd set up things in moodle itself.
Thanks for writing this plugin!