Skip to content

Commit

Permalink
Merge pull request #88 from wiris/v4.11.4
Browse files Browse the repository at this point in the history
V4.11.4
  • Loading branch information
ptorrent-at-wiris authored Sep 30, 2024
2 parents 36b4fa7 + 676882b commit f5148c6
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 59 deletions.
3 changes: 3 additions & 0 deletions lang/en/qtype_wq.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,6 @@
$string['privacy:metadata:qtype_wq:xml'] = 'Wiris Quizzes Question XML';

$string['auxiliar_text'] = 'Write an optional reasoning for your answer:';

$string['log_server_errors'] = 'Log server errors';
$string['log_server_errors_help'] = 'Extensively log errors coming from the WirisQuizzes service to your server logs. This might cause an increase in the size of your log files but might help the Wiris team troubleshoot issues.';
17 changes: 17 additions & 0 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ public function call_wiris_service($request) {
$service = $builder->getQuizzesService();

$isdebugmodeenabled = get_config('qtype_wq', 'debug_mode_enabled') == '1';
$islogmodeenabled = get_config('qtype_wq', 'log_server_errors') == '1';

if ($isdebugmodeenabled) {
// @codingStandardsIgnoreLine
Expand All @@ -382,6 +383,10 @@ public function call_wiris_service($request) {
print_object($e);
}

if ($islogmodeenabled) {
error_log('WIRISQUIZZES SERVER ERROR --- REQUEST: --- ' . $request->serialize());
}

throw new moodle_exception('wirisquestionincorrect', 'qtype_wq', $link, $a, '');
}

Expand All @@ -391,4 +396,16 @@ public function call_wiris_service($request) {
}
return $response;
}


public function update_attempt_state_data_for_new_version(
question_attempt_step $oldstep,
question_definition $otherversion
) {
return $this->base->update_attempt_state_data_for_new_version($oldstep, $otherversion->base);
}

public function validate_can_regrade_with_other_version(question_definition $otherversion): ?string {
return $this->base->validate_can_regrade_with_other_version($otherversion->base);
}
}
2 changes: 1 addition & 1 deletion renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,6 @@ protected function prepare_response(
'auxiliar_text',
$step
);
return format_text($text, $step->get_qt_var($name), $formatoptions);
return format_text($text, FORMAT_MOODLE, $formatoptions);
}
}
139 changes: 84 additions & 55 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,63 +37,92 @@
}
}

$settings->add(new admin_setting_heading('qtype_wq/connectionsettings',
get_string('connectionsettings', 'qtype_wq'),
get_string('connectionsettings_text', 'qtype_wq')));

$settings->add(new admin_setting_configtext('qtype_wq/quizzesserviceurl',
get_string('quizzesserviceurl', 'qtype_wq'),
get_string('quizzesserviceurl_help', 'qtype_wq'),
'http://www.wiris.net/demo/quizzes',
PARAM_URL));

$settings->add(new admin_setting_configtext('qtype_wq/quizzeseditorurl',
get_string('quizzeseditorurl', 'qtype_wq'),
get_string('quizzeseditorurl_help', 'qtype_wq'),
'http://www.wiris.net/demo/editor',
PARAM_URL));

$settings->add(new admin_setting_configtext('qtype_wq/quizzeshandurl',
get_string('quizzeshandurl', 'qtype_wq'),
get_string('quizzeshandurl_help', 'qtype_wq'),
'http://www.wiris.net/demo/hand',
PARAM_URL));

$settings->add(new admin_setting_configtext('qtype_wq/quizzeswirislauncherurl',
get_string('quizzeswirislauncherurl', 'qtype_wq'),
get_string('quizzeswirislauncherurl_help', 'qtype_wq'),
'http://stateful.wiris.net/demo/wiris',
PARAM_URL));

$settings->add(new admin_setting_configtext('qtype_wq/quizzeswirisurl',
get_string('quizzeswirisurl', 'qtype_wq'),
get_string('quizzeswirisurl_help', 'qtype_wq'),
'http://www.wiris.net/demo/wiris',
PARAM_URL));
$settings->add(new admin_setting_heading(
'qtype_wq/connectionsettings',
get_string('connectionsettings', 'qtype_wq'),
get_string('connectionsettings_text', 'qtype_wq')
));

$settings->add(new admin_setting_configtext(
'qtype_wq/quizzesserviceurl',
get_string('quizzesserviceurl', 'qtype_wq'),
get_string('quizzesserviceurl_help', 'qtype_wq'),
'http://www.wiris.net/demo/quizzes',
PARAM_URL
));

$settings->add(new admin_setting_configtext(
'qtype_wq/quizzeseditorurl',
get_string('quizzeseditorurl', 'qtype_wq'),
get_string('quizzeseditorurl_help', 'qtype_wq'),
'http://www.wiris.net/demo/editor',
PARAM_URL
));

$settings->add(new admin_setting_configtext(
'qtype_wq/quizzeshandurl',
get_string('quizzeshandurl', 'qtype_wq'),
get_string('quizzeshandurl_help', 'qtype_wq'),
'http://www.wiris.net/demo/hand',
PARAM_URL
));

$settings->add(new admin_setting_configtext(
'qtype_wq/quizzeswirislauncherurl',
get_string('quizzeswirislauncherurl', 'qtype_wq'),
get_string('quizzeswirislauncherurl_help', 'qtype_wq'),
'http://stateful.wiris.net/demo/wiris',
PARAM_URL
));

$settings->add(new admin_setting_configtext(
'qtype_wq/quizzeswirisurl',
get_string('quizzeswirisurl', 'qtype_wq'),
get_string('quizzeswirisurl_help', 'qtype_wq'),
'http://www.wiris.net/demo/wiris',
PARAM_URL
));

// Access provider option. If enabled only loged users can access to Wiris Quizzes services.
$settings->add(new admin_setting_configcheckbox('qtype_wq/access_provider_enabled',
get_string('access_provider_enabled', 'qtype_wq'),
get_string('access_provider_enabled_help', 'qtype_wq'),
'0'));

$settings->add(new admin_setting_heading('qtype_wq/compatibility_settings',
get_string('compatibility_settings', 'qtype_wq'),
get_string('compatibility_settings_text', 'qtype_wq')));

$settings->add(new admin_setting_configcheckbox('qtype_wq/filtercodes_compatibility',
get_string('filtercodes_compatibility_enabled', 'qtype_wq'),
get_string('filtercodes_compatibility_enabled_help', 'qtype_wq'),
'0'));

$settings->add(new admin_setting_heading('qtype_wq/troubleshooting_settings',
get_string('troubleshooting_settings', 'qtype_wq'),
get_string('troubleshooting_settings_text', 'qtype_wq')));

$settings->add(new admin_setting_configcheckbox('qtype_wq/debug_mode_enabled',
get_string('debug_mode_enabled', 'qtype_wq'),
get_string('debug_mode_enabled_help', 'qtype_wq'),
'0'));
$settings->add(new admin_setting_configcheckbox(
'qtype_wq/access_provider_enabled',
get_string('access_provider_enabled', 'qtype_wq'),
get_string('access_provider_enabled_help', 'qtype_wq'),
'0'
));

$settings->add(new admin_setting_heading(
'qtype_wq/compatibility_settings',
get_string('compatibility_settings', 'qtype_wq'),
get_string('compatibility_settings_text', 'qtype_wq')
));

$settings->add(new admin_setting_configcheckbox(
'qtype_wq/filtercodes_compatibility',
get_string('filtercodes_compatibility_enabled', 'qtype_wq'),
get_string('filtercodes_compatibility_enabled_help', 'qtype_wq'),
'0'
));

$settings->add(new admin_setting_heading(
'qtype_wq/troubleshooting_settings',
get_string('troubleshooting_settings', 'qtype_wq'),
get_string('troubleshooting_settings_text', 'qtype_wq')
));

$settings->add(new admin_setting_configcheckbox(
'qtype_wq/debug_mode_enabled',
get_string('debug_mode_enabled', 'qtype_wq'),
get_string('debug_mode_enabled_help', 'qtype_wq'),
'0'
));

$settings->add(new admin_setting_configcheckbox(
'qtype_wq/log_server_errors',
get_string('log_server_errors', 'qtype_wq'),
get_string('log_server_errors_help', 'qtype_wq'),
'0'
));


if ($CFG->version >= 2012120300 && $CFG->version < 2013051400) {
Expand Down
2 changes: 1 addition & 1 deletion step.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function get_var($name, $subquesbool = true) {
}

private function get_step_var_internal($name, $subquesbool) {
if ($subquesbool && strlen($this->extraprefix) > 0) {
if ($subquesbool && isset($this->extraprefix) && strlen($this->extraprefix) > 0) {
// The prefix is needed when it is a subquestion of a cloze
// (multianswer) question type.
if (substr($name, 0, 2) === '!_') {
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2024032203;
$plugin->version = 2024032204;
$plugin->requires = 2015111600; // Moodle 3.0.
$plugin->release = '4.11.3';
$plugin->release = '4.11.4';
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'qtype_wq';
$plugin->dependencies = array(
Expand Down

0 comments on commit f5148c6

Please sign in to comment.