diff --git a/.github/workflows/moodle-plugin-ci.yml b/.github/workflows/moodle-plugin-ci.yml index e2a310e..e146c5d 100644 --- a/.github/workflows/moodle-plugin-ci.yml +++ b/.github/workflows/moodle-plugin-ci.yml @@ -102,12 +102,6 @@ jobs: - php: 7.4 moodle-branch: MOODLE_311_STABLE database: mariadb - - php: 7.4 - moodle-branch: MOODLE_310_STABLE - database: pgsql - - php: 7.4 - moodle-branch: MOODLE_310_STABLE - database: mariadb - php: 7.4 moodle-branch: MOODLE_39_STABLE database: pgsql @@ -121,12 +115,6 @@ jobs: - php: 7.3 moodle-branch: MOODLE_311_STABLE database: mariadb - - php: 7.3 - moodle-branch: MOODLE_310_STABLE - database: pgsql - - php: 7.3 - moodle-branch: MOODLE_310_STABLE - database: mariadb - php: 7.3 moodle-branch: MOODLE_39_STABLE database: pgsql @@ -134,12 +122,6 @@ jobs: moodle-branch: MOODLE_39_STABLE database: mariadb - - php: 7.2 - moodle-branch: MOODLE_310_STABLE - database: pgsql - - php: 7.2 - moodle-branch: MOODLE_310_STABLE - database: mariadb - php: 7.2 moodle-branch: MOODLE_39_STABLE database: pgsql diff --git a/CHANGES.md b/CHANGES.md index 2f5bd9f..dc9e951 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ moodle-quiz_archive Changes ------- +### Unreleased + +* 2023-11-12 - Name the person who made a change in the question response history (if not the student) + ### Release v4.3-r2 * 2023-11-09 - Add options to show/hide history & correct answer diff --git a/report.php b/report.php index 8c642cc..41faea7 100644 --- a/report.php +++ b/report.php @@ -251,8 +251,13 @@ protected function quiz_report_get_student_attempt($attemptid, $userid) { // Cannot display grade. echo ''; } else if (is_null($grade)) { + if (get_string_manager()->string_exists('gradenoun', 'moodle')) { + $gradenounstring = get_string('gradenoun'); + } else { + $gradenounstring = get_string('grade', 'quiz'); + } $summarydata['grade'] = [ - 'title' => get_string('grade', 'quiz'), + 'title' => $gradenounstring, 'content' => quiz_format_grade($quiz, $grade), ]; @@ -279,8 +284,13 @@ protected function quiz_report_get_student_attempt($attemptid, $userid) { } else { $formattedgrade = get_string('outof', 'quiz', $a); } + if (get_string_manager()->string_exists('gradenoun', 'moodle')) { + $gradenounstring = get_string('gradenoun'); + } else { + $gradenounstring = get_string('grade', 'quiz'); + } $summarydata['grade'] = [ - 'title' => get_string('grade', 'quiz'), + 'title' => $gradenounstring, 'content' => $formattedgrade, ]; } @@ -334,6 +344,9 @@ protected function quiz_report_get_student_attempt($attemptid, $userid) { $attemptobj->get_question_attempt($originalslot)->get_max_mark()); } $quba = question_engine::load_questions_usage_by_activity($attemptobj->get_uniqueid()); + if (method_exists($quba, 'preload_all_step_users')) { + $quba->preload_all_step_users(); + } $string .= $quba->render_question($slot, $displayoptions, $number); } diff --git a/tests/behat/basic.feature b/tests/behat/basic.feature index fe552e1..aac3257 100644 --- a/tests/behat/basic.feature +++ b/tests/behat/basic.feature @@ -4,8 +4,7 @@ Feature: Basic use of the Archive report As a teacher I need to use the Archive report - @javascript - Scenario: Using the Archive report + Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | T1 | Teacher1 | teacher1@example.com | T1000 | @@ -33,11 +32,13 @@ Feature: Basic use of the Archive report | Test questions | truefalse | TF2 | Second question | And quiz "Quiz 1" contains the following questions: | question | page | maxmark | - | TF1 | 1 | | - | TF2 | 1 | 3.0 | + | TF1 | 1 | 1.0 | + | TF2 | 1 | 1.0 | + @javascript + Scenario: Using the Archive report # Add some attempts - And I log in as "student1" + Given I log in as "student1" And I am on "Course 1" course homepage And I follow "Quiz 1" And I press "Attempt quiz" @@ -65,3 +66,77 @@ Feature: Basic use of the Archive report And I should see "S1 Student1" # And student2's attempt And I should see "S2 Student2" + + @javascript + Scenario: Using the Archive report with teacher grade override for Moodle 3.9 + # Add an attempt + Given the site is running Moodle version 3.9 or higher + And the site is running Moodle version 3.9 or lower + And I log in as "student1" + And I am on "Course 1" course homepage + And I follow "Quiz 1" + And I press "Attempt quiz" + And I click on "True" "radio" in the "First question" "question" + And I click on "False" "radio" in the "Second question" "question" + And I press "Finish attempt ..." + And I press "Submit all and finish" + And I confirm the quiz submission in the modal dialog + And I log out + And I am on the "Quiz 1" "mod_quiz > Manual grading report" page logged in as "teacher1" + And I follow "Also show questions that have been graded automatically" + And I click on "update grades" "link" in the "TF1" "table_row" + And I set the field "Comment" to "I have adjusted your mark to 0.5" + And I set the field "Mark" to "0.5" + And I press "Save and show next" + And I follow "Results" + When I am on the "Quiz 1" "quiz_archive > Archive" page logged in as "teacher1" + Then I should see "T1 Teacher1" in the "I have adjusted your mark to 0.5" "table_row" + + @javascript + Scenario: Using the Archive report with teacher grade override for Moodle 3.11 + # Add an attempt + Given the site is running Moodle version 3.11 or higher + And the site is running Moodle version 3.11 or lower + And I log in as "student1" + And I am on "Course 1" course homepage + And I follow "Quiz 1" + And I press "Attempt quiz" + And I click on "True" "radio" in the "First question" "question" + And I click on "False" "radio" in the "Second question" "question" + And I press "Finish attempt ..." + And I press "Submit all and finish" + And I confirm the quiz submission in the modal dialog + And I log out + And I am on the "Quiz 1" "mod_quiz > Manual grading report" page logged in as "teacher1" + And I follow "Also show questions that have been graded automatically" + And I click on "update grades" "link" in the "TF1" "table_row" + And I set the field "Comment" to "I have adjusted your mark to 0.5" + And I set the field "Mark" to "0.5" + And I press "Save and go to next page" + And I follow "Results" + When I am on the "Quiz 1" "quiz_archive > Archive" page logged in as "teacher1" + Then I should see "T1 Teacher1" in the "I have adjusted your mark to 0.5" "table_row" + + @javascript + Scenario: Using the Archive report with teacher grade override for Moodle ≥ 4.0 + # Add an attempt + Given the site is running Moodle version 4.0 or higher + And I log in as "student1" + And I am on "Course 1" course homepage + And I follow "Quiz 1" + And I press "Attempt quiz" + And I click on "True" "radio" in the "First question" "question" + And I click on "False" "radio" in the "Second question" "question" + And I press "Finish attempt ..." + And I press "Submit all and finish" + And I confirm the quiz submission in the modal dialog + And I log out + And I am on the "Quiz 1" "mod_quiz > Manual grading report" page logged in as "teacher1" + And I follow "Also show questions that have been graded automatically" + And I click on "update grades" "link" in the "TF1" "table_row" + And I set the field "Comment" to "I have adjusted your mark to 0.5" + And I set the field "Mark" to "0.5" + And I press "Save and show next" + And I follow "Results" + When I am on the "Quiz 1" "quiz_archive > Archive" page logged in as "teacher1" + Then I should see "T1 Teacher1" in the "I have adjusted your mark to 0.5" "table_row" diff --git a/version.php b/version.php index a5da9cb..7364c6d 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2023111100; +$plugin->version = 2023111200; $plugin->requires = 2017110800; $plugin->component = 'quiz_archive'; $plugin->maturity = MATURITY_STABLE;