2727 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2828 */
2929class 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 = [];
0 commit comments