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