$string['attemptsonly'] = 'Show only students with attempts';
$string['attemptsallowed'] = 'Attempts allowed';
$string['attemptselection'] = 'Select which attempts to analyze per user: ';
-$string['attemptsexist'] = 'This quiz has already been attempted.<br />You can no longer add or remove questions.';
+$string['attemptsexist'] = 'You can no longer add or remove questions.';
$string['attemptsunlimited'] = 'Unlimited attempts';
$string['back'] = 'Back to preview question';
$string['backtoquiz'] = 'Back to quiz editing';
$string['notenoughanswers'] = 'This type of question requires at least $a answers';
$string['notenoughsubquestions'] = 'Not enough sub-questions have been defined!<br />Do you want to go back and fix this question?';
$string['notimedependentitems'] = 'Time dependent items are not currently supported by the quiz module. As a work around, set a time limit for the whole quiz. Do you wish to choose a different item (or use the current item regardless)?';
+$string['numattempts'] = '$a->studentnum $a->studentstring have made $a->attemptnum attempts';
$string['numberabbr'] = '#';
$string['numerical'] = 'Numerical';
$string['none']= 'None';
print_simple_box_start("center");
- $attemptcount = count_records('quiz_attempts', 'quiz', $modform->instance, 'preview', 0);
-
- $strviewallanswers = get_string("viewallanswers","quiz",$attemptcount);
- $strattemptsexist = get_string("attemptsexist","quiz");
- $usercount = count_records_select('quiz_attempts', "quiz = '$modform->id' AND preview = '0'", 'COUNT(DISTINCT userid)');
- $strusers = $course->students;
+ $a->attemptnum = count_records('quiz_attempts', 'quiz', $quiz->id, 'preview', 0);
+ $a->studentnum = count_records_select('quiz_attempts', "quiz = '$quiz->id' AND preview = '0'", 'COUNT(DISTINCT userid)');
+ $a->studentstring = $course->students;
if (! $cm = get_coursemodule_from_instance("quiz", $modform->instance, $course->id)) {
error("Course Module ID was incorrect");
}
echo "<center>\n";
- echo "$strattemptsexist<br /><a href=\"report.php?mode=overview&id=$cm->id\">$strviewallanswers ($usercount $strusers)</a>";
+ echo "<a href=\"report.php?mode=overview&id=$cm->id\">".get_string('numattempts', 'quiz', $a)."</a><br />".get_string("attemptsexist","quiz");
echo "</center><br/ >\n";
$sumgrades = quiz_print_question_list($modform, false, $SESSION->quiz_showbreaks, $SESSION->quiz_reordertool);
$closequiz = $quiz->timeclose ? userdate($quiz->timeclose) : '';
if (isteacher($course->id)) {
- if ($usercount = count_records_select('quiz_attempts', "quiz = '$quiz->id' AND preview = '0'", 'COUNT(DISTINCT userid)')) {
- $attemptcount = count_records('quiz_attempts', 'quiz', $quiz->id, 'preview', 0);
- $strviewallreports = get_string('viewallreports', 'quiz', $attemptcount);
- $gradecol = "<a href=\"report.php?mode=overview&q=$quiz->id\">$strviewallreports ($usercount $strusers)</a>";
+ if ($a->attemptnum = count_records('quiz_attempts', 'quiz', $quiz->id, 'preview', 0)) {
+ $a->studentnum = count_records_select('quiz_attempts', "quiz = '$quiz->id' AND preview = '0'", 'COUNT(DISTINCT userid)');
+ $a->studentstring = $course->students;
+ $gradecol = "<a href=\"report.php?mode=overview&q=$quiz->id\">".get_string('numattempts', 'quiz', $a).'</a>';
} else {
- $answercount = 0;
$gradecol = "";
}
} else {
}
break;
}
-
+ /// Print information on the number of existing attempts
+ if ($a->attemptnum = count_records('quiz_attempts', 'quiz', $quiz->id, 'preview', 0)) {
+ $a->studentnum = count_records_select('quiz_attempts', "quiz = '$quiz->id' AND preview = '0'", 'COUNT(DISTINCT userid)');
+ $a->studentstring = $course->students;
+
+ notify(get_string('numattempts', 'quiz', $a));
+ }
/// Check to see if groups are being used in this quiz
if ($groupmode = groupmode($course, $cm)) { // Groups are being used
if (!$download) {
// This is all the teacher will get
if ($isteacher) {
-
- if ($attemptcount = count_records('quiz_attempts', 'quiz', $quiz->id, 'preview', 0)) {
-
- $strviewallanswers = get_string("viewallanswers", "quiz", $attemptcount);
- $usercount = count_records_select('quiz_attempts', "quiz = '$quiz->id' AND preview = '0'", 'COUNT(DISTINCT userid)');
- $strusers = $course->students;
+ if ($a->attemptnum = count_records('quiz_attempts', 'quiz', $quiz->id, 'preview', 0)) {
+ $a->studentnum = count_records_select('quiz_attempts', "quiz = '$quiz->id' AND preview = '0'", 'COUNT(DISTINCT userid)');
+ $a->studentstring = $course->students;
- notify("<a href=\"report.php?mode=overview&id=$cm->id\">$strviewallanswers ($usercount $strusers)</a>");
+ notify("<a href=\"report.php?mode=overview&id=$cm->id\">".get_string('numattempts', 'quiz', $a).'</a>');
}
echo '</td></tr></table>';