Skip to content
Snippets Groups Projects
Commit 3cf10dd8 authored by Chris Sangwin's avatar Chris Sangwin
Browse files

Update default timeout (for CI tests) and fix notice issue with new PRT.

parent db798323
No related branches found
No related tags found
No related merge requests found
...@@ -127,7 +127,7 @@ jobs: ...@@ -127,7 +127,7 @@ jobs:
cp ${{ github.workspace }}/moodledata/phpu_moodledata/stack/maxima_opt_auto ${{ github.workspace }}/maxima_opt_auto cp ${{ github.workspace }}/moodledata/phpu_moodledata/stack/maxima_opt_auto ${{ github.workspace }}/maxima_opt_auto
# Try a command on the command line. # Try a command on the command line.
# echo "1+1; quit();" | timeout --kill-after=10s 10s ${{ github.workspace }}/maxima_opt_auto -eval '(cl-user::run)' # echo "1+1; quit();" | timeout --kill-after=100s 100s ${{ github.workspace }}/maxima_opt_auto -eval '(cl-user::run)'
env: env:
......
...@@ -58,7 +58,7 @@ function xmldb_qtype_stack_install() { ...@@ -58,7 +58,7 @@ function xmldb_qtype_stack_install() {
// Set to the same defaults as in settings.php - however, that has not been done // Set to the same defaults as in settings.php - however, that has not been done
// yet in the Moodle install code flow, so we have to duplicate here. // yet in the Moodle install code flow, so we have to duplicate here.
set_config('maximaversion', 'default', 'qtype_stack'); set_config('maximaversion', 'default', 'qtype_stack');
set_config('castimeout', 10, 'qtype_stack'); set_config('castimeout', 20, 'qtype_stack');
set_config('casresultscache', 'db', 'qtype_stack'); set_config('casresultscache', 'db', 'qtype_stack');
set_config('caspreparse', 'true', 'qtype_stack'); set_config('caspreparse', 'true', 'qtype_stack');
set_config('maximacommand', '', 'qtype_stack'); set_config('maximacommand', '', 'qtype_stack');
......
...@@ -33,7 +33,7 @@ Other options for the platform are `linux` and `linux-optimised`. ...@@ -33,7 +33,7 @@ Other options for the platform are `linux` and `linux-optimised`.
define('QTYPE_STACK_TEST_CONFIG_MAXIMACOMMAND', 'maxima --use-version=5.42.0'); define('QTYPE_STACK_TEST_CONFIG_MAXIMACOMMAND', 'maxima --use-version=5.42.0');
define('QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDOPT', ''); define('QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDOPT', '');
define('QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDSERVER', 'http://pool.home:8080/MaximaPool/MaximaPool'); define('QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDSERVER', 'http://pool.home:8080/MaximaPool/MaximaPool');
define('QTYPE_STACK_TEST_CONFIG_CASTIMEOUT', '5'); define('QTYPE_STACK_TEST_CONFIG_CASTIMEOUT', '20');
define('QTYPE_STACK_TEST_CONFIG_MAXIMALIBRARIES', 'stats, distrib, descriptive, simplex'); define('QTYPE_STACK_TEST_CONFIG_MAXIMALIBRARIES', 'stats, distrib, descriptive, simplex');
define('QTYPE_STACK_TEST_CONFIG_CASDEBUGGING', '0'); define('QTYPE_STACK_TEST_CONFIG_CASDEBUGGING', '0');
define('QTYPE_STACK_TEST_CONFIG_PLOTCOMMAND', ''); define('QTYPE_STACK_TEST_CONFIG_PLOTCOMMAND', '');
......
...@@ -516,6 +516,8 @@ class qtype_stack extends question_type { ...@@ -516,6 +516,8 @@ class qtype_stack extends question_type {
$totalvalue = 0; $totalvalue = 0;
$allformative = true; $allformative = true;
foreach ($prtnames as $name) { foreach ($prtnames as $name) {
// If not then we have just created the PRT.
if (array_key_exists($name, $questiondata->prts)) {
$prtdata = $questiondata->prts[$name]; $prtdata = $questiondata->prts[$name];
// At this point we do not have the PRT method is_formative() available to us. // At this point we do not have the PRT method is_formative() available to us.
if ($prtdata->feedbackstyle > 0) { if ($prtdata->feedbackstyle > 0) {
...@@ -523,6 +525,7 @@ class qtype_stack extends question_type { ...@@ -523,6 +525,7 @@ class qtype_stack extends question_type {
$allformative = false; $allformative = false;
} }
} }
}
if ($questiondata->prts && !$allformative && $totalvalue < 0.0000001) { if ($questiondata->prts && !$allformative && $totalvalue < 0.0000001) {
throw new coding_exception('There is an error authoring your question. ' . throw new coding_exception('There is an error authoring your question. ' .
'The $totalvalue, the marks available for the question, must be positive in question ' . 'The $totalvalue, the marks available for the question, must be positive in question ' .
......
...@@ -77,7 +77,7 @@ $settings->add(new admin_setting_configselect('qtype_stack/maximaversion', ...@@ -77,7 +77,7 @@ $settings->add(new admin_setting_configselect('qtype_stack/maximaversion',
$settings->add(new admin_setting_configtext('qtype_stack/castimeout', $settings->add(new admin_setting_configtext('qtype_stack/castimeout',
get_string('settingcastimeout', 'qtype_stack'), get_string('settingcastimeout', 'qtype_stack'),
get_string('settingcastimeout_desc', 'qtype_stack'), 10, PARAM_INT, 3)); get_string('settingcastimeout_desc', 'qtype_stack'), 20, PARAM_INT, 3));
$settings->add(new admin_setting_configselect('qtype_stack/casresultscache', $settings->add(new admin_setting_configselect('qtype_stack/casresultscache',
get_string('settingcasresultscache', 'qtype_stack'), get_string('settingcasresultscache', 'qtype_stack'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment