General developer forum

Change In activity completion not saved

 
Picture of A. Obeid
Change In activity completion not saved
Particularly helpful Moodlers

Hi

in my developed activity  are change to "Completion tracking" and "Require view" not saved. By adding new activity everything is saved, by update everything is saved excepted completion changes. Without any errors.

Does anyone have an idea why?

lib.php "myactivity_supports":

switch($feature) {
case FEATURE_GROUPS: return true;
case FEATURE_GROUPINGS: return true;
case FEATURE_MOD_INTRO: return true;
case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
case FEATURE_PLAGIARISM: return true;

default: return null; }
 
Average of ratings: -
Picture of A. Obeid
Re: Change In activity completion not saved
Particularly helpful Moodlers

Solved.


It was this function in mod_form.php

 public function definition_after_data() {
if ($this->current->instance) {
return;
}
parent::definition_after_data();
}

I remove it, everything works as expected.
 
Average of ratings: -