Skip to content

Commit f30826f

Browse files
committed
WIP3
1 parent 7321336 commit f30826f

26 files changed

+474
-265
lines changed

classes/edit_question_form.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
* @property array _customdata
3636
*/
3737
class edit_question_form extends \moodleform {
38-
3938
/**
4039
* Form definition.
4140
*/
@@ -75,7 +74,7 @@ public function validation($data, $files) {
7574
$errors["length"] = get_string('notenoughscaleitems', 'questionnaire');
7675
}
7776
// If this is a rate question with no duplicates option.
78-
if ($data['precise'] == 2 ) {
77+
if ($data['precise'] == 2) {
7978
$allchoices = $data['allchoices'];
8079
$allchoices = explode("\n", $allchoices);
8180
$nbvalues = 0;
@@ -92,8 +91,12 @@ public function validation($data, $files) {
9291

9392
// If this is a slider question.
9493
if ($data['type_id'] == QUESSLIDER) {
95-
if (isset($data['minrange']) && isset($data['maxrange']) && isset($data['startingvalue']) &&
96-
isset($data['stepvalue'])) {
94+
if (
95+
isset($data['minrange']) &&
96+
isset($data['maxrange']) &&
97+
isset($data['startingvalue']) &&
98+
isset($data['stepvalue'])
99+
) {
97100
if ($data['minrange'] >= $data['maxrange']) {
98101
$errors['maxrange'] = get_string('invalidrange', 'questionnaire');
99102
}
@@ -134,7 +137,7 @@ public function __get($name) {
134137
} else if ($name == '_customdata') {
135138
return $this->_customdata;
136139
} else {
137-
throw new \coding_exception($name.' is not a publicly accessible property of '.get_class($this));
140+
throw new \coding_exception($name . ' is not a publicly accessible property of ' . get_class($this));
138141
}
139142
}
140143
}

classes/event/all_responses_deleted.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/
3535
class all_responses_deleted extends \core\event\base {
36-
3736
/**
3837
* Init method.
3938
*/

classes/event/all_responses_saved_as_text.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/
3535
class all_responses_saved_as_text extends \core\event\base {
36-
3736
/**
3837
* Init method.
3938
*/
@@ -68,10 +67,9 @@ public function get_description() {
6867
* @return \moodle_url
6968
*/
7069
public function get_url() {
71-
$params = array();
70+
$params = [];
7271
$params['action'] = 'vall';
7372
$params['group'] = $this->other['currentgroupid'];
7473
return new \moodle_url("/mod/questionnaire/report.php", $params);
7574
}
76-
7775
}

classes/event/all_responses_viewed.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
4141
*/
4242
class all_responses_viewed extends \core\event\base {
43-
4443
/**
4544
* Set basic properties for the event.
4645
*/
@@ -75,7 +74,7 @@ public function get_description() {
7574
* @return \moodle_url
7675
*/
7776
public function get_url() {
78-
$params = array();
77+
$params = [];
7978
$params['id'] = $this->contextinstanceid;
8079
if (isset($this->other['action'])) {
8180
$params['action'] = $this->other['action'];

classes/event/attempt_resumed.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/
3535
class attempt_resumed extends \core\event\base {
36-
3736
/**
3837
* Set basic properties for the event.
3938
*/
@@ -68,7 +67,6 @@ public function get_description() {
6867
* @return \moodle_url
6968
*/
7069
public function get_url() {
71-
return new \moodle_url("/mod/questionnaire/view.php", array('id' => $this->contextinstanceid));
70+
return new \moodle_url("/mod/questionnaire/view.php", ['id' => $this->contextinstanceid]);
7271
}
73-
7472
}

classes/event/attempt_saved.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/
3535
class attempt_saved extends \core\event\base {
36-
3736
/**
3837
* Set basic properties for the event.
3938
*/
@@ -67,7 +66,7 @@ public function get_description() {
6766
* @return \moodle_url
6867
*/
6968
public function get_url() {
70-
return new \moodle_url("/mod/questionnaire/view.php", array('id' => $this->contextinstanceid));
69+
return new \moodle_url("/mod/questionnaire/view.php", ['id' => $this->contextinstanceid]);
7170
}
7271

7372
/**

classes/event/attempt_submitted.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/
3535
class attempt_submitted extends \core\event\base {
36-
3736
/**
3837
* Set basic properties for the event.
3938
*/
@@ -67,7 +66,7 @@ public function get_description() {
6766
* @return \moodle_url
6867
*/
6968
public function get_url() {
70-
return new \moodle_url("/mod/questionnaire/view.php", array('id' => $this->contextinstanceid));
69+
return new \moodle_url("/mod/questionnaire/view.php", ['id' => $this->contextinstanceid]);
7170
}
7271

7372
/**

classes/event/course_module_viewed.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/
3535
class course_module_viewed extends \core\event\course_module_viewed {
36-
3736
/**
3837
* Set basic properties for the event.
3938
*/

classes/event/non_respondents_viewed.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/
3535
class non_respondents_viewed extends \core\event\base {
36-
3736
/**
3837
* Set basic properties for the event.
3938
*/
@@ -68,9 +67,8 @@ public function get_description() {
6867
* @return \moodle_url
6968
*/
7069
public function get_url() {
71-
$params = array();
70+
$params = [];
7271
$params['id'] = $this->contextinstanceid;
7372
return new \moodle_url("/mod/questionnaire/show_nonrespondents.php", $params);
7473
}
75-
7674
}

classes/event/questionnaire_previewed.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/
3535
class questionnaire_previewed extends \core\event\base {
36-
3736
/**
3837
* Set basic properties for the event.
3938
*/
@@ -67,9 +66,8 @@ public function get_description() {
6766
* @return \moodle_url
6867
*/
6968
public function get_url() {
70-
$params = array();
69+
$params = [];
7170
$params['id'] = $this->contextinstanceid;
7271
return new \moodle_url("/mod/questionnaire/preview.php", $params);
7372
}
74-
7573
}

0 commit comments

Comments
 (0)