MDL-47793 assign: Reset reveal identities
authorMichael Aherne <michael.aherne@strath.ac.uk>
Thu, 23 Oct 2014 11:05:31 +0000 (12:05 +0100)
committerMichael Aherne <michael.aherne@strath.ac.uk>
Wed, 29 Oct 2014 11:18:06 +0000 (11:18 +0000)
mod/assign/locallib.php

index 97d59e5..0a24703 100644 (file)
@@ -770,6 +770,12 @@ class assign {
                 // Remove all grades from gradebook.
                 require_once($CFG->dirroot.'/mod/assign/lib.php');
                 assign_reset_gradebook($data->courseid);
+
+                // Reset revealidentities if both submissions and grades have been reset.
+                $instance = $this->get_instance();
+                if ($this->get_instance()->blindmarking && $this->get_instance()->revealidentities) {
+                    $DB->set_field('assign', 'revealidentities', 0, array('id' => $instance->id));
+                }
             }
         }
         // Updating dates - shift may be negative too.