amandadoughty / moodle-mod_peerwork

3 stars 8 forks source link

Activity completion not working as expected #13

Closed alec-gullon closed 2 weeks ago

alec-gullon commented 1 year ago

We were testing this plugin's activity completion and we noticed it doesn't work as expected when the activity completion is configured to "Students must grade all their peers". Steps to reproduce below:

  1. Create a grouping with at least one group
  2. Add some students to the group
  3. Create a peer assessment using the grouping
  4. Use default settings and add at least one criteria
  5. Enable activity completion and set the criteria as "Students must grade all their peers"
  6. Login as student A and submit grade for the other students in the group
  7. Confirm that activity completion for student A is shown as "done"
  8. Logout as student and check the activity completion report and check that only Student A is marked as completed
  9. Login as student B.
  10. The peer assessment activity is shown as "done" even though they have not graded any student and the activity completion report shows they have not completed.

I did a little inspection of the code, and it looks to me like this query needs something additional added to its WHERE clause: https://github.com/amandadoughty/moodle-mod_peerwork/blob/master/classes/completion/custom_completion.php#L59. Possibly something like $gradedby = ? which is set equal to the user's id. This is how it is done here, for example: https://github.com/amandadoughty/moodle-mod_peerwork/blob/master/locallib.php#L540.

As it currently stands, this particular check for activity completion will pass for everybody as soon as one individual has submitted grades for everybody in the group.

nuria2c commented 9 months ago

Could it be possible this isse impact in the app version?

We have this error in the app https://github.com/amandadoughty/moodle-mod_peerwork/issues/14

when a user is enrolled in a course with grouping and completion options and with "Students must grade all their peers" activated.

amandadoughty commented 2 weeks ago

I have tested this in 4.1 - 4.5 and I can only recreate the issue in versions < 4.3 so I am closing it as stale. Thank you for providing enough steps to help write a behat test to cover the feature.