Completed
Push — 1.10.x ( 8f997c...918380 )
by Yannick
259:37 queued 220:06
created
main/exercice/MatchingDraggable.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
                 for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
68 68
                     if ($answer->isCorrect($i)) {
69 69
                         $nb_matches++;
70
-                        $defaults['answer[' . $nb_matches . ']'] = $answer->selectAnswer($i);
71
-                        $defaults['weighting[' . $nb_matches . ']'] = float_format($answer->selectWeighting($i), 1);
72
-                        $defaults['matches[' . $nb_matches . ']'] = $answer->correct[$i];
70
+                        $defaults['answer['.$nb_matches.']'] = $answer->selectAnswer($i);
71
+                        $defaults['weighting['.$nb_matches.']'] = float_format($answer->selectWeighting($i), 1);
72
+                        $defaults['matches['.$nb_matches.']'] = $answer->correct[$i];
73 73
                     } else {
74 74
                         $nb_options++;
75
-                        $defaults['option[' . $nb_options . ']'] = $answer->selectAnswer($i);
75
+                        $defaults['option['.$nb_options.']'] = $answer->selectAnswer($i);
76 76
                     }
77 77
                 }
78 78
             }
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
         $html = '<table class="table table-striped table-hover">
104 104
             <thead>
105 105
                 <tr>
106
-                    <th width="10">' . get_lang('Number') . '</th>
107
-                    <th width="85%">' . get_lang('Answer') . '</th>
108
-                    <th width="15%">' . get_lang('MatchesTo') . '</th>
109
-                    <th width="10">' . get_lang('Weighting') . '</th>
106
+                    <th width="10">' . get_lang('Number').'</th>
107
+                    <th width="85%">' . get_lang('Answer').'</th>
108
+                    <th width="15%">' . get_lang('MatchesTo').'</th>
109
+                    <th width="10">' . get_lang('Weighting').'</th>
110 110
                 </tr>
111 111
             </thead>
112 112
             <tbody>';
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
         $html = '<table class="table table-striped table-hover">
155 155
             <thead>
156 156
                 <tr>
157
-                    <th width="15%">' . get_lang('Number') . '</th>
158
-                    <th width="85%">' . get_lang('Answer') . '</th>
157
+                    <th width="15%">' . get_lang('Number').'</th>
158
+                    <th width="85%">' . get_lang('Answer').'</th>
159 159
                 </tr>
160 160
             </thead>
161 161
             <tbody>';
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             );
177 177
 
178 178
             $form->addHtml('<tr>');
179
-            $form->addHtml('<td>' . chr(64 + $i) . '</td>');
179
+            $form->addHtml('<td>'.chr(64 + $i).'</td>');
180 180
             $form->addText("option[$i]", null);
181 181
             $form->addHtml('</tr>');
182 182
         }
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
     public function return_header($feedback_type = null, $counter = null, $score = null)
259 259
     {
260 260
         $header = parent::return_header($feedback_type, $counter, $score);
261
-        $header .= '<table class="' . $this->question_table_class . '">
261
+        $header .= '<table class="'.$this->question_table_class.'">
262 262
                 <tr>
263
-                    <th>' . get_lang('ElementList') . '</th>
264
-                    <th>' . get_lang('CorrespondsTo') . '</th>
263
+                    <th>' . get_lang('ElementList').'</th>
264
+                    <th>' . get_lang('CorrespondsTo').'</th>
265 265
                 </tr>';
266 266
 
267 267
         return $header;
Please login to merge, or discard this patch.
main/exercice/unique_answer_no_option.class.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $editor_config = array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '125');
40 40
 
41 41
         //this line define how many question by default appear when creating a choice question
42
-        $nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3;  // The previous default value was 2. See task #1759.
42
+        $nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3; // The previous default value was 2. See task #1759.
43 43
         $nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
44 44
 
45 45
         /*
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
         if ($obj_ex->selectFeedbackType() == 1) {
56 56
             $editor_config['Width'] = '250';
57 57
             $editor_config['Height'] = '110';
58
-            $comment_title = '<th width="50%" >' . get_lang('Comment') . '</th>';
59
-            $feedback_title = '<th width="50%" >' . get_lang('Scenario') . '</th>';
58
+            $comment_title = '<th width="50%" >'.get_lang('Comment').'</th>';
59
+            $feedback_title = '<th width="50%" >'.get_lang('Scenario').'</th>';
60 60
         } else {
61
-            $comment_title = '<th width="50%">' . get_lang('Comment') . '</th>';
61
+            $comment_title = '<th width="50%">'.get_lang('Comment').'</th>';
62 62
         }
63 63
 
64 64
         $html = '<table class="table table-striped table-hover">';
65 65
         $html .= '<thead>';
66 66
         $html .= '<tr>';
67
-        $html .= '<th>' . get_lang('Number') . '</th>';
68
-        $html .= '<th>' . get_lang('True') . '</th>';
69
-        $html .= '<th width="50%">' . get_lang('Answer') . '</th>';
70
-        $html .= $comment_title . $feedback_title;
71
-        $html .= '<th>' . get_lang('Weighting') . '</th>';
67
+        $html .= '<th>'.get_lang('Number').'</th>';
68
+        $html .= '<th>'.get_lang('True').'</th>';
69
+        $html .= '<th width="50%">'.get_lang('Answer').'</th>';
70
+        $html .= $comment_title.$feedback_title;
71
+        $html .= '<th>'.get_lang('Weighting').'</th>';
72 72
         $html .= '</tr>';
73 73
         $html .= '</thead>';
74 74
         $html .= '<tbody>';
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
                         $weight_result = '0';
136 136
                     }
137 137
 
138
-                    $defaults['answer[' . $i . ']'] = $answer_result;
139
-                    $defaults['comment[' . $i . ']'] = $answer->comment[$i];
140
-                    $defaults['weighting[' . $i . ']'] = $weight_result;
138
+                    $defaults['answer['.$i.']'] = $answer_result;
139
+                    $defaults['comment['.$i.']'] = $answer->comment[$i];
140
+                    $defaults['weighting['.$i.']'] = $weight_result;
141 141
 
142 142
                     $item_list = explode('@@', $answer->destination[$i]);
143 143
 
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
                     else
157 157
                         $url_result = $url;
158 158
 
159
-                    $temp_scenario['url' . $i] = $url_result;
160
-                    $temp_scenario['try' . $i] = $try_result;
161
-                    $temp_scenario['lp' . $i] = $lp;
162
-                    $temp_scenario['destination' . $i] = $list_dest;
159
+                    $temp_scenario['url'.$i] = $url_result;
160
+                    $temp_scenario['try'.$i] = $try_result;
161
+                    $temp_scenario['lp'.$i] = $lp;
162
+                    $temp_scenario['destination'.$i] = $list_dest;
163 163
                 }
164 164
             }
165 165
 
@@ -172,30 +172,30 @@  discard block
 block discarded – undo
172 172
             );
173 173
             $renderer->setElementTemplate(
174 174
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
175
-                'counter[' . $i . ']'
175
+                'counter['.$i.']'
176 176
             );
177 177
             $renderer->setElementTemplate(
178 178
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
179
-                'answer[' . $i . ']'
179
+                'answer['.$i.']'
180 180
             );
181 181
             $renderer->setElementTemplate(
182 182
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
183
-                'comment[' . $i . ']'
183
+                'comment['.$i.']'
184 184
             );
185 185
             $renderer->setElementTemplate(
186 186
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
187
-                'weighting[' . $i . ']'
187
+                'weighting['.$i.']'
188 188
             );
189 189
 
190
-            $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
190
+            $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"');
191 191
             $answer_number->freeze();
192 192
 
193 193
 
194 194
             $form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"');
195
-            $form->addElement('html_editor', 'answer[' . $i . ']', null, array(), $editor_config);
195
+            $form->addElement('html_editor', 'answer['.$i.']', null, array(), $editor_config);
196 196
 
197
-            $form->addElement('html_editor', 'comment[' . $i . ']', null, array(), $editor_config);
198
-            $form->addElement('text', 'weighting[' . $i . ']', null, array('style' => 'width: 60px;', 'value' => '0'));
197
+            $form->addElement('html_editor', 'comment['.$i.']', null, array(), $editor_config);
198
+            $form->addElement('text', 'weighting['.$i.']', null, array('style' => 'width: 60px;', 'value' => '0'));
199 199
             $form->addElement('html', '</tr>');
200 200
             $i++;
201 201
         }
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
         $i = 666;
210 210
         $form->addHtml('<tr>');
211 211
 
212
-        $defaults['answer[' . $i . ']'] = get_lang('DontKnow');
213
-        $defaults['weighting[' . $i . ']'] = 0;
212
+        $defaults['answer['.$i.']'] = get_lang('DontKnow');
213
+        $defaults['weighting['.$i.']'] = 0;
214 214
         $defaults['scenario'] = $temp_scenario;
215 215
         $renderer = & $form->defaultRenderer();
216 216
 
@@ -220,31 +220,31 @@  discard block
 block discarded – undo
220 220
         );
221 221
         $renderer->setElementTemplate(
222 222
             '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
223
-            'counter[' . $i . ']'
223
+            'counter['.$i.']'
224 224
         );
225 225
         $renderer->setElementTemplate(
226 226
             '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
227
-            'answer[' . $i . ']'
227
+            'answer['.$i.']'
228 228
         );
229 229
         $renderer->setElementTemplate(
230 230
             '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
231
-            'comment[' . $i . ']'
231
+            'comment['.$i.']'
232 232
         );
233 233
         $renderer->setElementTemplate(
234 234
             '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
235
-            'weighting[' . $i . ']'
235
+            'weighting['.$i.']'
236 236
         );
237 237
 
238
-        $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="-"');
238
+        $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="-"');
239 239
         $answer_number->freeze();
240 240
 
241
-        $form->addElement('hidden', 'position[' . $i . ']', '666');
241
+        $form->addElement('hidden', 'position['.$i.']', '666');
242 242
 
243 243
         $form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"');
244
-        $form->addElement('html_editor', 'answer[' . $i . ']', null, array(), $editor_config);
244
+        $form->addElement('html_editor', 'answer['.$i.']', null, array(), $editor_config);
245 245
 
246
-        $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
247
-        $form->addElement('html_editor', 'comment[' . $i . ']', null, array(), $editor_config);
246
+        $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
247
+        $form->addElement('html_editor', 'comment['.$i.']', null, array(), $editor_config);
248 248
 
249 249
         //$form->addElement('select', 'destination'.$i, get_lang('SelectQuestion').' : ',$select_question,'multiple');
250 250
 
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
 		    $minus = 0;
299 299
 		}
300 300
 
301
-		for ($i=1 ; $i <= $nb_answers - $minus; $i++) {
302
-		    $position   = trim($form -> getSubmitValue('position['.$i.']'));
303
-        	$answer     = trim($form -> getSubmitValue('answer['.$i.']'));
301
+		for ($i = 1; $i <= $nb_answers - $minus; $i++) {
302
+		    $position = trim($form -> getSubmitValue('position['.$i.']'));
303
+        	$answer = trim($form -> getSubmitValue('answer['.$i.']'));
304 304
             $comment    = trim($form -> getSubmitValue('comment['.$i.']'));
305 305
             $weighting  = trim($form -> getSubmitValue('weighting['.$i.']'));
306 306
             $scenario   = $form -> getSubmitValue('scenario');
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
            	//$list_destination = $form -> getSubmitValue('destination'.$i);
309 309
            	//$destination_str = $form -> getSubmitValue('destination'.$i);
310 310
 
311
- 		    $try           = $scenario['try'.$i];
312
-            $lp            = $scenario['lp'.$i];
311
+ 		    $try = $scenario['try'.$i];
312
+            $lp = $scenario['lp'.$i];
313 313
  			$destination   = $scenario['destination'.$i];
314 314
  			$url           = trim($scenario['url'.$i]);
315 315
 
@@ -333,34 +333,34 @@  discard block
 block discarded – undo
333 333
  				$destination_str.=$destination_id.';';
334 334
  			}*/
335 335
 
336
-        	$goodAnswer= ($correct == $i) ? true : false;
336
+        	$goodAnswer = ($correct == $i) ? true : false;
337 337
 
338 338
         	if ($goodAnswer) {
339 339
         		$nbrGoodAnswers++;
340 340
         		$weighting = abs($weighting);
341
-        		if($weighting > 0) {
341
+        		if ($weighting > 0) {
342 342
                     $questionWeighting += $weighting;
343 343
                 }
344 344
         	}
345 345
 
346 346
  			if (empty($try))
347
- 				$try=0;
347
+ 				$try = 0;
348 348
 
349 349
  			if (empty($lp)) {
350
- 				$lp=0;
350
+ 				$lp = 0;
351 351
  			}
352 352
 
353 353
  			if (empty($destination)) {
354
- 				$destination=0;
354
+ 				$destination = 0;
355 355
  			}
356 356
 
357
- 			if ($url=='') {
358
- 				$url=0;
357
+ 			if ($url == '') {
358
+ 				$url = 0;
359 359
  			}
360 360
 
361 361
  			//1@@1;2;@@2;4;4;@@http://www.chamilo.org
362
-			$dest= $try.'@@'.$lp.'@@'.$destination.'@@'.$url;
363
-        	$objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest);
362
+			$dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url;
363
+        	$objAnswer -> createAnswer($answer, $goodAnswer, $comment, $weighting, $i, NULL, NULL, $dest);
364 364
         }
365 365
 
366 366
         //Create 666 answer
@@ -368,10 +368,10 @@  discard block
 block discarded – undo
368 368
         $answer     = trim($form -> getSubmitValue('answer['.$i.']'));
369 369
         $comment    = trim($form -> getSubmitValue('comment['.$i.']'));
370 370
         $weighting  = trim($form -> getSubmitValue('weighting['.$i.']'));
371
-        $goodAnswer= ($correct == $i) ? true : false;
371
+        $goodAnswer = ($correct == $i) ? true : false;
372 372
         $dest       = '';
373 373
 
374
-        $objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest);
374
+        $objAnswer -> createAnswer($answer, $goodAnswer, $comment, $weighting, $i, NULL, NULL, $dest);
375 375
 
376 376
     	// saves the answers into the data base
377 377
         $objAnswer -> save();
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 	function return_header($feedback_type = null, $counter = null, $score = null)
385 385
     {
386 386
 	    $header = parent::return_header($feedback_type, $counter, $score);
387
-	    $header .= '<table class="'.$this->question_table_class .'">
387
+	    $header .= '<table class="'.$this->question_table_class.'">
388 388
 			<tr>
389 389
 				<th>'.get_lang("Choice").'</th>
390 390
 				<th>'. get_lang("ExpectedChoice").'</th>
Please login to merge, or discard this patch.
main/exercice/adminhp.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -8,28 +8,28 @@  discard block
 block discarded – undo
8 8
 */
9 9
 require_once '../inc/global.inc.php';
10 10
 
11
-$this_section=SECTION_COURSES;
11
+$this_section = SECTION_COURSES;
12 12
 
13 13
 if (isset($_REQUEST["cancel"])) {
14
-    if ($_REQUEST["cancel"]==get_lang('Cancel')) {
14
+    if ($_REQUEST["cancel"] == get_lang('Cancel')) {
15 15
         header("Location: exercise.php");
16 16
     }
17 17
 }
18 18
 
19 19
 //$is_courseAdmin = $_SESSION['is_courseAdmin'];
20
-$newName = (!empty($_REQUEST['newName'])?$_REQUEST['newName']:'');
21
-$hotpotatoesName = (!empty($_REQUEST['hotpotatoesName'])?$_REQUEST['hotpotatoesName']:'');
20
+$newName = (!empty($_REQUEST['newName']) ? $_REQUEST['newName'] : '');
21
+$hotpotatoesName = (!empty($_REQUEST['hotpotatoesName']) ? $_REQUEST['hotpotatoesName'] : '');
22 22
 
23
-$is_allowedToEdit=api_is_allowed_to_edit(null,true);
23
+$is_allowedToEdit = api_is_allowed_to_edit(null, true);
24 24
 
25 25
 // document path
26
-$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
26
+$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
27 27
 
28 28
 // picture path
29
-$picturePath=$documentPath.'/images';
29
+$picturePath = $documentPath.'/images';
30 30
 
31 31
 // audio path
32
-$audioPath=$documentPath.'/audio';
32
+$audioPath = $documentPath.'/audio';
33 33
 
34 34
 // Database table definitions
35 35
 if (!$is_allowedToEdit) {
@@ -37,21 +37,21 @@  discard block
 block discarded – undo
37 37
 }
38 38
 
39 39
 if (isset($_SESSION['gradebook'])) {
40
-    $gradebook=	$_SESSION['gradebook'];
40
+    $gradebook = $_SESSION['gradebook'];
41 41
 }
42 42
 
43
-if (!empty($gradebook) && $gradebook=='view') {
44
-    $interbreadcrumb[]= array (
43
+if (!empty($gradebook) && $gradebook == 'view') {
44
+    $interbreadcrumb[] = array(
45 45
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
46 46
         'name' => get_lang('ToolGradebook')
47 47
     );
48 48
 }
49 49
 
50
-$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
50
+$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
51 51
 
52 52
 $nameTools = get_lang('adminHP');
53 53
 
54
-Display::display_header($nameTools,"Exercise");
54
+Display::display_header($nameTools, "Exercise");
55 55
 
56 56
 /** @todo probably wrong !!!! */
57 57
 require_once(api_get_path(SYS_CODE_PATH).'/exercice/hotpotatoes.lib.php');
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 
65 65
 <?php
66 66
 if (isset($newName)) {
67
-    if ($newName!="") {
67
+    if ($newName != "") {
68 68
         //alter database record for that test
69
-        SetComment($hotpotatoesName,$newName);
69
+        SetComment($hotpotatoesName, $newName);
70 70
         echo "<script language='Javascript' type='text/javascript'> window.location='exercise.php'; </script>";
71 71
     }
72 72
 }
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 
79 79
 $lstrComment = "";
80 80
 $lstrComment = GetComment($hotpotatoesName);
81
-if ($lstrComment=="") {
82
-    $lstrComment = GetQuizName($hotpotatoesName,$documentPath);
81
+if ($lstrComment == "") {
82
+    $lstrComment = GetQuizName($hotpotatoesName, $documentPath);
83 83
 }
84
-if ($lstrComment=="") {
85
-    $lstrComment = basename($hotpotatoesName,$documentPath);
84
+if ($lstrComment == "") {
85
+    $lstrComment = basename($hotpotatoesName, $documentPath);
86 86
 }
87 87
 
88 88
 echo $lstrComment;
Please login to merge, or discard this patch.
main/exercice/question_pool.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 }
49 49
 
50 50
 $nameTools = get_lang('QuestionPool');
51
-$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
51
+$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
52 52
 
53 53
 if (!empty($objExercise)) {
54 54
     $interbreadcrumb[] = array(
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         if ($old_question_obj) {
75 75
             $old_question_obj->updateTitle(
76
-                $old_question_obj->selectTitle() . ' - ' . get_lang('Copy')
76
+                $old_question_obj->selectTitle().' - '.get_lang('Copy')
77 77
             );
78 78
             //Duplicating the source question, in the current course
79 79
             $new_id = $old_question_obj->duplicate($current_course);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         }
108 108
         // destruction of the Question object
109 109
         unset($objQuestionTmp);
110
-    } elseif($recup && $fromExercise) {
110
+    } elseif ($recup && $fromExercise) {
111 111
         // gets an existing question and copies it into a new exercise
112 112
         $objQuestionTmp = Question :: read($recup);
113 113
         // if the question exists
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 $old_question_obj = Question::read($old_question_id, $origin_course_id);
140 140
                 if ($old_question_obj) {
141 141
                     $old_question_obj->updateTitle(
142
-                        $old_question_obj->selectTitle() . ' - ' . get_lang('Copy')
142
+                        $old_question_obj->selectTitle().' - '.get_lang('Copy')
143 143
                     );
144 144
 
145 145
                     //Duplicating the source question, in the current course
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
                 }
168 168
             }
169 169
         }
170
-        Session::write('objExercise',$objExercise);
170
+        Session::write('objExercise', $objExercise);
171 171
     }
172 172
 }
173 173
 
174
-if (isset($_SESSION['gradebook'])){
175
-	$gradebook=	$_SESSION['gradebook'];
174
+if (isset($_SESSION['gradebook'])) {
175
+	$gradebook = $_SESSION['gradebook'];
176 176
 }
177 177
 
178
-if (!empty($gradebook) && $gradebook=='view') {
179
-	$interbreadcrumb[]= array ('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook'));
178
+if (!empty($gradebook) && $gradebook == 'view') {
179
+	$interbreadcrumb[] = array('url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('ToolGradebook'));
180 180
 }
181 181
 
182 182
 // if admin of course
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
 }
217 217
 if (isset($fromExercise) && $fromExercise > 0) {
218 218
     echo '<a href="admin.php?'.api_get_cidreq().'&exerciseId='.$fromExercise.'">'.
219
-            Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
219
+            Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
220 220
     $titleAdd = get_lang('AddQuestionToTest');
221 221
 } else {
222 222
     echo '<a href="exercise.php?'.api_get_cidReq().'">'.
223
-        Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
223
+        Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>';
224 224
     echo "<a href='admin.php?exerciseId=0'>".Display::return_icon('add_question.gif', get_lang('NewQu'), '', ICON_SIZE_MEDIUM)."</a>";
225 225
     $titleAdd = get_lang('ManageAllQuestions');
226 226
 }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 foreach ($sessionList as $item) {
250 250
     $session_select_list[$item['session_id']] = $item['session_name'];
251 251
 }
252
-$select_session_html =  Display::select('session_id', $session_select_list, $session_id, $tabAttrParam);
252
+$select_session_html = Display::select('session_id', $session_select_list, $session_id, $tabAttrParam);
253 253
 echo Display::form_row($labelFormRow, $select_session_html);
254 254
 
255 255
 // Course list, get course list of session, or for course where user is admin
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	$course_select_list[$courseItemId] .= $courseInfo['title'];
291 291
 }
292 292
 
293
-$select_course_html =  Display::select(
293
+$select_course_html = Display::select(
294 294
     'selected_course',
295 295
     $course_select_list,
296 296
     $selected_course,
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 $my_exercise_list['0']  = get_lang('AllExercises');
347 347
 $my_exercise_list['-1'] = get_lang('OrphanQuestions');
348 348
 if (is_array($exercise_list)) {
349
-    foreach($exercise_list as $row) {
349
+    foreach ($exercise_list as $row) {
350 350
         $my_exercise_list[$row['id']] = "";
351
-        if ($row['id'] ==  $fromExercise && $selected_course == api_get_course_int_id()) {
351
+        if ($row['id'] == $fromExercise && $selected_course == api_get_course_int_id()) {
352 352
             $my_exercise_list[$row['id']] = ">&nbsp;&nbsp;&nbsp;&nbsp;";
353 353
         }
354 354
         $my_exercise_list[$row['id']] .= $row['title'];
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 if ($exercise_id_changed == 1) {
359 359
 	reset_menu_lvl_type();
360 360
 }
361
-$select_exercise_html =  Display::select(
361
+$select_exercise_html = Display::select(
362 362
     'exerciseId',
363 363
     $my_exercise_list,
364 364
     $exerciseId,
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 $question_list = Question::get_question_type_list();
392 392
 
393 393
 $new_question_list = array();
394
-$new_question_list['-1']  = get_lang('All');
394
+$new_question_list['-1'] = get_lang('All');
395 395
 if (!empty($_course)) {
396 396
     $objExercise = new Exercise();
397 397
     $objExercise->read($fromExercise);
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
             ORDER BY question_order";
465 465
 
466 466
     $result = Database::query($sql);
467
-    while($row = Database::fetch_array($result, 'ASSOC')) {
467
+    while ($row = Database::fetch_array($result, 'ASSOC')) {
468 468
         $mainQuestionList[] = $row;
469 469
     }
470 470
 } elseif ($exerciseId == -1) {
@@ -477,11 +477,11 @@  discard block
 block discarded – undo
477 477
 		        crc.c_id = $selected_course AND
478 478
 		        crc.category_id = $courseCategoryId";
479 479
 	}
480
-	if (isset($exerciseLevel) && $exerciseLevel!= -1 ) {
480
+	if (isset($exerciseLevel) && $exerciseLevel != -1) {
481 481
 		$level_where = ' AND level='.$exerciseLevel;
482 482
 	}
483 483
 	$answer_where = '';
484
-	if (isset($answerType) && $answerType >0 -1 ) {
484
+	if (isset($answerType) && $answerType > 0 - 1) {
485 485
 		$answer_where = ' AND type='.$answerType;
486 486
 	}
487 487
 
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
                     $level_where $answer_where
522 522
              )";
523 523
     $result = Database::query($sql);
524
-    while($row = Database::fetch_array($result, 'ASSOC')) {
524
+    while ($row = Database::fetch_array($result, 'ASSOC')) {
525 525
         $mainQuestionList[] = $row;
526 526
     }
527 527
 } else {
Please login to merge, or discard this patch.
main/gradebook/gradebook_showlog_eval.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
 api_block_anonymous_users();
10 10
 GradebookUtils::block_students();
11 11
 
12
-$interbreadcrumb[] = array (
12
+$interbreadcrumb[] = array(
13 13
     'url' => $_SESSION['gradebook_dest'].'?',
14 14
     'name' => get_lang('Gradebook'
15 15
 ));
16
-$interbreadcrumb[] = array (
16
+$interbreadcrumb[] = array(
17 17
     'url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['selectcat']),
18 18
     'name' => get_lang('Details'
19 19
 ));
20
-$interbreadcrumb[] = array (
20
+$interbreadcrumb[] = array(
21 21
     'url' => 'gradebook_showlog_eval.php?visiblelog='.Security::remove_XSS($_GET['visiblelog']).'&amp;selectcat='.Security::remove_XSS($_GET['selectcat']),
22 22
     'name' => get_lang('GradebookQualifyLog')
23 23
 );
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 $t_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
30 30
 $t_user = Database :: get_main_table(TABLE_MAIN_USER);
31
-$visible_log=Security::remove_XSS($_GET['visiblelog']);
31
+$visible_log = Security::remove_XSS($_GET['visiblelog']);
32 32
 
33 33
 $evaledit = Evaluation :: load($visible_log);
34 34
 $sql = "SELECT le.name,le.description,le.weight,le.visible,le.type,le.created_at,us.username
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
     $list_info[] = $row;
43 43
 }
44 44
 
45
-foreach($list_info as $key => $info_log) {
46
-    $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
47
-    $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
45
+foreach ($list_info as $key => $info_log) {
46
+    $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
47
+    $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
48 48
 }
49 49
 
50 50
 $parameters = array(
Please login to merge, or discard this patch.
main/gradebook/gradebook_edit_cat.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $cat->setGenerateCertificates(false);
63 63
     }
64 64
 
65
-    if ($values['hid_parent_id'] == 0 ) {
65
+    if ($values['hid_parent_id'] == 0) {
66 66
         $cat->set_certificate_min_score($values['certif_min_score']);
67 67
     }
68 68
 
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
     }
82 82
 
83 83
     $cat->save();
84
-    header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?editcat=&selectcat=' . $cat->get_parent_id().'&'.api_get_cidreq());
84
+    header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?editcat=&selectcat='.$cat->get_parent_id().'&'.api_get_cidreq());
85 85
     exit;
86 86
 }
87 87
 $selectcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : '';
88 88
 $interbreadcrumb[] = array(
89
-    'url' => Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $selectcat . '&' . api_get_cidreq(),
89
+    'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectcat.'&'.api_get_cidreq(),
90 90
     'name' => get_lang('Gradebook')
91 91
 );
92 92
 $this_section = SECTION_COURSES;
Please login to merge, or discard this patch.
main/gradebook/gradebook_edit_eval.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     null,
21 21
     'edit_eval_form',
22 22
     null,
23
-    api_get_self() . '?editeval=' . Security::remove_XSS($_GET['editeval'])
23
+    api_get_self().'?editeval='.Security::remove_XSS($_GET['editeval'])
24 24
 );
25 25
 if ($form->validate()) {
26 26
     $values = $form->exportValues();
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     }
46 46
     $eval->set_visible($visible);
47 47
     $eval->save();
48
-    header('Location: '.$_SESSION['gradebook_dest'].'?editeval=&selectcat=' . $eval->get_category_id());
48
+    header('Location: '.$_SESSION['gradebook_dest'].'?editeval=&selectcat='.$eval->get_category_id());
49 49
     exit;
50 50
 }
51
-$selectcat_inter=isset($_GET['selectcat'])?Security::remove_XSS($_GET['selectcat']):'';
52
-$interbreadcrumb[] = array (
51
+$selectcat_inter = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : '';
52
+$interbreadcrumb[] = array(
53 53
     'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectcat_inter,
54 54
     'name' => get_lang('Gradebook'
55 55
     ));
Please login to merge, or discard this patch.
main/gradebook/index.php 1 patch
Spacing   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 //$cidReset = false;
12 12
 $_in_course = true;
13 13
 require_once '../inc/global.inc.php';
14
-$current_course_tool  = TOOL_GRADEBOOK;
14
+$current_course_tool = TOOL_GRADEBOOK;
15 15
 
16 16
 api_protect_course_script(true);
17 17
 
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 });
81 81
 </script>';
82 82
 api_block_anonymous_users();
83
-$htmlHeadXtra[]= '<script type="text/javascript">
83
+$htmlHeadXtra[] = '<script type="text/javascript">
84 84
 function confirmation() {
85
-	if (confirm("' . get_lang('DeleteAll') . '?")) {
85
+	if (confirm("' . get_lang('DeleteAll').'?")) {
86 86
 		return true;
87 87
 	} else {
88 88
 		return false;
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 $_GET['selectcat'] = $cats[0]->get_id();
110 110
 
111 111
 if (isset($_GET['isStudentView'])) {
112
-    if ( (isset($_GET['selectcat']) && $_GET['selectcat']>0) && (isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview') ) {
113
-        $interbreadcrumb[]= array ('url' => 'index.php'.'?selectcat=0&amp;isStudentView='.$_GET['isStudentView'],'name' => get_lang('ToolGradebook'));
112
+    if ((isset($_GET['selectcat']) && $_GET['selectcat'] > 0) && (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'studentview')) {
113
+        $interbreadcrumb[] = array('url' => 'index.php'.'?selectcat=0&amp;isStudentView='.$_GET['isStudentView'], 'name' => get_lang('ToolGradebook'));
114 114
     }
115 115
 }
116 116
 
117
-if ((isset($_GET['selectcat']) && $_GET['selectcat']>0) &&
118
-    (isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview')
117
+if ((isset($_GET['selectcat']) && $_GET['selectcat'] > 0) &&
118
+    (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'studentview')
119 119
 ) {
120 120
     /*Display :: display_header();
121 121
     //Introduction tool: student view
@@ -132,19 +132,19 @@  discard block
 block discarded – undo
132 132
     exit;*/
133 133
 } else {
134 134
     if (!isset($_GET['selectcat']) &&
135
-        ($_SESSION['studentview']=='studentview') ||
136
-        (isset($_GET['isStudentView']) && $_GET['isStudentView']=='true')
135
+        ($_SESSION['studentview'] == 'studentview') ||
136
+        (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true')
137 137
     ) {
138 138
         Display :: display_header(get_lang('Gradebook'));
139 139
 
140 140
         //Introduction tool: student view
141 141
         Display::display_introduction_section(TOOL_GRADEBOOK, array('ToolbarSet' => 'AssessmentsIntroduction'));
142
-        $addparams=array();
143
-        $cats = Category :: load (0, null, null, null, null, null, false);
144
-        $allcat= $cats[0]->get_subcategories($stud_id, $course_code, $session_id);
145
-        $alleval= $cats[0]->get_evaluations($stud_id);
146
-        $alllink= $cats[0]->get_links($stud_id);
147
-        $gradebooktable= new GradebookTable($cats[0], $allcat, $alleval,$alllink, $addparams);
142
+        $addparams = array();
143
+        $cats = Category :: load(0, null, null, null, null, null, false);
144
+        $allcat = $cats[0]->get_subcategories($stud_id, $course_code, $session_id);
145
+        $alleval = $cats[0]->get_evaluations($stud_id);
146
+        $alllink = $cats[0]->get_links($stud_id);
147
+        $gradebooktable = new GradebookTable($cats[0], $allcat, $alleval, $alllink, $addparams);
148 148
         $gradebooktable->display();
149 149
         Display :: display_footer();
150 150
         exit;
@@ -155,10 +155,10 @@  discard block
 block discarded – undo
155 155
 //this is called when there is no data for the course admin
156 156
 if (isset($_GET['createallcategories'])) {
157 157
     GradebookUtils::block_students();
158
-    $coursecat= Category :: get_not_created_course_categories($stud_id);
158
+    $coursecat = Category :: get_not_created_course_categories($stud_id);
159 159
     if (!count($coursecat) == 0) {
160 160
         foreach ($coursecat as $row) {
161
-            $cat= new Category();
161
+            $cat = new Category();
162 162
             $cat->set_name($row[1]);
163 163
             $cat->set_course_code($row[0]);
164 164
             $cat->set_description(null);
@@ -176,25 +176,25 @@  discard block
 block discarded – undo
176 176
 
177 177
 //show logs evaluations
178 178
 if (isset($_GET['visiblelog'])) {
179
-    header('Location: ' . api_get_self().'/gradebook_showlog_eval.php');
179
+    header('Location: '.api_get_self().'/gradebook_showlog_eval.php');
180 180
     exit;
181 181
 }
182 182
 
183 183
 //move a category
184 184
 if (isset($_GET['movecat'])) {
185 185
     GradebookUtils::block_students();
186
-    $cats= Category :: load($_GET['movecat']);
186
+    $cats = Category :: load($_GET['movecat']);
187 187
     if (!isset ($_GET['targetcat'])) {
188
-        $move_form= new CatForm(CatForm :: TYPE_MOVE,
188
+        $move_form = new CatForm(CatForm :: TYPE_MOVE,
189 189
             $cats[0],
190 190
             'move_cat_form',
191 191
             null,
192
-            api_get_self() . '?movecat=' . Security::remove_XSS($_GET['movecat'])
193
-            . '&selectcat=' . Security::remove_XSS($_GET['selectcat']));
192
+            api_get_self().'?movecat='.Security::remove_XSS($_GET['movecat'])
193
+            . '&selectcat='.Security::remove_XSS($_GET['selectcat']));
194 194
         if ($move_form->validate()) {
195
-            header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat'])
196
-                . '&movecat=' . Security::remove_XSS($_GET['movecat'])
197
-                . '&targetcat=' . $move_form->exportValue('move_cat'));
195
+            header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat'])
196
+                . '&movecat='.Security::remove_XSS($_GET['movecat'])
197
+                . '&targetcat='.$move_form->exportValue('move_cat'));
198 198
             exit;
199 199
         }
200 200
     } else {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 
204 204
         if (!($course_to_crsind && !isset($_GET['confirm']))) {
205 205
             $cats[0]->move_to_cat($targetcat[0]);
206
-            header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . Security::remove_XSS($_GET['selectcat']));
206
+            header('Location: '.api_get_self().'?categorymoved=&selectcat='.Security::remove_XSS($_GET['selectcat']));
207 207
             exit;
208 208
         }
209 209
         unset ($targetcat);
@@ -214,30 +214,30 @@  discard block
 block discarded – undo
214 214
 //move an evaluation
215 215
 if (isset($_GET['moveeval'])) {
216 216
     GradebookUtils::block_students();
217
-    $evals= Evaluation :: load($_GET['moveeval']);
217
+    $evals = Evaluation :: load($_GET['moveeval']);
218 218
     if (!isset ($_GET['targetcat'])) {
219 219
 
220
-        $move_form= new EvalForm(EvalForm :: TYPE_MOVE,
220
+        $move_form = new EvalForm(EvalForm :: TYPE_MOVE,
221 221
             $evals[0],
222 222
             null,
223 223
             'move_eval_form',
224 224
             null,
225
-            api_get_self() . '?moveeval=' . Security::remove_XSS($_GET['moveeval'])
226
-            . '&selectcat=' . Security::remove_XSS($_GET['selectcat']));
225
+            api_get_self().'?moveeval='.Security::remove_XSS($_GET['moveeval'])
226
+            . '&selectcat='.Security::remove_XSS($_GET['selectcat']));
227 227
 
228 228
         if ($move_form->validate()) {
229
-            header('Location: ' .api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat'])
230
-                . '&moveeval=' . Security::remove_XSS($_GET['moveeval'])
231
-                . '&targetcat=' . $move_form->exportValue('move_cat'));
229
+            header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat'])
230
+                . '&moveeval='.Security::remove_XSS($_GET['moveeval'])
231
+                . '&targetcat='.$move_form->exportValue('move_cat'));
232 232
             exit;
233 233
         }
234 234
     } else {
235
-        $targetcat= Category :: load($_GET['targetcat']);
235
+        $targetcat = Category :: load($_GET['targetcat']);
236 236
         $course_to_crsind = ($evals[0]->get_course_code() != null && $targetcat[0]->get_course_code() == null);
237 237
 
238 238
         if (!($course_to_crsind && !isset($_GET['confirm']))) {
239 239
             $evals[0]->move_to_cat($targetcat[0]);
240
-            header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat']));
240
+            header('Location: '.api_get_self().'?evaluationmoved=&selectcat='.Security::remove_XSS($_GET['selectcat']));
241 241
             exit;
242 242
         }
243 243
         unset ($targetcat);
@@ -248,21 +248,21 @@  discard block
 block discarded – undo
248 248
 //move a link
249 249
 if (isset($_GET['movelink'])) {
250 250
     GradebookUtils::block_students();
251
-    $link= LinkFactory :: load($_GET['movelink']);
251
+    $link = LinkFactory :: load($_GET['movelink']);
252 252
     $move_form = new LinkForm(
253 253
         LinkForm :: TYPE_MOVE,
254 254
         null,
255 255
         $link[0],
256 256
         'move_link_form',
257 257
         null,
258
-        api_get_self() . '?movelink=' . $_GET['movelink'] . '&selectcat=' . Security::remove_XSS($_GET['selectcat'])
258
+        api_get_self().'?movelink='.$_GET['movelink'].'&selectcat='.Security::remove_XSS($_GET['selectcat'])
259 259
     );
260 260
 
261 261
     if ($move_form->validate()) {
262
-        $targetcat= Category :: load($move_form->exportValue('move_cat'));
262
+        $targetcat = Category :: load($move_form->exportValue('move_cat'));
263 263
         $link[0]->move_to_cat($targetcat[0]);
264 264
         unset ($link);
265
-        header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat']));
265
+        header('Location: '.api_get_self().'?linkmoved=&selectcat='.Security::remove_XSS($_GET['selectcat']));
266 266
         exit;
267 267
     }
268 268
 }
@@ -272,9 +272,9 @@  discard block
 block discarded – undo
272 272
     GradebookUtils::block_students();
273 273
 
274 274
     if (isset($_GET['set_visible'])) {
275
-        $visibility_command= 1;
275
+        $visibility_command = 1;
276 276
     } else {
277
-        $visibility_command= 0;
277
+        $visibility_command = 0;
278 278
     }
279 279
     $cats = Category :: load($_GET['visiblecat']);
280 280
     $cats[0]->set_visible($visibility_command);
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
 if (isset($_GET['visibleeval'])) {
310 310
     GradebookUtils::block_students();
311 311
     if (isset ($_GET['set_visible'])) {
312
-        $visibility_command= 1;
312
+        $visibility_command = 1;
313 313
     } else {
314
-        $visibility_command= 0;
314
+        $visibility_command = 0;
315 315
     }
316
-    $eval= Evaluation :: load($_GET['visibleeval']);
316
+    $eval = Evaluation :: load($_GET['visibleeval']);
317 317
     $eval[0]->set_visible($visibility_command);
318 318
     $eval[0]->save();
319 319
     unset ($eval);
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 if (isset($_GET['lockedeval'])) {
331 331
     GradebookUtils::block_students();
332 332
     $locked = Security::remove_XSS($_GET['lockedeval']);
333
-    if (isset($_GET['typelocked']) && api_is_platform_admin()){
333
+    if (isset($_GET['typelocked']) && api_is_platform_admin()) {
334 334
         $type_locked = 0;
335 335
         $confirmation_message = get_lang('EvaluationHasBeenUnLocked');
336 336
     } else {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
 if (isset($_GET['deleteeval'])) {
349 349
     GradebookUtils::block_students();
350
-    $eval= Evaluation :: load($_GET['deleteeval']);
350
+    $eval = Evaluation :: load($_GET['deleteeval']);
351 351
     if ($eval[0] != null) {
352 352
         $eval[0]->delete_with_results();
353 353
     }
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
 if (isset($_GET['visiblelink'])) {
360 360
     GradebookUtils::block_students();
361 361
     if (isset ($_GET['set_visible'])) {
362
-        $visibility_command= 1;
362
+        $visibility_command = 1;
363 363
     } else {
364
-        $visibility_command= 0;
364
+        $visibility_command = 0;
365 365
     }
366
-    $link= LinkFactory :: load($_GET['visiblelink']);
366
+    $link = LinkFactory :: load($_GET['visiblelink']);
367 367
     if (isset($link) && isset($link[0])) {
368 368
         $link[0]->set_visible($visibility_command);
369 369
         $link[0]->save();
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
     $get_delete_link = intval($_GET['deletelink']);
386 386
     //fixing #5229
387 387
     if (!empty($get_delete_link)) {
388
-        $link= LinkFactory :: load($get_delete_link);
388
+        $link = LinkFactory :: load($get_delete_link);
389 389
         if ($link[0] != null) {
390 390
             // Clean forum qualify
391 391
             $sql = 'UPDATE '.$tbl_forum_thread.' SET
@@ -420,11 +420,11 @@  discard block
 block discarded – undo
420 420
     if (!isset($_GET['movecat']) && !isset($_GET['moveeval'])) {
421 421
         die ('Error: movecat or moveeval not defined');
422 422
     }
423
-    $button = '<form name="confirm" method="post" action="'.api_get_self() .'?confirm='
424
-        .(isset($_GET['movecat']) ? '&movecat=' . Security::remove_XSS($_GET['movecat'])
425
-            : '&moveeval=' . Security::remove_XSS($_GET['moveeval']) )
426
-        .'&selectcat=' . Security::remove_XSS($_GET['selectcat'])
427
-        .'&targetcat=' . Security::remove_XSS($_GET['targetcat']).'">
423
+    $button = '<form name="confirm" method="post" action="'.api_get_self().'?confirm='
424
+        .(isset($_GET['movecat']) ? '&movecat='.Security::remove_XSS($_GET['movecat'])
425
+            : '&moveeval='.Security::remove_XSS($_GET['moveeval']))
426
+        .'&selectcat='.Security::remove_XSS($_GET['selectcat'])
427
+        .'&targetcat='.Security::remove_XSS($_GET['targetcat']).'">
428 428
 			   <input type="submit" value="'.get_lang('Ok').'">
429 429
 			   </form>';
430 430
     $warning_message = get_lang('MoveWarning').'<br><br>'.$button;
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 //actions on the sortabletable
456 456
 if (isset($_POST['action'])) {
457 457
     GradebookUtils::block_students();
458
-    $number_of_selected_items= count($_POST['id']);
458
+    $number_of_selected_items = count($_POST['id']);
459 459
 
460 460
     if ($number_of_selected_items == '0') {
461 461
         $warning_message = get_lang('NoItemsSelected');
@@ -463,19 +463,19 @@  discard block
 block discarded – undo
463 463
     } else {
464 464
         switch ($_POST['action']) {
465 465
             case 'deleted':
466
-                $number_of_deleted_categories= 0;
467
-                $number_of_deleted_evaluations= 0;
468
-                $number_of_deleted_links= 0;
466
+                $number_of_deleted_categories = 0;
467
+                $number_of_deleted_evaluations = 0;
468
+                $number_of_deleted_links = 0;
469 469
                 foreach ($_POST['id'] as $indexstr) {
470 470
                     if (substr($indexstr, 0, 4) == 'CATE') {
471
-                        $cats= Category :: load(substr($indexstr, 4));
471
+                        $cats = Category :: load(substr($indexstr, 4));
472 472
                         if ($cats[0] != null) {
473 473
                             $cats[0]->delete_all();
474 474
                         }
475 475
                         $number_of_deleted_categories++;
476 476
                     }
477 477
                     if (substr($indexstr, 0, 4) == 'EVAL') {
478
-                        $eval= Evaluation :: load(substr($indexstr, 4));
478
+                        $eval = Evaluation :: load(substr($indexstr, 4));
479 479
                         if ($eval[0] != null) {
480 480
                             $eval[0]->delete_with_results();
481 481
                         }
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
                         //fixing #5229
487 487
                         $id = substr($indexstr, 4);
488 488
                         if (!empty($id)) {
489
-                            $link= LinkFactory :: load($id);
489
+                            $link = LinkFactory :: load($id);
490 490
                             if ($link[0] != null) {
491 491
                                 $link[0]->delete();
492 492
                             }
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                         }
495 495
                     }
496 496
                 }
497
-                $confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br />' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br />' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br /><br />' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>';
497
+                $confirmation_message = get_lang('DeletedCategories').' : <b>'.$number_of_deleted_categories.'</b><br />'.get_lang('DeletedEvaluations').' : <b>'.$number_of_deleted_evaluations.'</b><br />'.get_lang('DeletedLinks').' : <b>'.$number_of_deleted_links.'</b><br /><br />'.get_lang('TotalItems').' : <b>'.$number_of_selected_items.'</b>';
498 498
                 $filter_confirm_msg = false;
499 499
                 break;
500 500
             case 'setvisible':
@@ -506,12 +506,12 @@  discard block
 block discarded – undo
506 506
                         $cats[0]->apply_visibility_to_children();
507 507
                     }
508 508
                     if (substr($indexstr, 0, 4) == 'EVAL') {
509
-                        $eval= Evaluation :: load(substr($indexstr, 4));
509
+                        $eval = Evaluation :: load(substr($indexstr, 4));
510 510
                         $eval[0]->set_visible(1);
511 511
                         $eval[0]->save();
512 512
                     }
513 513
                     if (substr($indexstr, 0, 4) == 'LINK') {
514
-                        $link= LinkFactory :: load(substr($indexstr, 4));
514
+                        $link = LinkFactory :: load(substr($indexstr, 4));
515 515
                         $link[0]->set_visible(1);
516 516
                         $link[0]->save();
517 517
                     }
@@ -528,12 +528,12 @@  discard block
 block discarded – undo
528 528
                         $cats[0]->apply_visibility_to_children();
529 529
                     }
530 530
                     if (substr($indexstr, 0, 4) == 'EVAL') {
531
-                        $eval= Evaluation :: load(substr($indexstr, 4));
531
+                        $eval = Evaluation :: load(substr($indexstr, 4));
532 532
                         $eval[0]->set_visible(0);
533 533
                         $eval[0]->save();
534 534
                     }
535 535
                     if (substr($indexstr, 0, 4) == 'LINK') {
536
-                        $link= LinkFactory :: load(substr($indexstr, 4));
536
+                        $link = LinkFactory :: load(substr($indexstr, 4));
537 537
                         $link[0]->set_visible(0);
538 538
                         $link[0]->save();
539 539
                     }
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 }
547 547
 
548 548
 if (isset ($_POST['submit']) && isset ($_POST['keyword'])) {
549
-    header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat'])
549
+    header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat'])
550 550
         . '&search='.Security::remove_XSS($_POST['keyword']));
551 551
     exit;
552 552
 }
@@ -554,13 +554,13 @@  discard block
 block discarded – undo
554 554
 // DISPLAY HEADERS AND MESSAGES
555 555
 if (!isset($_GET['exportpdf'])) {
556 556
     if (isset ($_GET['studentoverview'])) {
557
-        $interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat']),'name' => get_lang('ToolGradebook'));
557
+        $interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('ToolGradebook'));
558 558
         Display :: display_header(get_lang('FlatView'));
559 559
     } elseif (isset ($_GET['search'])) {
560
-        $interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat']),'name' => get_lang('ToolGradebook'));
560
+        $interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('ToolGradebook'));
561 561
         Display :: display_header(get_lang('SearchResults'));
562
-    } elseif(isset ($_GET['selectcat'])) {
563
-        $interbreadcrumb[]= array (	'url' =>'#','name' => get_lang('ToolGradebook'));
562
+    } elseif (isset ($_GET['selectcat'])) {
563
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('ToolGradebook'));
564 564
         if (!isset($_GET['gradebooklist_direction'])) {
565 565
             //$interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details'));
566 566
         }
@@ -571,46 +571,46 @@  discard block
 block discarded – undo
571 571
 }
572 572
 
573 573
 if (isset ($_GET['categorymoved'])) {
574
-    Display :: display_confirmation_message(get_lang('CategoryMoved'),false);
574
+    Display :: display_confirmation_message(get_lang('CategoryMoved'), false);
575 575
 }
576 576
 if (isset ($_GET['evaluationmoved'])) {
577
-    Display :: display_confirmation_message(get_lang('EvaluationMoved'),false);
577
+    Display :: display_confirmation_message(get_lang('EvaluationMoved'), false);
578 578
 }
579 579
 if (isset ($_GET['linkmoved'])) {
580
-    Display :: display_confirmation_message(get_lang('LinkMoved'),false);
580
+    Display :: display_confirmation_message(get_lang('LinkMoved'), false);
581 581
 }
582 582
 if (isset ($_GET['addcat'])) {
583
-    Display :: display_confirmation_message(get_lang('CategoryAdded'),false);
583
+    Display :: display_confirmation_message(get_lang('CategoryAdded'), false);
584 584
 }
585 585
 if (isset ($_GET['linkadded'])) {
586
-    Display :: display_confirmation_message(get_lang('LinkAdded'),false);
586
+    Display :: display_confirmation_message(get_lang('LinkAdded'), false);
587 587
 }
588 588
 if (isset ($_GET['addresult'])) {
589
-    Display :: display_confirmation_message(get_lang('ResultAdded'),false);
589
+    Display :: display_confirmation_message(get_lang('ResultAdded'), false);
590 590
 }
591 591
 if (isset ($_GET['editcat'])) {
592
-    Display :: display_confirmation_message(get_lang('CategoryEdited'),false);
592
+    Display :: display_confirmation_message(get_lang('CategoryEdited'), false);
593 593
 }
594 594
 if (isset ($_GET['editeval'])) {
595
-    Display :: display_confirmation_message(get_lang('EvaluationEdited'),false);
595
+    Display :: display_confirmation_message(get_lang('EvaluationEdited'), false);
596 596
 }
597 597
 if (isset ($_GET['linkedited'])) {
598
-    Display :: display_confirmation_message(get_lang('LinkEdited'),false);
598
+    Display :: display_confirmation_message(get_lang('LinkEdited'), false);
599 599
 }
600
-if (isset ($_GET['nolinkitems'])){
601
-    Display :: display_warning_message(get_lang('NoLinkItems'),false);
600
+if (isset ($_GET['nolinkitems'])) {
601
+    Display :: display_warning_message(get_lang('NoLinkItems'), false);
602 602
 }
603
-if (isset ($_GET['addallcat'])){
604
-    Display :: display_normal_message(get_lang('AddAllCat'),false);
603
+if (isset ($_GET['addallcat'])) {
604
+    Display :: display_normal_message(get_lang('AddAllCat'), false);
605 605
 }
606
-if (isset ($confirmation_message)){
607
-    Display :: display_confirmation_message($confirmation_message,$filter_confirm_msg);
606
+if (isset ($confirmation_message)) {
607
+    Display :: display_confirmation_message($confirmation_message, $filter_confirm_msg);
608 608
 }
609
-if (isset ($warning_message)){
610
-    Display :: display_warning_message($warning_message,$filter_warning_msg);
609
+if (isset ($warning_message)) {
610
+    Display :: display_warning_message($warning_message, $filter_warning_msg);
611 611
 }
612
-if (isset ($move_form)){
613
-    Display :: display_normal_message($move_form->toHtml(),false);
612
+if (isset ($move_form)) {
613
+    Display :: display_normal_message($move_form->toHtml(), false);
614 614
 }
615 615
 
616 616
 // LOAD DATA & DISPLAY TABLE
@@ -624,17 +624,17 @@  discard block
 block discarded – undo
624 624
 } else {
625 625
     $category = $_GET['selectcat'];
626 626
 }
627
-$simple_search_form='';
627
+$simple_search_form = '';
628 628
 
629 629
 if (isset($_GET['studentoverview'])) {
630 630
     //@todo this code also seems to be deprecated ...
631 631
     $cats = Category :: load($category);
632
-    $stud_id= (api_is_allowed_to_edit() ? null : $stud_id);
632
+    $stud_id = (api_is_allowed_to_edit() ? null : $stud_id);
633 633
     $allcat = $cats[0]->get_subcategories($stud_id, $course_code, $session_id);
634
-    $alleval= $cats[0]->get_evaluations($stud_id, true);
635
-    $alllink= $cats[0]->get_links($stud_id, true);
634
+    $alleval = $cats[0]->get_evaluations($stud_id, true);
635
+    $alllink = $cats[0]->get_links($stud_id, true);
636 636
     if (isset ($_GET['exportpdf'])) {
637
-        $datagen = new GradebookDataGenerator($allcat,$alleval, $alllink);
637
+        $datagen = new GradebookDataGenerator($allcat, $alleval, $alllink);
638 638
         $header_names = array(
639 639
             get_lang('Name'),
640 640
             get_lang('Description'),
@@ -642,18 +642,18 @@  discard block
 block discarded – undo
642 642
             get_lang('Date'),
643 643
             get_lang('Results'),
644 644
         );
645
-        $data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME,0,null,true);
645
+        $data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME, 0, null, true);
646 646
         $newarray = array();
647 647
         foreach ($data_array as $data) {
648 648
             $newarray[] = array_slice($data, 1);
649 649
         }
650
-        $pdf= new Cezpdf();
650
+        $pdf = new Cezpdf();
651 651
         $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm');
652 652
         $pdf->ezSetMargins(30, 30, 50, 30);
653 653
         $pdf->ezSetY(810);
654
-        $pdf->ezText(get_lang('FlatView').' ('. api_convert_and_format_date(null, DATE_FORMAT_SHORT). ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) .')',12,array('justification'=>'center'));
655
-        $pdf->line(50,790,550,790);
656
-        $pdf->line(50,40,550,40);
654
+        $pdf->ezText(get_lang('FlatView').' ('.api_convert_and_format_date(null, DATE_FORMAT_SHORT).' '.api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).')', 12, array('justification'=>'center'));
655
+        $pdf->line(50, 790, 550, 790);
656
+        $pdf->line(50, 40, 550, 40);
657 657
         $pdf->ezSetY(750);
658 658
         $pdf->ezTable(
659 659
             $newarray,
@@ -744,10 +744,10 @@  discard block
 block discarded – undo
744 744
     $addparams['studentoverview'] = '';
745 745
 }
746 746
 //$addparams['cidReq']='';
747
-if (isset($_GET['cidReq']) && $_GET['cidReq']!='') {
747
+if (isset($_GET['cidReq']) && $_GET['cidReq'] != '') {
748 748
     $addparams['cidReq'] = Security::remove_XSS($_GET['cidReq']);
749 749
 } else {
750
-    $addparams['cidReq']='';
750
+    $addparams['cidReq'] = '';
751 751
 }
752 752
 
753 753
 $no_qualification = false;
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
                 $stud_id
772 772
             );
773 773
             if (isset($certificate['pdf_url'])) {
774
-                $actionsLeft .= Display::url(Display::returnFontAwesomeIcon('file-pdf-o') .
774
+                $actionsLeft .= Display::url(Display::returnFontAwesomeIcon('file-pdf-o').
775 775
                     get_lang('DownloadCertificatePdf'),
776 776
                     $certificate['pdf_url'],
777 777
                     ['class' => 'btn btn-default']
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 
787 787
 if (!api_is_allowed_to_edit(null, true)) {
788 788
     $actionsLeft .= Display::url(
789
-            Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadReportPdf'),
789
+            Display::returnFontAwesomeIcon('file-pdf-o').get_lang('DownloadReportPdf'),
790 790
             api_get_self()."?".api_get_self()."&action=export_table",
791 791
             ['class' => 'btn btn-default']
792 792
     );
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
     // Tool introduction
799 799
     Display::display_introduction_section(TOOL_GRADEBOOK, array('ToolbarSet' => 'AssessmentsIntroduction'));
800 800
 
801
-    if ((isset ($_GET['selectcat']) && $_GET['selectcat']<>0)) {
801
+    if ((isset ($_GET['selectcat']) && $_GET['selectcat'] <> 0)) {
802 802
         //
803 803
     } else {
804 804
         if ((
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
     }
821 821
 }
822 822
 
823
-if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) {
823
+if (isset($first_time) && $first_time == 1 && api_is_allowed_to_edit(null, true)) {
824 824
     echo '<meta http-equiv="refresh" content="0;url='.api_get_self().'?cidReq='.$course_code.'" />';
825 825
 } else {
826 826
     $cats = Category::load(null, null, $course_code, null, null, $session_id, false);
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
                         $components = $obj->get_components($value);
858 858
 
859 859
                         foreach ($components as $component) {
860
-                            $gradebook =  new Gradebook();
860
+                            $gradebook = new Gradebook();
861 861
                             $params = array();
862 862
 
863 863
                             $params['name'] = $component['acronym'];
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
                     $certificate
906 906
                 );
907 907
 
908
-                if (api_is_allowed_to_edit(null,true) &&
908
+                if (api_is_allowed_to_edit(null, true) &&
909 909
                     api_get_setting('gradebook_enable_grade_model') == 'true'
910 910
                 ) {
911 911
                     //Showing the grading system
Please login to merge, or discard this patch.
main/gradebook/gradebook_display_certificate.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package chamilo.gradebook
7 7
  */
8 8
 require_once '../inc/global.inc.php';
9
-$current_course_tool  = TOOL_GRADEBOOK;
9
+$current_course_tool = TOOL_GRADEBOOK;
10 10
 
11 11
 if (!api_is_student_boss()) {
12 12
     api_protect_course_script(true);
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 ini_set('max_execution_time', 0);
17 17
 
18 18
 //extra javascript functions for in html head:
19
-$htmlHeadXtra[] ="<script>
19
+$htmlHeadXtra[] = "<script>
20 20
 function confirmation() {
21
-	if (confirm(\" " . trim(get_lang('AreYouSureToDelete')) . " ?\")) {
21
+	if (confirm(\" " . trim(get_lang('AreYouSureToDelete'))." ?\")) {
22 22
 	    return true;
23 23
 	} else {
24 24
 	    return false;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     api_not_allowed(true);
32 32
 }
33 33
 
34
-$cat_id = isset($_GET['cat_id']) ? (int)$_GET['cat_id'] : null;
34
+$cat_id = isset($_GET['cat_id']) ? (int) $_GET['cat_id'] : null;
35 35
 $action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null;
36 36
 $filterOfficialCode = isset($_POST['filter']) ? Security::remove_XSS($_POST['filter']) : null;
37 37
 $filterOfficialCodeGet = isset($_GET['filter']) ? Security::remove_XSS($_GET['filter']) : null;
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
 $course_code = api_get_course_id();
74 74
 
75
-$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?',	'name' => get_lang('Gradebook'));
76
-$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsCertificates'));
75
+$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook'));
76
+$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsCertificates'));
77 77
 
78 78
 $this_section = SECTION_COURSES;
79 79
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $certificate = new Certificate($_GET['certificate_id']);
86 86
         $result = $certificate->delete(true);
87 87
         Security::clear_token();
88
-        if ($result ==true) {
88
+        if ($result == true) {
89 89
             Display::display_confirmation_message(get_lang('CertificateRemoved'));
90 90
         } else {
91 91
             Display::display_error_message(get_lang('CertificateNotRemoved'));
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 
105 105
     //with this fix the teacher only can view 1 gradebook
106 106
     if (api_is_platform_admin()) {
107
-        $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id());
107
+        $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id());
108 108
     } else {
109
-        $stud_id= api_get_user_id();
109
+        $stud_id = api_get_user_id();
110 110
     }
111 111
 
112 112
     $total_weight = $cats[0]->get_weight();
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     $alleval = $cats[0]->get_evaluations($stud_id);
116 116
     $alllink = $cats[0]->get_links($stud_id);
117 117
 
118
-    $datagen = new GradebookDataGenerator ($allcat,$alleval, $alllink);
118
+    $datagen = new GradebookDataGenerator($allcat, $alleval, $alllink);
119 119
 
120 120
     $total_resource_weight = 0;
121 121
     if (!empty($datagen)) {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                 $newarray[] = array_slice($data, 1);
133 133
             }
134 134
 
135
-            foreach($newarray as $item) {
135
+            foreach ($newarray as $item) {
136 136
                 $total_resource_weight = $total_resource_weight + $item['2'];
137 137
             }
138 138
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 if ($filter === 'true') {
151 151
     echo '<br />';
152 152
     $options = UserManager::getOfficialCodeGrouped();
153
-    $options =array_merge(array('all' => get_lang('All')), $options);
153
+    $options = array_merge(array('all' => get_lang('All')), $options);
154 154
     $form = new FormValidator(
155 155
         'official_code_filter',
156 156
         'POST',
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
 echo $filterForm;
198 198
 
199
-if (count($certificate_list) == 0 ) {
199
+if (count($certificate_list) == 0) {
200 200
     echo Display::display_warning_message(get_lang('NoResultsAvailable'));
201 201
 } else {
202 202
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             $certificates = Display::url(get_lang('Certificate'), $url, array('target'=>'_blank', 'class' => 'btn btn-default'));
220 220
             echo $certificates;
221 221
             echo '<a onclick="return confirmation();" href="gradebook_display_certificate.php?sec_token='.$token.'&cidReq='.$course_code.'&action=delete&cat_id='.$cat_id.'&certificate_id='.$value_certificate['id'].'">
222
-                    '.Display::return_icon('delete.png',get_lang('Delete')).'
222
+                    '.Display::return_icon('delete.png', get_lang('Delete')).'
223 223
                   </a>';
224 224
             echo '</td></tr>';
225 225
         }
Please login to merge, or discard this patch.