Skip to content

Commit 825e59c

Browse files
authored
Merge pull request #139 from KQMATH/update-ci-workflow
Update CI workflow and fix various problems
2 parents b7a62dd + 62008c6 commit 825e59c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+391
-377
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/moodle-ci.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
runs-on: ubuntu-22.04
7+
runs-on: ubuntu-24.04
88

99
services:
1010
postgres:
11-
image: postgres:13
11+
image: postgres:16
1212
env:
1313
POSTGRES_USER: 'postgres'
1414
POSTGRES_HOST_AUTH_METHOD: 'trust'
@@ -20,23 +20,30 @@ jobs:
2020
image: mariadb:10
2121
env:
2222
MYSQL_USER: 'root'
23-
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
24-
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
25-
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
23+
MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
24+
MYSQL_CHARACTER_SET_SERVER: 'utf8mb4'
25+
MYSQL_COLLATION_SERVER: 'utf8mb4_unicode_ci'
2626
ports:
2727
- 3306:3306
2828
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
2929

3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
php: ['8.0']
34-
moodle-branch: ['MOODLE_403_STABLE']
35-
database: [pgsql, mariadb]
33+
include:
34+
- php: '8.2'
35+
moodle-branch: 'MOODLE_405_STABLE'
36+
database: 'pgsql'
37+
- php: '8.3'
38+
moodle-branch: 'MOODLE_500_STABLE'
39+
database: 'pgsql'
40+
- php: '8.3'
41+
moodle-branch: 'MOODLE_500_STABLE'
42+
database: 'mariadb'
3643

3744
steps:
3845
- name: Check out repository code
39-
uses: actions/checkout@v4
46+
uses: actions/checkout@v5
4047
with:
4148
path: plugin
4249

@@ -66,19 +73,14 @@ jobs:
6673
if: ${{ !cancelled() }}
6774
run: moodle-plugin-ci phplint
6875

69-
- name: PHP Copy/Paste Detector
70-
continue-on-error: true # This step will show errors but will not fail
71-
if: ${{ !cancelled() }}
72-
run: moodle-plugin-ci phpcpd
73-
7476
- name: PHP Mess Detector
7577
continue-on-error: true # This step will show errors but will not fail
7678
if: ${{ !cancelled() }}
7779
run: moodle-plugin-ci phpmd
7880

7981
- name: Moodle Code Checker
8082
if: ${{ !cancelled() }}
81-
run: moodle-plugin-ci phpcs --max-warnings 0
83+
run: moodle-plugin-ci codechecker --max-warnings 0
8284

8385
- name: Moodle PHPDoc Checker
8486
if: ${{ !cancelled() }}

ajax.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ function show_all_jump_questions(jazzquiz $jazzquiz): array {
9494
* Get the form for the current question.
9595
*
9696
* @param jazzquiz_session $session
97+
* @param jazzquiz $jazzquiz
9798
* @return array
9899
*/
99100
function get_question_form(jazzquiz_session $session, jazzquiz $jazzquiz): array {
@@ -110,7 +111,7 @@ function get_question_form(jazzquiz_session $session, jazzquiz $jazzquiz): array
110111
/** @var output\renderer $renderer */
111112
$renderer = $jazzquiz->renderer;
112113
$isinstructor = $jazzquiz->is_instructor();
113-
list($html, $js, $css) = $renderer->render_question_form($slot, $session->myattempt, $jazzquiz, $isinstructor);
114+
[$html, $js, $css] = $renderer->render_question_form($slot, $session->myattempt, $jazzquiz, $isinstructor);
114115
$isalreadysubmitted = false;
115116
}
116117
$qtype = $session->get_question_type_by_slot($slot);
@@ -129,6 +130,7 @@ function get_question_form(jazzquiz_session $session, jazzquiz $jazzquiz): array
129130
* Start a new question.
130131
*
131132
* @param jazzquiz_session $session
133+
* @param jazzquiz $jazzquiz
132134
* @return array
133135
*/
134136
function start_question(jazzquiz_session $session, jazzquiz $jazzquiz): array {
@@ -210,6 +212,7 @@ function start_quiz(jazzquiz_session $session): array {
210212
* Submit a response for the current question.
211213
*
212214
* @param jazzquiz_session $session
215+
* @param jazzquiz $jazzquiz
213216
* @return array
214217
*/
215218
function save_question(jazzquiz_session $session, jazzquiz $jazzquiz): array {
@@ -298,6 +301,7 @@ function end_question(jazzquiz_session $session): array {
298301
* Get the correct answer for the current question.
299302
*
300303
* @param jazzquiz_session $session
304+
* @param jazzquiz $jazzquiz
301305
* @return array
302306
*/
303307
function get_right_response(jazzquiz_session $session, jazzquiz $jazzquiz): array {
@@ -405,6 +409,7 @@ function stack_to_latex(): array {
405409
*
406410
* @param string $action
407411
* @param jazzquiz_session $session
412+
* @param jazzquiz $jazzquiz
408413
* @return array
409414
*/
410415
function handle_instructor_request(string $action, jazzquiz_session $session, jazzquiz $jazzquiz): array {
@@ -432,6 +437,7 @@ function handle_instructor_request(string $action, jazzquiz_session $session, ja
432437
*
433438
* @param string $action
434439
* @param jazzquiz_session $session
440+
* @param jazzquiz $jazzquiz
435441
* @return array
436442
*/
437443
function handle_student_request(string $action, jazzquiz_session $session, jazzquiz $jazzquiz): array {
@@ -451,7 +457,6 @@ function handle_student_request(string $action, jazzquiz_session $session, jazzq
451457
function jazzquiz_ajax(): array {
452458
$action = required_param('action', PARAM_ALPHANUMEXT);
453459

454-
// TODO: Better solution if more non-session actions are added.
455460
if ($action === 'stack') {
456461
return stack_to_latex();
457462
}

amd/build/core.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)