Skip to content

Commit baf32db

Browse files
committed
WIP4
1 parent f30826f commit baf32db

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

classes/privacy/provider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ public static function delete_data_for_user(approved_contextlist $contextlist) {
283283
'questionnaire_response',
284284
['questionnaireid' => $questionnaire->id,
285285
'userid' => $userid]
286-
)
287-
) {
286+
)
287+
) {
288288
self::delete_responses($responses);
289289
}
290290
$responses->close();

classes/question/question.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
global $idcounter, $CFG;
4949
$idcounter = 0;
5050

51-
require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');
51+
require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');
5252

5353
#[\AllowDynamicProperties]
5454
/**
@@ -294,7 +294,8 @@ private function get_dependencies() {
294294
if (
295295
$dependencies = $DB->get_records(
296296
'questionnaire_dependency',
297-
['questionid' => $this->id , 'surveyid' => $this->surveyid], 'id ASC'
297+
['questionid' => $this->id, 'surveyid' => $this->surveyid],
298+
'id ASC'
298299
)
299300
) {
300301
foreach ($dependencies as $dependency) {
@@ -437,7 +438,7 @@ public function insert_response($responsedata) {
437438
*/
438439
public function get_results($rids = false) {
439440
if (
440-
isset ($this->responsetype) && is_object($this->responsetype) &&
441+
isset($this->responsetype) && is_object($this->responsetype) &&
441442
is_subclass_of($this->responsetype, '\\mod_questionnaire\\responsetype\\responsetype')
442443
) {
443444
return $this->responsetype->get_results($rids);
@@ -455,7 +456,7 @@ public function get_results($rids = false) {
455456
*/
456457
public function display_results($rids = false, $sort = '', $anonymous = false) {
457458
if (
458-
isset ($this->responsetype) && is_object($this->responsetype) &&
459+
isset($this->responsetype) && is_object($this->responsetype) &&
459460
is_subclass_of($this->responsetype, '\\mod_questionnaire\\responsetype\\responsetype')
460461
) {
461462
return $this->responsetype->display_results($rids, $sort, $anonymous);
@@ -895,7 +896,7 @@ public function response_template() {
895896
*/
896897
public function results_template($pdf = false) {
897898
if (
898-
isset ($this->responsetype) && is_object($this->responsetype) &&
899+
isset($this->responsetype) && is_object($this->responsetype) &&
899900
is_subclass_of($this->responsetype, '\\mod_questionnaire\\responsetype\\responsetype')
900901
) {
901902
return $this->responsetype->results_template($pdf);
@@ -912,7 +913,7 @@ public function results_template($pdf = false) {
912913
* @param int $qnum
913914
* @return \stdClass
914915
*/
915-
public function question_output($response, $blankquestionnaire, $dependants=[], $qnum = '') {
916+
public function question_output($response, $blankquestionnaire, $dependants = [], $qnum = '') {
916917
$pagetags = $this->questionstart_survey_display($qnum, $response);
917918
$pagetags->qformelement = $this->question_survey_display($response, $dependants, $blankquestionnaire);
918919
return $pagetags;
@@ -1214,7 +1215,8 @@ protected function form_dependencies($form, $questions) {
12141215
// Area for "must"-criteria.
12151216
$mform->addElement(
12161217
'static',
1217-
'mandatory', '',
1218+
'mandatory',
1219+
'',
12181220
'<div class="dimmed_text">' . get_string('mandatory', 'questionnaire') . '</div>'
12191221
);
12201222
$selectand = $mform->createElement(
@@ -1223,7 +1225,7 @@ protected function form_dependencies($form, $questions) {
12231225
get_string('condition', 'questionnaire'),
12241226
[
12251227
get_string('answernotgiven', 'questionnaire'),
1226-
get_string('answergiven', 'questionnaire')
1228+
get_string('answergiven', 'questionnaire'),
12271229
]
12281230
);
12291231
$selectand->setSelected('1');
@@ -1241,8 +1243,8 @@ protected function form_dependencies($form, $questions) {
12411243
get_string('dependquestion', 'questionnaire'),
12421244
$groupitemsand,
12431245
' ',
1244-
false
1245-
);
1246+
false
1247+
);
12461248
$form->repeat_elements(
12471249
[$groupand],
12481250
$dependenciescountand + 1,

classes/question/radio.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected function question_survey_display($response, $dependants = [], $blankqu
120120
$value = ' (' . $choice->value . ') ';
121121
}
122122
$contents = questionnaire_choice_values($choice->content);
123-
$radio->label = $value.format_text($contents->text, FORMAT_HTML, ['noclean' => true]) . $contents->image;
123+
$radio->label = $value . format_text($contents->text, FORMAT_HTML, ['noclean' => true]) . $contents->image;
124124
if (!empty($this->qlegend)) {
125125
$radio->alabel = strip_tags("{$this->qlegend} {$radio->label}");
126126
}
@@ -139,7 +139,7 @@ protected function question_survey_display($response, $dependants = [], $blankqu
139139
}
140140
$otherempty = !empty($radio->checked) && empty($odata);
141141
$radio->label = format_text($othertext, FORMAT_HTML, ['noclean' => true]);
142-
$radio->oname = 'q' . $this->id.choice::id_other_choice_name($id);
142+
$radio->oname = 'q' . $this->id . choice::id_other_choice_name($id);
143143
$radio->oid = $htmlid . '-other';
144144
if (isset($odata)) {
145145
$radio->ovalue = format_string(stripslashes($odata));

classes/questions_form.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function definition() {
221221
'static',
222222
'qnums',
223223
'',
224-
'<div class="qnums">' . $strposition . ' ' . $pos.'</div>'
224+
'<div class="qnums">' . $strposition . ' ' . $pos . '</div>'
225225
);
226226

227227
// Need to index by 'id' since IE doesn't return assigned 'values' for image inputs.
@@ -318,7 +318,7 @@ public function definition() {
318318
$reqsrc = $questionnaire->renderer->image_url('t/go');
319319
$strrequired = get_string('notrequired', 'questionnaire');
320320
}
321-
$strrequired .= ' ' .get_string('clicktoswitch', 'questionnaire');
321+
$strrequired .= ' ' . get_string('clicktoswitch', 'questionnaire');
322322
$reqextra = [
323323
'value' => $question->id,
324324
'alt' => $strrequired,
@@ -331,7 +331,7 @@ public function definition() {
331331
$reqextra
332332
);
333333
}
334-
$manageqgroup[] =& $mform->createElement('static', 'closetag_'.$question->id, '', '');
334+
$manageqgroup[] =& $mform->createElement('static', 'closetag_' . $question->id, '', '');
335335
} else {
336336
$manageqgroup[] =& $mform->createElement(
337337
'static',
@@ -395,7 +395,7 @@ public function definition() {
395395
} else {
396396
$qname = '';
397397
}
398-
$manageqgroup[] =& $mform->createElement('static', 'qinfo_' .$question->id, '', $qtype . ' ' . $qname);
398+
$manageqgroup[] =& $mform->createElement('static', 'qinfo_' . $question->id, '', $qtype . ' ' . $qname);
399399

400400
if (!empty($dependencies)) {
401401
$mform->addElement('static', 'qdepend_' . $question->id, '', $dependencies);
@@ -423,7 +423,7 @@ public function definition() {
423423
'static',
424424
'qcontent_' . $question->id,
425425
'',
426-
$qnumber . '<div class="qn-question">'.$content.'</div>'
426+
$qnumber . '<div class="qn-question">' . $content . '</div>'
427427
);
428428
}
429429
$mform->addElement('html', '</div>'); // End div qn-container.

0 commit comments

Comments
 (0)