Completed
Pull Request — 1.11.x (#1628)
by José
97:30 queued 69:06
created
main/exercise/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/exercise/multiple_answer_true_false.class.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
         $html = '<table class="table table-striped table-hover">';
45 45
         $html .= '<thead>';
46 46
         $html .= '<tr>';
47
-        $html .= '<th>' . get_lang('Number') . '</th>';
48
-        $html .= '<th>' . get_lang('True') . '</th>';
49
-        $html .= '<th>' . get_lang('False') . '</th>';
50
-        $html .= '<th>' . get_lang('Answer') . '</th>';
47
+        $html .= '<th>'.get_lang('Number').'</th>';
48
+        $html .= '<th>'.get_lang('True').'</th>';
49
+        $html .= '<th>'.get_lang('False').'</th>';
50
+        $html .= '<th>'.get_lang('Answer').'</th>';
51 51
 
52 52
         // show column comment when feedback is enable
53 53
         if ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {
54
-            $html .= '<th>' . get_lang('Comment') . '</th>';
54
+            $html .= '<th>'.get_lang('Comment').'</th>';
55 55
         }
56 56
 
57 57
         $html .= '</tr>';
@@ -89,19 +89,19 @@  discard block
 block discarded – undo
89 89
 
90 90
             $renderer->setElementTemplate(
91 91
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
92
-                'correct[' . $i . ']'
92
+                'correct['.$i.']'
93 93
             );
94 94
             $renderer->setElementTemplate(
95 95
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
96
-                'counter[' . $i . ']'
96
+                'counter['.$i.']'
97 97
             );
98 98
             $renderer->setElementTemplate(
99 99
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
100
-                'answer[' . $i . ']'
100
+                'answer['.$i.']'
101 101
             );
102 102
             $renderer->setElementTemplate(
103 103
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
104
-                'comment[' . $i . ']'
104
+                'comment['.$i.']'
105 105
             );
106 106
 
107 107
             $answer_number = $form->addElement(
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
             $answer_number->freeze();
115 115
 
116 116
             if (is_object($answer)) {
117
-                $defaults['answer[' . $i . ']'] = $answer->answer[$i];
118
-                $defaults['comment[' . $i . ']'] = $answer->comment[$i];
117
+                $defaults['answer['.$i.']'] = $answer->answer[$i];
118
+                $defaults['comment['.$i.']'] = $answer->comment[$i];
119 119
                 $correct = $answer->correct[$i];
120
-                $defaults['correct[' . $i . ']'] = $correct;
120
+                $defaults['correct['.$i.']'] = $correct;
121 121
 
122 122
                 $j = 1;
123 123
                 if (!empty($optionData)) {
124 124
                     foreach ($optionData as $id => $data) {
125
-                        $form->addElement('radio', 'correct[' . $i . ']', null, null, $id);
125
+                        $form->addElement('radio', 'correct['.$i.']', null, null, $id);
126 126
                         $j++;
127 127
                         if ($j == 3) {
128 128
                             break;
@@ -130,15 +130,15 @@  discard block
 block discarded – undo
130 130
                     }
131 131
                 }
132 132
             } else {
133
-                $form->addElement('radio', 'correct[' . $i . ']', null, null, 1);
134
-                $form->addElement('radio', 'correct[' . $i . ']', null, null, 2);
133
+                $form->addElement('radio', 'correct['.$i.']', null, null, 1);
134
+                $form->addElement('radio', 'correct['.$i.']', null, null, 2);
135 135
 
136
-                $defaults['answer[' . $i . ']'] = '';
137
-                $defaults['comment[' . $i . ']'] = '';
138
-                $defaults['correct[' . $i . ']'] = '';
136
+                $defaults['answer['.$i.']'] = '';
137
+                $defaults['comment['.$i.']'] = '';
138
+                $defaults['correct['.$i.']'] = '';
139 139
             }
140 140
 
141
-            $boxes_names[] = 'correct[' . $i . ']';
141
+            $boxes_names[] = 'correct['.$i.']';
142 142
 
143 143
             $form->addHtmlEditor(
144 144
                 "answer[$i]",
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             if ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {
153 153
                 $form->addElement(
154 154
                     'html_editor',
155
-                    'comment[' . $i . ']',
155
+                    'comment['.$i.']',
156 156
                     null,
157 157
                     array(),
158 158
                     array(
@@ -170,22 +170,22 @@  discard block
 block discarded – undo
170 170
 
171 171
         $correctInputTemplate = '<div class="form-group">';
172 172
         $correctInputTemplate .= '<label class="col-sm-2 control-label">';
173
-        $correctInputTemplate .= '<span class="form_required">*</span>' . get_lang('Score');
173
+        $correctInputTemplate .= '<span class="form_required">*</span>'.get_lang('Score');
174 174
         $correctInputTemplate .= '</label>';
175 175
         $correctInputTemplate .= '<div class="col-sm-8">';
176 176
         $correctInputTemplate .= '<table>';
177 177
         $correctInputTemplate .= '<tr>';
178 178
         $correctInputTemplate .= '<td>';
179
-        $correctInputTemplate .= get_lang('Correct') . '{element}';
179
+        $correctInputTemplate .= get_lang('Correct').'{element}';
180 180
         $correctInputTemplate .= '<!-- BEGIN error --><span class="form_error">{error}</span><!-- END error -->';
181 181
         $correctInputTemplate .= '</td>';
182 182
 
183 183
         $wrongInputTemplate = '<td>';
184
-        $wrongInputTemplate .= get_lang('Wrong') . '{element}';
184
+        $wrongInputTemplate .= get_lang('Wrong').'{element}';
185 185
         $wrongInputTemplate .= '<!-- BEGIN error --><span class="form_error">{error}</span><!-- END error -->';
186 186
         $wrongInputTemplate .= '</td>';
187 187
 
188
-        $doubtScoreInputTemplate = '<td>' . get_lang('DoubtScore') . '<br>{element}';
188
+        $doubtScoreInputTemplate = '<td>'.get_lang('DoubtScore').'<br>{element}';
189 189
         $doubtScoreInputTemplate .= '<!-- BEGIN error --><span class="form_error">{error}</span><!-- END error -->';
190 190
         $doubtScoreInputTemplate .= '</td>';
191 191
         $doubtScoreInputTemplate .= '</tr>';
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
             if (!empty($scores)) {
216 216
                 for ($i = 1; $i <= 3; $i++) {
217
-                    $defaults['option[' . $i . ']'] = $scores[$i - 1];
217
+                    $defaults['option['.$i.']'] = $scores[$i - 1];
218 218
                 }
219 219
             }
220 220
         }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                 Question::updateQuestionOption($id, $optionData, $course_id);
263 263
             }
264 264
         } else {
265
-            for ($i=1 ; $i <= 3 ; $i++) {
265
+            for ($i = 1; $i <= 3; $i++) {
266 266
                 $last_id = Question::saveQuestionOption(
267 267
                     $this->id,
268 268
                     $this->options[$i],
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
         the true, false, doubt options registered in this format
288 288
         XX:YY:ZZZ where XX is a float score value.*/
289 289
         $extra_values = array();
290
-        for ($i=1 ; $i <= 3 ; $i++) {
290
+        for ($i = 1; $i <= 3; $i++) {
291 291
             $score = trim($form -> getSubmitValue('option['.$i.']'));
292
-            $extra_values[]= $score;
292
+            $extra_values[] = $score;
293 293
         }
294 294
         $this->setExtra(implode(':', $extra_values));
295 295
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
             }
305 305
     	    $questionWeighting += $extra_values[0]; //By default 0 has the correct answers
306 306
 
307
-        	$objAnswer->createAnswer($answer, $goodAnswer, $comment,'',$i);
307
+        	$objAnswer->createAnswer($answer, $goodAnswer, $comment, '', $i);
308 308
         }
309 309
 
310 310
     	// saves the answers into the data base
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     function return_header($feedback_type = null, $counter = null, $score = null)
325 325
     {
326 326
         $header = parent::return_header($feedback_type, $counter, $score);
327
-  	    $header .= '<table class="'.$this->question_table_class .'">
327
+  	    $header .= '<table class="'.$this->question_table_class.'">
328 328
 		<tr>
329 329
 			<th>'.get_lang("Choice").'</th>
330 330
 			<th>'. get_lang("ExpectedChoice").'</th>
Please login to merge, or discard this patch.
main/exercise/hotspot_save.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 $TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER);
14 14
 $questionId = intval($_GET['questionId']);
15
-$answerId 	= intval($_GET['answerId']);
15
+$answerId = intval($_GET['answerId']);
16 16
 
17 17
 if ($_GET['type'] == "square" || $_GET['type'] == "circle") {
18 18
 	$hotspot_type = $_GET['type'];
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
 }
21 21
 if ($_GET['type'] == "poly" || $_GET['type'] == "delineation" || $_GET['type'] == "oar") {
22 22
 	$hotspot_type = $_GET['type'];
23
-	$tmp_coord = explode(",",$_GET['co']);
23
+	$tmp_coord = explode(",", $_GET['co']);
24 24
 	$i = 0;
25 25
 	$hotspot_coordinates = "";
26 26
 	foreach ($tmp_coord as $coord) {
27
-		if ($i%2 == 0) {
27
+		if ($i % 2 == 0) {
28 28
 			$delimiter = ";";
29 29
 		} else {
30 30
 			$delimiter = "|";
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		$hotspot_coordinates .= $coord.$delimiter;
33 33
 		$i++;
34 34
 	}
35
-	$hotspot_coordinates = api_substr($hotspot_coordinates,0,-2);
35
+	$hotspot_coordinates = api_substr($hotspot_coordinates, 0, -2);
36 36
 }
37 37
 $course_id = api_get_course_int_id();
38 38
 $sql = "UPDATE $TBL_ANSWER SET
Please login to merge, or discard this patch.
main/exercise/hotspot_lang_conversion.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
 
14 14
 $hotspot_lang_file = api_get_path(SYS_LANG_PATH);
15 15
 
16
-if(isset($_GET['lang'])) {
16
+if (isset($_GET['lang'])) {
17 17
 	//$search = array('../','\\0','\\');
18 18
 	$lang = urldecode($_GET['lang']);
19 19
 	if (preg_match('/^[a-zA-Z0-9\._-]+$/', $lang)) {
20 20
 		//$lang = str_replace($search,$replace,urldecode($_GET['lang']));
21
-		if(file_exists($hotspot_lang_file . $lang . '/hotspot.inc.php'))
22
-			$hotspot_lang_file .= $lang . '/hotspot.inc.php';
21
+		if (file_exists($hotspot_lang_file.$lang.'/hotspot.inc.php'))
22
+			$hotspot_lang_file .= $lang.'/hotspot.inc.php';
23 23
 		else
24 24
 			$hotspot_lang_file .= 'english/hotspot.inc.php';
25 25
 	} else {
@@ -33,25 +33,25 @@  discard block
 block discarded – undo
33 33
 
34 34
 $temp = array();
35 35
 
36
-foreach($file as $value)
36
+foreach ($file as $value)
37 37
 {
38 38
 	$explode = explode('=', $value);
39 39
 
40
-	if(count($explode) > 1)
40
+	if (count($explode) > 1)
41 41
 	{
42 42
 		$explode[0] = trim($explode[0]);
43
-		$explode[0] = '&' . substr($explode[0], 1, strlen($explode[0]));
43
+		$explode[0] = '&'.substr($explode[0], 1, strlen($explode[0]));
44 44
 
45 45
 		$explode[1] = trim($explode[1]);
46 46
 		$explode[1] = substr($explode[1], 0, strlen($explode[1]) - 1);
47 47
 		$explode[1] = str_replace('"', '', $explode[1]);
48 48
 
49
-		$temp[] = $explode[0] . '=' . $explode[1];
49
+		$temp[] = $explode[0].'='.$explode[1];
50 50
 	}
51 51
 }
52 52
 
53
-foreach($temp as $value)
53
+foreach ($temp as $value)
54 54
 {
55
-	echo $value . ' ';
55
+	echo $value.' ';
56 56
 }
57 57
 ?>
Please login to merge, or discard this patch.
main/exercise/hotpotatoes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 }
32 32
 // The breadcrumbs.
33 33
 $interbreadcrumb[] = array(
34
-    'url' => api_get_path(WEB_CODE_PATH) . '.exercise/exercise.php?' . api_get_cidreq(),
34
+    'url' => api_get_path(WEB_CODE_PATH).'.exercise/exercise.php?'.api_get_cidreq(),
35 35
     'name' => get_lang('Exercises')
36 36
 );
37 37
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
                 $_course,
154 154
                 $_FILES['userFile'],
155 155
                 $document_sys_path,
156
-                $uploadPath . '/' . $fld,
156
+                $uploadPath.'/'.$fld,
157 157
                 api_get_user_id(),
158 158
                 null,
159 159
                 null,
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                     $imgparams = $_POST['imgparams'];
166 166
                     $checked = CheckImageName($imgparams, $filename);
167 167
                     if ($checked) {
168
-                        $imgcount = $imgcount-1;
168
+                        $imgcount = $imgcount - 1;
169 169
                     } else {
170 170
                         $dialogBox .= $filename.' '.get_lang('NameNotEqual');
171 171
                         my_delete($document_sys_path.$uploadPath.'/'.$fld.'/'.$filename);
Please login to merge, or discard this patch.
main/exercise/exercise_report.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             Display::addFlash(
249 249
                 Display::return_message(get_lang('MessageSent'))
250 250
             );
251
-            header('Location: ' . api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId);
251
+            header('Location: '.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId);
252 252
             exit;
253 253
         }
254 254
     }
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
         api_is_course_tutor() || api_is_course_coach()
279 279
     ) {
280 280
         $actions .= '<a href="admin.php?exerciseId='.intval($_GET['exerciseId']).'">'.Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
281
-        $actions .='<a href="live_stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('activity_monitor.png', get_lang('LiveResults'), '', ICON_SIZE_MEDIUM).'</a>';
282
-        $actions .='<a href="stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('statistics.png', get_lang('ReportByQuestion'), '', ICON_SIZE_MEDIUM).'</a>';
281
+        $actions .= '<a href="live_stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('activity_monitor.png', get_lang('LiveResults'), '', ICON_SIZE_MEDIUM).'</a>';
282
+        $actions .= '<a href="stats.php?'.api_get_cidreq().'&exerciseId='.$exercise_id.'">'.Display :: return_icon('statistics.png', get_lang('ReportByQuestion'), '', ICON_SIZE_MEDIUM).'</a>';
283 283
 
284 284
         $actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&exerciseId='.intval($_GET['exerciseId']).'" >'.
285 285
         Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
Please login to merge, or discard this patch.
main/exercise/Draggable.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
                 for ($i = 1; $i <= $answer->nbrAnswers; $i++) {
64 64
                     if ($answer->isCorrect($i)) {
65 65
                         $nb_matches++;
66
-                        $defaults['answer[' . $nb_matches . ']'] = $answer->selectAnswer($i);
67
-                        $defaults['weighting[' . $nb_matches . ']'] = float_format($answer->selectWeighting($i), 1);
66
+                        $defaults['answer['.$nb_matches.']'] = $answer->selectAnswer($i);
67
+                        $defaults['weighting['.$nb_matches.']'] = float_format($answer->selectWeighting($i), 1);
68 68
                         $answerInfo = $answer->getAnswerByAutoId($answer->correct[$i]);
69
-                        $defaults['matches[' . $nb_matches . ']'] = isset($answerInfo['answer']) ? $answerInfo['answer'] : '';
69
+                        $defaults['matches['.$nb_matches.']'] = isset($answerInfo['answer']) ? $answerInfo['answer'] : '';
70 70
                     } else {
71 71
                         $nb_options++;
72
-                        $defaults['option[' . $nb_options . ']'] = $answer->selectAnswer($i);
72
+                        $defaults['option['.$nb_options.']'] = $answer->selectAnswer($i);
73 73
                     }
74 74
                 }
75 75
             }
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
         $html = '<table class="table table-striped table-hover">
93 93
             <thead>
94 94
                 <tr>
95
-                    <th width="85%">' . get_lang('Answer') . '</th>
96
-                    <th width="15%">' . get_lang('MatchesTo') . '</th>
97
-                    <th width="10">' . get_lang('Weighting') . '</th>
95
+                    <th width="85%">' . get_lang('Answer').'</th>
96
+                    <th width="15%">' . get_lang('MatchesTo').'</th>
97
+                    <th width="10">' . get_lang('Weighting').'</th>
98 98
                 </tr>
99 99
             </thead>
100 100
             <tbody>';
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
         for ($i = 1; $i <= $nb_matches; ++$i) {
190 190
             $position++;
191 191
 
192
-            $answer = $form->getSubmitValue('answer[' . $i . ']');
193
-            $matches = $form->getSubmitValue('matches[' . $i . ']');
194
-            $weighting = $form->getSubmitValue('weighting[' . $i . ']');
192
+            $answer = $form->getSubmitValue('answer['.$i.']');
193
+            $matches = $form->getSubmitValue('matches['.$i.']');
194
+            $weighting = $form->getSubmitValue('weighting['.$i.']');
195 195
             $this->weighting += $weighting;
196 196
             $objAnswer->createAnswer(
197 197
                 $answer,
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
     public function return_header($feedback_type = null, $counter = null, $score = null)
217 217
     {
218 218
         $header = parent::return_header($feedback_type, $counter, $score);
219
-        $header .= '<table class="' . $this->question_table_class . '">
219
+        $header .= '<table class="'.$this->question_table_class.'">
220 220
             <tr>
221
-                <th>' . get_lang('ElementList') . '</th>
222
-                <th>' . get_lang('Status') . '</th>
221
+                <th>' . get_lang('ElementList').'</th>
222
+                <th>' . get_lang('Status').'</th>
223 223
             </tr>';
224 224
 
225 225
         return $header;
Please login to merge, or discard this patch.
main/exercise/qti2.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 }
22 22
 
23 23
 // the breadcrumbs
24
-$interbreadcrumb[]= array (
25
-    "url" => api_get_path(WEB_CODE_PATH) . "exercise/exercise.php?".api_get_cidreq(),
24
+$interbreadcrumb[] = array(
25
+    "url" => api_get_path(WEB_CODE_PATH)."exercise/exercise.php?".api_get_cidreq(),
26 26
     "name" => get_lang('Exercises')
27 27
 );
28 28
 $is_allowedToEdit = api_is_allowed_to_edit(null, true);
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 {
35 35
     $name_tools = get_lang('ImportQtiQuiz');
36 36
     $form  = '<div class="actions">';
37
-    $form .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?show=test&'.api_get_cidreq().'">'.
37
+    $form .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?show=test&'.api_get_cidreq().'">'.
38 38
         Display :: return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>';
39 39
     $form .= '</div>';
40 40
     $formValidator = new FormValidator(
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $imported = ch_qti2_import_file($_FILES['userFile']);
85 85
 
86 86
         if (is_numeric($imported) && !empty($imported)) {
87
-            header('Location: '.api_get_path(WEB_CODE_PATH) . 'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$imported);
87
+            header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$imported);
88 88
             exit;
89 89
         } else {
90 90
             $message = Display::return_message(get_lang($imported));
Please login to merge, or discard this patch.
main/exercise/unique_answer.class.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -59,21 +59,21 @@  discard block
 block discarded – undo
59 59
 
60 60
         if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
61 61
             //Scenario
62
-            $comment_title = '<th width="20%">' . get_lang('Comment') . '</th>';
63
-            $feedback_title = '<th width="20%">' . get_lang('Scenario') . '</th>';
62
+            $comment_title = '<th width="20%">'.get_lang('Comment').'</th>';
63
+            $feedback_title = '<th width="20%">'.get_lang('Scenario').'</th>';
64 64
         } else {
65
-            $comment_title = '<th width="40%">' . get_lang('Comment') . '</th>';
65
+            $comment_title = '<th width="40%">'.get_lang('Comment').'</th>';
66 66
         }
67 67
 
68 68
         $html = '<table class="table table-striped table-hover">
69 69
             <thead>
70 70
                 <tr style="text-align: center;">
71
-                    <th width="5%">' . get_lang('Number') . '</th>
72
-                    <th width="5%"> ' . get_lang('True') . '</th>
73
-                    <th width="40%">' . get_lang('Answer') . '</th>
74
-                        ' . $comment_title . '
75
-                        ' . $feedback_title . '
76
-                    <th width="10%">' . get_lang('Weighting') . '</th>
71
+                    <th width="5%">' . get_lang('Number').'</th>
72
+                    <th width="5%"> ' . get_lang('True').'</th>
73
+                    <th width="40%">' . get_lang('Answer').'</th>
74
+                        ' . $comment_title.'
75
+                        ' . $feedback_title.'
76
+                    <th width="10%">' . get_lang('Weighting').'</th>
77 77
                 </tr>
78 78
             </thead>
79 79
             <tbody>';
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                     continue;
104 104
                 }
105 105
                 $question = Question::read($questionid);
106
-                $select_question[$questionid] = 'Q' . $key . ' :' . cut(
106
+                $select_question[$questionid] = 'Q'.$key.' :'.cut(
107 107
                     $question->selectTitle(), 20
108 108
                 );
109 109
             }
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
                 if ($answer->correct[$i]) {
135 135
                     $correct = $i;
136 136
                 }
137
-                $defaults['answer[' . $i . ']'] = $answer->answer[$i];
138
-                $defaults['comment[' . $i . ']'] = $answer->comment[$i];
139
-                $defaults['weighting[' . $i . ']'] = float_format(
137
+                $defaults['answer['.$i.']'] = $answer->answer[$i];
138
+                $defaults['comment['.$i.']'] = $answer->comment[$i];
139
+                $defaults['weighting['.$i.']'] = float_format(
140 140
                     $answer->weighting[$i],
141 141
                     1
142 142
                 );
@@ -159,18 +159,18 @@  discard block
 block discarded – undo
159 159
                     $url_result = $url;
160 160
                 }
161 161
 
162
-                $temp_scenario['url' . $i] = $url_result;
163
-                $temp_scenario['try' . $i] = $try_result;
164
-                $temp_scenario['lp' . $i] = $lp;
165
-                $temp_scenario['destination' . $i] = $list_dest;
162
+                $temp_scenario['url'.$i] = $url_result;
163
+                $temp_scenario['try'.$i] = $try_result;
164
+                $temp_scenario['lp'.$i] = $lp;
165
+                $temp_scenario['destination'.$i] = $list_dest;
166 166
             } else {
167 167
                 $defaults['answer[1]'] = get_lang('DefaultUniqueAnswer1');
168 168
                 $defaults['weighting[1]'] = 10;
169 169
                 $defaults['answer[2]'] = get_lang('DefaultUniqueAnswer2');
170 170
                 $defaults['weighting[2]'] = 0;
171 171
 
172
-                $temp_scenario['destination' . $i] = array('0');
173
-                $temp_scenario['lp' . $i] = array('0');
172
+                $temp_scenario['destination'.$i] = array('0');
173
+                $temp_scenario['lp'.$i] = array('0');
174 174
             }
175 175
             $defaults['scenario'] = $temp_scenario;
176 176
 
@@ -182,62 +182,62 @@  discard block
 block discarded – undo
182 182
             );
183 183
             $renderer->setElementTemplate(
184 184
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
185
-                'counter[' . $i . ']'
185
+                'counter['.$i.']'
186 186
             );
187 187
             $renderer->setElementTemplate(
188 188
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
189
-                'answer[' . $i . ']'
189
+                'answer['.$i.']'
190 190
             );
191 191
             $renderer->setElementTemplate(
192 192
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
193
-                'comment[' . $i . ']'
193
+                'comment['.$i.']'
194 194
             );
195 195
             $renderer->setElementTemplate(
196 196
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
197
-                'weighting[' . $i . ']'
197
+                'weighting['.$i.']'
198 198
             );
199 199
 
200 200
             $answer_number = $form->addElement(
201
-                'text', 'counter[' . $i . ']', null, ' value = "' . $i . '"'
201
+                'text', 'counter['.$i.']', null, ' value = "'.$i.'"'
202 202
             );
203 203
             $answer_number->freeze();
204 204
             $form->addElement(
205 205
                 'radio', 'correct', null, null, $i, 'class="checkbox"'
206 206
             );
207 207
 
208
-            $form->addHtmlEditor('answer[' . $i . ']', null, null, true, $editor_config);
208
+            $form->addHtmlEditor('answer['.$i.']', null, null, true, $editor_config);
209 209
 
210 210
             $form->addRule(
211
-                'answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required'
211
+                'answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required'
212 212
             );
213 213
 
214 214
             if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
215
-                $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editor_config);
215
+                $form->addHtmlEditor('comment['.$i.']', null, null, false, $editor_config);
216 216
                 // Direct feedback
217 217
                 //Adding extra feedback fields
218 218
                 $group = array();
219
-                $group['try' . $i] = $form->createElement(
219
+                $group['try'.$i] = $form->createElement(
220 220
                     'checkbox',
221
-                    'try' . $i,
221
+                    'try'.$i,
222 222
                     null,
223 223
                     get_lang('TryAgain')
224 224
                 );
225
-                $group['lp' . $i] = $form->createElement(
225
+                $group['lp'.$i] = $form->createElement(
226 226
                     'select',
227
-                    'lp' . $i,
228
-                    get_lang('SeeTheory') . ': ',
227
+                    'lp'.$i,
228
+                    get_lang('SeeTheory').': ',
229 229
                     $select_lp_id
230 230
                 );
231
-                $group['destination' . $i] = $form->createElement(
231
+                $group['destination'.$i] = $form->createElement(
232 232
                     'select',
233
-                    'destination' . $i,
234
-                    get_lang('GoToQuestion') . ': ',
233
+                    'destination'.$i,
234
+                    get_lang('GoToQuestion').': ',
235 235
                     $select_question
236 236
                 );
237
-                $group['url' . $i] = $form->createElement(
237
+                $group['url'.$i] = $form->createElement(
238 238
                     'text',
239
-                    'url' . $i,
240
-                    get_lang('Other') . ': ',
239
+                    'url'.$i,
240
+                    get_lang('Other').': ',
241 241
                     array(
242 242
                         'class' => 'col-md-2',
243 243
                         'placeholder' => get_lang('Other')
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
                     'scenario'
251 251
                 );
252 252
             } else {
253
-                $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editor_config);
253
+                $form->addHtmlEditor('comment['.$i.']', null, null, false, $editor_config);
254 254
             }
255
-            $form->addText('weighting[' . $i . ']', null, null, array('value' => '0'));
255
+            $form->addText('weighting['.$i.']', null, null, array('value' => '0'));
256 256
             $form->addHtml('</tr>');
257 257
         }
258 258
 
@@ -306,19 +306,19 @@  discard block
 block discarded – undo
306 306
         $nb_answers = $form->getSubmitValue('nb_answers');
307 307
 
308 308
         for ($i = 1; $i <= $nb_answers; $i++) {
309
-            $answer = trim($form->getSubmitValue('answer[' . $i . ']'));
310
-            $comment = trim($form->getSubmitValue('comment[' . $i . ']'));
311
-            $weighting = trim($form->getSubmitValue('weighting[' . $i . ']'));
309
+            $answer = trim($form->getSubmitValue('answer['.$i.']'));
310
+            $comment = trim($form->getSubmitValue('comment['.$i.']'));
311
+            $weighting = trim($form->getSubmitValue('weighting['.$i.']'));
312 312
 
313 313
             $scenario = $form->getSubmitValue('scenario');
314 314
 
315 315
             //$list_destination = $form -> getSubmitValue('destination'.$i);
316 316
             //$destination_str = $form -> getSubmitValue('destination'.$i);
317 317
 
318
-            $try = $scenario['try' . $i];
319
-            $lp = $scenario['lp' . $i];
320
-            $destination = $scenario['destination' . $i];
321
-            $url = trim($scenario['url' . $i]);
318
+            $try = $scenario['try'.$i];
319
+            $lp = $scenario['lp'.$i];
320
+            $destination = $scenario['destination'.$i];
321
+            $url = trim($scenario['url'.$i]);
322 322
 
323 323
             /*
324 324
             How we are going to parse the destination value
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
             }
367 367
 
368 368
             //1@@1;2;@@2;4;4;@@http://www.chamilo.org
369
-            $dest = $try . '@@' . $lp . '@@' . $destination . '@@' . $url;
369
+            $dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url;
370 370
             $objAnswer->createAnswer(
371 371
                 $answer,
372 372
                 $goodAnswer,
@@ -400,12 +400,12 @@  discard block
 block discarded – undo
400 400
         $score = null
401 401
     ) {
402 402
         $header = parent::return_header($feedback_type, $counter, $score);
403
-        $header .= '<table class="' . $this->question_table_class . '">
403
+        $header .= '<table class="'.$this->question_table_class.'">
404 404
 			<tr>
405
-				<th>' . get_lang("Choice") . '</th>
406
-				<th>' . get_lang("ExpectedChoice") . '</th>
407
-				<th>' . get_lang("Answer") . '</th>';
408
-        $header .= '<th>' . get_lang("Comment") . '</th>';
405
+				<th>' . get_lang("Choice").'</th>
406
+				<th>' . get_lang("ExpectedChoice").'</th>
407
+				<th>' . get_lang("Answer").'</th>';
408
+        $header .= '<th>'.get_lang("Comment").'</th>';
409 409
         $header .= '</tr>';
410 410
 
411 411
         return $header;
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
         if ($correct) {
470 470
             $sql = "UPDATE $tbl_quiz_question
471 471
                     SET ponderation = (ponderation + $score)
472
-                    WHERE c_id = $course_id AND id = " . $question_id;
472
+                    WHERE c_id = $course_id AND id = ".$question_id;
473 473
             Database::query($sql);
474 474
         }
475 475
     }
Please login to merge, or discard this patch.