Permalink
Browse files

MDL-29920: grade.php in assignment now can show submission/feedback f…

…or a particular user (also when submission did not exist yet)
  • Loading branch information...
1 parent bb17ac1 commit 63b9a6d07d2a8278054478ba47b00146f0c66ad7 @marinaglancy marinaglancy committed with mudrd8mz Nov 1, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 mod/assignment/grade.php
@@ -3,6 +3,7 @@
require_once("../../config.php");
$id = required_param('id', PARAM_INT); // Course module ID
+$userid = optional_param('userid', 0, PARAM_INT); // Graded user ID (optional)
$PAGE->set_url('/mod/assignment/grade.php', array('id'=>$id));
if (! $cm = get_coursemodule_from_id('assignment', $id)) {
@@ -20,7 +21,12 @@
require_login($course, false, $cm);
if (has_capability('mod/assignment:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) {
- redirect('submissions.php?id='.$cm->id);
+ if ($userid) {
+ redirect('submissions.php?id='.$cm->id.'&userid='.$userid.'&mode=single&filter=0&offset=0');
+ } else {
+ redirect('submissions.php?id='.$cm->id);
+ }
} else {
+ // user will view his own submission, parameter $userid is ignored
redirect('view.php?id='.$cm->id);
}

0 comments on commit 63b9a6d

Please sign in to comment.