Skip to content

Commit c5f0c2e

Browse files
xripoll-at-wirismcagigas-at-wiris
authored andcommitted
QUIZINT-599: Fix errors and warnings for codechecker
1 parent d767819 commit c5f0c2e

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

classes/privacy/provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class provider implements
3939
\core_privacy\local\request\plugin\provider {
4040

4141
// This trait must be included to provide the relevant polyfill for the metadata provider.
42-
// All required methods must start with an underscore
42+
// All required methods must start with an underscore.
4343
use \core_privacy\local\legacy_polyfill;
4444

4545

info.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) {
115115
$output .= html_writer::start_tag('tr', array('class' => 'wrs_filter wrs_plugin'));
116116

117117
require_once($CFG->dirroot . '/filter/wiris/version.php');
118-
$plugininfo = get_string('info_test2_info', 'qtype_wq') . '<a href="../../../filter/wiris/info.php" target="_blank">' . get_string('info_test2_infopage', 'qtype_wq') . '</a>';
118+
$plugininfo = get_string('info_test2_info', 'qtype_wq') . '<a href="../../../filter/wiris/info.php" target="_blank">' .
119+
get_string('info_test2_infopage', 'qtype_wq') . '</a>';
119120
if (isset($plugin->release)) {
120121
$version = $plugin->release;
121122
if ($version >= '3.17.20') {
@@ -513,9 +514,11 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) {
513514
}
514515
}
515516
$p->unlockVariable('wiris_maxconnections');
516-
echo wrs_createTableRow($testname, sprintf(get_string('info_test12_rt1', 'qtype_wq'), $count, $configmaxconnections, $maxconnections), '', true);
517+
echo wrs_createTableRow($testname, sprintf(get_string('info_test12_rt1', 'qtype_wq'),
518+
$count, $configmaxconnections, $maxconnections), '', true);
517519
} catch (Exception $e) {
518-
echo wrs_createTableRow($testname, sprintf(get_string('info_test12_rt2', 'qtype_wq'), $e->getMessage(), $e->getTraceAsString()), '', false);
520+
echo wrs_createTableRow($testname, sprintf(get_string('info_test12_rt2', 'qtype_wq'),
521+
$e->getMessage(), $e->getTraceAsString()), '', false);
519522
}
520523
$wrap->stop();
521524

@@ -529,7 +532,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) {
529532
$output = '';
530533
$output .= html_writer::start_tag('p', array('class' => 'wrs_filter wrs_plugin'));
531534
$output .= html_writer::end_tag('br');
532-
$output .= html_writer::start_tag('span', array('class' => 'wrs_filter wrs_plugin', 'style' => 'font-size:14px; font-weight:normal;'));
535+
$output .= html_writer::start_tag('span', array('class' => 'wrs_filter wrs_plugin',
536+
'style' => 'font-size:14px; font-weight:normal;'));
533537
$output .= get_string('info_information', 'qtype_wq');
534538
$output .= " (<a href=\"mailto:support@wiris.com\">support@wiris.com</a>)";
535539
$output .= html_writer::end_tag('span');

question.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ public function is_same_response(array $prevresponse, array $newresponse) {
221221
$baseresponse = $this->base->is_same_response($prevresponse, $newresponse);
222222
$sqicompare = ((empty($newresponse['_sqi']) && empty($prevresponse['_sqi'])) || (!empty($prevresponse['_sqi']) &&
223223
!empty($newresponse['_sqi']) && $newresponse['_sqi'] == $prevresponse['_sqi']));
224-
$auxiliarcompare = ((empty($newresponse['auxiliar_text']) && empty($prevresponse['auxiliar_text'])) || (!empty($prevresponse['auxiliar_text']) &&
224+
$auxiliarcompare = ((empty($newresponse['auxiliar_text']) && empty($prevresponse['auxiliar_text'])) ||
225+
(!empty($prevresponse['auxiliar_text']) &&
225226
!empty($newresponse['auxiliar_text']) && $newresponse['auxiliar_text'] == $prevresponse['auxiliar_text']));
226227
return $baseresponse && $sqicompare && $auxiliarcompare;
227228

renderer.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ public function __construct(qtype_renderer $base = null, moodle_page $page, $tar
2828
public function formulation_and_controls(question_attempt $qa, question_display_options $options) {
2929
$result = $this->base->formulation_and_controls($qa, $options);
3030

31-
// Auxiliar text
32-
$show_auxiliar_text_input = $qa->get_question()->wirisquestion->question->getProperty(com_wiris_quizzes_api_QuizzesConstants::$PROPERTY_SHOW_AUXILIAR_TEXT_INPUT);
33-
if ($show_auxiliar_text_input) {
31+
// Auxiliar text.
32+
$showauxiliartextinput = $qa->get_question()->wirisquestion->question->getProperty(
33+
com_wiris_quizzes_api_QuizzesConstants::$PROPERTY_SHOW_AUXILIAR_TEXT_INPUT); // @codingStandardsIgnoreLine
34+
if ($showauxiliartextinput) {
3435
$result .= $this->auxiliar_text($qa, $options);
3536
}
3637

@@ -113,15 +114,15 @@ protected function auxiliar_text(question_attempt $qa, question_display_options
113114
}
114115

115116
if (empty($options->readonly)) {
116-
$auxiliar_text = $responseoutput->response_area_input('auxiliar_text', $qa,
117+
$auxiliartext = $responseoutput->response_area_input('auxiliar_text', $qa,
117118
$step, $question->auxiliartextfieldlines, $options->context);
118119

119120
} else {
120-
$auxiliar_text = $responseoutput->response_area_read_only('auxiliar_text', $qa,
121+
$auxiliartext = $responseoutput->response_area_read_only('auxiliar_text', $qa,
121122
$step, $question->auxiliartextfieldlines, $options->context);
122123
}
123124

124-
$result .= html_writer::tag('div', $auxiliar_text);
125+
$result .= html_writer::tag('div', $auxiliartext);
125126

126127
return $result;
127128
}

settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
'http://www.wiris.net/demo/wiris',
7272
PARAM_URL));
7373

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

tests/behat/behat_wq_base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function i_open_wiris_quizzes_studio() {
4040
);
4141
$this->ensure_node_is_visible($node);
4242
$node->click();
43-
// Mink does not provide any way to call other steps, so we recreate the switch_to_window step from behat_general:
43+
// Mink does not provide any way to call other steps, so we recreate the switch_to_window step from behat_general.
4444
$this->getSession()->executeScript(
4545
'if (window.name == "") window.name = "' . behat_general::MAIN_WINDOW_NAME . '"');
4646
$this->getSession()->switchToWindow('wirisstudiopopup');

0 commit comments

Comments
 (0)