2005-11-08 07:48:10 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
|
|
|
|
// This page lists all the instances of hotpot in a particular course
|
|
|
|
|
2006-08-09 13:45:49 +00:00
|
|
|
require_once("../../config.php");
|
|
|
|
require_once("../../course/lib.php");
|
|
|
|
require_once("lib.php");
|
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
$id = required_param('id', PARAM_INT); // course
|
2008-06-01 18:12:24 +00:00
|
|
|
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
2008-04-04 02:54:20 +00:00
|
|
|
print_error("Course ID is incorrect");
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
require_login($course->id);
|
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
$coursecontext = get_context_instance(CONTEXT_COURSE, $id);
|
2008-05-02 04:37:02 +00:00
|
|
|
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
2006-10-07 08:59:59 +00:00
|
|
|
|
2006-08-09 13:45:49 +00:00
|
|
|
add_to_log($course->id, "hotpot", "view all", "index.php?id=$course->id", "");
|
|
|
|
|
|
|
|
// Moodle 1.4+ requires sesskey to be passed in forms
|
|
|
|
if (isset($USER->sesskey)) {
|
|
|
|
$sesskey = '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
|
|
|
|
} else {
|
|
|
|
$sesskey = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
// get message strings for titles
|
|
|
|
$strmodulenameplural = get_string("modulenameplural", "hotpot");
|
|
|
|
$strmodulename = get_string("modulename", "hotpot");
|
|
|
|
|
|
|
|
// string translation array for single and double quotes
|
|
|
|
$quotes = array("'"=>"\'", '"'=>'"');
|
|
|
|
|
|
|
|
// Print the header
|
|
|
|
|
2007-02-28 06:25:22 +00:00
|
|
|
$title = format_string($course->shortname) . ": $strmodulenameplural";
|
|
|
|
$heading = $course->fullname;
|
2007-04-16 21:40:46 +00:00
|
|
|
|
2007-07-05 04:55:24 +00:00
|
|
|
$navlinks = array();
|
2007-07-05 04:40:48 +00:00
|
|
|
$navlinks[] = array('name' => $strmodulenameplural, 'link' => '', 'type' => 'activity');
|
|
|
|
$navigation = build_navigation($navlinks);
|
2007-04-16 21:40:46 +00:00
|
|
|
|
2006-08-09 13:45:49 +00:00
|
|
|
print_header($title, $heading, $navigation, "", "", true, "", navmenu($course));
|
|
|
|
|
|
|
|
$next_url = "$CFG->wwwroot/course/view.php?id=$course->id";
|
|
|
|
|
|
|
|
// get display section, if any
|
2007-05-22 04:28:27 +00:00
|
|
|
$section = optional_param('section', 0, PARAM_ALPHANUM);
|
|
|
|
if ($section=='all') {
|
|
|
|
// do nothing
|
|
|
|
} else {
|
|
|
|
$section = intval($section);
|
|
|
|
}
|
2006-08-09 13:45:49 +00:00
|
|
|
if ($section) {
|
|
|
|
$displaysection = course_set_display($course->id, $section);
|
|
|
|
} else {
|
|
|
|
if (isset($USER->display[$course->id])) {
|
|
|
|
$displaysection = $USER->display[$course->id];
|
|
|
|
} else {
|
|
|
|
$displaysection = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
// Get all hotpot instances in this course
|
|
|
|
$hotpots = array();
|
|
|
|
if ($hotpot_instances = hotpot_get_all_instances_in_course('hotpot', $course)) {
|
|
|
|
foreach ($hotpot_instances as $hotpot_instance) {
|
|
|
|
if ($displaysection>0 && $hotpot_instance->section>0 && $displaysection<>$hotpot_instance->section) {
|
|
|
|
// do nothing (user is not diplaying this section)
|
|
|
|
} else {
|
|
|
|
$hotpots[$hotpot_instance->id] = $hotpot_instance;
|
|
|
|
}
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (empty($hotpots)) {
|
2007-10-29 10:44:50 +00:00
|
|
|
notice(get_string('thereareno', 'moodle', $strmodulenameplural), $next_url);
|
2006-08-09 13:45:49 +00:00
|
|
|
exit;
|
|
|
|
}
|
2006-10-07 08:59:59 +00:00
|
|
|
$hotpotids = implode(',', array_keys($hotpots));
|
2006-08-09 13:45:49 +00:00
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
if (has_capability('mod/hotpot:grade', $sitecontext)) {
|
2006-08-09 13:45:49 +00:00
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
// array of hotpots to be regraded
|
|
|
|
$regrade_hotpots = array();
|
2006-08-09 13:45:49 +00:00
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
// do we need to regrade any or all of the hotpots?
|
|
|
|
$regrade = optional_param('regrade', 0, PARAM_SEQUENCE);
|
|
|
|
if ($regrade) {
|
|
|
|
// add valid hotpot ids to the regrade array
|
|
|
|
$regrade = explode(',', $regrade);
|
|
|
|
foreach ($regrade as $id) {
|
|
|
|
if (isset($hotpots[$id])) {
|
|
|
|
$regrade_hotpots[$id] = &$hotpots[$id];
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
2006-10-07 08:59:59 +00:00
|
|
|
$regrade = implode(',', array_keys($regrade_hotpots));
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
2006-10-07 08:59:59 +00:00
|
|
|
if ($regrade) {
|
2006-08-09 13:45:49 +00:00
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
|
|
|
if (!$confirm) {
|
2006-08-09 13:45:49 +00:00
|
|
|
|
|
|
|
print_simple_box_start("center", "60%", "#FFAAAA", 20, "noticebox");
|
2006-10-07 08:59:59 +00:00
|
|
|
|
|
|
|
if (count($regrade_hotpots)==1) {
|
|
|
|
print_heading(get_string('regradecheck', 'hotpot', $regrade_hotpots[$regrade]->name));
|
|
|
|
} else {
|
|
|
|
print_heading(get_string('regradecheck', 'hotpot', ''));
|
|
|
|
print '<ul>';
|
|
|
|
foreach ($regrade_hotpots as $hotpot) {
|
|
|
|
print "<li>$hotpot->name</li>";
|
|
|
|
}
|
|
|
|
print '</ul>';
|
|
|
|
}
|
2006-08-09 13:45:49 +00:00
|
|
|
print ''
|
2006-10-07 08:59:59 +00:00
|
|
|
. '<div align="center"><table border="0"><tr><td>'
|
2006-08-09 13:45:49 +00:00
|
|
|
. '<form target="_parent" method="post" action="'.$ME.'">'
|
2007-10-21 03:02:55 +00:00
|
|
|
. '<input type="hidden" name="id" value="'.$course->id.'" />'
|
2006-08-09 13:45:49 +00:00
|
|
|
. '<input type="hidden" name="regrade" value="'.$regrade.'" />'
|
|
|
|
. '<input type="hidden" name="confirm" value="1" />'
|
|
|
|
. $sesskey
|
|
|
|
. '<input type="submit" value="'.get_string("yes").'" />'
|
|
|
|
. '</form>'
|
|
|
|
. '</td><td> </td><td>'
|
|
|
|
. '<form target="_parent" method="post" action="'.$ME.'">'
|
2007-10-21 03:02:55 +00:00
|
|
|
. '<input type="hidden" name="id" value="'.$course->id.'" />'
|
2006-08-09 13:45:49 +00:00
|
|
|
. $sesskey
|
|
|
|
. '<input type="submit" value="'.get_string("no").'" />'
|
|
|
|
. '</form>'
|
2006-10-07 08:59:59 +00:00
|
|
|
. '</td></tr></table></div>'
|
2006-08-09 13:45:49 +00:00
|
|
|
;
|
2006-10-07 08:59:59 +00:00
|
|
|
|
2006-08-09 13:45:49 +00:00
|
|
|
print_simple_box_end();
|
|
|
|
print_footer($course);
|
|
|
|
exit;
|
|
|
|
|
|
|
|
} else { // regrade has been confirmed, so proceed
|
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
// start hotpot counter and timer
|
|
|
|
$hotpotstart = microtime();
|
|
|
|
$hotpotcount = 0;
|
2006-08-09 13:45:49 +00:00
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
// regrade attempts for these hotpots
|
|
|
|
foreach ($regrade_hotpots as $hotpot) {
|
|
|
|
notify("<b>$hotpot->name</b>");
|
2006-08-09 13:45:49 +00:00
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
// delete questions and responses for this hotpot
|
|
|
|
if ($records = get_records_select('hotpot_questions', "hotpot=$hotpot->id", '', 'id,hotpot')) {
|
|
|
|
$questionids = implode(',', array_keys($records));
|
|
|
|
hotpot_delete_and_notify('hotpot_questions', "id IN ($questionids)", get_string('question', 'quiz'));
|
|
|
|
hotpot_delete_and_notify('hotpot_responses', "question IN ($questionids)", get_string('answer', 'quiz'));
|
|
|
|
}
|
2006-08-09 13:45:49 +00:00
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
// start attempt counter and timer
|
|
|
|
$attemptstart = microtime();
|
|
|
|
$attemptcount = 0;
|
|
|
|
|
|
|
|
// regrade attempts, if any, for this hotpot
|
|
|
|
if ($attempts = get_records_select('hotpot_attempts', "hotpot=$hotpot->id")) {
|
|
|
|
foreach ($attempts as $attempt) {
|
|
|
|
$attempt->details = get_field('hotpot_details', 'details', 'attempt', $attempt->id);
|
|
|
|
if ($attempt->details) {
|
|
|
|
hotpot_add_attempt_details($attempt);
|
|
|
|
if (! update_record('hotpot_attempts', $attempt)) {
|
2008-05-15 21:40:00 +00:00
|
|
|
print_error("Could not update attempt record: ".$DB->get_last_error(), '', $next_url);
|
2006-10-07 08:59:59 +00:00
|
|
|
}
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
2006-10-07 08:59:59 +00:00
|
|
|
$attemptcount++;
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
2006-10-07 08:59:59 +00:00
|
|
|
if ($attemptcount) {
|
|
|
|
$msg = get_string('added', 'moodle', "$attemptcount x ".get_string('attempts', 'quiz'));
|
|
|
|
if (!empty($CFG->hotpot_showtimes)) {
|
|
|
|
$msg .= ' ('.format_time(sprintf("%0.2f", microtime_diff($attemptstart, microtime()))).')';
|
|
|
|
}
|
|
|
|
notify($msg);
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
2006-10-07 08:59:59 +00:00
|
|
|
$hotpotcount++;
|
|
|
|
} // end foreach $hotpots
|
|
|
|
if ($hotpotcount) {
|
|
|
|
$msg = get_string('regrade', 'quiz').": $hotpotcount x ".get_string('modulenameplural', 'hotpot');
|
2006-08-09 13:45:49 +00:00
|
|
|
if (!empty($CFG->hotpot_showtimes)) {
|
2006-10-07 08:59:59 +00:00
|
|
|
$msg .= ' ('.format_time(sprintf("%0.2f", microtime_diff($hotpotstart, microtime()))).')';
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
|
|
|
notify($msg);
|
|
|
|
}
|
2006-10-07 08:59:59 +00:00
|
|
|
notify(get_string('regradecomplete', 'quiz'));
|
|
|
|
} // end if $confirm
|
2006-08-09 13:45:49 +00:00
|
|
|
} // end regrade
|
|
|
|
|
|
|
|
// get duplicate hotpot-name questions
|
|
|
|
// - JMatch LHS is longer than 255 bytes
|
|
|
|
// - JQuiz question text is longer than 255 bytes
|
2006-10-07 08:59:59 +00:00
|
|
|
// - other unidentified situations ?!
|
2006-08-09 13:45:49 +00:00
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
$regrade_hotpots = array();
|
|
|
|
$concat_field = sql_concat('hotpot', "'_'", 'name');
|
|
|
|
if ($concat_field) {
|
|
|
|
$records = get_records_sql("
|
|
|
|
SELECT $concat_field, COUNT(*), hotpot, name
|
2006-08-09 13:45:49 +00:00
|
|
|
FROM {$CFG->prefix}hotpot_questions
|
|
|
|
WHERE hotpot IN ($hotpotids)
|
|
|
|
GROUP BY hotpot, name
|
|
|
|
HAVING COUNT(*) >1
|
|
|
|
");
|
2006-10-07 08:59:59 +00:00
|
|
|
if ($records) {
|
|
|
|
foreach ($records as $record) {
|
|
|
|
$regrade_hotpots[$record->hotpot] = 1;
|
|
|
|
}
|
|
|
|
ksort($regrade_hotpots);
|
|
|
|
$regrade_hotpots = array_keys($regrade_hotpots);
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// start timer
|
|
|
|
$start = microtime();
|
|
|
|
|
|
|
|
// get total number of attempts, users and details for these hotpots
|
2006-10-25 09:04:25 +00:00
|
|
|
$tables = "{$CFG->prefix}hotpot_attempts a";
|
2006-08-09 13:45:49 +00:00
|
|
|
$fields = "
|
|
|
|
a.hotpot AS hotpot,
|
|
|
|
COUNT(DISTINCT a.clickreportid) AS attemptcount,
|
|
|
|
COUNT(DISTINCT a.userid) AS usercount,
|
|
|
|
MAX(a.score) AS maxscore
|
|
|
|
";
|
|
|
|
$select = "a.hotpot IN ($hotpotids)";
|
2006-08-30 08:43:17 +00:00
|
|
|
if (has_capability('mod/hotpot:viewreport', $coursecontext)) {
|
2006-08-09 13:45:49 +00:00
|
|
|
// do nothing (=get all users)
|
|
|
|
} else {
|
|
|
|
// restrict results to this user only
|
|
|
|
$select .= " AND a.userid='$USER->id'";
|
|
|
|
}
|
2006-10-01 06:39:51 +00:00
|
|
|
$usejoin = 0;
|
2008-05-02 04:37:02 +00:00
|
|
|
if (has_capability('mod/hotpot:grade', get_context_instance(CONTEXT_SYSTEM)) && $usejoin) {
|
2006-08-09 13:45:49 +00:00
|
|
|
// join attempts table and details table
|
2006-10-25 09:04:25 +00:00
|
|
|
$tables .= ",{$CFG->prefix}hotpot_details d";
|
2006-08-09 13:45:49 +00:00
|
|
|
$fields .= ',COUNT(DISTINCT d.id) AS detailcount';
|
|
|
|
$select .= " AND a.id=d.attempt";
|
|
|
|
|
|
|
|
// this may take about twice as long as getting the gradecounts separately :-(
|
|
|
|
// so this operation could be done after getting the $totals from the attempts table
|
|
|
|
}
|
|
|
|
$totals = get_records_sql("SELECT $fields FROM $tables WHERE $select GROUP BY a.hotpot");
|
2006-10-07 08:59:59 +00:00
|
|
|
|
2008-05-02 04:37:02 +00:00
|
|
|
if (has_capability('mod/hotpot:grade', get_context_instance(CONTEXT_SYSTEM)) && empty($usejoin)) {
|
2006-08-09 13:45:49 +00:00
|
|
|
foreach ($hotpots as $hotpot) {
|
|
|
|
$totals[$hotpot->id]->detailcount = 0;
|
|
|
|
if ($ids = get_records('hotpot_attempts', 'hotpot', $hotpot->id)) {
|
|
|
|
$ids = join(',', array_keys($ids));
|
|
|
|
$totals[$hotpot->id]->detailcount = count_records_select('hotpot_details', "attempt IN ($ids)");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// message strings for main table
|
|
|
|
$strusers = get_string('users');
|
|
|
|
$strupdate = get_string('update');
|
|
|
|
$strregrade = get_string('regrade', 'hotpot');
|
|
|
|
$strneverclosed = get_string('neverclosed', 'hotpot');
|
|
|
|
$strregraderequired = get_string('regraderequired', 'hotpot');
|
|
|
|
|
|
|
|
// column headings and attributes
|
|
|
|
$table->head = array();
|
|
|
|
$table->align = array();
|
|
|
|
|
|
|
|
if (!empty($CFG->hotpot_showtimes)) {
|
|
|
|
print '<H3>'.sprintf("%0.3f", microtime_diff($start, microtime())).' secs'."</H3>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ($course->format) {
|
|
|
|
case 'weeks' :
|
|
|
|
$title = get_string("week");
|
|
|
|
break;
|
|
|
|
case 'topics' :
|
|
|
|
$title = get_string("topic");
|
|
|
|
break;
|
|
|
|
default :
|
|
|
|
$title = '';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ($title) {
|
|
|
|
array_push($table->head, $title);
|
|
|
|
array_push($table->align, "center");
|
|
|
|
}
|
2006-08-30 08:43:17 +00:00
|
|
|
if (has_capability('moodle/course:manageactivities', $coursecontext)) {
|
2006-08-09 13:45:49 +00:00
|
|
|
array_push($table->head, $strupdate);
|
|
|
|
array_push($table->align, "center");
|
|
|
|
}
|
|
|
|
array_push($table->head,
|
|
|
|
get_string("name"),
|
|
|
|
get_string("quizcloses", "quiz"),
|
|
|
|
get_string("bestgrade", "quiz"),
|
|
|
|
get_string("attempts", "quiz")
|
|
|
|
);
|
|
|
|
array_push($table->align,
|
|
|
|
"left", "left", "center", "left"
|
|
|
|
);
|
2006-08-30 08:43:17 +00:00
|
|
|
if (has_capability('mod/hotpot:grade', $coursecontext)) {
|
2006-08-09 13:45:49 +00:00
|
|
|
array_push($table->head, $strregrade);
|
|
|
|
array_push($table->align, "center");
|
|
|
|
}
|
|
|
|
|
|
|
|
$currentsection = -1;
|
|
|
|
foreach ($hotpots as $hotpot) {
|
|
|
|
|
|
|
|
$printsection = "";
|
|
|
|
if ($hotpot->section != $currentsection) {
|
|
|
|
if ($hotpot->section) {
|
|
|
|
$printsection = $hotpot->section;
|
|
|
|
if ($course->format=='weeks' || $course->format=='topics') {
|
|
|
|
// Show the zoom boxes
|
|
|
|
if ($displaysection==$hotpot->section) {
|
|
|
|
$strshowall = get_string('showall'.$course->format);
|
2007-10-21 03:02:55 +00:00
|
|
|
$printsection .= '<br /><a href="index.php?id='.$course->id.'&section=all" title="'.$strshowall.'"><img src="'.$CFG->pixpath.'/i/all.gif" style="height:25px; width:16px; border:0px" alt="'.$strshowall.'" /></a><br />';
|
2006-08-09 13:45:49 +00:00
|
|
|
} else {
|
|
|
|
$strshowone = get_string('showonly'.preg_replace('|s$|', '', $course->format, 1), '', $hotpot->section);
|
2007-10-21 03:02:55 +00:00
|
|
|
$printsection .= '<br /><a href="index.php?id='.$course->id.'&section='.$hotpot->section.'" title="'.$strshowone.'"><img src="'.$CFG->pixpath.'/i/one.gif" class="icon" alt="'.$strshowone.'" /></a><br />';
|
2006-08-09 13:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($currentsection>=0) {
|
|
|
|
$table->data[] = 'hr';
|
|
|
|
}
|
|
|
|
$currentsection = $hotpot->section;
|
|
|
|
}
|
|
|
|
|
|
|
|
$class = ($hotpot->visible) ? '' : 'class="dimmed" ';
|
2007-10-21 03:02:55 +00:00
|
|
|
$quizname = '<a '.$class.'href="view.php?id='.$hotpot->coursemodule.'">'.$hotpot->name.'</a>';
|
2006-08-09 13:45:49 +00:00
|
|
|
$quizclose = empty($hotpot->timeclose) ? $strneverclosed : userdate($hotpot->timeclose);
|
|
|
|
|
|
|
|
// are there any totals for this hotpot?
|
|
|
|
if (empty($totals[$hotpot->id]->attemptcount)) {
|
|
|
|
$report = " ";
|
|
|
|
$bestscore = " ";
|
|
|
|
|
|
|
|
} else {
|
2006-08-30 08:43:17 +00:00
|
|
|
|
|
|
|
$cm = get_coursemodule_from_instance('hotpot', $hotpot->id);
|
2006-08-09 13:45:49 +00:00
|
|
|
// report number of attempts and users
|
|
|
|
$report = get_string("viewallreports","quiz", $totals[$hotpot->id]->attemptcount);
|
2006-08-30 08:43:17 +00:00
|
|
|
if (has_capability('mod/hotpot:viewreport', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
2006-08-09 13:45:49 +00:00
|
|
|
$report .= " (".$totals[$hotpot->id]->usercount." $strusers)";
|
|
|
|
}
|
|
|
|
$report = '<a href="report.php?hp='.$hotpot->id.'">'.$report.'</a>';
|
|
|
|
|
|
|
|
// get best score
|
|
|
|
if (is_numeric($totals[$hotpot->id]->maxscore)) {
|
2007-05-08 15:44:37 +00:00
|
|
|
$weighting = $hotpot->grade / 100;
|
|
|
|
$precision = hotpot_get_precision($hotpot);
|
|
|
|
$bestscore = round($totals[$hotpot->id]->maxscore * $weighting, $precision)." / $hotpot->grade";
|
2006-08-09 13:45:49 +00:00
|
|
|
} else {
|
|
|
|
$bestscore = " ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
if (has_capability('mod/hotpot:grade', $sitecontext)) {
|
|
|
|
if (in_array($hotpot->id, $regrade_hotpots)) {
|
2006-08-09 13:45:49 +00:00
|
|
|
$report .= ' <font color="red">'.$strregraderequired.'</font>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$data = array ();
|
|
|
|
|
|
|
|
if ($course->format=="weeks" || $course->format=="topics") {
|
|
|
|
array_push($data, $printsection);
|
|
|
|
}
|
|
|
|
|
2006-08-30 08:43:17 +00:00
|
|
|
if (has_capability('moodle/course:manageactivities', $coursecontext)) {
|
2006-08-09 13:45:49 +00:00
|
|
|
$updatebutton = ''
|
2007-10-21 03:02:55 +00:00
|
|
|
. '<form '.$CFG->frametarget.' method="get" action="'.$CFG->wwwroot.'/course/mod.php">'
|
2006-08-09 13:45:49 +00:00
|
|
|
. '<input type="hidden" name="update" value="'.$hotpot->coursemodule.'" />'
|
|
|
|
. $sesskey
|
|
|
|
. '<input type="submit" value="'.$strupdate.'" />'
|
|
|
|
. '</form>'
|
|
|
|
;
|
|
|
|
array_push($data, $updatebutton);
|
|
|
|
}
|
|
|
|
|
|
|
|
array_push($data, $quizname, $quizclose, $bestscore, $report);
|
|
|
|
|
2006-10-07 08:59:59 +00:00
|
|
|
if (has_capability('mod/hotpot:grade', $sitecontext)) {
|
2006-08-09 13:45:49 +00:00
|
|
|
if (empty($totals[$hotpot->id]->detailcount)) {
|
|
|
|
// no details records for this hotpot, so disable regrade
|
|
|
|
$regradebutton = ' ';
|
|
|
|
} else {
|
|
|
|
$strregradecheck = get_string('regradecheck', 'hotpot', strtr($hotpot->name, $quotes));
|
|
|
|
$regradebutton = ''
|
|
|
|
. '<form target="_parent" method="post" action="'.$ME.'" onsubmit="var x=window.confirm('."'$strregradecheck'".');this.confirm.value=x;return x;">'
|
2007-10-21 03:02:55 +00:00
|
|
|
. '<input type="hidden" name="id" value="'.$course->id.'" />'
|
2006-08-09 13:45:49 +00:00
|
|
|
. '<input type="hidden" name="regrade" value="'.$hotpot->id.'" />'
|
|
|
|
. '<input type="hidden" name="confirm" value="" />'
|
|
|
|
. $sesskey
|
|
|
|
. '<input type="submit" value="'.$strregrade.'" />'
|
|
|
|
. '</form>'
|
|
|
|
;
|
|
|
|
}
|
|
|
|
array_push($data, $regradebutton);
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->data[] = $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "<br />";
|
|
|
|
|
|
|
|
print_table($table);
|
|
|
|
|
|
|
|
// Finish the page
|
|
|
|
print_footer($course);
|
2005-11-08 07:48:10 +00:00
|
|
|
?>
|