<?php // $Id$
-
-// This file allows a teacher to grade essay questions.
-// Could be later expanded to change grades for all question types
-
-# Flow of the file:
-# Get variables, run essential queries
-# Check for post data submitted. If exists, then process data (the data is the grades and comments for essay questions)
-# Check for userid, attemptid, or gradeall and for questionid. If found, print out the appropriate essay question attempts
-# Switch:
-# first case: print out all essay questions in quiz and the number of ungraded attempts
-# second case: print out all users and their attempts for a specific essay question
-
-
- require_once("editlib.php");
- require_once($CFG->libdir.'/tablelib.php');
-
+/**
+ * Quiz report to help teachers manually grade quiz questions that need it.
+ *
+ * @package quiz
+ * @subpackage reports
+ */
+
+// Flow of the file:
+// Get variables, run essential queries
+// Check for post data submitted. If exists, then process data (the data is the grades and comments for essay questions)
+// Check for userid, attemptid, or gradeall and for questionid. If found, print out the appropriate essay question attempts
+// Switch:
+// first case: print out all essay questions in quiz and the number of ungraded attempts
+// second case: print out all users and their attempts for a specific essay question
+
+require_once($CFG->dirroot . "/mod/quiz/editlib.php");
+require_once($CFG->libdir . '/tablelib.php');
+
+/**
+ * Quiz report to help teachers manually grade quiz questions that need it.
+ *
+ * @package quiz
+ * @subpackage reports
+ */
class quiz_report extends quiz_default_report {
-
- function display($quiz, $cm, $course) { /// This function just displays the report
+ /**
+ * Displays the report.
+ */
+ function display($quiz, $cm, $course) {
global $CFG, $SESSION, $USER, $db, $QTYPES;
$action = optional_param('action', 'viewquestions', PARAM_ALPHA);
$usercount = count($users);
// set up table
- $tablecolumns = array('picture', 'fullname', 'attempt', 'grade');
+ $tablecolumns = array('picture', 'fullname', 'timefinish', 'grade');
$tableheaders = array('', get_string('fullname'), get_string("completedon", "quiz"), '');
$table = new flexible_table('mod-quiz-report-grading');
$sort = 'ORDER BY '.$sort; // seems like I would need to have u. or qa. infront of the ORDER BY attribues... but seems to work..
} else {
// my default sort rule
- $sort = 'ORDER BY u.firstname, u.lastname, qa.attempt ASC';
+ $sort = 'ORDER BY u.firstname, u.lastname, qa.timefinish ASC';
}
// set up the pagesize
// link for the attempt
$attemptlink = "<a $style href=\"report.php?mode=grading&action=grade&q=$quiz->id&questionid=$question->id&attemptid=$attempt->attemptid\">".
userdate($attempt->timefinish, get_string('strftimedatetime')).'</a>';
-
+
// grade all attempts for this user
$gradelink = "<a href=\"report.php?mode=grading&action=grade&q=$quiz->id&questionid=$question->id&userid=$attempt->userid\">".
get_string('grade').'</a>';