Completed
Push — 1.10.x ( 51aeba...107530 )
by Yannick
123:47 queued 78:53
created
main/exercice/export/scorm/scorm_classes.php 1 patch
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -327,8 +327,7 @@  discard block
 block discarded – undo
327 327
 		if($this->response == 'TRUE')
328 328
 		{
329 329
 	    	$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array(\'true\');'."\n";
330
-		}
331
-		else
330
+		} else
332 331
 		{
333 332
 	    	$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array(\'false\');'."\n";
334 333
 		}
@@ -471,8 +470,11 @@  discard block
 block discarded – undo
471 470
 
472 471
 				$s.='</select>&nbsp;&nbsp;</td>'."\n";
473 472
 				$s.='<td width="40%" valign="top">';
474
-				if(isset($Select[$cpt2])) $s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
475
-					else $s.='&nbsp;';
473
+				if(isset($Select[$cpt2])) {
474
+				    $s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
475
+				} else {
476
+					    $s.='&nbsp;';
477
+					}
476 478
 				$s.="</td>\n</tr>\n";
477 479
 
478 480
 				$jstmpc .= '['.$answerCorrect.','.$cpt2.'],';
@@ -577,8 +579,7 @@  discard block
 block discarded – undo
577 579
 			$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n";
578 580
 	    	$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][1] = 0;'.";\n";
579 581
 	    	$header .= $jstmpw;
580
-		}
581
-		else
582
+		} else
582 583
 		{
583 584
 			$header = '';
584 585
 			$header .= 'questions_answers['.$this->questionJSId.'] = new Array();'."\n";
@@ -885,8 +886,7 @@  discard block
 block discarded – undo
885 886
                 . $this->end_body()
886 887
                 . $this->end_page();
887 888
             return $res;
888
-        }
889
-        else
889
+        } else
890 890
         {
891 891
             return array($js,$html);
892 892
         }
Please login to merge, or discard this patch.
main/exercice/question.class.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -607,10 +607,11 @@
 block discarded – undo
607 607
             $current_width = $current_image_size['width'];
608 608
             $current_height = $current_image_size['height'];
609 609
 
610
-            if ($current_width < $Max && $current_height < $Max)
611
-                return true;
612
-            elseif ($current_height == "")
613
-                return false;
610
+            if ($current_width < $Max && $current_height < $Max) {
611
+                            return true;
612
+            } elseif ($current_height == "") {
613
+                            return false;
614
+            }
614 615
 
615 616
             // Resize according to height.
616 617
             if ($Dimension == "height") {
Please login to merge, or discard this patch.
main/exercice/unique_answer_no_option.class.php 1 patch
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -146,15 +146,17 @@  discard block
 block discarded – undo
146 146
                     $list_dest = $item_list[2];
147 147
                     $url = $item_list[3];
148 148
 
149
-                    if ($try == 0)
150
-                        $try_result = 0;
151
-                    else
152
-                        $try_result = 1;
149
+                    if ($try == 0) {
150
+                                            $try_result = 0;
151
+                    } else {
152
+                                            $try_result = 1;
153
+                    }
153 154
 
154
-                    if ($url == 0)
155
-                        $url_result = '';
156
-                    else
157
-                        $url_result = $url;
155
+                    if ($url == 0) {
156
+                                            $url_result = '';
157
+                    } else {
158
+                                            $url_result = $url;
159
+                    }
158 160
 
159 161
                     $temp_scenario['url' . $i] = $url_result;
160 162
                     $temp_scenario['try' . $i] = $try_result;
@@ -343,8 +345,9 @@  discard block
 block discarded – undo
343 345
                 }
344 346
         	}
345 347
 
346
- 			if (empty($try))
347
- 				$try=0;
348
+ 			if (empty($try)) {
349
+ 			 				$try=0;
350
+ 			}
348 351
 
349 352
  			if (empty($lp)) {
350 353
  				$lp=0;
Please login to merge, or discard this patch.
main/gradebook/gradebook.php 1 patch
Braces   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     GradebookUtils::block_students();
228 228
     if (isset ($_GET['set_visible'])) {
229 229
         $visibility_command= 1;
230
-    }else {
230
+    } else {
231 231
         $visibility_command= 0;
232 232
     }
233 233
     $link= LinkFactory :: load($_GET['visiblelink']);
@@ -281,8 +281,7 @@  discard block
 block discarded – undo
281 281
     if ($number_of_selected_items == '0') {
282 282
         $warning_message = get_lang('NoItemsSelected');
283 283
         $filter_warning_msg = false;
284
-    }
285
-    else {
284
+    } else {
286 285
         switch ($_POST['action']) {
287 286
             case 'deleted' :
288 287
                 $number_of_deleted_categories= 0;
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_result.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@
 block discarded – undo
39 39
         $res->set_evaluation_id($values['evaluation_id']);
40 40
         $res->set_user_id(key($scores));
41 41
         //if no scores are given, don't set the score
42
-        if ((!empty ($row)) || ($row == '0')) $res->set_score($row);
42
+        if ((!empty ($row)) || ($row == '0')) {
43
+            $res->set_score($row);
44
+        }
43 45
         $res->add();
44 46
         next($scores);
45 47
     }
Please login to merge, or discard this patch.
main/gradebook/lib/user_data_generator.class.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		// sort users array
96 96
 		if ($sorting & self :: UDG_SORT_TYPE) {
97 97
 			usort($allitems, array('UserDataGenerator', 'sort_by_type'));
98
-		}elseif ($sorting & self :: UDG_SORT_NAME) {
98
+		} elseif ($sorting & self :: UDG_SORT_NAME) {
99 99
 			usort($allitems, array('UserDataGenerator', 'sort_by_name'));
100 100
 		} elseif ($sorting & self :: UDG_SORT_COURSE) {
101 101
 			usort($allitems, array('UserDataGenerator', 'sort_by_course'));
@@ -148,8 +148,9 @@  discard block
 block discarded – undo
148 148
 			$row[] = $this->build_category_name($item);
149 149
 			$row[] = $this->build_average_column($item, $ignore_score_color);
150 150
 			$row[] = $this->build_result_column($item, $ignore_score_color);
151
-			if ($scoredisplay->is_custom())
152
-				$row[] = $this->build_mask_column($item, $ignore_score_color);
151
+			if ($scoredisplay->is_custom()) {
152
+							$row[] = $this->build_mask_column($item, $ignore_score_color);
153
+			}
153 154
 			$data[] = $row;
154 155
 		}
155 156
 		return $data;
@@ -362,13 +363,14 @@  discard block
 block discarded – undo
362 363
 		if (isset ($this->categorycache)
363 364
 			&& isset ($this->categorycache[$category_id])) {
364 365
 			return $this->categorycache[$category_id];
365
-		}else {
366
+		} else {
366 367
 			$cat = Category::load($category_id);
367 368
 			if (isset($cat)){
368 369
 				$this->categorycache[$category_id] = $cat[0];
369 370
 				return $cat[0];
370
-			}else
371
-				return null;
371
+			} else {
372
+							return null;
373
+			}
372 374
 		}
373 375
 	}
374 376
 
Please login to merge, or discard this patch.
main/gradebook/lib/fe/userform.class.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@
 block discarded – undo
31 31
 		}
32 32
 		if ($this->form_type == self :: TYPE_USER_INFO) {
33 33
 			$this->build_user_info_form();
34
-		}
35
-		elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) {
34
+		} elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) {
36 35
 			$this->build_simple_search();
37 36
 		}
38 37
 		$this->setDefaults();
Please login to merge, or discard this patch.
main/gradebook/lib/fe/displaygradebook.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -674,8 +674,9 @@
 block discarded – undo
674 674
             $scoretotal = $cattotal[0]->calc_score(api_get_user_id());
675 675
             $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable'));
676 676
             $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . $user['complete_name']. '</b><br />';
677
-            if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search'])))
678
-                $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>';
677
+            if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) {
678
+                            $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>';
679
+            }
679 680
             $scoreinfo.= '<br />' . get_lang('Total') . ' : <b>' . $scoretotal_display . '</b>';
680 681
             Display :: display_normal_message($scoreinfo, false);
681 682
         }
Please login to merge, or discard this patch.
main/gradebook/lib/fe/gradebooktable.class.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -256,10 +256,11 @@
 block discarded – undo
256 256
         }
257 257
 
258 258
         // Categories.
259
-        if (!empty($data_array))
260
-        foreach ($data_array as $data) {
259
+        if (!empty($data_array)) {
260
+                foreach ($data_array as $data) {
261 261
             // list of items inside the gradebook (exercises, lps, forums, etc)
262 262
             $row  = array();
263
+        }
263 264
             /** @var AbstractLink $item */
264 265
             $item = $mainCategory = $data[0];
265 266
 
Please login to merge, or discard this patch.