Skip to content

Commit

Permalink
Release v4.4-r1
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Apr 21, 2024
1 parent 18e9789 commit d8517dd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 22 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ moodle-quiz_archive
Changes
-------

### Unreleased
### Release v4.4-r1

* 2024-04-21 - Assure PHP 8.3 compatibility.
* 2023-11-29 - Behat step for the quiz_archive plugin instead of re-defining

### Release v4.3-r3
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ moodle-quiz_archive
=========================
[![Latest Release](https://img.shields.io/github/v/release/bfh/moodle-quiz_archive?sort=semver&color=orange)](https://github.com/bfh/moodle-quiz_archive/releases)
[![Build Status](https://github.com/bfh/moodle-quiz_archive/workflows/Moodle%20Plugin%20CI/badge.svg?branch=main)](https://github.com/bfh/moodle-quiz_archive/actions?query=workflow%3A%22Moodle+Plugin+CI%22+branch%3Amain)
[![PHP Support](https://img.shields.io/badge/php-7.2--8.2-blue)](https://github.com/bfh/moodle-quiz_archive/actions)
[![Moodle Support](https://img.shields.io/badge/Moodle-3.9--4.3+-orange)](https://github.com/bfh/moodle-quiz_archive/actions)
[![PHP Support](https://img.shields.io/badge/php-7.2--8.3-blue)](https://github.com/bfh/moodle-quiz_archive/actions)
[![Moodle Support](https://img.shields.io/badge/Moodle-3.9--4.4+-orange)](https://github.com/bfh/moodle-quiz_archive/actions)
[![License GPL-3.0](https://img.shields.io/github/license/bfh/moodle-quiz_archive?color=lightgrey)](https://github.com/bfh/moodle-quiz_archive/blob/main/LICENSE)
[![GitHub contributors](https://img.shields.io/github/contributors/bfh/moodle-quiz_archive)](https://github.com/bfh/moodle-quiz_archive/graphs/contributors)

Expand All @@ -13,7 +13,7 @@ Moodle quiz report plugin to achieve archiving your test, by printing out all at
Requirements
------------

This plugin requires Moodle 3.4.
This plugin requires Moodle 3.9.


Motivation for this report
Expand Down
10 changes: 3 additions & 7 deletions lang/en/quiz_archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@
*/

$string['archive'] = 'Archive';
$string['includecorrectanswer'] = 'Include correct answer banner';
$string['includehistory'] = 'Include response history table';
$string['pluginname'] = 'Archive';
$string['unknownquestion'] = 'Unknown question';

// PRIVACY.
$string['privacy:metadata'] = 'The quiz archive plugin does not store any personal data about any user.';

// OPTIONS.
$string['includehistory'] = 'Include response history table';
$string['includecorrectanswer'] = 'Include correct answer banner';
$string['unknownquestion'] = 'Unknown question';
26 changes: 20 additions & 6 deletions report.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

use mod_quiz\local\reports\report_base;
use mod_quiz\output\attempt_summary_information;
use mod_quiz\quiz_attempt;
use mod_quiz\question\display_options;
use mod_quiz\local\reports\attempts_report;
Expand All @@ -47,6 +48,7 @@ class_alias('\mod_quiz_display_options', '\quiz_archive_mod_quiz_display_options
require_once($CFG->dirroot . '/mod/quiz/report/reportlib.php');
require_once($CFG->dirroot . '/mod/quiz/locallib.php');
require_once($CFG->libdir . '/pagelib.php');
require_once($CFG->libdir . '/environmentlib.php');

/**
* Quiz report subclass for the archive report.
Expand Down Expand Up @@ -174,7 +176,7 @@ protected function quizreportgetstudentandattempts($quiz) {
* @param int $userid the user id.
*/
protected function quiz_report_get_student_attempt($attemptid, $userid) {
global $DB, $PAGE;
global $DB, $PAGE, $CFG;
$attemptobj = quiz_create_attempt_handling_errors($attemptid, $this->cm->id);

// Summary table start.
Expand Down Expand Up @@ -230,10 +232,14 @@ protected function quiz_report_get_student_attempt($attemptid, $userid) {
'title' => get_string('completedon', 'quiz'),
'content' => userdate($attempt->timefinish),
];
$summarydata['timetaken'] = [
'title' => get_string('timetaken', 'quiz'),
'content' => $timetaken,
];
$currentversion = normalize_version($CFG->release);
if (version_compare($currentversion, '4.4', "<")) {
// Beginning Moodle 4.4, the string 'timetaken' is deprecated and not used anymore.
$summarydata['timetaken'] = [
'title' => get_string('timetaken', 'quiz'),
'content' => $timetaken,
];
}
}

if (!empty($overtime)) {
Expand Down Expand Up @@ -315,7 +321,15 @@ protected function quiz_report_get_student_attempt($attemptid, $userid) {

$renderer = $PAGE->get_renderer('mod_quiz');
$string = '';
$string .= $renderer->review_summary_table($summarydata, 0);

if (method_exists($renderer, 'review_attempt_summary')) {
$displayoptions = $attemptobj->get_display_options(true);
$summarydata = attempt_summary_information::create_for_attempt(
$attemptobj, $displayoptions);
$string .= $renderer->review_attempt_summary($summarydata, 0);
} else {
$string .= $renderer->review_summary_table($summarydata, 0);
}

// Display the questions. The overall goal is to have question_display_options from question/engine/lib.php
// set so they would show what we wand and not show what we don't want.
Expand Down
3 changes: 1 addition & 2 deletions tests/behat/behat_quiz_archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ protected function resolve_page_url(string $page): moodle_url {
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {
global $DB;

switch ($type) {
case 'Archive':
Expand Down Expand Up @@ -106,7 +105,7 @@ public function i_confirm_the_quiz_submission_in_the_modal_dialog_for_the_quiz_a
global $CFG;
require_once($CFG->libdir . '/environmentlib.php');
require($CFG->dirroot . '/version.php');
$currentversion = normalize_version($release);
$currentversion = normalize_version($CFG->release);
if (version_compare($currentversion, '4.1', ">=")) {
$xpath = "//div[contains(@class, 'modal-dialog')]/*/*/button[contains(@class, 'btn-primary')]";
} else if (version_compare($currentversion, '3.9', ">=")) {
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2023111200;
$plugin->version = 2024042200;
$plugin->requires = 2017110800;
$plugin->component = 'quiz_archive';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 'v4.3-r3';
$plugin->supported = [39, 403];
$plugin->release = 'v4.4-r1';
$plugin->supported = [39, 404];

0 comments on commit d8517dd

Please sign in to comment.