Permalink
Browse files

Merge branch 'MDL-31291-POST23' of git://github.com/netspotau/moodle-…

…mod_assign
  • Loading branch information...
2 parents 89577d7 + b98824c commit d59b488b5a7adb7c2bd4a3a2c2c90036dd98f82d @nebgor nebgor committed Sep 6, 2012
@@ -216,7 +216,7 @@ public function save(stdClass $submissionorgrade, stdClass $data) {
*
* @return bool - if false - this plugin will not accept submissions / feedback
*/
- public final function is_enabled() {
+ public function is_enabled() {
return $this->get_config('enabled');
}
@@ -60,7 +60,9 @@ protected function define_structure() {
'requiresubmissionstatement',
'teamsubmission',
'requireallteammemberssubmit',
- 'teamsubmissiongroupingid'));
+ 'teamsubmissiongroupingid',
+ 'blindmarking',
+ 'revealidentities'));
$submissions = new backup_nested_element('submissions');
View
@@ -93,6 +93,16 @@
'clonepermissionsfrom' => 'gradereport/grader:view'
),
+ 'mod/assign:revealidentities' => array(
+ 'captype' => 'write',
+ 'contextlevel' => CONTEXT_MODULE,
+ 'archetypes' => array(
+ 'editingteacher' => CAP_ALLOW,
+ 'manager' => CAP_ALLOW
+ )
+ ),
+
+
);
View
@@ -25,7 +25,9 @@
<FIELD NAME="cutoffdate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The final date after which submissions will no longer be accepted for this assignment without an extensions." PREVIOUS="completionsubmit" NEXT="teamsubmission"/>
<FIELD NAME="teamsubmission" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Do students submit in teams?" PREVIOUS="cutoffdate" NEXT="requireallteammemberssubmit"/>
<FIELD NAME="requireallteammemberssubmit" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="If enabled, a submission will not be accepted until all team members have submitted it." PREVIOUS="teamsubmission" NEXT="teamsubmissiongroupingid"/>
- <FIELD NAME="teamsubmissiongroupingid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="A grouping id to get groups for team submissions" PREVIOUS="requireallteammemberssubmit"/>
+ <FIELD NAME="teamsubmissiongroupingid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="A grouping id to get groups for team submissions" PREVIOUS="requireallteammemberssubmit" NEXT="blindmarking"/>
+ <FIELD NAME="blindmarking" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Hide student/grader identities until the reveal identities action is performed" PREVIOUS="teamsubmissiongroupingid" NEXT="revealidentities"/>
+ <FIELD NAME="revealidentities" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Show identities for a blind marking assignment" PREVIOUS="blindmarking"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="The unique id for this assignment instance."/>
@@ -75,7 +77,7 @@
<INDEX NAME="mailed" UNIQUE="false" FIELDS="mailed" COMMENT="True if notifications have been sent about the most recent grader update about this submission." PREVIOUS="userid"/>
</INDEXES>
</TABLE>
- <TABLE NAME="assign_plugin_config" COMMENT="Config data for an instance of a plugin in an assignment." PREVIOUS="assign_grades">
+ <TABLE NAME="assign_plugin_config" COMMENT="Config data for an instance of a plugin in an assignment." PREVIOUS="assign_grades" NEXT="assign_user_mapping">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" NEXT="assignment"/>
<FIELD NAME="assignment" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="plugin"/>
@@ -94,5 +96,17 @@
<INDEX NAME="name" UNIQUE="false" FIELDS="name" COMMENT="The name of this plugin setting." PREVIOUS="subtype"/>
</INDEXES>
</TABLE>
+ <TABLE NAME="assign_user_mapping" COMMENT="Map an assignment specific id number to a user" PREVIOUS="assign_plugin_config">
+ <FIELDS>
+ <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" NEXT="assignment"/>
+ <FIELD NAME="assignment" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
+ <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="assignment"/>
+ </FIELDS>
+ <KEYS>
+ <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Unique ID for this user/assignment combination." NEXT="assignment"/>
+ <KEY NAME="assignment" TYPE="foreign" FIELDS="assignment" REFTABLE="assign" REFFIELDS="id" COMMENT="The assignment instance" PREVIOUS="primary" NEXT="user"/>
+ <KEY NAME="user" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" COMMENT="The user to map to an id" PREVIOUS="assignment"/>
+ </KEYS>
+ </TABLE>
</TABLES>
</XMLDB>
View
@@ -30,6 +30,7 @@
array('module'=>'assign', 'action'=>'download all submissions', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'grade submission', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'lock submission', 'mtable'=>'assign', 'field'=>'name'),
+ array('module'=>'assign', 'action'=>'reveal identities', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'revert submission to draft', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'submission statement accepted', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'submit', 'mtable'=>'assign', 'field'=>'name'),
View
@@ -156,6 +156,36 @@ function xmldb_assign_upgrade($oldversion) {
}
upgrade_mod_savepoint(true, 2012082300, 'assign');
}
+ if ($oldversion < 2012082400) {
+
+ // Define field to be added to assign
+ $table = new xmldb_table('assign_user_mapping');
+
+ $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
+ $table->add_field('assignment', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+
+ $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+ $table->add_key('userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));
+ $table->add_key('assignment', XMLDB_KEY_FOREIGN, array('assignment'), 'assign', array('id'));
+
+ if (!$dbman->table_exists($table)) {
+ $dbman->create_table($table);
+ }
+
+ $table = new xmldb_table('assign');
+ $field = new xmldb_field('blindmarking', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'teamsubmissiongroupingid');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ $table = new xmldb_table('assign');
+ $field = new xmldb_field('revealidentities', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'blindmarking');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+ upgrade_mod_savepoint(true, 2012082400, 'assign');
+ }
return true;
@@ -144,13 +144,19 @@ function __construct(assign $assignment, $perpage, $filter, $rowoffset, $quickgr
$headers[] = get_string('edit');
}
- // User picture
- $columns[] = 'picture';
- $headers[] = get_string('pictureofuser');
-
- // Fullname
- $columns[] = 'fullname';
- $headers[] = get_string('fullname');
+ // User picture.
+ if (!$this->assignment->is_blind_marking()) {
+ $columns[] = 'picture';
+ $headers[] = get_string('pictureofuser');
+
+ // Fullname.
+ $columns[] = 'fullname';
+ $headers[] = get_string('fullname');
+ } else {
+ // Record ID.
+ $columns[] = 'recordid';
+ $headers[] = get_string('recordid', 'assign');
+ }
// Submission status
if ($assignment->is_any_submission_plugin_enabled()) {
@@ -237,6 +243,16 @@ function __construct(assign $assignment, $perpage, $filter, $rowoffset, $quickgr
}
/**
+ * Add a column with an ID that uniquely identifies this user in this assignment
+ *
+ * @return string
+ */
+ function col_recordid(stdClass $row) {
+ return get_string('hiddenuser', 'assign', $this->assignment->get_uniqueid_for_user($row->userid));
+ }
+
+
+ /**
* Add the userid to the row class so it can be updated via ajax
*
* @param stdClass $row The row of data
@@ -37,6 +37,7 @@
$string['assign:exportownsubmission'] = 'Export own submission';
$string['assign:grade'] = 'Grade assignment';
$string['assign:grantextension'] = 'Grant extension';
+$string['assign:revealidentities'] = 'Reveal student identities';
$string['assign:submit'] = 'Submit assignment';
$string['assign:view'] = 'View assignment';
$string['assignfeedback'] = 'Feedback plugin';
@@ -68,6 +69,8 @@
$string['batchoperationlock'] = 'lock submissions';
$string['batchoperationunlock'] = 'unlock submissions';
$string['batchoperationreverttodraft'] = 'revert submissions to draft';
+$string['blindmarking'] = 'Blind marking';
+$string['blindmarking_help'] = 'Blind marking hides the identity of students to markers. Blind marking settings will be locked once a submission or grade has been made in relation to this assignment.';
$string['changegradewarning'] = 'This assignment has graded submissions and changing the grade will not automatically re-calculate existing submission grades. You must re-grade all existing submissions, if you wish to change the grade.';
$string['comment'] = 'Comment';
$string['completionsubmit'] = 'Student must submit to this activity to complete it';
@@ -156,6 +159,7 @@
$string['gradingstudentprogress'] = 'Grading student {$a->index} of {$a->count}';
$string['gradingsummary'] = 'Grading summary';
$string['hideshow'] = 'Hide/Show';
+$string['hiddenuser'] = 'Participant {$a}';
$string['instructionfiles'] = 'Instruction files';
$string['invalidgradeforscale'] = 'The grade supplied was not valid for the current scale';
$string['invalidfloatforgrade'] = 'The grade provided could not be understood: {$a}';
@@ -202,6 +206,7 @@
$string['outlinegrade'] = 'Grade: {$a}';
$string['page-mod-assign-x'] = 'Any assignment module page';
$string['page-mod-assign-view'] = 'Assignment module main and submission page';
+$string['participant'] = 'Participant';
$string['pluginadministration'] = 'Assignment administration';
$string['pluginname'] = 'Assignment';
$string['preventsubmissions'] = 'Prevent the user from making any more submissions to this assignment.';
@@ -215,6 +220,9 @@
$string['requiresubmissionstatement_help'] = 'Require that students accept the submission statement for all assignment submissions for this entire Moodle installation. If this setting is not enabled, then submission statements can be enabled or disabled in the settings for each assignment.';
$string['requireallteammemberssubmit'] = 'Require all team members submit';
$string['requireallteammemberssubmit_help'] = 'If enabled, all members of the student team must click the submit button for this assignment before the team submission will be considered as submitted. If disabled, the team submission will be considered as submitted as soon as any member of the student team clicks the submit button.';
+$string['recordid'] = 'Identifier';
+$string['revealidentities'] = 'Reveal student identities';
+$string['revealidentitiesconfirm'] = 'Are you sure you want to reveal student identities for this assignment. This operation cannot be undone. Once the student identities have been revealed, the marks will be released to the gradebook.';
$string['reverttodraftforstudent'] = 'Revert submission to draft for student: (id={$a->id}, fullname={$a->fullname}).';
$string['reverttodraft'] = 'Revert the submission to draft status.';
$string['reverttodraftshort'] = 'Revert the submission to draft';
@@ -299,3 +307,5 @@
$string['viewsubmissionforuser'] = 'View submission for user: {$a}';
$string['viewsubmission'] = 'View submission';
$string['viewsubmissiongradingtable'] = 'View submission grading table.';
+$string['viewrevealidentitiesconfirm'] = 'View reveal student identities confirmation page.';
+
View
@@ -113,7 +113,7 @@ function assign_grading_areas_list() {
* @return void
*/
function assign_extend_settings_navigation(settings_navigation $settings, navigation_node $navref) {
- global $PAGE;
+ global $PAGE, $DB;
$cm = $PAGE->cm;
if (!$cm) {
@@ -144,6 +144,14 @@ function assign_extend_settings_navigation(settings_navigation $settings, naviga
$node = $navref->add(get_string('downloadall', 'assign'), $link, navigation_node::TYPE_SETTING);
}
+ if (has_capability('mod/assign:revealidentities', $context)) {
+ $assignment = $DB->get_record('assign', array('id'=>$cm->instance), 'blindmarking, revealidentities');
+
+ if ($assignment && $assignment->blindmarking && !$assignment->revealidentities) {
+ $link = new moodle_url('/mod/assign/view.php', array('id' => $cm->id,'action'=>'revealidentities'));
+ $node = $navref->add(get_string('revealidentities', 'assign'), $link, navigation_node::TYPE_SETTING);
+ }
+ }
}
Oops, something went wrong.

0 comments on commit d59b488

Please sign in to comment.