$string['gradingdetailspenalty'] = 'This submission attracted a penalty of $a. ';
$string['gradingdetailszeropenalty'] = 'You were not penalized for this submission. ';
$string['guestsno'] = 'Sorry, guests cannot see or attempt quizzes';
+$string['history'] = 'History of Responses: ';
$string['hotpot'] = 'Hot Potatoes format';
$string['illegalformulasyntax'] = 'Illegal formula syntax starting with \'$a\'';
$string['imagedisplay'] = 'Image to display';
}
// make sure these are gone!
- unset($action->responses['mark'], $action->responses['validate']);
+ unset($action->responses['submit'], $action->responses['validate']);
// Check the question session is still open
if (question_state_is_closed($state)) {
error(get_string("noreview", "quiz"));
}
if ((time() - $attempt->timefinish) > 120) { // always allow review right after attempt
- if (!$quiz->timeclose or time() < $quiz->timeclose and !($quiz->review & QUIZ_REVIEW_OPEN)) {
+ if ((!$quiz->timeclose or time() < $quiz->timeclose) and !($quiz->review & QUIZ_REVIEW_OPEN)) {
error(get_string("noreviewuntil", "quiz", userdate($quiz->timeclose)));
}
if ($quiz->timeclose and time() >= $quiz->timeclose and !($quiz->review & QUIZ_REVIEW_CLOSED)) {
$options = quiz_get_reviewoptions($quiz, $attempt, $isteacher);
$options->validation = ($state->event == QUESTION_EVENTVALIDATE);
- $options->history = 'all';
+ $options->history = ($isteacher and !$attempt->preview) ? 'all' : 'graded';
// Provide the links to this question review script
$options->questionreviewlink = '/mod/quiz/reviewquestion.php';
foreach ($subquestions as $key => $sub) {
foreach ($responses as $ind => $code) {
if (isset($sub->options->answers[$code])) {
- $results[$ind] = $subquestions[$ind]->questiontext . " : " . $sub->options->answers[$code]->answer;
+ $results[$ind] = $subquestions[$ind]->questiontext . ":" . $sub->options->answers[$code]->answer;
}
}
}
function response_summary($question, $state, $length=80) {
// This should almost certainly be overridden
- return substr(implode(',', $this->get_actual_response($question, $state)), 0, $length);
+ return substr(implode(', ', $this->get_actual_response($question, $state)), 0, $length);
}
/// BACKUP FUNCTIONS ////////////////////////////
$answers = $question->options->answers;
if (!empty($state->responses)) {
foreach ($state->responses as $aid =>$rid){
- $answer = $rid ? $answers[$rid]->answer : '';
- $responses[] = $answer;
+ $responses[] = (!empty($answers[$rid]) ? $answers[$rid]->answer : '');
}
} else {
$responses[] = '';
</div>
<div class="grading">
<?php $this->print_question_grading_details($question, $state, $cmoptions, $options); ?>
+ </div>
+ <?php if ($history) { ?>
+ <div class="history">
+ <?php
+ print_string('history', 'quiz');
+ echo $history;
+ ?>
</div>
- <?php if ($history) { ?>
- <div class="history">
- <?php echo $history; ?>
- </div>
- <?php } ?>
+ <?php } ?>
</td></tr></table>
if(isset($options->history) and $options->history) {
if ($options->history == 'all') {
// show all states
- $states = get_records_select('question_states', "attempt = '$state->attempt' AND question = '$question->id' AND event > '0'", 'seq_number DESC');
+ $states = get_records_select('question_states', "attempt = '$state->attempt' AND question = '$question->id' AND event > '0'", 'seq_number ASC');
} else {
// show only graded states
- $states = get_records_select('question_states', "attempt = '$state->attempt' AND question = '$question->id' AND event IN (".QUESTION_EVENTGRADE.','.QUESTION_EVENTCLOSEANDGRADE.")", 'seq_number DESC');
+ $states = get_records_select('question_states', "attempt = '$state->attempt' AND question = '$question->id' AND event IN (".QUESTION_EVENTGRADE.','.QUESTION_EVENTCLOSEANDGRADE.")", 'seq_number ASC');
}
if (count($states) > 1) {
$strreviewquestion = get_string('reviewresponse', 'quiz');
*/
function response_summary($question, $state, $length=80) {
// This should almost certainly be overridden
- return substr($state->answer, 0, $length);
+ return substr(implode(',', $this->get_actual_response($question, $state)), 0, $length);
}
/**
.que .grade {
font-size: 0.8em;
}
+.que .history {
+ font-size:75%;
+}
/***
*** Tabs