From: gustav_delius Date: Thu, 6 Apr 2006 19:59:02 +0000 (+0000) Subject: Improvements to response history. Three small bug fixes. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=755bddf11869b009c88897c29069277c8dacd5ad;p=moodle.git Improvements to response history. Three small bug fixes. --- diff --git a/lang/en_utf8/quiz.php b/lang/en_utf8/quiz.php index 6d3962c404..9f31bb092a 100644 --- a/lang/en_utf8/quiz.php +++ b/lang/en_utf8/quiz.php @@ -204,6 +204,7 @@ $string['gradingdetailsadjustment'] = 'With previous penalties this gives 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)) { diff --git a/mod/quiz/reviewquestion.php b/mod/quiz/reviewquestion.php index b61e5e3e89..8b6e20e37b 100644 --- a/mod/quiz/reviewquestion.php +++ b/mod/quiz/reviewquestion.php @@ -70,7 +70,7 @@ 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)) { @@ -107,7 +107,7 @@ $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'; diff --git a/question/type/match/questiontype.php b/question/type/match/questiontype.php index d8cb0602cf..6538198e4e 100644 --- a/question/type/match/questiontype.php +++ b/question/type/match/questiontype.php @@ -328,7 +328,7 @@ class question_match_qtype extends default_questiontype { 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; } } } @@ -337,7 +337,7 @@ class question_match_qtype extends default_questiontype { 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 //////////////////////////// diff --git a/question/type/multichoice/questiontype.php b/question/type/multichoice/questiontype.php index 99d2bc6969..e5edafdb6b 100644 --- a/question/type/multichoice/questiontype.php +++ b/question/type/multichoice/questiontype.php @@ -362,8 +362,7 @@ class question_multichoice_qtype extends default_questiontype { $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[] = ''; diff --git a/question/type/question.html b/question/type/question.html index 2de4aa6f23..f6ac34a2ab 100644 --- a/question/type/question.html +++ b/question/type/question.html @@ -18,10 +18,13 @@
print_question_grading_details($question, $state, $cmoptions, $options); ?> +
+ +
+
- -
- -
- + diff --git a/question/type/questiontype.php b/question/type/questiontype.php index ba3bcbee76..6e3b4c04db 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -489,10 +489,10 @@ class default_questiontype { 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'); @@ -702,7 +702,7 @@ class default_questiontype { */ 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); } /** diff --git a/theme/standard/styles_fonts.css b/theme/standard/styles_fonts.css index 7d59ede553..de8c87451c 100644 --- a/theme/standard/styles_fonts.css +++ b/theme/standard/styles_fonts.css @@ -578,6 +578,9 @@ body#grade-index .grades .header { .que .grade { font-size: 0.8em; } +.que .history { + font-size:75%; +} /*** *** Tabs