When marking workflow is on and the grade is not released we never send notifications anyway.
Instead of preventing the grading form from submitting (validation error) we silently ignore it.
When marking workflow is enabled, students will be notified only when
the workflow state transitions to 'Released'. Until that happens,
sending of messages will be held and the 'Notify students' grading
form option will be locked.
Additionally, the batch set marking workflow state facility gains
the 'Notify students' option.
Credit to Steve Upton and David Balch for the basis of this patch.
This prevents a bug where the next student feedback will default to the values that
were on the last submitted form. This is a similar case to having multiple instances
of the same form on the same page - each one needs a unique identifier to distinguish
between them. In this case I include the $rownum which changes as you go to each student
in the list.