Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 56... Línea 56...
56
$output = $PAGE->get_renderer('mod_quiz');
56
$output = $PAGE->get_renderer('mod_quiz');
57
echo $output->header();
57
echo $output->header();
Línea 58... Línea 58...
58
 
58
 
59
// Prepare summary information about this question attempt.
59
// Prepare summary information about this question attempt.
60
$summary = new attempt_summary_information();
-
 
-
 
60
$summary = new attempt_summary_information();
-
 
61
// Set the caption.
61
 
62
$summary->set_caption(get_string('summaryofattempt', 'quiz'));
62
// Student name.
63
// Student name.
63
$userpicture = new user_picture($student);
64
$userpicture = new user_picture($student);
64
$userpicture->courseid = $attemptobj->get_courseid();
65
$userpicture->courseid = $attemptobj->get_courseid();
65
$summary->add_item('user', $userpicture, new action_link(
66
$summary->add_item('user', $userpicture, new action_link(
Línea 70... Línea 71...
70
$summary->add_item('quizname', get_string('modulename', 'quiz'), format_string($attemptobj->get_quiz_name()));
71
$summary->add_item('quizname', get_string('modulename', 'quiz'), format_string($attemptobj->get_quiz_name()));
Línea 71... Línea 72...
71
 
72
 
72
// Question name.
73
// Question name.
Línea -... Línea 74...
-
 
74
$summary->add_item('questionname', get_string('question', 'quiz'), $attemptobj->get_question_name($slot));
-
 
75
 
-
 
76
// Error message in case of input invalid mark.
73
$summary->add_item('questionname', get_string('question', 'quiz'), $attemptobj->get_question_name($slot));
77
$submiterror = false;
74
 
78
 
75
// Process any data that was submitted.
79
// Process any data that was submitted.
76
if (data_submitted() && confirm_sesskey()) {
80
if (data_submitted() && confirm_sesskey()) {
77
    if (optional_param('submit', false, PARAM_BOOL) && question_engine::is_manual_grade_in_range($attemptobj->get_uniqueid(), $slot)) {
81
    if (optional_param('submit', false, PARAM_BOOL) && question_engine::is_manual_grade_in_range($attemptobj->get_uniqueid(), $slot)) {
Línea 94... Línea 98...
94
        $event->trigger();
98
        $event->trigger();
Línea 95... Línea 99...
95
 
99
 
96
        echo $output->notification(get_string('changessaved'), 'notifysuccess');
100
        echo $output->notification(get_string('changessaved'), 'notifysuccess');
97
        close_window(2, true);
101
        close_window(2, true);
-
 
102
        die;
-
 
103
    } else {
98
        die;
104
        $submiterror = true;
99
    }
105
    }
Línea 100... Línea 106...
100
}
106
}
101
 
107
 
Línea -... Línea 108...
-
 
108
// Print quiz information.
-
 
109
echo html_writer::div($output->render($summary), 'mb-3');
-
 
110
 
-
 
111
// Display notification if current mark is invalid.
102
// Print quiz information.
112
if ($submiterror) {
103
echo html_writer::div($output->render($summary), 'mb-3');
113
    echo $output->notification(get_string('savemanualgradingfailed', 'quiz'), \core\output\notification::NOTIFY_ERROR);
104
 
114
}
105
// Print the comment form.
115
// Print the comment form.
106
echo '<form method="post" class="mform" id="manualgradingform" action="' .
116
echo '<form method="post" class="mform" id="manualgradingform" action="' .