Steps to recreate:
- create a coursework activity and set an idnumber in common module settings
- go to gradebook and check the idnumber corresponding to new coursework activity
- submit and grade some work
- release grades
- go to gradebook, the idnumber has been replaced with the cmid of the coursework activity
- go back to coursework, edit settings, idnumber has not changed here, save and display without making changes
- go to gradebook, the idnumber now matches common module settings.
You can repeat 4-7 several times to see the idnumber toggle back and forth.