I have overridden the setup_elements method in assignment.class.php and added a few new fields to the form. I have also overridden add_instance to store the extra fields in a separate table. It all works fine. However, when I edit the assignment to change some of the fields, only the default fields are filled - the additional fields remain empty. What's the recommended way of filling those additional fields? It can't be done within the setup_elements method because $this contains empty values (in particular, $this->assignment is null).
(
[cm] =>
[course] =>
[coursecontext] =>
[assignment] =>
[strassignment] =>
[strassignments] =>
[strsubmissions] =>
[strlastmodified] =>
[pagetitle] =>
[usehtmleditor] =>
[defaultformat] =>
[context] =>
[type] =>
)
It seems that there's something fundamental about adding custom fields to an assignment that I'm missing. I'd appreciate any help!
(Sorry for the formatting problems. I ask for left justification and I get centered text.)