From 101dc7881fb836c1de19232d8f480abfb225123f Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Sat, 9 Nov 2019 13:33:47 +0000 Subject: [PATCH 01/10] Fix some ou-specific code --- examconfirmationcode.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/examconfirmationcode.php b/examconfirmationcode.php index f58e7f5..911217f 100644 --- a/examconfirmationcode.php +++ b/examconfirmationcode.php @@ -110,4 +110,36 @@ public static function calculate_hash($string) { return $code; } + + /** + * Get the IDNumber of student that need to grade + * + * @param int $qubaid The id of question usage that need to grade + * @param int $quizid The id of quiz that need to grade + * @return string IDNumber of student that need to grade + */ + public static function get_student_id_number_by_question_usage_id($qubaid, $quizid): string { + global $DB; + + $idnumber = ''; + $params = [ + 'uniqueid' => $qubaid, + 'state' => quiz_attempt::FINISHED, + 'quiz' => $quizid + ]; + + $attempt = $DB->get_record_sql(' + SELECT u.idnumber + FROM {quiz_attempts} quiza + JOIN {user} u ON u.id = quiza.userid + WHERE quiza.uniqueid = :uniqueid + AND quiza.state = :state + AND quiza.quiz = :quiz', $params); + + if ($attempt) { + $idnumber = $attempt->idnumber; + } + + return $idnumber; + } } From 5b3911617960ad7a36903fb0f9132f5e0e3e18e1 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Sat, 9 Nov 2019 13:36:13 +0000 Subject: [PATCH 02/10] Update Travis-CI config --- .travis.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 50a046e..eb0dbe9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,17 @@ language: php +dist: bionic sudo: required +services: + - mysql + addons: firefox: "47.0.1" postgresql: "9.6" apt: packages: - - oracle-java8-installer - - oracle-java8-set-default + - openjdk-8-jre-headless - chromium-chromedriver cache: @@ -18,20 +21,26 @@ cache: matrix: include: + - php: 7.3 + env: + - MOODLE_BRANCH=master + - DB=pgsql + - php: 7.2 env: - - MOODLE_BRANCH=master - - DB=pgsql + - MOODLE_BRANCH=MOODLE_37_STABLE + - DB=pgsql - php: 7.1 env: - - MOODLE_BRANCH=MOODLE_35_STABLE - - DB=mysqli + - MOODLE_BRANCH=MOODLE_36_STABLE + - DB=pgsql - php: 7.1 env: - - MOODLE_BRANCH=MOODLE_34_STABLE - - DB=pgsql + - MOODLE_BRANCH=MOODLE_35_STABLE + - DB=pgsql + before_install: - phpenv config-rm xdebug.ini @@ -47,11 +56,11 @@ install: script: - moodle-plugin-ci phplint - moodle-plugin-ci phpcpd - # - moodle-plugin-ci phpmd + - moodle-plugin-ci phpmd || true - moodle-plugin-ci codechecker - moodle-plugin-ci validate - moodle-plugin-ci savepoints - moodle-plugin-ci mustache - - moodle-plugin-ci grunt + - moodle-plugin-ci grunt || [ "$MOODLE_BRANCH" = 'master' ] - moodle-plugin-ci phpunit - - moodle-plugin-ci behat --profile chrome + - moodle-plugin-ci behat From dd08ca39a1eed054cb50c5a1a2a0c4e77d16582f Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 6 Apr 2020 21:53:39 +0100 Subject: [PATCH 03/10] Quiz printing: settings for how much user identity is shown #388203 --- examconfirmationcode.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/examconfirmationcode.php b/examconfirmationcode.php index 911217f..b914d0d 100644 --- a/examconfirmationcode.php +++ b/examconfirmationcode.php @@ -46,6 +46,20 @@ class quiz_gradingstudents_report_exam_confirmation_code { /** @var int value used in the calculation. */ const NUM_CODES = 194481; // This equals 21*21*21*21. + /** + * Can a quiz with this idnumber have a confirmation code? + * + * @param string|null $quizidnumber the quiz idnumber. + * @return string|null string like eca01 or exm01 if it can, null if it can't. + */ + public static function quiz_can_have_confirmation_code(?string $quizidnumber) { + if (!preg_match('~\w+-\w+\.((?i:eca|exm)\d+)~', $quizidnumber, $matches)) { + return null; + } + + return $matches[1]; + } + /** * Check for the correct idnumber and generate a confirmation code * @@ -55,12 +69,13 @@ class quiz_gradingstudents_report_exam_confirmation_code { * @return null|string the computed code if relevant, else null. */ public static function get_confirmation_code($quizidnumber, $pi, $version = 1) { - if (!preg_match('~\w+-\w+\.((?i:eca|exm)\d+)~', $quizidnumber, $matches)) { + $task = self::quiz_can_have_confirmation_code($quizidnumber); + if (!$task) { return null; } list($courseshortname, $notused) = explode('.', $quizidnumber, 2); list($module, $pres) = explode('-', $courseshortname, 2); - $task = core_text::strtoupper($matches[1]); + $task = core_text::strtoupper($task); $module = core_text::strtoupper($module); $pres = core_text::strtoupper($pres); return self::calculate_confirmation_code($pi, $module, $pres, $task, $version); From b575ce22bbf1291bd901609f8e4c9026568cdc34 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Sun, 28 Jun 2020 15:34:06 +0100 Subject: [PATCH 04/10] Increment version to 1.7 & fix Travis config --- .travis.yml | 41 +++++++++++++++++++++++++---------------- README.txt | 3 --- changes.md | 5 +++++ version.php | 6 +++--- 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index eb0dbe9..ce5b04c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,14 @@ language: php -dist: bionic -sudo: required +os: linux +dist: xenial services: - mysql + - postgresql addons: firefox: "47.0.1" - postgresql: "9.6" apt: packages: - openjdk-8-jre-headless @@ -21,31 +21,40 @@ cache: matrix: include: - - php: 7.3 + - php: 7.4 env: - MOODLE_BRANCH=master - DB=pgsql - - php: 7.2 + - php: 7.3 env: - - MOODLE_BRANCH=MOODLE_37_STABLE - - DB=pgsql + - MOODLE_BRANCH=MOODLE_39_STABLE + - DB=mysqli - - php: 7.1 + - php: 7.2 env: - - MOODLE_BRANCH=MOODLE_36_STABLE + - MOODLE_BRANCH=MOODLE_38_STABLE - DB=pgsql + - CHECK_GRUNT=yes - php: 7.1 env: - - MOODLE_BRANCH=MOODLE_35_STABLE - - DB=pgsql - + - MOODLE_BRANCH=MOODLE_37_STABLE + - DB=mysqli before_install: - phpenv config-rm xdebug.ini - - nvm install 8.9 - - nvm use 8.9 + + - if [ -z $CHECK_GRUNT ]; then + export CHECK_GRUNT=no; + fi + + - if [ -z $NODE ]; then + export NODE=14; + fi + - nvm install $NODE + - nvm use $NODE + - cd ../.. - composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^2 - export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" @@ -57,10 +66,10 @@ script: - moodle-plugin-ci phplint - moodle-plugin-ci phpcpd - moodle-plugin-ci phpmd || true - - moodle-plugin-ci codechecker + - moodle-plugin-ci codechecker || true - moodle-plugin-ci validate - moodle-plugin-ci savepoints - moodle-plugin-ci mustache - - moodle-plugin-ci grunt || [ "$MOODLE_BRANCH" = 'master' ] + - moodle-plugin-ci grunt || [ "$CHECK_GRUNT" = 'no' ] - moodle-plugin-ci phpunit - moodle-plugin-ci behat diff --git a/README.txt b/README.txt index d5029e2..2a0aea9 100644 --- a/README.txt +++ b/README.txt @@ -5,9 +5,6 @@ This 'report' is actually a tool like the standard Manual grading quiz report, but which lets you grade all the responses by one student, rather than all the responses to one question. -This version of the plugin, which is compatible with Moodle 3.4+ and later. -Older versions of this plugin will work with older Moodle versions. - You can install it from the Moodle plugins database using the link above. Alternatively, you can install it using git. In the top-level folder of your diff --git a/changes.md b/changes.md index 3e54d65..bbf4ff2 100644 --- a/changes.md +++ b/changes.md @@ -1,5 +1,10 @@ # Change log for the Manual grading by student quiz report +## Changes in 1.7 + +* Moodle 3.9 compatibility. +* Small OU-specific change for quiz_answersheets plugin. + ## Changes in 1.6 diff --git a/version.php b/version.php index 0aeacc4..3d5401c 100644 --- a/version.php +++ b/version.php @@ -24,11 +24,11 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2018112000; -$plugin->requires = 2017111300; +$plugin->version = 2020062800; +$plugin->requires = 2019052000; $plugin->cron = 0; $plugin->component = 'quiz_gradingstudents'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = 'v1.6 for Moodle 3.4+'; +$plugin->release = 'v1.7 for Moodle 3.7+'; $plugin->outestssufficient = true; From 0959ee277673f4ea1c8a9501c4e35e9c1a6d9824 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 27 Jul 2020 21:21:22 +0100 Subject: [PATCH 05/10] Quiz: exam confirmation codes Add icmeNN as an allowed idnumber #406165 --- examconfirmationcode.php | 2 +- tests/examconfirmationcode_test.php | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/examconfirmationcode.php b/examconfirmationcode.php index b914d0d..4085263 100644 --- a/examconfirmationcode.php +++ b/examconfirmationcode.php @@ -53,7 +53,7 @@ class quiz_gradingstudents_report_exam_confirmation_code { * @return string|null string like eca01 or exm01 if it can, null if it can't. */ public static function quiz_can_have_confirmation_code(?string $quizidnumber) { - if (!preg_match('~\w+-\w+\.((?i:eca|exm)\d+)~', $quizidnumber, $matches)) { + if (!preg_match('~\w+-\w+\.((?i:eca|exm|icme)\d+)~', $quizidnumber, $matches)) { return null; } diff --git a/tests/examconfirmationcode_test.php b/tests/examconfirmationcode_test.php index efe6745..f81e62b 100644 --- a/tests/examconfirmationcode_test.php +++ b/tests/examconfirmationcode_test.php @@ -35,6 +35,31 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class quiz_gradingstudents_report_exam_confirmation_code_testcase extends basic_testcase { + /** + * Data provider for test_quiz_can_have_confirmation_code. + * @return array + */ + public function quiz_can_have_confirmation_code_cases(): array { + return [ + ['sk121-13r.eca30', 'eca30'], + ['sk121-13j.exm01', 'exm01'], + ['mu123-14b.icma42', null], + ['practicequiz', null], + ['B747-20B.icme30', 'icme30'], + ]; + } + + /** + * @dataProvider quiz_can_have_confirmation_code_cases + * + * @param string $idnumber + * @param string? $expectedresult + */ + public function test_quiz_can_have_confirmation_code(string $idnumber, ?string $expectedresult = null) { + $this->assertSame($expectedresult, + quiz_gradingstudents_report_exam_confirmation_code::quiz_can_have_confirmation_code($idnumber)); + } + public function test_calculate_hash() { $this->assertEquals('PYWF', quiz_gradingstudents_report_exam_confirmation_code::calculate_hash( 'R335671X L120 1 12P TMA30')); From 9d9fbdbd283626e229fea45950ed284a6b7538cd Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 9 Nov 2020 13:25:06 +0000 Subject: [PATCH 06/10] Quiz manual grade by student: fix capability check #427428 Also, change the Behat test setup to use generators. --- report.php | 2 +- tests/behat/gradingstudents.feature | 74 +++++++++-------------------- 2 files changed, 24 insertions(+), 52 deletions(-) diff --git a/report.php b/report.php index daa0aba..70ec875 100644 --- a/report.php +++ b/report.php @@ -212,7 +212,7 @@ protected function display_index($includeauto) { if (!$includeauto && $attempt->needsgrading == 0 && $attempt->manuallygraded == 0) { continue; } - if (has_capability ('mod/quiz:attempt', $this->context)) { + if (has_capability('mod/quiz:viewreports', $this->context)) { $reviewlink = html_writer::tag('a', get_string('attemptid', 'quiz_gradingstudents', $attempt->attemptnumber), array('href' => new moodle_url('/mod/quiz/review.php', diff --git a/tests/behat/gradingstudents.feature b/tests/behat/gradingstudents.feature index ce80fdc..b7d1ba7 100644 --- a/tests/behat/gradingstudents.feature +++ b/tests/behat/gradingstudents.feature @@ -4,7 +4,7 @@ Feature: Grading by students Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | - | teacher1 | T1 | Teacher1 | teacher1@moodle.com | T1000 | + | teacher | T1 | Teacher | teacher@moodle.com | T1000 | | student1 | S1 | Student1 | student1@moodle.com | S1000 | | student2 | S2 | Student2 | student2@moodle.com | S2000 | And the following "courses" exist: @@ -12,72 +12,44 @@ Feature: Grading by students | Course 1 | C1 | 0 | And the following "course enrolments" exist: | user | course | role | - | teacher1 | C1 | editingteacher | + | teacher | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | - When I log in as "admin" - And I am on "Course 1" course homepage - And I turn editing mode on - And I add a "Quiz" to section "1" and I fill the form with: - | Name | Quiz 1 | - | Description | Quiz 1 description | + And the following "question categories" exist: + | contextlevel | reference | name | + | Course | C1 | Test questions | + And the following "activities" exist: + | activity | name | course | idnumber | + | quiz | Quiz 1 | C1 | q1 | + And the following "questions" exist: + | questioncategory | qtype | name | + | Test questions | shortanswer | SA | + And quiz "Quiz 1" contains the following questions: + | question | page | maxmark | + | SA | 1 | | - And I add a "Short answer" question to the "Quiz 1" quiz with: - | Question name | Short answer 001 | - | Question text | Where is the capital city of France? | - | Answer 1 | Paris | - | Grade | 100% | - - And I log out - - @javascript Scenario: report with no attempts - When I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Quiz 1" + When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher" And I navigate to "Results > Manual grading by student" in current page administration Then I should see "Manual grading by student" And I should see "Quiz 1" And I should see "Nothing to display" - @javascript Scenario: Report with attempts - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Quiz 1" - And I press "Attempt quiz now" - Then I should see "Question 1" - And I should see "Not yet answered" - And I should see "Where is the capital city of France?" - When I set the field "Answer:" to "Paris" - And I press "Finish attempt ..." - Then I should see "Answer saved" - When I press "Submit all and finish" - And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue" - And I log out - - When I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Quiz 1" - And I press "Attempt quiz now" - Then I should see "Question 1" - And I should see "Not yet answered" - And I should see "Where is the capital city of France?" - When I set the field "Answer:" to "London or Berlin" - And I press "Finish attempt ..." - Then I should see "Answer saved" - When I press "Submit all and finish" - And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue" - And I log out + Given user "student1" has attempted "Quiz 1" with responses: + | slot | response | + | 1 | Frog | + And user "student2" has attempted "Quiz 1" with responses: + | slot | response | + | 1 | Cat | - When I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Quiz 1" + When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher" And I navigate to "Results > Manual grading by student" in current page administration Then I should see "Manual grading by student" When I follow "Also show questions that have been graded automatically" Then I should see "S1000" And I should see "S2000" + And "Attempt 1" "link" should exist # Adjust the mark for Student1 When I click on "update grades" "link" in the "S1000" "table_row" From d4691dc040b21b5ecf1e5a33d505a0ba6c14ac66 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 18 Dec 2020 20:50:08 +0000 Subject: [PATCH 07/10] Switch from Travis to Github actions --- .github/workflows/ci.yml | 117 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 75 ------------------------- 2 files changed, 117 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b22af4a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,117 @@ +name: Moodle plugin CI +on: [push, pull_request] + +jobs: + test: + runs-on: 'ubuntu-latest' + strategy: + fail-fast: false + matrix: + include: + - php: '7.4' + moodle-branch: 'master' + database: 'pgsql' + - php: '7.4' + moodle-branch: 'MOODLE_311_STABLE' + database: 'mariadb' + - php: '7.3' + moodle-branch: 'MOODLE_310_STABLE' + database: 'pgsql' + - php: '7.2' + moodle-branch: 'MOODLE_39_STABLE' + database: 'mariadb' + + services: + postgres: + image: postgres + env: + POSTGRES_USER: 'postgres' + POSTGRES_HOST_AUTH_METHOD: 'trust' + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 3 + ports: + - 5432:5432 + + mariadb: + image: mariadb + env: + MYSQL_USER: 'root' + MYSQL_ALLOW_EMPTY_PASSWORD: "true" + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: plugin + + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: '14.15.0' + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, pgsql, mysqli + + - name: Deploy moodle-plugin-ci + run: | + composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 + # Add dirs to $PATH + echo $(cd ci/bin; pwd) >> $GITHUB_PATH + echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH + # PHPUnit depends on en_AU.UTF-8 locale + sudo locale-gen en_AU.UTF-8 + + - name: Install Moodle + run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 + env: + DB: ${{ matrix.database }} + MOODLE_BRANCH: ${{ matrix.moodle-branch }} + + - name: phplint + if: ${{ always() }} + run: moodle-plugin-ci phplint + + - name: phpcpd + if: ${{ always() }} + run: moodle-plugin-ci phpcpd + + - name: phpmd + if: ${{ always() }} + run: moodle-plugin-ci phpmd + + - name: codechecker + if: ${{ always() }} + run: moodle-plugin-ci codechecker + + - name: validate + if: ${{ always() }} + run: moodle-plugin-ci validate + + - name: savepoints + if: ${{ always() }} + run: moodle-plugin-ci savepoints + + - name: mustache + if: ${{ always() }} + run: moodle-plugin-ci mustache + + - name: grunt + if: ${{ always() }} + run: moodle-plugin-ci grunt + + - name: phpunit + if: ${{ always() }} + run: moodle-plugin-ci phpunit + + - name: behat + if: ${{ always() }} + run: moodle-plugin-ci behat --profile chrome diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ce5b04c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,75 +0,0 @@ -language: php - -os: linux -dist: xenial - -services: - - mysql - - postgresql - -addons: - firefox: "47.0.1" - apt: - packages: - - openjdk-8-jre-headless - - chromium-chromedriver - -cache: - directories: - - $HOME/.composer/cache - - $HOME/.npm - -matrix: - include: - - php: 7.4 - env: - - MOODLE_BRANCH=master - - DB=pgsql - - - php: 7.3 - env: - - MOODLE_BRANCH=MOODLE_39_STABLE - - DB=mysqli - - - php: 7.2 - env: - - MOODLE_BRANCH=MOODLE_38_STABLE - - DB=pgsql - - CHECK_GRUNT=yes - - - php: 7.1 - env: - - MOODLE_BRANCH=MOODLE_37_STABLE - - DB=mysqli - -before_install: - - phpenv config-rm xdebug.ini - - - if [ -z $CHECK_GRUNT ]; then - export CHECK_GRUNT=no; - fi - - - if [ -z $NODE ]; then - export NODE=14; - fi - - nvm install $NODE - - nvm use $NODE - - - cd ../.. - - composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^2 - - export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" - -install: - - moodle-plugin-ci install - -script: - - moodle-plugin-ci phplint - - moodle-plugin-ci phpcpd - - moodle-plugin-ci phpmd || true - - moodle-plugin-ci codechecker || true - - moodle-plugin-ci validate - - moodle-plugin-ci savepoints - - moodle-plugin-ci mustache - - moodle-plugin-ci grunt || [ "$CHECK_GRUNT" = 'no' ] - - moodle-plugin-ci phpunit - - moodle-plugin-ci behat From 762e4df5750a23da8214bc2ced62a6e9bc4b3941 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 18 Dec 2020 20:58:23 +0000 Subject: [PATCH 08/10] Fix unit tests for latest PHPunit --- tests/gradingstudentsreport_test.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/gradingstudentsreport_test.php b/tests/gradingstudentsreport_test.php index 69ddc16..4c9c266 100644 --- a/tests/gradingstudentsreport_test.php +++ b/tests/gradingstudentsreport_test.php @@ -48,21 +48,13 @@ public function normalise_state($state) { * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class quiz_gradingstudents_report_testcase extends basic_testcase { - /** @var quiz_gradingstudents_testable_report report instance to test. */ - protected $report; - - public function setUp() { - $this->report = new quiz_gradingstudents_testable_report(); - } - - public function tearDown() { - $this->report = null; - } - public function test_normalise_state() { - $this->assertEquals('needsgrading', $this->report->normalise_state('needsgrading')); - $this->assertEquals('autograded', $this->report->normalise_state('graded')); - $this->assertEquals('manuallygraded', $this->report->normalise_state('mangr')); + /** @var quiz_gradingstudents_testable_report */ + $report = new quiz_gradingstudents_testable_report(); + + $this->assertEquals('needsgrading', $report->normalise_state('needsgrading')); + $this->assertEquals('autograded', $report->normalise_state('graded')); + $this->assertEquals('manuallygraded', $report->normalise_state('mangr')); } } From ab9c75618d661efaeded5b98c454cacb9812cd82 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 18 Dec 2020 21:02:27 +0000 Subject: [PATCH 09/10] Increment version for the 1.8 release --- changes.md | 5 +++++ version.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/changes.md b/changes.md index bbf4ff2..dacbed6 100644 --- a/changes.md +++ b/changes.md @@ -1,5 +1,10 @@ # Change log for the Manual grading by student quiz report +## Changes in 1.8 + +* Fix capability checks when showing a link to the review page. + + ## Changes in 1.7 * Moodle 3.9 compatibility. diff --git a/version.php b/version.php index 3d5401c..26d4de4 100644 --- a/version.php +++ b/version.php @@ -24,11 +24,11 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2020062800; -$plugin->requires = 2019052000; +$plugin->version = 2020121800; +$plugin->requires = 2020061500; $plugin->cron = 0; $plugin->component = 'quiz_gradingstudents'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = 'v1.7 for Moodle 3.7+'; +$plugin->release = 'v1.8 for Moodle 3.9+'; $plugin->outestssufficient = true; From 30544e021e29c1e76d254945c7dd7eb88b16e566 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 18 Dec 2020 21:14:14 +0000 Subject: [PATCH 10/10] Fix coding style error --- tests/gradingstudentsreport_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gradingstudentsreport_test.php b/tests/gradingstudentsreport_test.php index 4c9c266..aa88449 100644 --- a/tests/gradingstudentsreport_test.php +++ b/tests/gradingstudentsreport_test.php @@ -49,7 +49,7 @@ public function normalise_state($state) { */ class quiz_gradingstudents_report_testcase extends basic_testcase { public function test_normalise_state() { - /** @var quiz_gradingstudents_testable_report */ + /** @var quiz_gradingstudents_testable_report $report */ $report = new quiz_gradingstudents_testable_report(); $this->assertEquals('needsgrading', $report->normalise_state('needsgrading'));