I think I've cracked this. In case anyone else has the same problem, here's the solution:
You need a function _get_coursemodule_info($coursemodule) in lib.php at the top level of the plugin.
This needs to contain something along the lines:
$info = new cached_cm_info();
$info->name = $->name;
if ($coursemodule->completion == COMPLETION_TRACKING_AUTOMATIC) {
$info->customdata['customcompletionrules']['completionsubmit'] = $->completionsubmit;
}
return $info;
You need a function _get_coursemodule_info($coursemodule) in lib.php at the top level of the plugin.
This needs to contain something along the lines:
$info = new cached_cm_info();
$info->name = $->name;
if ($coursemodule->completion == COMPLETION_TRACKING_AUTOMATIC) {
$info->customdata['customcompletionrules']['completionsubmit'] = $->completionsubmit;
}
return $info;