Grade from my activity plugin appear twice

Grade from my activity plugin appear twice

by Thomas Chapeaux -
Number of replies: 0

We are the developers of Wooclap, an activity plugin where students can answers real-time interactive questions during a live course and the teacher can synchronize their results in the course Gradebook after the lesson.

Upon synchronization, some of our users observe an error in the Gradebook where the activity appears multiple times (over multiple columns), instead of one column per activity as expected.

Here are the two function calls by our plugin that produces the result in attachment (on Moodle 3.9):

grade_update(
  'mod/wooclap',
   2, // id of the course
   'mod',
   'wooclap',
   21, // id of the activity
   0,
   ['userid' => 2, 'rawgrade' => 100],
   ['itemname' => 'columns 3']
);

grade_update(
   'mod/wooclap',
   2, // id of the course
   'mod',
   'wooclap',
   21, // id of the activity
   0,
   ['userid' => 3, 'rawgrade' => 0],
   ['itemname' => 'columns 3']
);

Both return a GRADE_UPDATE_OK (=0) response.

We expect those two calls to update different cells of a same column in the Gradebook instead. What could cause two different columns to be created? Is there something we are not understanding correctly?

Note: Not sure if relevant to this bug, but running the synchronization again (so re-running the function calls above) return a GRADE_UPDATE_MULTIPLE error.

Note2: We have also reported this as a bug in the Tracker.

Thanks in advance for any help you can provide on this issue.

Attachment 2020-11-18 17_08_13-Grades_ View — Firefox Developer Edition.png