From: tjhunt <tjhunt> Date: Thu, 22 Mar 2007 21:31:39 +0000 (+0000) Subject: MDL-7241 - Manual grading report, sort by completed time didn't. Merged from MOODLE_1... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bc67d9b3bdc9fe64509822759ba3d4a4553fee09;p=moodle.git MDL-7241 - Manual grading report, sort by completed time didn't. Merged from MOODLE_16_STABLE. --- diff --git a/mod/quiz/report/grading/report.php b/mod/quiz/report/grading/report.php index 25f2c9f341..b230943096 100644 --- a/mod/quiz/report/grading/report.php +++ b/mod/quiz/report/grading/report.php @@ -1,23 +1,33 @@ <?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); @@ -186,7 +196,7 @@ class quiz_report extends quiz_default_report { $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'); @@ -233,7 +243,7 @@ class quiz_report extends quiz_default_report { $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 @@ -259,7 +269,7 @@ class quiz_report extends quiz_default_report { // 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>';