Skip to content

Commit a6aa6bc

Browse files
authored
Merge pull request #1725 from maths/dev
Release of STACK 4.12.0.
2 parents 576dbd8 + 6863395 commit a6aa6bc

3,158 files changed

Lines changed: 373966 additions & 244615 deletions

File tree

Some content is hidden

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

.github/workflows/moodle-ci.yml

Lines changed: 92 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,40 @@ jobs:
3333
# We use a mix of SBCL and GCL.
3434
include:
3535
- php: '8.4'
36-
moodle-branch: 'main'
36+
moodle-branch: 'MOODLE_502_STABLE'
3737
database: 'pgsql'
3838
maxima: 'GCL'
39-
moodle-app: true
39+
moodle-app: false
4040
- php: '8.4'
4141
moodle-branch: 'MOODLE_501_STABLE'
4242
database: 'pgsql'
43-
maxima: 'GCL'
44-
moodle-app: true
43+
maxima: 'SBCL'
44+
moodle-app: false
4545
- php: '8.2'
4646
moodle-branch: 'MOODLE_500_STABLE'
4747
database: 'pgsql'
4848
maxima: 'SBCL'
49-
moodle-app: true
49+
moodle-app: false
5050
# Edinburgh is planning to run the setup below for 2025-26.
5151
- php: '8.2'
5252
moodle-branch: 'MOODLE_405_STABLE'
5353
database: 'mariadb'
5454
maxima: 'GCL'
55-
moodle-app: true
56-
- php: '7.4'
57-
moodle-branch: 'MOODLE_401_STABLE'
55+
moodle-app: false
56+
# Note, Moodle 4.2 will run on PHP 8.0, but we require PHP 8.1 or newer.
57+
- php: '8.1'
58+
moodle-branch: 'MOODLE_402_STABLE'
5859
database: 'pgsql'
5960
maxima: 'GCL'
60-
moodle-app: true
61+
moodle-app: false
6162

6263
steps:
6364
- name: Install Maxima (${{ matrix.maxima }})
6465
run: |
6566
maxima="${{ (matrix.maxima == 'SBCL' && 'sbcl') || 'gcl' }}"
6667
wget http://mirrors.kernel.org/ubuntu/pool/main/r/readline/libreadline7_7.0-3_amd64.deb \
67-
https://sourceforge.net/projects/maxima/files/Maxima-Linux/5.42.2-Linux/maxima-common_5.42.2-1_all.deb \
68-
https://sourceforge.net/projects/maxima/files/Maxima-Linux/5.42.2-Linux/maxima-${maxima}_5.42.2-1_amd64.deb
68+
https://sourceforge.net/projects/maxima/files/Maxima-Linux-RPM/5.42.2-Linux/maxima-common_5.42.2-1_all.deb \
69+
https://sourceforge.net/projects/maxima/files/Maxima-Linux-RPM/5.42.2-Linux/maxima-${maxima}_5.42.2-1_amd64.deb
6970
7071
sudo locale-gen en_AU.UTF-8
7172
sudo apt-get install libtinfo5
@@ -119,11 +120,13 @@ jobs:
119120
sudo locale-gen en_AU.UTF-8
120121
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
121122
122-
- name: Install moodle-plugin-ci
123+
- name: Install moodle-plugin-ci (full unit tests)
124+
if: ${{ matrix.moodle-branch == 'main' }}
123125
run: |
124126
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfexplicitvaildate
125127
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfcbmexplicitvaildate
126128
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_adaptivemultipart
129+
moodle-plugin-ci add-plugin maths/moodle-qbank_importasversion
127130
128131
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
129132
@@ -145,57 +148,123 @@ jobs:
145148
# Try a command on the command line.
146149
# echo "1+1; quit();" | timeout --kill-after=100s 100s ${{ github.workspace }}/maxima_opt_auto -eval '(cl-user::run)'
147150
151+
env:
152+
DB: ${{ matrix.database }}
153+
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
154+
155+
- name: Install moodle-plugin-ci (light unit tests & moodle app)
156+
if: ${{ matrix.moodle-branch != 'main' && matrix.moodle-app == true}}
157+
run: |
158+
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfexplicitvaildate
159+
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfcbmexplicitvaildate
160+
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_adaptivemultipart
161+
moodle-plugin-ci add-plugin maths/moodle-qbank_importasversion
162+
163+
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
164+
165+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMAVERSION", "5.42.2");'
166+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMAND", "maxima");'
167+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDOPT", "timeout --kill-after=10s 10s ${{ github.workspace }}/maxima_opt_auto -eval '\''(cl-user::run)'\''");'
168+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDSERVER", "http://pool.home:8080/MaximaPool/MaximaPool");'
169+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASTIMEOUT", "100");'
170+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMALIBRARIES", "stats, distrib, descriptive, simplex");'
171+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASPREPARSE", "true");'
172+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLATFORM", "linux-optimised");'
173+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASRESULTSCACHE", "db");'
174+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLOTCOMMAND", "");'
175+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASDEBUGGING", "0");'
176+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CI_LIGHT", "1");'
177+
178+
#cat ${{ github.workspace }}/moodle/config.php
179+
180+
cp ${{ github.workspace }}/moodledata/phpu_moodledata/stack/maxima_opt_auto ${{ github.workspace }}/maxima_opt_auto
181+
# Try a command on the command line.
182+
# echo "1+1; quit();" | timeout --kill-after=100s 100s ${{ github.workspace }}/maxima_opt_auto -eval '(cl-user::run)'
183+
184+
env:
185+
DB: ${{ matrix.database }}
186+
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
187+
MOODLE_APP: 'true'
188+
189+
- name: Install moodle-plugin-ci (light unit tests & no moodle app)
190+
if: ${{ matrix.moodle-branch != 'main' && matrix.moodle-app != true}}
191+
run: |
192+
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfexplicitvaildate
193+
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfcbmexplicitvaildate
194+
moodle-plugin-ci add-plugin maths/moodle-qbehaviour_adaptivemultipart
195+
moodle-plugin-ci add-plugin maths/moodle-qbank_importasversion
196+
197+
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
198+
199+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMAVERSION", "5.42.2");'
200+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMAND", "maxima");'
201+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDOPT", "timeout --kill-after=10s 10s ${{ github.workspace }}/maxima_opt_auto -eval '\''(cl-user::run)'\''");'
202+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDSERVER", "http://pool.home:8080/MaximaPool/MaximaPool");'
203+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASTIMEOUT", "100");'
204+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMALIBRARIES", "stats, distrib, descriptive, simplex");'
205+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASPREPARSE", "true");'
206+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLATFORM", "linux-optimised");'
207+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASRESULTSCACHE", "db");'
208+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLOTCOMMAND", "");'
209+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASDEBUGGING", "0");'
210+
moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CI_LIGHT", "1");'
211+
212+
#cat ${{ github.workspace }}/moodle/config.php
213+
214+
cp ${{ github.workspace }}/moodledata/phpu_moodledata/stack/maxima_opt_auto ${{ github.workspace }}/maxima_opt_auto
215+
# Try a command on the command line.
216+
# echo "1+1; quit();" | timeout --kill-after=100s 100s ${{ github.workspace }}/maxima_opt_auto -eval '(cl-user::run)'
148217
149218
env:
150219
DB: ${{ matrix.database }}
151220
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
152-
MOODLE_APP: ${{ matrix.moodle-app }}
153221

154222
- name: PHP Lint
155-
if: ${{ always() }}
223+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
156224
run: moodle-plugin-ci phplint
157225

158226
- name: PHP Copy/Paste Detector
159227
continue-on-error: true # This step will show errors but will not fail.
160-
if: ${{ always() }}
228+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
161229
run: moodle-plugin-ci phpcpd
162230

163231
- name: PHP Mess Detector
164232
continue-on-error: true # This step will show errors but will not fail.
165-
if: ${{ always() }}
233+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
166234
run: moodle-plugin-ci phpmd
167235

168236
- name: Moodle Code Checker
169237
continue-on-error: true # Currently fails. We really ought to get this passing.
170-
if: ${{ always() }}
238+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
171239
run: moodle-plugin-ci codechecker --max-warnings 0
172240

173241
- name: Moodle PHPDoc Checker
174242
continue-on-error: true # Currently fails. We really ought to get this passing.
175-
if: ${{ always() }}
243+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
176244
run: moodle-plugin-ci phpdoc
177245

178246
- name: Validating
179-
if: ${{ always() }}
247+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
180248
run: moodle-plugin-ci validate
181249

182250
- name: Check upgrade savepoints
183-
if: ${{ always() }}
251+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
184252
run: moodle-plugin-ci savepoints
185253

186254
- name: Mustache Lint
187-
if: ${{ always() }}
255+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
188256
run: moodle-plugin-ci mustache
189257

190258
- name: Grunt
191-
if: ${{ matrix.moodle-branch == 'MOODLE_500_STABLE' }}
259+
if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_502_STABLE'}}
192260
run: moodle-plugin-ci grunt
193261

194262
- name: PHPUnit tests
263+
#if: ${{ matrix.moodle-branch == 'main' || matrix.moodle-branch == 'MOODLE_405_STABLE'}}
195264
if: ${{ always() }}
196265
run: moodle-plugin-ci phpunit
197266

198267
- name: Behat features
199268
if: ${{ always() }}
200-
run: moodle-plugin-ci behat --profile chrome --auto-rerun 6
269+
run: moodle-plugin-ci behat --profile chrome --auto-rerun 12
201270

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# STACK 4.11.1
1+
# STACK 4.12.0
22

33
STACK is an assessment system for mathematics, science and related disciplines. STACK is a question type for the Moodle learning management system, and also the ILIAS learning management system. STACK has an API for stand-alone integration into other 3rd party systems.
44

adminui/answertests.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
define('NO_OUTPUT_BUFFERING', true);
3030

31-
require_once(__DIR__.'/../../../../config.php');
32-
require_once($CFG->dirroot .'/course/lib.php');
31+
require_once(__DIR__ . '/../../../../config.php');
32+
require_once($CFG->dirroot . '/course/lib.php');
3333
require_once($CFG->libdir . '/questionlib.php');
34-
require_once($CFG->libdir .'/filelib.php');
35-
require_once($CFG->libdir .'/tablelib.php');
34+
require_once($CFG->libdir . '/filelib.php');
35+
require_once($CFG->libdir . '/tablelib.php');
3636

3737
require_once(__DIR__ . '/../locallib.php');
3838
require_once(__DIR__ . '/../stack/options.class.php');
@@ -109,7 +109,6 @@
109109

110110
$oldtest = '';
111111
foreach ($tests as $test) {
112-
113112
$notests++;
114113

115114
if ($oldtest != $test->name) {
@@ -128,7 +127,7 @@
128127
}
129128

130129
set_time_limit(30);
131-
list($passed, $error, $rawmark, $feedback, $ansnote, $expectednote, $trace)
130+
[$passed, $error, $rawmark, $feedback, $ansnote, $expectednote, $trace]
132131
= stack_answertest_test_data::run_test($test);
133132
$allpassed = $allpassed && $passed;
134133

@@ -187,14 +186,14 @@
187186
$took = (microtime(true) - $start);
188187
$rtook = round($took, 5);
189188
$pertest = round($took / $notests, 5);
190-
echo '<p>'.stack_string('testsuitenotests', ['no' => $notests]);
191-
echo '<br/>'.stack_string('testsuiteteststook', ['time' => $rtook]);
192-
echo '<br/>'.stack_string('testsuiteteststookeach', ['time' => $pertest]);
189+
echo '<p>' . stack_string('testsuitenotests', ['no' => $notests]);
190+
echo '<br/>' . stack_string('testsuiteteststook', ['time' => $rtook]);
191+
echo '<br/>' . stack_string('testsuiteteststookeach', ['time' => $pertest]);
193192
echo '</p>';
194193

195194
$config = get_config('qtype_stack');
196195
echo html_writer::tag('p', stack_string('healthcheckcache_' . $config->casresultscache));
197-
echo html_writer::tag('p', stack_string('settingcasmaximaversion').': '.$config->maximaversion);
196+
echo html_writer::tag('p', stack_string('settingcasmaximaversion') . ': ' . $config->maximaversion);
198197
}
199198

200199
if ($anstest) {

adminui/bulktest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,24 @@
7373
echo $OUTPUT->heading($title);
7474

7575
// Run the tests.
76-
list($allpassed, $failing) = $bulktester->run_all_tests_for_context(
77-
$context, $categoryid, 'web', false, $skippreviouspasses, $addtags);
76+
[$allpassed, $failing] = $bulktester->run_all_tests_for_context(
77+
$context,
78+
$categoryid,
79+
'web',
80+
false,
81+
$skippreviouspasses,
82+
$addtags
83+
);
7884

7985
// Display the final summary.
8086
$bulktester->print_overall_result($allpassed, $failing);
8187

8288
// If we used the cache, report state.
8389
if (class_exists('stack_cas_connection_db_cache')) {
84-
echo html_writer::tag('p', stack_string('healthcheckcachestatus',
85-
stack_cas_connection_db_cache::entries_count($DB)));
90+
echo html_writer::tag('p', stack_string(
91+
'healthcheckcachestatus',
92+
stack_cas_connection_db_cache::entries_count($DB)
93+
));
8694
}
8795

8896
echo $OUTPUT->footer();

adminui/bulktestall.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@
8484
echo $OUTPUT->heading(get_string('bulktesttitle', 'qtype_stack', $testcontext->get_context_name()));
8585
echo html_writer::tag('p', html_writer::link(
8686
new moodle_url('/question/type/stack/adminui/bulktestall.php', $urlparams),
87-
stack_string('bulktestcontinuefromhere')));
88-
list($passed, $failing) = $bulktester->run_all_tests_for_context($testcontext, null, 'web', false, $skippreviouspasses);
87+
stack_string('bulktestcontinuefromhere')
88+
));
89+
[$passed, $failing] = $bulktester->run_all_tests_for_context($testcontext, null, 'web', false, $skippreviouspasses);
8990
$allpassed = $allpassed && $passed;
9091
foreach ($failing as $key => $arrvals) {
9192
// Guard clause here to future proof any new fields from the bulk tester.

adminui/bulktestindex.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
define('NO_OUTPUT_BUFFERING', true);
2626

27-
require_once(__DIR__.'/../../../../config.php');
27+
require_once(__DIR__ . '/../../../../config.php');
2828

2929
require_once($CFG->libdir . '/questionlib.php');
3030
require_once(__DIR__ . '/../locallib.php');
@@ -88,8 +88,11 @@
8888
$numquestions = $info['numquestions'];
8989

9090
$testallurl = new moodle_url('/question/type/stack/adminui/bulktest.php', ['contextid' => $contextid]);
91-
$testalllink = html_writer::link($testallurl,
92-
get_string('bulktestallincontext', 'qtype_stack'), ['title' => get_string('testalltitle', 'qtype_stack')]);
91+
$testalllink = html_writer::link(
92+
$testallurl,
93+
get_string('bulktestallincontext', 'qtype_stack'),
94+
['title' => get_string('testalltitle', 'qtype_stack')]
95+
);
9396
$litext = $name . ' (' . $numquestions . ') ' . $testalllink;
9497

9598
echo html_writer::start_tag('details');
@@ -99,12 +102,17 @@
99102
echo html_writer::start_tag('ul', ['class' => 'expandable']);
100103
foreach ($categories as $cat) {
101104
if ($cat->count > 0) {
102-
$url = new moodle_url('/question/type/stack/adminui/bulktest.php',
103-
['contextid' => $contextid, 'categoryid' => $cat->id]);
105+
$url = new moodle_url(
106+
'/question/type/stack/adminui/bulktest.php',
107+
['contextid' => $contextid, 'categoryid' => $cat->id]
108+
);
104109
$linktext = $cat->name . ' (' . $cat->count . ')';
105110
$link = html_writer::link($url, $linktext);
106-
echo html_writer::tag('li', $link,
107-
['title' => get_string('testallincategory', 'qtype_stack')]);
111+
echo html_writer::tag(
112+
'li',
113+
$link,
114+
['title' => get_string('testallincategory', 'qtype_stack')]
115+
);
108116
}
109117
}
110118
echo html_writer::end_tag('ul');
@@ -114,7 +122,9 @@
114122

115123
if (has_capability('moodle/site:config', context_system::instance())) {
116124
echo html_writer::tag('p', html_writer::link(
117-
new moodle_url('/question/type/stack/adminui/bulktestall.php'), get_string('bulktestrun', 'qtype_stack')));
125+
new moodle_url('/question/type/stack/adminui/bulktestall.php'),
126+
get_string('bulktestrun', 'qtype_stack')
127+
));
118128
}
119129
}
120130

0 commit comments

Comments
 (0)