Skip to content

Commit 224cc95

Browse files
committed
WIP5
1 parent baf32db commit 224cc95

33 files changed

+374
-327
lines changed

classes/completion/custom_completion.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//
1414
// You should have received a copy of the GNU General Public License
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
1617
declare(strict_types=1);
1718

1819
namespace mod_questionnaire\completion;
@@ -57,7 +58,7 @@ public function get_state(string $rule): int {
5758
*/
5859
public static function get_defined_custom_rules(): array {
5960
return [
60-
'completionsubmit'
61+
'completionsubmit',
6162
];
6263
}
6364

@@ -68,7 +69,7 @@ public static function get_defined_custom_rules(): array {
6869
*/
6970
public function get_custom_rule_descriptions(): array {
7071
return [
71-
'completionsubmit' => get_string('completionsubmit', 'questionnaire')
72+
'completionsubmit' => get_string('completionsubmit', 'questionnaire'),
7273
];
7374
}
7475

classes/feedback/section.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3232
*/
3333
class section {
34-
3534
/** @var int */
3635
public $id = 0;
3736
/** @var int */

classes/file_storage.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2525
*/
2626
class file_storage extends \file_storage {
27-
2827
/**
2928
* Copy all the files in a file area from one context to another.
3029
*
@@ -39,8 +38,14 @@ class file_storage extends \file_storage {
3938
* @throws \file_exception
4039
* @throws \stored_file_creation_exception
4140
*/
42-
public function copy_area_files_to_new_context($oldcontextid, $newcontextid, $component, $filearea, $olditemid = false,
43-
$newitemid = false) {
41+
public function copy_area_files_to_new_context(
42+
$oldcontextid,
43+
$newcontextid,
44+
$component,
45+
$filearea,
46+
$olditemid = false,
47+
$newitemid = false
48+
) {
4449
$count = 0;
4550

4651
$oldfiles = $this->get_area_files($oldcontextid, $component, $filearea, $olditemid, 'id', false);

classes/output/completepage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
*/
2727
class completepage implements \renderable, \templatable {
28-
2928
/**
3029
* The data to be exported.
3130
* @var array
@@ -64,5 +63,4 @@ public function add_to_page($element, $content) {
6463
public function export_for_template(\renderer_base $output) {
6564
return $this->data;
6665
}
67-
6866
}

classes/output/fbsectionspage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
*/
2727
class fbsectionspage implements \renderable, \templatable {
28-
2928
/**
3029
* The data to be exported.
3130
* @var array
@@ -60,5 +59,4 @@ public function add_to_page($element, $content) {
6059
public function export_for_template(\renderer_base $output) {
6160
return $this->data;
6261
}
63-
6462
}

classes/output/feedbackpage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
*/
2727
class feedbackpage implements \renderable, \templatable {
28-
2928
/**
3029
* The data to be exported.
3130
* @var array
@@ -60,5 +59,4 @@ public function add_to_page($element, $content) {
6059
public function export_for_template(\renderer_base $output) {
6160
return $this->data;
6261
}
63-
6462
}

classes/output/mobile.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2828
*/
2929
class mobile {
30-
3130
/**
3231
* Returns the initial page when viewing the activity for the mobile app.
3332
*
@@ -36,7 +35,7 @@ class mobile {
3635
*/
3736
public static function mobile_view_activity($args) {
3837
global $OUTPUT, $USER, $CFG, $DB;
39-
require_once($CFG->dirroot.'/mod/questionnaire/questionnaire.class.php');
38+
require_once($CFG->dirroot . '/mod/questionnaire/questionnaire.class.php');
4039

4140
$args = (object) $args;
4241

@@ -49,7 +48,7 @@ public static function mobile_view_activity($args) {
4948
$submit = isset($args->submit) ? $args->submit : false;
5049
$completed = isset($args->completed) ? $args->completed : false;
5150

52-
list($cm, $course, $questionnaire) = questionnaire_get_standard_page_items($cmid);
51+
[$cm, $course, $questionnaire] = questionnaire_get_standard_page_items($cmid);
5352
$questionnaire = new \questionnaire($course, $cm, 0, $questionnaire);
5453

5554
$data = [];
@@ -86,6 +85,7 @@ public static function mobile_view_activity($args) {
8685
case 'submit':
8786
case 'nextpage':
8887
case 'previouspage':
88+
// Check for notifications.
8989
if (!$data['notifications']) {
9090
$result = $questionnaire->save_mobile_data($userid, $pagenum, $completed, $rid, $submit, $action, (array)$args);
9191
}
@@ -183,12 +183,12 @@ public static function mobile_view_activity($args) {
183183
'templates' => [
184184
[
185185
'id' => 'main',
186-
'html' => $OUTPUT->render_from_template($template, $data)
186+
'html' => $OUTPUT->render_from_template($template, $data),
187187
],
188188
],
189189
'javascript' => file_get_contents($CFG->dirroot . '/mod/questionnaire/appjs/uncheckother.js'),
190190
'otherdata' => $responses,
191-
'files' => null
191+
'files' => null,
192192
];
193193
return $return;
194194
}
@@ -238,7 +238,7 @@ protected static function add_index_data($questionnaire, &$data, $userid) {
238238
* @param response $response
239239
* @return array
240240
*/
241-
protected static function add_pagequestion_data($questionnaire, $pagenum, $response=null) {
241+
protected static function add_pagequestion_data($questionnaire, $pagenum, $response = null) {
242242
$qnum = 1;
243243
$pagequestions = [];
244244
$responses = [];

classes/output/nonrespondentspage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
*/
2727
class nonrespondentspage implements \renderable, \templatable {
28-
2928
/**
3029
* The data to be exported.
3130
* @var array
@@ -60,5 +59,4 @@ public function add_to_page($element, $content) {
6059
public function export_for_template(\renderer_base $output) {
6160
return $this->data;
6261
}
63-
6462
}

classes/output/previewpage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
*/
2727
class previewpage implements \renderable, \templatable {
28-
2928
/**
3029
* The data to be exported.
3130
* @var array
@@ -64,5 +63,4 @@ public function add_to_page($element, $content) {
6463
public function export_for_template(\renderer_base $output) {
6564
return $this->data;
6665
}
67-
6866
}

classes/output/qsettingspage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
*/
2727
class qsettingspage implements \renderable, \templatable {
28-
2928
/**
3029
* The data to be exported.
3130
* @var array
@@ -60,5 +59,4 @@ public function add_to_page($element, $content) {
6059
public function export_for_template(\renderer_base $output) {
6160
return $this->data;
6261
}
63-
6462
}

0 commit comments

Comments
 (0)