/** * Reveal the identities of anonymous students to markers for a single seplment. * * @param int $seplmentid The id of the seplment * @return array of warnings to indicate any errors. * @since Moodle 2.6 */ public static function reveal_identities($seplmentid) { global $CFG, $USER; require_once "{$CFG->dirroot}/mod/sepl/locallib.php"; $params = self::validate_parameters(self::reveal_identities_parameters(), array('seplmentid' => $seplmentid)); $cm = get_coursemodule_from_instance('sepl', $params['seplmentid'], 0, false, MUST_EXIST); $context = context_module::instance($cm->id); self::validate_context($context); $seplment = new sepl($context, $cm, null); $warnings = array(); if (!$seplment->reveal_identities()) { $detail = 'User id: ' . $USER->id . ', Assignment id: ' . $params['seplmentid']; $warnings[] = self::generate_warning($params['seplmentid'], 'couldnotrevealidentities', $detail); } return $warnings; }