While working on grades backup... looking my DB i detected that modules using more than one gradeitem (workshop only for now, afaik). Are duplicating grade_item->idnumber, and that value is expected to be 100% unique or any calculation based on it will break badly.
Quick-tracing down the problem a bit... it seems that, beginning in modedit.php, we are allowing the introduction of only one idnumber, and I think the interface should adapt to show more if the activity requires multiple. Then, after the interface, the same script uses one grade_item::fetch() call to get exclusively one grade_item (once again wrong assumption).
Not sure where else this is wrong, but clearly... we should 100% avoid duplicates of idnumber and right now all workshop activities have them. As a minor problem we should ensure, at least, that only one item gets the idnumber, but never both. And ideally, as commented, interface and process should handle multiple ok (perhaps some new value in module_supports() like NUMBER_OF_GRADE_ITEMS could be used, if present, to make the modedit to know....
Just a quick thought... ciao