From ee146f9ee216e7f290850ff6afbaa771bef1a910 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Tue, 16 Sep 2025 14:16:31 +0200 Subject: [PATCH 01/17] Student e2e and quiz admin --- tests/behat/student.feature | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/behat/student.feature diff --git a/tests/behat/student.feature b/tests/behat/student.feature new file mode 100644 index 0000000..bb0886a --- /dev/null +++ b/tests/behat/student.feature @@ -0,0 +1,37 @@ +@javascript @qtype_multichoicewiris @studentwiris +Feature: Student answers a quiz with a Multiple choice (WIRIS) question + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | student1 | Student | One | student1@example.com | + And the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + + And the following "activities" exist: + | activity | name | course | idnumber | + | quiz | WIRIS MC Quiz | C1 | quiz_mc | + + And the following "question categories" exist: Then I should see "Review" + | contextlevel | reference | name | + | Course | C1 | WIRIS bank | + + # Single-answer MC with 3 choices; "2" is correct + And the following "questions" exist: + | questioncategory | qtype | name | questiontext | defaultmark | single | answers[1] | fraction[1] | answers[2] | fraction[2] | answers[3] | fraction[3] | + | WIRIS bank | multichoicewiris | MC WIRIS – 1+1 |

What is 1 + 1?

| 1.0 | 1 | 2 | 1.0 | 3 | 0.0 | 1 | 0.0 | + + And quiz "WIRIS MC Quiz" contains the following questions: + | question | page | + | MC WIRIS – 1+1 | 1 | + + Scenario: Student attempts and submits the Multiple choice (WIRIS) quiz + Given I am on the "WIRIS MC Quiz" "mod_quiz > View" page logged in as "student1" + When I press "Attempt quiz" + And I click on "Finish attempt ..." "link" + And I press "Submit all and finish" + And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue" From 658f179526dd7e262bb4b4b92abec016841f93d1 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Thu, 18 Sep 2025 08:44:18 +0200 Subject: [PATCH 02/17] Link qase --- tests/behat/student.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/behat/student.feature b/tests/behat/student.feature index bb0886a..df635b5 100644 --- a/tests/behat/student.feature +++ b/tests/behat/student.feature @@ -1,4 +1,4 @@ -@javascript @qtype_multichoicewiris @studentwiris +@javascript @qtype_multichoicewiris @studentwiris @wqmdl-272 Feature: Student answers a quiz with a Multiple choice (WIRIS) question Background: From eb84bbe34e6565553feb22190a63a95d9beabba6 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 12:06:10 +0200 Subject: [PATCH 03/17] Adding definitions --- .github/workflows/ci.yml | 204 ++++++++++++++++++++++++++++----------- 1 file changed, 147 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f75a51c..56bbf34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,104 +1,194 @@ name: Moodle Plugin CI -on: [push, pull_request] - +# Automatically triggered on push to main branch, on pull requests +on: ['push', 'pull_request'] jobs: test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest services: postgres: - image: postgres:10 + image: postgres:17 env: - POSTGRES_USER: 'postgres' - POSTGRES_HOST_AUTH_METHOD: 'trust' + POSTGRES_USER: "postgres" + POSTGRES_HOST_AUTH_METHOD: "trust" ports: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 strategy: fail-fast: false + matrix: - php: ['7.3','7.4'] - moodle-branch: ['MOODLE_39_STABLE', 'MOODLE_310_STABLE', 'MOODLE_311_STABLE', 'MOODLE_400_STABLE'] + php: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] + moodle_branch: + [ + "MOODLE_401_STABLE", + "MOODLE_402_STABLE", + "MOODLE_403_STABLE", + "MOODLE_404_STABLE", + "MOODLE_405_STABLE", + "MOODLE_500_STABLE", + "main", + ] database: [pgsql] + browser: ["chrome", "firefox"] + exclude: + # Exclude Moodle+PHP incompatible versions + # See: https://docs.moodle.org/dev/Moodle_and_PHP + + - moodle_branch: "MOODLE_402_STABLE" + php: "7.4" + - moodle_branch: "MOODLE_403_STABLE" + php: "7.4" + - moodle_branch: "MOODLE_404_STABLE" + php: "7.4" + - moodle_branch: "MOODLE_405_STABLE" + php: "7.4" + - moodle_branch: "MOODLE_500_STABLE" + php: "7.4" + + + - moodle_branch: "MOODLE_404_STABLE" + php: "8.0" + - moodle_branch: "MOODLE_405_STABLE" + php: "8.0" + - moodle_branch: "MOODLE_500_STABLE" + php: "8.0" + + - moodle_branch: "MOODLE_500_STABLE" + php: "8.1" + + - moodle_branch: "MOODLE_401_STABLE" + php: "8.2" + + - moodle_branch: "MOODLE_401_STABLE" + php: "8.3" + - moodle_branch: "MOODLE_402_STABLE" + php: "8.3" + - moodle_branch: "MOODLE_403_STABLE" + php: "8.3" + + - moodle_branch: "MOODLE_401_STABLE" + php: "8.4" + - moodle_branch: "MOODLE_402_STABLE" + php: "8.4" + - moodle_branch: "MOODLE_403_STABLE" + php: "8.4" + - moodle_branch: "MOODLE_404_STABLE" + php: "8.4" + - moodle_branch: "MOODLE_405_STABLE" + php: "8.4" + + - moodle_branch: "main" + + + include: + # Only test master against latest PHP until we know which + # versions are supported in the next release + - moodle_branch: "main" + php: "8.4" + database: "pgsql" steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v7.0.7 - - name: Check out repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: plugin + # 0.1 Detect branch name based on event type. + - name: Set branch name + id: get_branch + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV + fi + + # 0.2 Log current matrix info. + - name: Log info + run: | + echo "PHP: ${{ matrix.php }}" + echo "Moodle: ${{ matrix.moodle_branch }}" + echo "Browser: ${{ matrix.browser }}" + echo "Branch: ${{ env.BRANCH_NAME }}" + + # 0.3 Cache Composer for faster builds. + - name: Cache Composer dependencies + uses: actions/cache@v3 + with: + path: | + ${{ github.workspace }}/.composer/cache + ${{ github.workspace }}/.npm + key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.moodle_branch }} + restore-keys: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.moodle_branch }} + + # 1. Setup PHP for the current matrix. - name: Setup PHP ${{ matrix.php }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: ${{ matrix.extensions }} - ini-values: max_input_vars=5000 + ini-values: max_input_vars=10000 coverage: none + # 2. Install moodle-plugin-ci tool. - name: Initialise moodle-plugin-ci run: | - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 + composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4 echo $(cd ci/bin; pwd) >> $GITHUB_PATH echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH sudo locale-gen en_AU.UTF-8 - echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV + echo NVM_DIR=$NVM_DIR >> $GITHUB_ENV + env: + IGNORE_PATHS: classes/privacy,ignore,node_modules,integration,render + COVERAGE: false + CODECHECKER_IGNORE_PATHS: classes/privacy,ignore,node_modules,integration,render + PHPUNIT_IGNORE_PATHS: classes/privacy,ignore,node_modules,integration,render - - name: Add filter & commons qtype + # 3. Install filter + - name: Add Wiris filter run: | moodle-plugin-ci add-plugin wiris/moodle-filter_wiris - moodle-plugin-ci add-plugin --branch ${{ steps.branch-name.outputs.current_branch }} wiris/moodle-qtype_wq - + + # 4. Install plugin and configure DB. - name: Install moodle-plugin-ci - run: | - moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 + run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 env: DB: ${{ matrix.database }} - MOODLE_BRANCH: ${{ matrix.moodle-branch }} - - - name: PHP Lint - if: ${{ always() }} - run: moodle-plugin-ci phplint - - - name: PHP Copy/Paste Detector - continue-on-error: true # This step will show errors but will not fail - if: ${{ always() }} - run: moodle-plugin-ci phpcpd + MOODLE_BRANCH: ${{ matrix.moodle_branch }} - - name: PHP Mess Detector - continue-on-error: true # This step will show errors but will not fail - if: ${{ always() }} - run: moodle-plugin-ci phpmd - - - name: Moodle Code Checker + # 5. Run PHPUnit tests. + - name: PHPUnit tests if: ${{ always() }} - run: moodle-plugin-ci codechecker --max-warnings 0 + run: moodle-plugin-ci phpunit ./plugin + continue-on-error: true + # 5.1 Run Moodle code validation. - name: Validating if: ${{ always() }} - run: moodle-plugin-ci validate - - - name: Check upgrade savepoints - if: ${{ always() }} - run: moodle-plugin-ci savepoints - - - name: Mustache Lint - if: ${{ always() }} - run: moodle-plugin-ci mustache + run: moodle-plugin-ci validate ./plugin + continue-on-error: true - - name: Grunt - if: ${{ always() }} - run: moodle-plugin-ci grunt --max-lint-warnings 0 - - - name: PHPUnit tests - if: ${{ always() }} - run: moodle-plugin-ci phpunit + # 6. Run Behat tests. + - name: Behat features for ( ${{ matrix.moodle_branch }} on PHP ${{ matrix.php }} ) + id: behat + run: | + case "${{ matrix.moodle_branch }}" in + "MOODLE_401_STABLE"|"MOODLE_402_STABLE"|"MOODLE_403_STABLE"|"MOODLE_404_STABLE"|"MOODLE_405_STABLE"|"MOODLE_500_STABLE"|"main") + TAG="@qtype_wq" + ;; + esac + moodle-plugin-ci behat --tags=$TAG --profile ${{ matrix.browser }} --auto-rerun=2 --verbose -vvv + + # 6.1 Upload Behat fail dumps when errors occur. + - name: Upload Behat Faildump + if: ${{ failure() && steps.behat.outcome == 'failure' }} + uses: actions/upload-artifact@v4 + with: + name: Behat Faildump (${{ matrix.php }}, ${{ matrix.moodle_branch }}, ${{ matrix.browser }}) + path: ${{ github.workspace }}/moodledata/behat_dump + retention-days: 1 + if-no-files-found: ignore - - name: Behat features - if: ${{ always() }} - run: moodle-plugin-ci behat --profile chrome \ No newline at end of file From 877fc6b83726ba789dfe980d62f0cdb47fbeb2e1 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 14:57:04 +0200 Subject: [PATCH 04/17] Remove old behat tests --- tests/behat/add.feature | 38 ---------------------------- tests/behat/edit.feature | 49 ------------------------------------- tests/behat/preview.feature | 33 ------------------------- 3 files changed, 120 deletions(-) delete mode 100644 tests/behat/add.feature delete mode 100644 tests/behat/edit.feature delete mode 100644 tests/behat/preview.feature diff --git a/tests/behat/add.feature b/tests/behat/add.feature deleted file mode 100644 index 487368b..0000000 --- a/tests/behat/add.feature +++ /dev/null @@ -1,38 +0,0 @@ -@qtype @qtype_wq @qtype_multichoicewiris -Feature: Test creating a Multiple choice wiris question without template - As a teacher - In order to test my students - I need to be able to create a Multiple choice question using variables - - Background: - Given the following "users" exist: - | username | - | teacher | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher | C1 | editingteacher | - - @javascript - Scenario: Create a Multiple choice wiris question - When I am on the "Course 1" "core_question > course question bank" page logged in as teacher - And I press "Create a new question ..." - And I choose the question type "Multiple choice - science" - Then I set the following fields to these values: - | Question name | multichoiceanswer-wiris-001 | - | Question text | This is a multichoice wiris question | - And I open Wiris Quizzes Studio - And I click on "Random variables" "text" - And I add the variable "a" with value "10" - And I add the variable "b" with value "-15/171" - And I go back in Wiris Quizzes Studio - And I save Wiris Quizzes Studio - Then I set the following fields to these values: - | Choice 1 | #a | - | id_fraction_0 | 100% | - | Choice 2 | #b | - | id_fraction_1 | None | - And I press "id_submitbutton" - Then I should see "multichoiceanswer-wiris-001" diff --git a/tests/behat/edit.feature b/tests/behat/edit.feature deleted file mode 100644 index 962c8a0..0000000 --- a/tests/behat/edit.feature +++ /dev/null @@ -1,49 +0,0 @@ -@qtype @qtype_wq @qtype_multichoicewiris -Feature: Test editing a Multichoice wiris question - As a teacher - In order to be able to update my Multichoice wiris question - I need to edit them - - Background: - Given the following "users" exist: - | username | - | teacher | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher | C1 | editingteacher | - And the following "question categories" exist: - | contextlevel | reference | name | - | Course | C1 | Test questions | - And the following "questions" exist: - | questioncategory | qtype | name | template | - | Test questions | multichoicewiris | multichoice-wiris-001 | four_of_five_science | - - @javascript @_switch_window - Scenario: Edit a multichoice wiris question - When I am on the "multichoice-wiris-001" "core_question > edit" page logged in as teacher - And I set the following fields to these values: - | Question name | Edited multichoice-wiris-001 name | - And I press "id_submitbutton" - Then I should see "Edited multichoice-wiris-001 name" - When I choose "Edit question" action for "Edited multichoice-wiris-001" in the question bank - And I press "Blanks for 3 more choices" - And I set the following fields to these values: - | id_answer_5 | 57 | - | id_fraction_5 | 20% | - | id_feedback_5 | 57 is odd | - | id_answer_6 | 6 | - | id_fraction_6 | None | - | id_feedback_6 | 6 is even | - | id_answer_7 | 88 | - | id_fraction_7 | None | - | id_feedback_7 | 88 is even | - | id_fraction_0 | 20% | - | id_fraction_1 | 20% | - | id_fraction_2 | 20% | - | id_fraction_3 | 20% | - | General feedback | The odd numbers are 57, #t1, #t2 and #t4. | - And I press "id_submitbutton" - Then I should see "Edited multichoice-wiris-001" diff --git a/tests/behat/preview.feature b/tests/behat/preview.feature deleted file mode 100644 index 0a977bf..0000000 --- a/tests/behat/preview.feature +++ /dev/null @@ -1,33 +0,0 @@ -@qtype @qtype_wq @qtype_multichoicewiris -Feature: A student can answer a Wiris Multi Choice question type - In order to answer the question - As a student - I need to answer the multi choice wiris question - - Background: - Given the "wiris" filter is "on" - Given the "mathjaxloader" filter is "disabled" - Given the following "users" exist: - | username | - | teacher | - And the following "courses" exist: - | fullname | shortname | format | - | Course 1 | C1 | weeks | - And the following "course enrolments" exist: - | user | course | role | - | teacher | C1 | editingteacher | - And the following "question categories" exist: - | contextlevel | reference | name | - | Course | C1 | Default for C1 | - And the following "questions" exist: - | questioncategory | qtype | name | template | - | Default for C1 | multichoicewiris | Multi choice wiris | four_of_five_science | - - @javascript - Scenario: A student executes a wiris multichoice question type - When I am on the "Multi choice wiris" "core_question > preview" page logged in as teacher - Then Wirisformula should exist - When I click on "1. " "text" - And I press "Submit and finish" - Then Feedback should exist - And Generalfeedback should exist From 45cc2bb82ec0bc81daba3a4fe315d0078cd0d8e9 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 15:04:02 +0200 Subject: [PATCH 05/17] Remove old behat tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56bbf34..483b5e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,7 +177,7 @@ jobs: run: | case "${{ matrix.moodle_branch }}" in "MOODLE_401_STABLE"|"MOODLE_402_STABLE"|"MOODLE_403_STABLE"|"MOODLE_404_STABLE"|"MOODLE_405_STABLE"|"MOODLE_500_STABLE"|"main") - TAG="@qtype_wq" + TAG="@qtype_multichoicewiris" ;; esac moodle-plugin-ci behat --tags=$TAG --profile ${{ matrix.browser }} --auto-rerun=2 --verbose -vvv From 96a53c377920067bb68601ada69397ea1b780f89 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 15:48:30 +0200 Subject: [PATCH 06/17] Remove old behat tests --- .github/workflows/ci.yml | 52 +------------------------------------ tests/behat/student.feature | 4 +-- 2 files changed, 3 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 483b5e5..e542109 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,16 +20,10 @@ jobs: fail-fast: false matrix: - php: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] + php: ["8.1"] moodle_branch: [ - "MOODLE_401_STABLE", - "MOODLE_402_STABLE", - "MOODLE_403_STABLE", - "MOODLE_404_STABLE", "MOODLE_405_STABLE", - "MOODLE_500_STABLE", - "main", ] database: [pgsql] browser: ["chrome", "firefox"] @@ -37,50 +31,6 @@ jobs: # Exclude Moodle+PHP incompatible versions # See: https://docs.moodle.org/dev/Moodle_and_PHP - - moodle_branch: "MOODLE_402_STABLE" - php: "7.4" - - moodle_branch: "MOODLE_403_STABLE" - php: "7.4" - - moodle_branch: "MOODLE_404_STABLE" - php: "7.4" - - moodle_branch: "MOODLE_405_STABLE" - php: "7.4" - - moodle_branch: "MOODLE_500_STABLE" - php: "7.4" - - - - moodle_branch: "MOODLE_404_STABLE" - php: "8.0" - - moodle_branch: "MOODLE_405_STABLE" - php: "8.0" - - moodle_branch: "MOODLE_500_STABLE" - php: "8.0" - - - moodle_branch: "MOODLE_500_STABLE" - php: "8.1" - - - moodle_branch: "MOODLE_401_STABLE" - php: "8.2" - - - moodle_branch: "MOODLE_401_STABLE" - php: "8.3" - - moodle_branch: "MOODLE_402_STABLE" - php: "8.3" - - moodle_branch: "MOODLE_403_STABLE" - php: "8.3" - - - moodle_branch: "MOODLE_401_STABLE" - php: "8.4" - - moodle_branch: "MOODLE_402_STABLE" - php: "8.4" - - moodle_branch: "MOODLE_403_STABLE" - php: "8.4" - - moodle_branch: "MOODLE_404_STABLE" - php: "8.4" - - moodle_branch: "MOODLE_405_STABLE" - php: "8.4" - - - moodle_branch: "main" include: diff --git a/tests/behat/student.feature b/tests/behat/student.feature index df635b5..9336c7c 100644 --- a/tests/behat/student.feature +++ b/tests/behat/student.feature @@ -16,14 +16,14 @@ Feature: Student answers a quiz with a Multiple choice (WIRIS) question | activity | name | course | idnumber | | quiz | WIRIS MC Quiz | C1 | quiz_mc | - And the following "question categories" exist: Then I should see "Review" + And the following "question categories" exist: | contextlevel | reference | name | | Course | C1 | WIRIS bank | # Single-answer MC with 3 choices; "2" is correct And the following "questions" exist: | questioncategory | qtype | name | questiontext | defaultmark | single | answers[1] | fraction[1] | answers[2] | fraction[2] | answers[3] | fraction[3] | - | WIRIS bank | multichoicewiris | MC WIRIS – 1+1 |

What is 1 + 1?

| 1.0 | 1 | 2 | 1.0 | 3 | 0.0 | 1 | 0.0 | + | WIRIS bank | multichoice | MC WIRIS – 1+1 |

What is 1 + 1?

| 1.0 | 1 | 2 | 1.0 | 3 | 0.0 | 1 | 0.0 | And quiz "WIRIS MC Quiz" contains the following questions: | question | page | From ec20476be4d417b9c91cdca03cc0f3f3595e6b97 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 15:51:14 +0200 Subject: [PATCH 07/17] Remove old behat tests --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e542109..e6609fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,7 @@ jobs: matrix: php: ["8.1"] moodle_branch: - [ - "MOODLE_405_STABLE", - ] + ["MOODLE_405_STABLE"] database: [pgsql] browser: ["chrome", "firefox"] exclude: From 1d468dac237a1d201ac52f20b156746a3df36c0d Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 15:51:48 +0200 Subject: [PATCH 08/17] Remove old behat tests --- .github/workflows/ci.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6609fb..edd9e6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,18 +25,6 @@ jobs: ["MOODLE_405_STABLE"] database: [pgsql] browser: ["chrome", "firefox"] - exclude: - # Exclude Moodle+PHP incompatible versions - # See: https://docs.moodle.org/dev/Moodle_and_PHP - - - - include: - # Only test master against latest PHP until we know which - # versions are supported in the next release - - moodle_branch: "main" - php: "8.4" - database: "pgsql" steps: - name: Check out repository code From 5b9710b9da8bc8829c15e04d431595b130e582ba Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 16:05:10 +0200 Subject: [PATCH 09/17] Remove old behat tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edd9e6f..695ca7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: php: ["8.1"] moodle_branch: - ["MOODLE_405_STABLE"] + ["MOODLE_401_STABLE"] database: [pgsql] browser: ["chrome", "firefox"] From 5aa1dca570628ca7b3f3e8e579e4f61d95426943 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 16:15:34 +0200 Subject: [PATCH 10/17] Remove old behat tests --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 695ca7c..e9c8a4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,21 @@ jobs: - name: Add Wiris filter run: | moodle-plugin-ci add-plugin wiris/moodle-filter_wiris + + + #3.5 Install WQ + - name: Add WirisQuizzes plugin + id: install-plugin-quizzes + if: ${{ always() }} + continue-on-error: true + run: | + moodle-plugin-ci add-plugin --branch ${{ env.BRANCH_NAME }} wiris/moodle-qtype_wq + - name: Add MathType plugin for TinyMCE using the main branch + name: Add Wiris Quizzes plugin using the main branch + if: ${{ steps.install-plugin-quizzes.outcome != 'success' }} + run: | + moodle-plugin-ci add-plugin --branch main wiris/moodle-qtype_wq + # 4. Install plugin and configure DB. - name: Install moodle-plugin-ci From 4da53ebe8c6bd6e65b2a66aab0c94f84928c0ba3 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 16:18:38 +0200 Subject: [PATCH 11/17] Remove old behat tests --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9c8a4b..6d19489 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,8 +96,7 @@ jobs: continue-on-error: true run: | moodle-plugin-ci add-plugin --branch ${{ env.BRANCH_NAME }} wiris/moodle-qtype_wq - - name: Add MathType plugin for TinyMCE using the main branch - name: Add Wiris Quizzes plugin using the main branch + - name: Add Wiris Quizzes plugin using the main branch if: ${{ steps.install-plugin-quizzes.outcome != 'success' }} run: | moodle-plugin-ci add-plugin --branch main wiris/moodle-qtype_wq From 4c463dd2bca44eb27972926279bad16b457e2caa Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 16:19:59 +0200 Subject: [PATCH 12/17] Remove old behat tests --- .github/workflows/ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d19489..6b4ae69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,13 +91,8 @@ jobs: #3.5 Install WQ - name: Add WirisQuizzes plugin - id: install-plugin-quizzes if: ${{ always() }} - continue-on-error: true - run: | - moodle-plugin-ci add-plugin --branch ${{ env.BRANCH_NAME }} wiris/moodle-qtype_wq - - name: Add Wiris Quizzes plugin using the main branch - if: ${{ steps.install-plugin-quizzes.outcome != 'success' }} + run: | moodle-plugin-ci add-plugin --branch main wiris/moodle-qtype_wq From 391868b2741c8e51826d32469717817f2528f2c7 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 16:24:19 +0200 Subject: [PATCH 13/17] Remove old behat tests --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b4ae69..f6da7f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,11 +88,15 @@ jobs: run: | moodle-plugin-ci add-plugin wiris/moodle-filter_wiris - - #3.5 Install WQ - - name: Add WirisQuizzes plugin + # 3.5. Install Wiris Quizzes plugin. + - name: Add Wiris Quizzes plugin + id: install-plugin-quizzes if: ${{ always() }} - + continue-on-error: true + run: | + moodle-plugin-ci add-plugin --branch ${{ env.BRANCH_NAME }} wiris/moodle-qtype_wq + - name: Add Wiris Quizzes plugin using the main branch + if: ${{ steps.install-plugin-quizzes.outcome != 'success' }} run: | moodle-plugin-ci add-plugin --branch main wiris/moodle-qtype_wq From 1cd635373adb162ac348e93decefad199eb2a940 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 16:28:35 +0200 Subject: [PATCH 14/17] Remove old behat tests --- tests/behat/student.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/behat/student.feature b/tests/behat/student.feature index 9336c7c..39160cc 100644 --- a/tests/behat/student.feature +++ b/tests/behat/student.feature @@ -23,7 +23,7 @@ Feature: Student answers a quiz with a Multiple choice (WIRIS) question # Single-answer MC with 3 choices; "2" is correct And the following "questions" exist: | questioncategory | qtype | name | questiontext | defaultmark | single | answers[1] | fraction[1] | answers[2] | fraction[2] | answers[3] | fraction[3] | - | WIRIS bank | multichoice | MC WIRIS – 1+1 |

What is 1 + 1?

| 1.0 | 1 | 2 | 1.0 | 3 | 0.0 | 1 | 0.0 | + | WIRIS bank | multichoicewiris | MC WIRIS – 1+1 |

What is 1 + 1?

| 1.0 | 1 | 2 | 1.0 | 3 | 0.0 | 1 | 0.0 | And quiz "WIRIS MC Quiz" contains the following questions: | question | page | From 75f3eab31896280885962eda42a32c026de01b8a Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Wed, 8 Oct 2025 16:35:10 +0200 Subject: [PATCH 15/17] Remove old behat tests --- .github/workflows/ci.yml | 70 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6da7f2..0ec5c75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,76 @@ jobs: strategy: fail-fast: false - matrix: - php: ["8.1"] + matrix: + php: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] moodle_branch: - ["MOODLE_401_STABLE"] + [ + "MOODLE_401_STABLE", + "MOODLE_402_STABLE", + "MOODLE_403_STABLE", + "MOODLE_404_STABLE", + "MOODLE_405_STABLE", + "MOODLE_500_STABLE", + "main", + ] database: [pgsql] browser: ["chrome", "firefox"] + exclude: + # Exclude Moodle+PHP incompatible versions + # See: https://docs.moodle.org/dev/Moodle_and_PHP + + - moodle_branch: "MOODLE_402_STABLE" + php: "7.4" + - moodle_branch: "MOODLE_403_STABLE" + php: "7.4" + - moodle_branch: "MOODLE_404_STABLE" + php: "7.4" + - moodle_branch: "MOODLE_405_STABLE" + php: "7.4" + - moodle_branch: "MOODLE_500_STABLE" + php: "7.4" + + + - moodle_branch: "MOODLE_404_STABLE" + php: "8.0" + - moodle_branch: "MOODLE_405_STABLE" + php: "8.0" + - moodle_branch: "MOODLE_500_STABLE" + php: "8.0" + + - moodle_branch: "MOODLE_500_STABLE" + php: "8.1" + + - moodle_branch: "MOODLE_401_STABLE" + php: "8.2" + + - moodle_branch: "MOODLE_401_STABLE" + php: "8.3" + - moodle_branch: "MOODLE_402_STABLE" + php: "8.3" + - moodle_branch: "MOODLE_403_STABLE" + php: "8.3" + + - moodle_branch: "MOODLE_401_STABLE" + php: "8.4" + - moodle_branch: "MOODLE_402_STABLE" + php: "8.4" + - moodle_branch: "MOODLE_403_STABLE" + php: "8.4" + - moodle_branch: "MOODLE_404_STABLE" + php: "8.4" + - moodle_branch: "MOODLE_405_STABLE" + php: "8.4" + + - moodle_branch: "main" + + + include: + # Only test master against latest PHP until we know which + # versions are supported in the next release + - moodle_branch: "main" + php: "8.4" + database: "pgsql" steps: - name: Check out repository code From fc6d28978e50296d0a91bdf29c5c36d04415dc46 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Thu, 9 Oct 2025 08:50:39 +0200 Subject: [PATCH 16/17] Fixing errors --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ec5c75..f2210fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false - matrix: + matrix: php: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] moodle_branch: [ @@ -89,6 +89,7 @@ jobs: - moodle_branch: "main" php: "8.4" database: "pgsql" + continue-on-error: ${{ matrix.branch == 'main' }} steps: - name: Check out repository code From 4aedf63b267e4f2eb8fa2cc133ed2b04afcbb794 Mon Sep 17 00:00:00 2001 From: oparareda-at-wiris Date: Fri, 10 Oct 2025 10:05:43 +0200 Subject: [PATCH 17/17] added 501 to the matrix --- .github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2210fc..0da999b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: "MOODLE_404_STABLE", "MOODLE_405_STABLE", "MOODLE_500_STABLE", + "MOODLE_501_STABLE", "main", ] database: [pgsql] @@ -47,6 +48,8 @@ jobs: php: "7.4" - moodle_branch: "MOODLE_500_STABLE" php: "7.4" + - moodle_branch: "MOODLE_501_STABLE" + php: "7.4" - moodle_branch: "MOODLE_404_STABLE" @@ -55,9 +58,13 @@ jobs: php: "8.0" - moodle_branch: "MOODLE_500_STABLE" php: "8.0" + - moodle_branch: "MOODLE_501_STABLE" + php: "8.0" - moodle_branch: "MOODLE_500_STABLE" php: "8.1" + - moodle_branch: "MOODLE_501_STABLE" + php: "8.1" - moodle_branch: "MOODLE_401_STABLE" php: "8.2" @@ -190,7 +197,7 @@ jobs: id: behat run: | case "${{ matrix.moodle_branch }}" in - "MOODLE_401_STABLE"|"MOODLE_402_STABLE"|"MOODLE_403_STABLE"|"MOODLE_404_STABLE"|"MOODLE_405_STABLE"|"MOODLE_500_STABLE"|"main") + "MOODLE_401_STABLE"|"MOODLE_402_STABLE"|"MOODLE_403_STABLE"|"MOODLE_404_STABLE"|"MOODLE_405_STABLE"|"MOODLE_500_STABLE"|"MOODLE_501_STABLE"|"main") TAG="@qtype_multichoicewiris" ;; esac