mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-3633 Don't show the attempt number column on the quiz view page if the quiz only allows one attempt.
This commit is contained in:
parent
237806f4f0
commit
152d3c0242
5 changed files with 64 additions and 29 deletions
|
@ -1,7 +1,8 @@
|
|||
<?php // $Id$
|
||||
/**
|
||||
* This page prints a review of a particular question attempt
|
||||
*
|
||||
* This page allows the teacher to enter a manual grade for a particular question.
|
||||
* This page is expected to only be used in a popup window.
|
||||
* *
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package quiz
|
||||
*/
|
||||
|
@ -12,15 +13,7 @@
|
|||
$attemptid =required_param('attempt', PARAM_INT); // attempt id
|
||||
$questionid =required_param('question', PARAM_INT); // question id
|
||||
|
||||
if (! $attempt = $DB->get_record('quiz_attempts', array('uniqueid' => $attemptid))) {
|
||||
print_error('invalidattemptid', 'quiz');
|
||||
}
|
||||
if (! $quiz = $DB->get_record('quiz', array('id' => $attempt->quiz))) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record('course', array('id' => $quiz->course))) {
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
$attemptobj = new quiz_attempt($attemptid);
|
||||
|
||||
// Teachers are only allowed to comment and grade on closed attempts
|
||||
if (!($attempt->timefinish > 0)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue