2006-08-10 21:52:07 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This script lists student attempts
|
|
|
|
*
|
|
|
|
* @version $Id$
|
|
|
|
* @author Martin Dougiamas, Tim Hunt and others.
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
|
|
|
* @package quiz
|
|
|
|
*//** */
|
|
|
|
|
|
|
|
require_once($CFG->libdir.'/tablelib.php');
|
2005-06-04 09:58:35 +00:00
|
|
|
|
|
|
|
class quiz_report extends quiz_default_report {
|
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
/**
|
|
|
|
* Display the report.
|
|
|
|
*/
|
|
|
|
function display($quiz, $cm, $course) {
|
2007-04-27 05:55:57 +00:00
|
|
|
global $CFG, $db;
|
2005-06-04 09:58:35 +00:00
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Define some strings
|
2005-06-04 09:58:35 +00:00
|
|
|
$strreallydel = addslashes(get_string('deleteattemptcheck','quiz'));
|
|
|
|
$strtimeformat = get_string('strftimedatetime');
|
|
|
|
$strreviewquestion = get_string('reviewresponse', 'quiz');
|
|
|
|
|
2007-09-17 16:17:24 +00:00
|
|
|
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Only print headers if not asked to download data
|
2005-07-22 09:43:23 +00:00
|
|
|
if (!$download = optional_param('download', NULL)) {
|
|
|
|
$this->print_header_and_tabs($cm, $course, $quiz, $reportmode="overview");
|
|
|
|
}
|
2005-06-04 09:58:35 +00:00
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Deal with actions
|
|
|
|
$action = optional_param('action', '', PARAM_ACTION);
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-06-04 09:58:35 +00:00
|
|
|
switch($action) {
|
2006-08-10 21:52:07 +00:00
|
|
|
case 'delete': // Some attempts need to be deleted
|
2007-09-17 16:17:24 +00:00
|
|
|
require_capability('mod/quiz:deleteattempts', $context);
|
2006-08-10 21:52:07 +00:00
|
|
|
$attemptids = optional_param('attemptid', array(), PARAM_INT);
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-06-04 09:58:35 +00:00
|
|
|
foreach($attemptids as $attemptid) {
|
2007-10-04 15:57:09 +00:00
|
|
|
add_to_log($course->id, 'quiz', 'delete attempt', 'report.php?id=' . $cm->id,
|
|
|
|
$attemptid, $cm->id);
|
2007-06-18 16:19:00 +00:00
|
|
|
quiz_delete_attempt($attemptid, $quiz);
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2007-07-30 10:33:43 +00:00
|
|
|
// Set of format options for teacher-created content, for example overall feedback.
|
|
|
|
$nocleanformatoptions = new stdClass;
|
|
|
|
$nocleanformatoptions->noclean = true;
|
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
// Work out some display options - whether there is feedback, and whether scores should be shown.
|
|
|
|
$hasfeedback = quiz_has_feedback($quiz->id) && $quiz->grade > 1.e-7 && $quiz->sumgrades > 1.e-7;
|
|
|
|
$fakeattempt = new stdClass();
|
|
|
|
$fakeattempt->preview = false;
|
|
|
|
$fakeattempt->timefinish = $quiz->timeopen;
|
|
|
|
$reviewoptions = quiz_get_reviewoptions($quiz, $fakeattempt, $context);
|
|
|
|
$showgrades = $quiz->grade && $quiz->sumgrades && $reviewoptions->scores;
|
|
|
|
|
2007-07-25 17:08:41 +00:00
|
|
|
// Set table options
|
|
|
|
$noattempts = optional_param('noattempts', 0, PARAM_INT);
|
|
|
|
$detailedmarks = optional_param('detailedmarks', 0, PARAM_INT);
|
|
|
|
$pagesize = optional_param('pagesize', 10, PARAM_INT);
|
|
|
|
$reporturl = $CFG->wwwroot.'/mod/quiz/report.php?mode=overview';
|
2007-10-04 15:57:09 +00:00
|
|
|
if ($pagesize < 1) {
|
|
|
|
$pagesize = 10;
|
|
|
|
}
|
|
|
|
if (!$reviewoptions->scores) {
|
|
|
|
$detailedmarks = 0;
|
|
|
|
}
|
2007-07-25 17:08:41 +00:00
|
|
|
$reporturlwithoptions = $reporturl . '&id=' . $cm->id . '&noattempts=' . $noattempts .
|
|
|
|
'&detailedmarks=' . $detailedmarks . '&pagesize=' . $pagesize;
|
2007-10-04 15:57:09 +00:00
|
|
|
|
2007-05-23 10:21:43 +00:00
|
|
|
/// find out current groups mode
|
2007-08-27 03:56:39 +00:00
|
|
|
$currentgroup = groups_get_activity_group($cm, true);
|
2007-10-04 15:57:09 +00:00
|
|
|
|
2007-08-27 03:56:39 +00:00
|
|
|
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used
|
2005-07-22 09:43:23 +00:00
|
|
|
if (!$download) {
|
2007-08-27 03:56:39 +00:00
|
|
|
groups_print_activity_menu($cm, $reporturlwithoptions);
|
2005-07-22 09:43:23 +00:00
|
|
|
}
|
2007-04-04 04:05:53 +00:00
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2007-12-12 17:23:55 +00:00
|
|
|
// Print information on the number of existing attempts
|
|
|
|
if (!$download) { //do not print notices when downloading
|
|
|
|
if ($strattemptnum = quiz_num_attempt_summary($quiz, $cm, false, $currentgroup)) {
|
|
|
|
echo '<div class="quizattemptcounts">' . $strattemptnum . '</div>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Now check if asked download of data
|
2005-07-22 09:43:23 +00:00
|
|
|
if ($download) {
|
|
|
|
$filename = clean_filename("$course->shortname ".format_string($quiz->name,true));
|
|
|
|
$sort = '';
|
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Define table columns
|
2006-07-17 16:35:34 +00:00
|
|
|
$tablecolumns = array('checkbox', 'picture', 'fullname', 'timestart', 'timefinish', 'duration');
|
2007-10-04 15:57:09 +00:00
|
|
|
$tableheaders = array(NULL, '', get_string('name'), get_string('startedon', 'quiz'),
|
|
|
|
get_string('timecompleted','quiz'), get_string('attemptduration', 'quiz'));
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
if ($showgrades) {
|
2005-06-04 09:58:35 +00:00
|
|
|
$tablecolumns[] = 'sumgrades';
|
|
|
|
$tableheaders[] = get_string('grade', 'quiz').'/'.$quiz->grade;
|
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-06-04 09:58:35 +00:00
|
|
|
if($detailedmarks) {
|
|
|
|
// we want to display marks for all questions
|
|
|
|
// Start by getting all questions
|
|
|
|
$questionlist = quiz_questions_in_quiz($quiz->questions);
|
|
|
|
$questionids = explode(',', $questionlist);
|
|
|
|
$sql = "SELECT q.*, i.grade AS maxgrade, i.id AS instance".
|
2006-08-10 21:52:07 +00:00
|
|
|
" FROM {$CFG->prefix}question q,".
|
|
|
|
" {$CFG->prefix}quiz_question_instances i".
|
|
|
|
" WHERE i.quiz = '$quiz->id' AND q.id = i.question".
|
|
|
|
" AND q.id IN ($questionlist)";
|
2005-06-04 09:58:35 +00:00
|
|
|
if (!$questions = get_records_sql($sql)) {
|
|
|
|
error('No questions found');
|
|
|
|
}
|
|
|
|
$number = 1;
|
|
|
|
foreach($questionids as $key => $id) {
|
|
|
|
if ($questions[$id]->length) {
|
|
|
|
// Only print questions of non-zero length
|
|
|
|
$tablecolumns[] = '$'.$id;
|
|
|
|
$tableheaders[] = '#'.$number;
|
|
|
|
$questions[$id]->number = $number;
|
|
|
|
$number += $questions[$id]->length;
|
|
|
|
} else {
|
|
|
|
// get rid of zero length questions
|
|
|
|
unset($questions[$id]);
|
|
|
|
unset($questionids[$key]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2006-08-22 17:31:26 +00:00
|
|
|
if ($hasfeedback) {
|
2007-06-03 07:26:54 +00:00
|
|
|
$tablecolumns[] = 'feedbacktext';
|
2006-08-22 17:31:26 +00:00
|
|
|
$tableheaders[] = get_string('feedback', 'quiz');
|
|
|
|
}
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
if (!$download) {
|
|
|
|
// Set up the table
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
$table = new flexible_table('mod-quiz-report-overview-report');
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
$table->define_columns($tablecolumns);
|
|
|
|
$table->define_headers($tableheaders);
|
2007-07-25 17:08:41 +00:00
|
|
|
$table->define_baseurl($reporturlwithoptions);
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
$table->sortable(true);
|
|
|
|
$table->collapsible(true);
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
$table->column_suppress('picture');
|
|
|
|
$table->column_suppress('fullname');
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
$table->column_class('picture', 'picture');
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
$table->set_attribute('cellspacing', '0');
|
|
|
|
$table->set_attribute('id', 'attempts');
|
|
|
|
$table->set_attribute('class', 'generaltable generalbox');
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
// Start working -- this is necessary as soon as the niceties are over
|
|
|
|
$table->setup();
|
2006-12-21 20:34:51 +00:00
|
|
|
} else if ($download =='ODS') {
|
|
|
|
require_once("$CFG->libdir/odslib.class.php");
|
|
|
|
|
|
|
|
$filename .= ".ods";
|
|
|
|
// Creating a workbook
|
|
|
|
$workbook = new MoodleODSWorkbook("-");
|
|
|
|
// Sending HTTP headers
|
|
|
|
$workbook->send($filename);
|
|
|
|
// Creating the first worksheet
|
|
|
|
$sheettitle = get_string('reportoverview','quiz');
|
|
|
|
$myxls =& $workbook->add_worksheet($sheettitle);
|
|
|
|
// format types
|
|
|
|
$format =& $workbook->add_format();
|
|
|
|
$format->set_bold(0);
|
|
|
|
$formatbc =& $workbook->add_format();
|
|
|
|
$formatbc->set_bold(1);
|
|
|
|
$formatbc->set_align('center');
|
|
|
|
$formatb =& $workbook->add_format();
|
|
|
|
$formatb->set_bold(1);
|
|
|
|
$formaty =& $workbook->add_format();
|
|
|
|
$formaty->set_bg_color('yellow');
|
|
|
|
$formatc =& $workbook->add_format();
|
|
|
|
$formatc->set_align('center');
|
|
|
|
$formatr =& $workbook->add_format();
|
|
|
|
$formatr->set_bold(1);
|
|
|
|
$formatr->set_color('red');
|
|
|
|
$formatr->set_align('center');
|
|
|
|
$formatg =& $workbook->add_format();
|
|
|
|
$formatg->set_bold(1);
|
|
|
|
$formatg->set_color('green');
|
|
|
|
$formatg->set_align('center');
|
|
|
|
// Here starts workshhet headers
|
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
$headers = array(get_string('name'), get_string('startedon', 'quiz'),
|
|
|
|
get_string('timecompleted', 'quiz'), get_string('attemptduration', 'quiz'));
|
2006-12-21 20:34:51 +00:00
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
if ($showgrades) {
|
2006-12-21 20:34:51 +00:00
|
|
|
$headers[] = get_string('grade', 'quiz').'/'.$quiz->grade;
|
|
|
|
}
|
|
|
|
if($detailedmarks) {
|
|
|
|
foreach ($questionids as $id) {
|
|
|
|
$headers[] = '#'.$questions[$id]->number;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($hasfeedback) {
|
|
|
|
$headers[] = get_string('feedback', 'quiz');
|
|
|
|
}
|
|
|
|
$colnum = 0;
|
|
|
|
foreach ($headers as $item) {
|
|
|
|
$myxls->write(0,$colnum,$item,$formatbc);
|
|
|
|
$colnum++;
|
|
|
|
}
|
|
|
|
$rownum=1;
|
2006-08-10 21:52:07 +00:00
|
|
|
} else if ($download =='Excel') {
|
2006-01-05 16:43:05 +00:00
|
|
|
require_once("$CFG->libdir/excellib.class.php");
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
$filename .= ".xls";
|
2006-08-10 21:52:07 +00:00
|
|
|
// Creating a workbook
|
2006-01-05 16:43:05 +00:00
|
|
|
$workbook = new MoodleExcelWorkbook("-");
|
2006-08-10 21:52:07 +00:00
|
|
|
// Sending HTTP headers
|
2006-01-05 16:43:05 +00:00
|
|
|
$workbook->send($filename);
|
2006-08-10 21:52:07 +00:00
|
|
|
// Creating the first worksheet
|
2006-06-05 14:24:13 +00:00
|
|
|
$sheettitle = get_string('reportoverview','quiz');
|
2005-07-22 09:43:23 +00:00
|
|
|
$myxls =& $workbook->add_worksheet($sheettitle);
|
2006-08-10 21:52:07 +00:00
|
|
|
// format types
|
2005-07-22 09:43:23 +00:00
|
|
|
$format =& $workbook->add_format();
|
|
|
|
$format->set_bold(0);
|
|
|
|
$formatbc =& $workbook->add_format();
|
|
|
|
$formatbc->set_bold(1);
|
|
|
|
$formatbc->set_align('center');
|
|
|
|
$formatb =& $workbook->add_format();
|
|
|
|
$formatb->set_bold(1);
|
|
|
|
$formaty =& $workbook->add_format();
|
|
|
|
$formaty->set_bg_color('yellow');
|
|
|
|
$formatc =& $workbook->add_format();
|
|
|
|
$formatc->set_align('center');
|
|
|
|
$formatr =& $workbook->add_format();
|
|
|
|
$formatr->set_bold(1);
|
|
|
|
$formatr->set_color('red');
|
|
|
|
$formatr->set_align('center');
|
|
|
|
$formatg =& $workbook->add_format();
|
|
|
|
$formatg->set_bold(1);
|
|
|
|
$formatg->set_color('green');
|
|
|
|
$formatg->set_align('center');
|
|
|
|
// Here starts workshhet headers
|
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
$headers = array(get_string('name'), get_string('startedon', 'quiz'),
|
|
|
|
get_string('timecompleted', 'quiz'), get_string('attemptduration', 'quiz'));
|
2005-07-22 09:43:23 +00:00
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
if ($showgrades) {
|
2005-07-22 09:43:23 +00:00
|
|
|
$headers[] = get_string('grade', 'quiz').'/'.$quiz->grade;
|
|
|
|
}
|
|
|
|
if($detailedmarks) {
|
2006-09-13 15:00:58 +00:00
|
|
|
foreach ($questionids as $id) {
|
2005-10-28 03:54:33 +00:00
|
|
|
$headers[] = '#'.$questions[$id]->number;
|
2005-07-22 09:43:23 +00:00
|
|
|
}
|
|
|
|
}
|
2006-08-22 17:31:26 +00:00
|
|
|
if ($hasfeedback) {
|
|
|
|
$headers[] = get_string('feedback', 'quiz');
|
|
|
|
}
|
2005-07-22 09:43:23 +00:00
|
|
|
$colnum = 0;
|
|
|
|
foreach ($headers as $item) {
|
|
|
|
$myxls->write(0,$colnum,$item,$formatbc);
|
|
|
|
$colnum++;
|
|
|
|
}
|
|
|
|
$rownum=1;
|
2006-08-10 21:52:07 +00:00
|
|
|
} else if ($download=='CSV') {
|
2005-07-22 09:43:23 +00:00
|
|
|
$filename .= ".txt";
|
|
|
|
|
2005-09-17 13:09:43 +00:00
|
|
|
header("Content-Type: application/download\n");
|
2005-07-22 09:43:23 +00:00
|
|
|
header("Content-Disposition: attachment; filename=\"$filename\"");
|
|
|
|
header("Expires: 0");
|
|
|
|
header("Cache-Control: must-revalidate,post-check=0,pre-check=0");
|
|
|
|
header("Pragma: public");
|
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
$headers = get_string('name')."\t".get_string('startedon', 'quiz')."\t".
|
|
|
|
get_string('timecompleted', 'quiz')."\t".get_string('attemptduration', 'quiz');
|
2005-07-22 09:43:23 +00:00
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
if ($showgrades) {
|
2005-07-22 09:43:23 +00:00
|
|
|
$headers .= "\t".get_string('grade', 'quiz')."/".$quiz->grade;
|
|
|
|
}
|
|
|
|
if($detailedmarks) {
|
2006-09-13 15:00:58 +00:00
|
|
|
foreach ($questionids as $id) {
|
|
|
|
$headers .= "\t#".$questions[$id]->number;
|
2005-07-22 09:43:23 +00:00
|
|
|
}
|
|
|
|
}
|
2006-08-22 17:31:26 +00:00
|
|
|
if ($hasfeedback) {
|
|
|
|
$headers .= "\t" . get_string('feedback', 'quiz');
|
|
|
|
}
|
2005-07-22 09:43:23 +00:00
|
|
|
echo $headers." \n";
|
|
|
|
}
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2006-09-20 09:00:04 +00:00
|
|
|
$contextlists = get_related_contexts_string(get_context_instance(CONTEXT_COURSE, $course->id));
|
2005-07-22 09:43:23 +00:00
|
|
|
|
2005-06-04 09:58:35 +00:00
|
|
|
// Construct the SQL
|
2006-09-26 05:05:10 +00:00
|
|
|
$select = 'SELECT '.sql_concat('u.id', '\'#\'', $db->IfNull('qa.attempt', '0')).' AS uniqueid, '.
|
2006-02-06 20:58:27 +00:00
|
|
|
'qa.uniqueid as attemptuniqueid, qa.id AS attempt, u.id AS userid, u.firstname, u.lastname, u.picture, '.
|
2005-11-18 21:03:05 +00:00
|
|
|
'qa.sumgrades, qa.timefinish, qa.timestart, qa.timefinish - qa.timestart AS duration ';
|
2005-11-15 22:23:43 +00:00
|
|
|
if ($course->id != SITEID) { // this is too complicated, so just do it for each of the four cases.
|
|
|
|
if (!empty($currentgroup) && empty($noattempts)) {
|
2006-03-01 00:49:49 +00:00
|
|
|
// we want a particular group and we only want to see students WITH attempts.
|
|
|
|
// So join on groups_members and do an inner join on attempts.
|
2007-01-04 13:15:04 +13:00
|
|
|
$from = 'FROM '.$CFG->prefix.'user u JOIN '.$CFG->prefix.'role_assignments ra ON ra.userid = u.id '.
|
2007-08-15 19:28:11 +00:00
|
|
|
'JOIN '.$CFG->prefix.'groups_members gm ON u.id = gm.userid '.
|
2005-11-15 22:23:43 +00:00
|
|
|
'JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid AND qa.quiz = '.$quiz->id;
|
2007-08-15 19:28:11 +00:00
|
|
|
$where = ' WHERE ra.contextid ' . $contextlists . ' AND gm.groupid = '. $currentgroup .' AND qa.preview = 0';
|
2005-11-15 22:23:43 +00:00
|
|
|
} else if (!empty($currentgroup) && !empty($noattempts)) {
|
2006-03-01 03:00:33 +00:00
|
|
|
// We want a particular group and we want to do something funky with attempts
|
2007-06-05 14:56:12 +00:00
|
|
|
// So join on groups_members and left join on attempts...
|
2007-01-04 13:15:04 +13:00
|
|
|
$from = 'FROM '.$CFG->prefix.'user u JOIN '.$CFG->prefix.'role_assignments ra ON ra.userid = u.id '.
|
2007-08-15 19:28:11 +00:00
|
|
|
'JOIN '.$CFG->prefix.'groups_members gm ON u.id = gm.userid '.
|
2005-11-15 22:23:43 +00:00
|
|
|
'LEFT JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid AND qa.quiz = '.$quiz->id;
|
2007-08-15 19:28:11 +00:00
|
|
|
$where = ' WHERE ra.contextid ' .$contextlists . ' AND gm.groupid = '.$currentgroup;
|
2006-03-01 02:20:32 +00:00
|
|
|
if ($noattempts == 1) {
|
2006-03-01 03:00:33 +00:00
|
|
|
// noattempts = 1 means only no attempts, so make the left join ask for only records where the right is null (no attempts)
|
2006-03-01 02:20:32 +00:00
|
|
|
$where .= ' AND qa.userid IS NULL'; // show ONLY no attempts;
|
2007-06-21 16:21:47 +00:00
|
|
|
} else {
|
|
|
|
// We are including attempts, so exclude previews.
|
|
|
|
$where .= ' AND qa.preview = 0';
|
|
|
|
}
|
2006-04-12 22:48:58 +00:00
|
|
|
} else if (empty($currentgroup)) {
|
2006-03-01 03:00:33 +00:00
|
|
|
// We don't care about group, and we to do something funky with attempts
|
|
|
|
// So do a left join on attempts
|
2007-10-04 15:57:09 +00:00
|
|
|
$from = 'FROM '.$CFG->prefix.'user u JOIN '.$CFG->prefix.'role_assignments ra ON ra.userid = u.id LEFT JOIN '.
|
|
|
|
$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid AND qa.quiz = '.$quiz->id;
|
2007-06-21 16:21:47 +00:00
|
|
|
$where = " WHERE ra.contextid $contextlists";
|
2006-04-12 22:48:58 +00:00
|
|
|
if (empty($noattempts)) {
|
2007-06-21 16:21:47 +00:00
|
|
|
$where .= ' AND qa.userid IS NOT NULL AND qa.preview = 0'; // show ONLY students with attempts;
|
2006-08-10 21:52:07 +00:00
|
|
|
} else if ($noattempts == 1) {
|
2006-03-01 03:00:33 +00:00
|
|
|
// noattempts = 1 means only no attempts, so make the left join ask for only records where the right is null (no attempts)
|
2006-04-13 00:02:36 +00:00
|
|
|
$where .= ' AND qa.userid IS NULL'; // show ONLY students without attempts;
|
2006-08-10 21:52:07 +00:00
|
|
|
} else if ($noattempts == 3) {
|
2006-04-13 00:02:36 +00:00
|
|
|
// we want all attempts
|
|
|
|
$from = 'FROM '.$CFG->prefix.'user u JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid ';
|
|
|
|
$where = ' WHERE qa.quiz = '.$quiz->id.' AND qa.preview = 0';
|
|
|
|
} // noattempts = 2 means we want all students, with or without attempts
|
2005-11-15 22:23:43 +00:00
|
|
|
}
|
2006-09-26 05:05:10 +00:00
|
|
|
$countsql = 'SELECT COUNT(DISTINCT('.sql_concat('u.id', '\'#\'', $db->IfNull('qa.attempt', '0')).')) '.$from.$where;
|
2005-11-15 22:23:43 +00:00
|
|
|
} else {
|
|
|
|
if (empty($noattempts)) {
|
|
|
|
$from = 'FROM '.$CFG->prefix.'user u JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid ';
|
2006-03-27 08:41:20 +00:00
|
|
|
$where = ' WHERE qa.quiz = '.$quiz->id.' AND qa.preview = 0';
|
2006-09-26 05:05:10 +00:00
|
|
|
$countsql = 'SELECT COUNT(DISTINCT('.sql_concat('u.id', '\'#\'', $db->IfNull('qa.attempt', '0')).')) '.$from.$where;
|
2005-11-15 22:23:43 +00:00
|
|
|
}
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
2005-07-22 09:43:23 +00:00
|
|
|
if (!$download) {
|
|
|
|
// Add extra limits due to initials bar
|
|
|
|
if($table->get_sql_where()) {
|
2005-11-15 22:23:43 +00:00
|
|
|
$where .= ' AND '.$table->get_sql_where();
|
2005-07-22 09:43:23 +00:00
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
// Count the records NOW, before funky question grade sorting messes up $from
|
2005-11-15 22:23:43 +00:00
|
|
|
if (!empty($countsql)) {
|
|
|
|
$totalinitials = count_records_sql($countsql);
|
|
|
|
if ($table->get_sql_where()) {
|
|
|
|
$countsql .= ' AND '.$table->get_sql_where();
|
|
|
|
}
|
|
|
|
$total = count_records_sql($countsql);
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2005-11-15 22:23:43 +00:00
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
// Add extra limits due to sorting by question grade
|
|
|
|
if($sort = $table->get_sql_sort()) {
|
|
|
|
$sortparts = explode(',', $sort);
|
|
|
|
$newsort = array();
|
|
|
|
$questionsort = false;
|
|
|
|
foreach($sortparts as $sortpart) {
|
|
|
|
$sortpart = trim($sortpart);
|
|
|
|
if(substr($sortpart, 0, 1) == '$') {
|
|
|
|
if(!$questionsort) {
|
|
|
|
$qid = intval(substr($sortpart, 1));
|
|
|
|
$select .= ', grade ';
|
2006-05-25 10:00:06 +00:00
|
|
|
$from .= ' LEFT JOIN '.$CFG->prefix.'question_sessions qns ON qns.attemptid = qa.id '.
|
2006-02-28 09:26:00 +00:00
|
|
|
'LEFT JOIN '.$CFG->prefix.'question_states qs ON qs.id = qns.newgraded ';
|
2005-07-22 09:43:23 +00:00
|
|
|
$where .= ' AND ('.sql_isnull('qns.questionid').' OR qns.questionid = '.$qid.')';
|
|
|
|
$newsort[] = 'grade '.(strpos($sortpart, 'ASC')? 'ASC' : 'DESC');
|
|
|
|
$questionsort = true;
|
|
|
|
}
|
2006-08-10 21:52:07 +00:00
|
|
|
} else {
|
2005-07-22 09:43:23 +00:00
|
|
|
$newsort[] = $sortpart;
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
// Reconstruct the sort string
|
|
|
|
$sort = ' ORDER BY '.implode(', ', $newsort);
|
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-10-28 02:22:34 +00:00
|
|
|
// Fix some wired sorting
|
|
|
|
if (empty($sort)) {
|
|
|
|
$sort = ' ORDER BY uniqueid';
|
|
|
|
}
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2005-07-22 09:43:23 +00:00
|
|
|
$table->pagesize($pagesize, $total);
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
2005-07-22 09:43:23 +00:00
|
|
|
|
2006-08-22 17:31:26 +00:00
|
|
|
// If there is feedback, include it in the query.
|
|
|
|
if ($hasfeedback) {
|
|
|
|
$factor = $quiz->grade/$quiz->sumgrades;
|
|
|
|
$select .= ', qf.feedbacktext ';
|
2007-08-12 13:57:57 +00:00
|
|
|
$from .= " JOIN {$CFG->prefix}quiz_feedback qf ON " .
|
2006-08-22 17:31:26 +00:00
|
|
|
"qf.quizid = $quiz->id AND qf.mingrade <= qa.sumgrades * $factor AND qa.sumgrades * $factor < qf.maxgrade";
|
|
|
|
}
|
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Fetch the attempts
|
2005-11-15 22:23:43 +00:00
|
|
|
if (!empty($from)) { // if we're in the site course and displaying no attempts, it makes no sense to do the query.
|
2006-10-31 22:19:15 +00:00
|
|
|
if (!$download) {
|
|
|
|
$attempts = get_records_sql($select.$from.$where.$sort,
|
2007-06-05 14:56:12 +00:00
|
|
|
$table->get_page_start(), $table->get_page_size());
|
2006-10-31 22:19:15 +00:00
|
|
|
} else {
|
|
|
|
$attempts = get_records_sql($select.$from.$where.$sort);
|
|
|
|
}
|
2005-11-15 22:23:43 +00:00
|
|
|
} else {
|
|
|
|
$attempts = array();
|
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Build table rows
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2005-11-15 22:23:43 +00:00
|
|
|
if (!$download) {
|
|
|
|
$table->initialbars($totalinitials>20);
|
|
|
|
}
|
|
|
|
if(!empty($attempts) || !empty($noattempts)) {
|
2006-02-14 23:24:10 +00:00
|
|
|
if ($attempts) {
|
|
|
|
foreach ($attempts as $attempt) {
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2006-02-14 23:24:10 +00:00
|
|
|
$picture = print_user_picture($attempt->userid, $course->id, $attempt->picture, false, true);
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2006-02-14 23:24:10 +00:00
|
|
|
// uncomment the commented lines below if you are choosing to show unenrolled users and
|
|
|
|
// have uncommented the corresponding lines earlier in this script
|
|
|
|
//if (in_array($attempt->userid, $unenrolledusers)) {
|
2007-10-04 15:57:09 +00:00
|
|
|
// $userlink = '<a class="dimmed" href="'.$CFG->wwwroot.'/user/view.php?id='.
|
|
|
|
// $attempt->userid.'&course='.$course->id.'">'.fullname($attempt).'</a>';
|
2006-02-14 23:24:10 +00:00
|
|
|
//}
|
|
|
|
//else {
|
2007-10-04 15:57:09 +00:00
|
|
|
$userlink = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$attempt->userid.
|
|
|
|
'&course='.$course->id.'">'.fullname($attempt).'</a>';
|
2006-02-14 23:24:10 +00:00
|
|
|
//}
|
2007-10-04 15:57:09 +00:00
|
|
|
|
|
|
|
// Username columns.
|
|
|
|
$row = array();
|
2005-07-22 09:43:23 +00:00
|
|
|
if (!$download) {
|
2007-10-04 15:57:09 +00:00
|
|
|
$row[] = '<input type="checkbox" name="attemptid[]" value="'.$attempt->attempt.'" />';
|
|
|
|
$row[] = $picture;
|
|
|
|
$row[] = $userlink;
|
2006-08-10 21:52:07 +00:00
|
|
|
} else {
|
2007-10-04 15:57:09 +00:00
|
|
|
$row[] = fullname($attempt);
|
2005-07-22 09:43:23 +00:00
|
|
|
}
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2007-10-04 15:57:09 +00:00
|
|
|
// Timing columns.
|
|
|
|
if ($attempt->attempt) {
|
|
|
|
$startdate = userdate($attempt->timestart, $strtimeformat);
|
2006-02-14 23:24:10 +00:00
|
|
|
if (!$download) {
|
2007-10-04 15:57:09 +00:00
|
|
|
$row[] = '<a href="review.php?q='.$quiz->id.'&attempt='.$attempt->attempt.'">'.$startdate.'</a>';
|
2006-08-10 21:52:07 +00:00
|
|
|
} else {
|
2007-10-04 15:57:09 +00:00
|
|
|
$row[] = $startdate;
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
2007-10-04 15:57:09 +00:00
|
|
|
if ($attempt->timefinish) {
|
|
|
|
$timefinish = userdate($attempt->timefinish, $strtimeformat);
|
|
|
|
$duration = format_time($attempt->duration);
|
|
|
|
if (!$download) {
|
|
|
|
$row[] = '<a href="review.php?q='.$quiz->id.'&attempt='.$attempt->attempt.'">'.$startdate.'</a>';
|
|
|
|
} else {
|
|
|
|
$row[] = '<a href="review.php?q='.$quiz->id.'&attempt='.$attempt->attempt.'">'.$timefinish.'</a>';
|
|
|
|
}
|
|
|
|
$row[] = $duration;
|
|
|
|
} else {
|
|
|
|
$row[] = '-';
|
|
|
|
$row[] = get_string('unfinished', 'quiz');
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$row[] = '-';
|
|
|
|
$row[] = '-';
|
|
|
|
$row[] = '-';
|
|
|
|
}
|
|
|
|
|
|
|
|
// Grades columns.
|
2007-12-11 16:55:54 +00:00
|
|
|
if ($showgrades) {
|
|
|
|
if ($attempt->timefinish) {
|
|
|
|
$grade = round($attempt->sumgrades / $quiz->sumgrades * $quiz->grade,$quiz->decimalpoints);
|
|
|
|
if (!$download) {
|
|
|
|
$row[] = '<a href="review.php?q='.$quiz->id.'&attempt='.$attempt->attempt.'">'.$grade.'</a>';
|
|
|
|
} else {
|
|
|
|
$row[] = $grade;
|
|
|
|
}
|
2007-10-04 15:57:09 +00:00
|
|
|
} else {
|
2007-12-11 16:55:54 +00:00
|
|
|
$row[] = '-';
|
2007-10-04 15:57:09 +00:00
|
|
|
}
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
2007-12-11 16:55:54 +00:00
|
|
|
|
2006-02-14 23:24:10 +00:00
|
|
|
if($detailedmarks) {
|
|
|
|
if(empty($attempt->attempt)) {
|
|
|
|
foreach($questionids as $questionid) {
|
|
|
|
$row[] = '-';
|
2005-07-22 09:43:23 +00:00
|
|
|
}
|
2006-08-10 21:52:07 +00:00
|
|
|
} else {
|
2006-02-14 23:24:10 +00:00
|
|
|
foreach($questionids as $questionid) {
|
2007-10-04 15:57:09 +00:00
|
|
|
$gradedstateid = get_field('question_sessions', 'newgraded', 'attemptid',
|
|
|
|
$attempt->attemptuniqueid, 'questionid', $questionid);
|
|
|
|
if ($gradedstateid) {
|
|
|
|
$grade = round(get_field('question_states', 'grade', 'id',
|
|
|
|
$gradedstateid), $quiz->decimalpoints);
|
2006-02-14 23:24:10 +00:00
|
|
|
} else {
|
2006-03-13 18:36:36 +00:00
|
|
|
$grade = '--';
|
2006-02-14 23:24:10 +00:00
|
|
|
}
|
|
|
|
if (!$download) {
|
2007-10-04 15:57:09 +00:00
|
|
|
$row[] = link_to_popup_window('/mod/quiz/reviewquestion.php?state='.
|
|
|
|
$gradedstateid.'&number='.$questions[$questionid]->number,
|
|
|
|
'reviewquestion', $grade, 450, 650, $strreviewquestion, 'none', true);
|
2006-08-10 21:52:07 +00:00
|
|
|
} else {
|
2007-10-04 08:22:55 +00:00
|
|
|
$row[] = $grade;
|
2006-02-14 23:24:10 +00:00
|
|
|
}
|
2005-07-22 09:43:23 +00:00
|
|
|
}
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
|
|
|
}
|
2007-10-04 15:57:09 +00:00
|
|
|
|
|
|
|
// Feedback column.
|
2006-08-22 17:31:26 +00:00
|
|
|
if ($hasfeedback) {
|
|
|
|
if ($attempt->timefinish) {
|
2007-07-30 10:33:43 +00:00
|
|
|
$row[] = format_text($attempt->feedbacktext, FORMAT_MOODLE, $nocleanformatoptions);
|
2006-08-22 17:31:26 +00:00
|
|
|
} else {
|
|
|
|
$row[] = '-';
|
|
|
|
}
|
|
|
|
}
|
2006-02-14 23:24:10 +00:00
|
|
|
if (!$download) {
|
|
|
|
$table->add_data($row);
|
2006-12-21 20:34:51 +00:00
|
|
|
} else if ($download == 'Excel' or $download == 'ODS') {
|
2006-02-14 23:24:10 +00:00
|
|
|
$colnum = 0;
|
|
|
|
foreach($row as $item){
|
|
|
|
$myxls->write($rownum,$colnum,$item,$format);
|
|
|
|
$colnum++;
|
|
|
|
}
|
|
|
|
$rownum++;
|
2006-08-10 21:52:07 +00:00
|
|
|
} else if ($download=='CSV') {
|
2006-02-14 23:24:10 +00:00
|
|
|
$text = implode("\t", $row);
|
|
|
|
echo $text." \n";
|
2005-07-22 09:43:23 +00:00
|
|
|
}
|
|
|
|
}
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
2005-09-17 13:09:43 +00:00
|
|
|
if (!$download) {
|
2006-08-10 21:52:07 +00:00
|
|
|
// Start form
|
2005-07-22 09:43:23 +00:00
|
|
|
echo '<div id="tablecontainer">';
|
2007-10-04 15:57:09 +00:00
|
|
|
echo '<form id="attemptsform" method="post" action="' . $reporturlwithoptions .
|
|
|
|
'" onsubmit="var menu = document.getElementById(\'menuaction\'); ' .
|
|
|
|
'return (menu.options[menu.selectedIndex].value == \'delete\' ? confirm(\''.
|
|
|
|
$strreallydel.'\') : true);">';
|
2007-02-28 07:11:58 +00:00
|
|
|
echo '<div>';
|
2005-09-17 13:09:43 +00:00
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Print table
|
2005-07-22 09:43:23 +00:00
|
|
|
$table->print_html();
|
|
|
|
|
2007-09-17 16:17:24 +00:00
|
|
|
// Prepare list of available options.
|
|
|
|
$options = array();
|
|
|
|
if (has_capability('mod/quiz:deleteattempts', $context)) {
|
|
|
|
$options['delete'] = get_string('delete');
|
|
|
|
}
|
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
// Print "Select all" etc.
|
2007-09-17 16:17:24 +00:00
|
|
|
if (!empty($attempts) && !empty($options)) {
|
2005-11-15 22:23:43 +00:00
|
|
|
echo '<table id="commands">';
|
|
|
|
echo '<tr><td>';
|
2007-10-04 15:57:09 +00:00
|
|
|
echo '<a href="javascript:select_all_in(\'DIV\',null,\'tablecontainer\');">'.
|
|
|
|
get_string('selectall', 'quiz').'</a> / ';
|
|
|
|
echo '<a href="javascript:deselect_all_in(\'DIV\',null,\'tablecontainer\');">'.
|
|
|
|
get_string('selectnone', 'quiz').'</a> ';
|
2005-11-15 22:23:43 +00:00
|
|
|
echo ' ';
|
2007-10-04 15:57:09 +00:00
|
|
|
choose_from_menu($options, 'action', '', get_string('withselected', 'quiz'),
|
|
|
|
'if(this.selectedIndex > 0) submitFormById(\'attemptsform\');');
|
2007-01-09 09:07:16 +00:00
|
|
|
echo '<noscript id="noscriptmenuaction" style="display: inline;"><div>';
|
|
|
|
echo '<input type="submit" value="'.get_string('go').'" /></div></noscript>';
|
2007-10-04 15:57:09 +00:00
|
|
|
echo '<script type="text/javascript">
|
|
|
|
<!--
|
|
|
|
document.getElementById("noscriptmenuaction").style.display = "none";
|
|
|
|
-->
|
|
|
|
</script>';
|
2005-11-15 22:23:43 +00:00
|
|
|
echo '</td></tr></table>';
|
|
|
|
}
|
2006-08-10 21:52:07 +00:00
|
|
|
// Close form
|
2007-02-28 07:11:58 +00:00
|
|
|
echo '</div>';
|
2005-07-22 09:43:23 +00:00
|
|
|
echo '</form></div>';
|
2007-06-05 14:56:12 +00:00
|
|
|
|
2005-11-15 22:23:43 +00:00
|
|
|
if (!empty($attempts)) {
|
2007-01-09 09:07:16 +00:00
|
|
|
echo '<table class="boxaligncenter"><tr>';
|
2006-12-21 20:34:51 +00:00
|
|
|
$options = array();
|
2007-07-25 17:08:41 +00:00
|
|
|
$options["id"] = $cm->id;
|
|
|
|
$options["q"] = $quiz->id;
|
2005-11-15 22:23:43 +00:00
|
|
|
$options['sesskey'] = sesskey();
|
|
|
|
$options["noheader"] = "yes";
|
2007-05-23 10:21:43 +00:00
|
|
|
$options['noattempts'] = $noattempts;
|
|
|
|
$options['detailedmarks'] = $detailedmarks;
|
2005-11-15 22:23:43 +00:00
|
|
|
echo '<td>';
|
2006-12-21 20:34:51 +00:00
|
|
|
$options["download"] = "ODS";
|
2007-07-25 17:08:41 +00:00
|
|
|
print_single_button($reporturl, $options, get_string("downloadods"));
|
2006-12-21 20:34:51 +00:00
|
|
|
echo "</td>\n";
|
|
|
|
echo '<td>';
|
2005-11-15 22:23:43 +00:00
|
|
|
$options["download"] = "Excel";
|
2007-07-25 17:08:41 +00:00
|
|
|
print_single_button($reporturl, $options, get_string("downloadexcel"));
|
2005-11-15 22:23:43 +00:00
|
|
|
echo "</td>\n";
|
|
|
|
echo '<td>';
|
|
|
|
$options["download"] = "CSV";
|
2007-07-25 17:08:41 +00:00
|
|
|
print_single_button($reporturl, $options, get_string("downloadtext"));
|
2005-11-15 22:23:43 +00:00
|
|
|
echo "</td>\n";
|
|
|
|
echo "<td>";
|
2006-06-30 10:31:44 +00:00
|
|
|
helpbutton('overviewdownload', get_string('overviewdownload', 'quiz_overview'), 'quiz');
|
2005-11-15 22:23:43 +00:00
|
|
|
echo "</td>\n";
|
|
|
|
echo '</tr></table>';
|
|
|
|
}
|
2006-12-21 20:34:51 +00:00
|
|
|
} else if ($download == 'Excel' or $download == 'ODS') {
|
2005-07-22 09:43:23 +00:00
|
|
|
$workbook->close();
|
2006-05-26 06:48:25 +00:00
|
|
|
exit;
|
2006-08-10 21:52:07 +00:00
|
|
|
} else if ($download == 'CSV') {
|
2005-07-22 09:43:23 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2006-08-10 21:52:07 +00:00
|
|
|
} else {
|
2005-07-22 09:43:23 +00:00
|
|
|
if (!$download) {
|
|
|
|
$table->print_html();
|
|
|
|
}
|
2005-06-04 09:58:35 +00:00
|
|
|
}
|
2006-08-10 21:52:07 +00:00
|
|
|
// Print display options
|
2006-04-12 22:48:58 +00:00
|
|
|
echo '<div class="controls">';
|
2007-07-25 17:08:41 +00:00
|
|
|
echo '<form id="options" action="' . $reporturl . '" method="get">';
|
2007-02-28 08:01:41 +00:00
|
|
|
echo '<div>';
|
2006-04-12 22:48:58 +00:00
|
|
|
echo '<p>'.get_string('displayoptions', 'quiz').': </p>';
|
|
|
|
echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
|
|
|
|
echo '<input type="hidden" name="q" value="'.$quiz->id.'" />';
|
|
|
|
echo '<input type="hidden" name="noattempts" value="0" />';
|
|
|
|
echo '<input type="hidden" name="detailedmarks" value="0" />';
|
2007-01-09 09:07:16 +00:00
|
|
|
echo '<table id="overview-options" class="boxaligncenter">';
|
2006-04-12 22:48:58 +00:00
|
|
|
echo '<tr align="left">';
|
|
|
|
echo '<td><label for="pagesize">'.get_string('pagesize', 'quiz').'</label></td>';
|
2007-04-11 20:38:02 +00:00
|
|
|
echo '<td><input type="text" id="pagesize" name="pagesize" size="3" value="'.$pagesize.'" /></td>';
|
2006-04-12 22:48:58 +00:00
|
|
|
echo '</tr>';
|
|
|
|
echo '<tr align="left">';
|
|
|
|
echo '<td colspan="2">';
|
2006-04-13 00:02:36 +00:00
|
|
|
$options = array(0 => get_string('attemptsonly','quiz_overview', $course->students));
|
2006-04-12 22:48:58 +00:00
|
|
|
if ($course->id != SITEID) {
|
2006-04-13 00:02:36 +00:00
|
|
|
$options[1] = get_string('noattemptsonly', 'quiz_overview', $course->students);
|
|
|
|
$options[2] = get_string('allstudents','quiz_overview', $course->students);
|
|
|
|
$options[3] = get_string('allattempts','quiz_overview');
|
2006-04-12 22:48:58 +00:00
|
|
|
}
|
|
|
|
choose_from_menu($options,'noattempts',$noattempts,'');
|
|
|
|
echo '</td></tr>';
|
|
|
|
echo '<tr align="left">';
|
2007-10-04 15:57:09 +00:00
|
|
|
echo '<td colspan="2">';
|
|
|
|
echo '<input type="checkbox" id="checkdetailedmarks" name="detailedmarks" '.
|
|
|
|
($detailedmarks?'checked="checked" ':'').'value="1" /> ';
|
|
|
|
echo '<label for="checkdetailedmarks">'.get_string('showdetailedmarks', 'quiz').'</label> ';
|
2006-04-12 22:48:58 +00:00
|
|
|
echo '</td></tr>';
|
|
|
|
echo '<tr><td colspan="2" align="center">';
|
|
|
|
echo '<input type="submit" value="'.get_string('go').'" />';
|
|
|
|
echo '</td></tr></table>';
|
2007-02-28 08:01:41 +00:00
|
|
|
echo '</div>';
|
2006-04-12 22:48:58 +00:00
|
|
|
echo '</form>';
|
|
|
|
echo '</div>';
|
|
|
|
echo "\n";
|
|
|
|
|
2005-06-04 09:58:35 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-07-17 16:35:34 +00:00
|
|
|
?>
|