Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 21... Línea 21...
21
 * @copyright  1999 onwards Martin Dougiamas  {@link http://moodle.com}
21
 * @copyright  1999 onwards Martin Dougiamas  {@link http://moodle.com}
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
23
 */
Línea 24... Línea 24...
24
 
24
 
-
 
25
use mod_quiz\output\grades\grade_out_of;
Línea 25... Línea 26...
25
use mod_quiz\output\grades\grade_out_of;
26
use mod_quiz\output\renderer;
26
 
27
 
Línea 27... Línea 28...
27
require_once("../../config.php");
28
require_once("../../config.php");
Línea 44... Línea 45...
44
// Print the header.
45
// Print the header.
45
$strquizzes = get_string("modulenameplural", "quiz");
46
$strquizzes = get_string("modulenameplural", "quiz");
46
$PAGE->navbar->add($strquizzes);
47
$PAGE->navbar->add($strquizzes);
47
$PAGE->set_title($strquizzes);
48
$PAGE->set_title($strquizzes);
48
$PAGE->set_heading($course->fullname);
49
$PAGE->set_heading($course->fullname);
-
 
50
/** @var renderer $output */
-
 
51
$output = $PAGE->get_renderer('mod_quiz');
49
echo $OUTPUT->header();
52
echo $output->header();
50
echo $OUTPUT->heading($strquizzes, 2);
53
echo $output->heading($strquizzes, 2);
Línea 51... Línea 54...
51
 
54
 
52
// Get all the appropriate data.
55
// Get all the appropriate data.
53
if (!$quizzes = get_all_instances_in_course("quiz", $course)) {
56
if (!$quizzes = get_all_instances_in_course("quiz", $course)) {
54
    notice(get_string('thereareno', 'moodle', $strquizzes), "../../course/view.php?id=$course->id");
57
    notice(get_string('thereareno', 'moodle', $strquizzes), "../../course/view.php?id=$course->id");
Línea 72... Línea 75...
72
 
75
 
73
array_push($headings, get_string('quizcloses', 'quiz'));
76
array_push($headings, get_string('quizcloses', 'quiz'));
Línea 74... Línea 77...
74
array_push($align, 'left');
77
array_push($align, 'left');
75
 
78
 
76
if (course_format_uses_sections($course->format)) {
79
if (course_format_uses_sections($course->format)) {
77
    array_unshift($headings, get_string('sectionname', 'format_'.$course->format));
80
    array_unshift($headings, course_get_format($course)->get_generic_section_name());
78
} else {
81
} else {
79
    array_unshift($headings, '');
82
    array_unshift($headings, '');
Línea 160... Línea 163...
160
 
163
 
161
        $grade = '';
164
        $grade = '';
162
        $feedback = '';
165
        $feedback = '';
163
        if ($quiz->grade && array_key_exists($quiz->id, $grades)) {
166
        if ($quiz->grade && array_key_exists($quiz->id, $grades)) {
164
            if ($alloptions->marks >= question_display_options::MARK_AND_MAX) {
167
            if ($alloptions->marks >= question_display_options::MARK_AND_MAX) {
165
                $grade = $OUTPUT->render(new grade_out_of(
168
                $grade = $output->render(new grade_out_of(
166
                        $grades[$quiz->id], $quiz->grade, $quiz->sumgrades, style: grade_out_of::SHORT));
169
                        $quiz, $grades[$quiz->id], $quiz->grade, $quiz->sumgrades, style: grade_out_of::SHORT));
167
            }
170
            }
168
            if ($alloptions->overallfeedback) {
171
            if ($alloptions->overallfeedback) {
169
                $feedback = quiz_feedback_for_grade($grades[$quiz->id], $quiz, $context);
172
                $feedback = quiz_feedback_for_grade($grades[$quiz->id], $quiz, $context);
170
            }
173
            }
Línea 180... Línea 183...
180
 
183
 
181
// Display the table.
184
// Display the table.
Línea 182... Línea 185...
182
echo html_writer::table($table);
185
echo html_writer::table($table);
183
 
186