Completed
Push — 1.10.x ( 23ca11...187186 )
by Julito
106:28 queued 51:04
created
main/exercice/live_stats.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $url = api_get_path(WEB_AJAX_PATH).'exercise.ajax.php?a=get_live_stats&exercise_id='.$objExercise->id.'&minutes='.$minutes;
42 42
 
43 43
 //The order is important you need to check the the $column variable in the model.ajax.php file
44
-$columns        = array(get_lang('FirstName'), get_lang('LastName'), get_lang('Time'), get_lang('QuestionsAlreadyAnswered'), get_lang('Score'));
44
+$columns = array(get_lang('FirstName'), get_lang('LastName'), get_lang('Time'), get_lang('QuestionsAlreadyAnswered'), get_lang('Score'));
45 45
 
46 46
 //Column config
47 47
 $column_model = array(
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 
94 94
 $(function() {
95 95
     <?php
96
-        echo Display::grid_js('live_stats',  $url, $columns, $column_model, $extra_params, array(), null, true);
96
+        echo Display::grid_js('live_stats', $url, $columns, $column_model, $extra_params, array(), null, true);
97 97
     ?>
98 98
     refreshGrid();
99 99
 });
100 100
 </script>
101 101
 <?php
102 102
 
103
-$actions = '<a href="exercise_report.php?exerciseId='.intval($_GET['exerciseId']).'&'.api_get_cidreq().'">' .
104
-    Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
103
+$actions = '<a href="exercise_report.php?exerciseId='.intval($_GET['exerciseId']).'&'.api_get_cidreq().'">'.
104
+    Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
105 105
 echo $actions = Display::div($actions, array('class'=> 'actions'));
106 106
 
107 107
 echo Display::grid_html('live_stats');
Please login to merge, or discard this patch.
main/exercice/aiken.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 }
28 28
 
29 29
 // the breadcrumbs
30
-$interbreadcrumb[]= array ("url"=>"exercise.php", "name"=> get_lang('Exercises'));
30
+$interbreadcrumb[] = array("url"=>"exercise.php", "name"=> get_lang('Exercises'));
31 31
 $is_allowedToEdit = api_is_allowed_to_edit(null, true);
32 32
 
33 33
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     if (isset($_POST['submit'])) {
38 38
         $message = aiken_import_file($_FILES['userFile']);
39 39
         if (is_numeric($message) && !empty($message)) {
40
-            header('Location: admin.php?' . api_get_cidreq() . '&exerciseId=' . $message);
40
+            header('Location: admin.php?'.api_get_cidreq().'&exerciseId='.$message);
41 41
             exit;
42 42
         }
43 43
     }
Please login to merge, or discard this patch.
main/exercice/feedback.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,23 +8,23 @@  discard block
 block discarded – undo
8 8
 * 	@version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
9 9
 */
10 10
 include("../inc/global.inc.php");
11
-$this_section=SECTION_COURSES;
11
+$this_section = SECTION_COURSES;
12 12
 
13
-$nameTools=get_lang('ExerciseManagement');
13
+$nameTools = get_lang('ExerciseManagement');
14 14
 
15
-if (isset($_SESSION['gradebook'])){
16
-	$gradebook=	$_SESSION['gradebook'];
15
+if (isset($_SESSION['gradebook'])) {
16
+	$gradebook = $_SESSION['gradebook'];
17 17
 }
18 18
 
19
-if (!empty($gradebook) && $gradebook=='view') {
20
-	$interbreadcrumb[]= array (
19
+if (!empty($gradebook) && $gradebook == 'view') {
20
+	$interbreadcrumb[] = array(
21 21
 			'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
22 22
 			'name' => get_lang('ToolGradebook')
23 23
 		);
24 24
 }
25 25
 
26
-$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
27
-Display::display_header($nameTools,"Exercises");
26
+$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
27
+Display::display_header($nameTools, "Exercises");
28 28
 ?>
29 29
 <table border="0" align="center" cellpadding="2" cellspacing="2" width="100%">
30 30
 <h4>
@@ -37,17 +37,17 @@  discard block
 block discarded – undo
37 37
 	echo $objQuestionTmp->selectTitle();
38 38
 	echo "</td></tr>";
39 39
 	echo " <br><tr><td><b><br>".get_lang('Answer')." : </b></td></tr>";
40
-	$objAnswerTmp=new Answer($id);
40
+	$objAnswerTmp = new Answer($id);
41 41
 	$num = $objAnswerTmp->selectNbrAnswers();
42 42
 	$objAnswerTmp->read();
43
-	for($i=1;$i<=$num;$i++)
43
+	for ($i = 1; $i <= $num; $i++)
44 44
 	{
45 45
 	echo "<tr><td width='10%'> ";
46
-	$ans =  $objAnswerTmp->answer[$i];
46
+	$ans = $objAnswerTmp->answer[$i];
47 47
 
48
-	$form = new FormValidator('feedbackform','post',api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
48
+	$form = new FormValidator('feedbackform', 'post', api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
49 49
 	$obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST');
50
-	$renderer =& $obj_registration_form->defaultRenderer();
50
+	$renderer = & $obj_registration_form->defaultRenderer();
51 51
 	$renderer->setCustomElementTemplate(
52 52
 '<tr>
53 53
 	<td align="left" style="" valign="top" width=30%>{label}
Please login to merge, or discard this patch.
main/exercice/UniqueAnswerImage.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -40,22 +40,22 @@  discard block
 block discarded – undo
40 40
 
41 41
         if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
42 42
             //Scenario
43
-            $commentTitle = '<th>' . get_lang('Comment') . '</th>';
44
-            $feedbackTitle = '<th>' . get_lang('Scenario') . '</th>';
43
+            $commentTitle = '<th>'.get_lang('Comment').'</th>';
44
+            $feedbackTitle = '<th>'.get_lang('Scenario').'</th>';
45 45
         } else {
46
-            $commentTitle = '<th >' . get_lang('Comment') . '</th>';
46
+            $commentTitle = '<th >'.get_lang('Comment').'</th>';
47 47
         }
48 48
 
49 49
         $html = '<div class="alert alert-success" role="alert">'.get_lang('UniqueAnswerImagePreferredSize200x150').'</div>';
50 50
         $html .= '<table class="table table-striped table-hover">
51 51
             <thead>
52 52
                 <tr style="text-align: center;">
53
-                    <th width="10">' . get_lang('Number') . '</th>
54
-                    <th>' . get_lang('True') . '</th>
55
-                    <th>' . get_lang('Answer') . '</th>
56
-                        ' . $commentTitle . '
57
-                        ' . $feedbackTitle . '
58
-                    <th width="15">' . get_lang('Weighting') . '</th>
53
+                    <th width="10">' . get_lang('Number').'</th>
54
+                    <th>' . get_lang('True').'</th>
55
+                    <th>' . get_lang('Answer').'</th>
56
+                        ' . $commentTitle.'
57
+                        ' . $feedbackTitle.'
58
+                    <th width="15">' . get_lang('Weighting').'</th>
59 59
                 </tr>
60 60
             </thead>
61 61
             <tbody>';
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 }
91 91
 
92 92
                 $question = Question::read($questionid);
93
-                $selectQuestion[$questionid] = 'Q' . $key . ' :' . cut(
93
+                $selectQuestion[$questionid] = 'Q'.$key.' :'.cut(
94 94
                     $question->selectTitle(), 20
95 95
                 );
96 96
             }
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
                     $correct = $i;
124 124
                 }
125 125
 
126
-                $defaults['answer[' . $i . ']'] = $answer->answer[$i];
127
-                $defaults['comment[' . $i . ']'] = $answer->comment[$i];
128
-                $defaults['weighting[' . $i . ']'] = float_format(
126
+                $defaults['answer['.$i.']'] = $answer->answer[$i];
127
+                $defaults['comment['.$i.']'] = $answer->comment[$i];
128
+                $defaults['weighting['.$i.']'] = float_format(
129 129
                     $answer->weighting[$i], 1
130 130
                 );
131 131
 
@@ -148,18 +148,18 @@  discard block
 block discarded – undo
148 148
                     $urlResult = $url;
149 149
                 }
150 150
 
151
-                $tempScenario['url' . $i] = $urlResult;
152
-                $tempScenario['try' . $i] = $tryResult;
153
-                $tempScenario['lp' . $i] = $lp;
154
-                $tempScenario['destination' . $i] = $listDestination;
151
+                $tempScenario['url'.$i] = $urlResult;
152
+                $tempScenario['try'.$i] = $tryResult;
153
+                $tempScenario['lp'.$i] = $lp;
154
+                $tempScenario['destination'.$i] = $listDestination;
155 155
             } else {
156 156
                 $defaults['answer[1]'] = get_lang('DefaultUniqueAnswer1');
157 157
                 $defaults['weighting[1]'] = 10;
158 158
                 $defaults['answer[2]'] = get_lang('DefaultUniqueAnswer2');
159 159
                 $defaults['weighting[2]'] = 0;
160 160
 
161
-                $tempScenario['destination' . $i] = array('0');
162
-                $tempScenario['lp' . $i] = array('0');
161
+                $tempScenario['destination'.$i] = array('0');
162
+                $tempScenario['lp'.$i] = array('0');
163 163
             }
164 164
 
165 165
             $defaults['scenario'] = $tempScenario;
@@ -172,50 +172,50 @@  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
-            $answerNumber = $form->addElement('text', 'counter[' . $i . ']', null, ' value = "' . $i . '"');
190
+            $answerNumber = $form->addElement('text', 'counter['.$i.']', null, ' value = "'.$i.'"');
191 191
             $answerNumber->freeze();
192 192
 
193 193
             $form->addElement('radio', 'correct', null, null, $i, 'class="checkbox"');
194
-            $form->addHtmlEditor('answer[' . $i . ']', null, null, true, $editorConfig);
194
+            $form->addHtmlEditor('answer['.$i.']', null, null, true, $editorConfig);
195 195
 
196
-            $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
196
+            $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
197 197
 
198 198
             if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
199
-                $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editorConfig);
199
+                $form->addHtmlEditor('comment['.$i.']', null, null, false, $editorConfig);
200 200
                 // Direct feedback
201 201
                 //Adding extra feedback fields
202 202
                 $group = array();
203
-                $group['try' . $i] = $form->createElement('checkbox', 'try' . $i, null, get_lang('TryAgain'));
204
-                $group['lp' . $i] = $form->createElement(
203
+                $group['try'.$i] = $form->createElement('checkbox', 'try'.$i, null, get_lang('TryAgain'));
204
+                $group['lp'.$i] = $form->createElement(
205 205
                     'select',
206
-                    'lp' . $i,
207
-                    get_lang('SeeTheory') . ': ',
206
+                    'lp'.$i,
207
+                    get_lang('SeeTheory').': ',
208 208
                     $selectLpId
209 209
                 );
210
-                $group['destination' . $i] = $form->createElement(
210
+                $group['destination'.$i] = $form->createElement(
211 211
                     'select',
212
-                    'destination' . $i,
213
-                    get_lang('GoToQuestion') . ': ',
212
+                    'destination'.$i,
213
+                    get_lang('GoToQuestion').': ',
214 214
                     $selectQuestion
215 215
                 );
216
-                $group['url' . $i] = $form->createElement(
217
-                    'text', 'url' . $i,
218
-                    get_lang('Other') . ': ',
216
+                $group['url'.$i] = $form->createElement(
217
+                    'text', 'url'.$i,
218
+                    get_lang('Other').': ',
219 219
                     array(
220 220
                         'class' => 'col-md-2',
221 221
                         'placeholder' => get_lang('Other')
@@ -228,9 +228,9 @@  discard block
 block discarded – undo
228 228
                     'scenario'
229 229
                 );
230 230
             } else {
231
-                $form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editorConfig);
231
+                $form->addHtmlEditor('comment['.$i.']', null, null, false, $editorConfig);
232 232
             }
233
-            $form->addText('weighting[' . $i . ']', null, null, array('class' => "col-md-1", 'value' => '0'));
233
+            $form->addText('weighting['.$i.']', null, null, array('class' => "col-md-1", 'value' => '0'));
234 234
             $form->addHtml('</tr>');
235 235
         }
236 236
 
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
         $numberAnswers = $form->getSubmitValue('nb_answers');
280 280
 
281 281
         for ($i = 1; $i <= $numberAnswers; $i++) {
282
-            $answer = trim(str_replace(['<p>', '</p>'], '', $form->getSubmitValue('answer[' . $i . ']')));
283
-            $comment = trim(str_replace(['<p>', '</p>'], '', $form->getSubmitValue('comment[' . $i . ']')));
284
-            $weighting = trim($form->getSubmitValue('weighting[' . $i . ']'));
282
+            $answer = trim(str_replace(['<p>', '</p>'], '', $form->getSubmitValue('answer['.$i.']')));
283
+            $comment = trim(str_replace(['<p>', '</p>'], '', $form->getSubmitValue('comment['.$i.']')));
284
+            $weighting = trim($form->getSubmitValue('weighting['.$i.']'));
285 285
 
286 286
             $scenario = $form->getSubmitValue('scenario');
287 287
 
288 288
             //$listDestination = $form -> getSubmitValue('destination'.$i);
289 289
             //$destinationStr = $form -> getSubmitValue('destination'.$i);
290 290
 
291
-            $try = $scenario['try' . $i];
292
-            $lp = $scenario['lp' . $i];
293
-            $destination = $scenario['destination' . $i];
294
-            $url = trim($scenario['url' . $i]);
291
+            $try = $scenario['try'.$i];
292
+            $lp = $scenario['lp'.$i];
293
+            $destination = $scenario['destination'.$i];
294
+            $url = trim($scenario['url'.$i]);
295 295
 
296 296
             /*
297 297
               How we are going to parse the destination value
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             }
341 341
 
342 342
             //1@@1;2;@@2;4;4;@@http://www.chamilo.org
343
-            $dest = $try . '@@' . $lp . '@@' . $destination . '@@' . $url;
343
+            $dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url;
344 344
 
345 345
             $objAnswer->createAnswer($answer, $goodAnswer, $comment, $weighting, $i, null, null, $dest);
346 346
         }
Please login to merge, or discard this patch.
main/exercice/freeanswer.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@
 block discarded – undo
60 60
             $score['revised'] = false;
61 61
         }
62 62
         $header = parent::return_header($feedback_type, $counter, $score);
63
-        $header .= '<table class="' . $this->question_table_class . '" >
63
+        $header .= '<table class="'.$this->question_table_class.'" >
64 64
         <tr>
65
-        <th>' . get_lang("Answer") . '</th>
65
+        <th>' . get_lang("Answer").'</th>
66 66
         </tr>';
67 67
 
68 68
         return $header;
Please login to merge, or discard this patch.
main/exercice/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/exercice/stats.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
         $data[$question_id]['type'] = $question_obj->get_question_type_name();
62 62
         $percentange = 0;
63 63
         if ($count_students) {
64
-            $percentange = $count_users / $count_students*100;
64
+            $percentange = $count_users / $count_students * 100;
65 65
         }
66 66
 
67 67
         $data[$question_id]['students_who_try_exercise'] = Display::bar_progress(
68 68
             $percentange,
69 69
             false,
70
-            $count_users .' / '.$count_students
70
+            $count_users.' / '.$count_students
71 71
         );
72 72
         $data[$question_id]['lowest_score'] = round($exercise_stats['min'], 2);
73 73
         $data[$question_id]['average_score'] = round($exercise_stats['average'], 2);
@@ -142,23 +142,23 @@  discard block
 block discarded – undo
142 142
                         } else {
143 143
                             $data[$id]['name'] = '-';
144 144
                         }
145
-                        $data[$id]['answer'] 	= $answer_item;
145
+                        $data[$id]['answer'] = $answer_item;
146 146
 
147 147
                         $answer_item = api_substr($answer_item, 1);
148
-                        $answer_item = api_substr($answer_item, 0, api_strlen($answer_item) -1);
148
+                        $answer_item = api_substr($answer_item, 0, api_strlen($answer_item) - 1);
149 149
                         
150
-                        $data[$id]['answer'] 	= $answer_item;
150
+                        $data[$id]['answer'] = $answer_item;
151 151
 
152
-                        $data[$id]['correct'] 	= '-';
152
+                        $data[$id]['correct'] = '-';
153 153
 
154 154
                         $count = ExerciseLib::getNumberStudentsFillBlanksAnwserCount($question_id, $exercise_id);
155 155
                         $count = $count[$counter];
156 156
                         
157 157
                         $percentange = 0;
158 158
                         if (!empty($count_students)) {
159
-                            $percentange = $count/$count_students*100;
159
+                            $percentange = $count / $count_students * 100;
160 160
                         }
161
-                        $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count .' / '.$count_students);
161
+                        $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count.' / '.$count_students);
162 162
                         $id++;
163 163
                         $counter++;
164 164
                     }
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
                         );
195 195
                         $percentange = 0;
196 196
                         if (!empty($count_students)) {
197
-                            $percentange = $count/$count_students*100;
197
+                            $percentange = $count / $count_students * 100;
198 198
                         }
199
-                        $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count .' / '.$count_students);
199
+                        $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count.' / '.$count_students);
200 200
                     }
201 201
                     break;
202 202
                 case HOT_SPOT:
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
                     );
218 218
                     $percentange = 0;
219 219
                     if (!empty($count_students)) {
220
-                        $percentange = $count/$count_students*100;
220
+                        $percentange = $count / $count_students * 100;
221 221
                     }
222
-                    $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count .' / '.$count_students);
222
+                    $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count.' / '.$count_students);
223 223
                     break;
224 224
                 default:
225 225
                     if ($answer_id == 1) {
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
                     );
240 240
                     $percentange = 0;
241 241
                     if (!empty($count_students)) {
242
-                        $percentange = $count/$count_students*100;
242
+                        $percentange = $count / $count_students * 100;
243 243
                     }
244
-                    $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count .' / '.$count_students);
244
+                    $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count.' / '.$count_students);
245 245
             }
246 246
             $id++;
247 247
         }
@@ -273,8 +273,8 @@  discard block
 block discarded – undo
273 273
 $interbreadcrumb[] = array("url" => "admin.php?exerciseId=$exercise_id&".api_get_cidreq(), "name" => $objExercise->name);
274 274
 
275 275
 $tpl = new Template(get_lang('ReportByQuestion'));
276
-$actions = '<a href="exercise_report.php?exerciseId='.intval($_GET['exerciseId']).'&'.api_get_cidreq().'">' .
277
-    Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
276
+$actions = '<a href="exercise_report.php?exerciseId='.intval($_GET['exerciseId']).'&'.api_get_cidreq().'">'.
277
+    Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
278 278
 $actions = Display::div($actions, array('class'=> 'actions'));
279 279
 $content = $actions.$content;
280 280
 $tpl->assign('content', $content);
Please login to merge, or discard this patch.
main/exercice/qti2.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 }
22 22
 
23 23
 // the breadcrumbs
24
-$interbreadcrumb[]= array (
24
+$interbreadcrumb[] = array(
25 25
     "url" => api_get_path(WEB_CODE_PATH)."exercice/exercise.php?".api_get_cidreq(),
26 26
     "name" => get_lang('Exercises')
27 27
 );
Please login to merge, or discard this patch.
main/exercice/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.