MDL-58523 mod_feedback: deleting response should reset completion
[moodle.git] / mod / feedback / classes / completion.php
index 4cf34b1..2289840 100644 (file)
@@ -561,7 +561,8 @@ class mod_feedback_completion extends mod_feedback_structure {
 
         // Update completion state.
         $completion = new completion_info($this->cm->get_course());
-        if (isloggedin() && !isguestuser() && $completion->is_enabled($this->cm) && $this->feedback->completionsubmit) {
+        if (isloggedin() && !isguestuser() && $completion->is_enabled($this->cm) &&
+                $this->cm->completion == COMPLETION_TRACKING_AUTOMATIC && $this->feedback->completionsubmit) {
             $completion->update_state($this->cm, COMPLETION_COMPLETE);
         }
     }