Completed
Push — 1.10.x ( 8f997c...918380 )
by Yannick
259:37 queued 220:06
created
main/exercice/hotpotatoes_exercise_report.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 if ($is_allowedToEdit && $origin != 'learnpath') {
74 74
     // the form
75 75
     if (api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) {
76
-        $actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&path='.Security::remove_XSS($hotpotatoes_path).' ">'.Display::return_icon('save.png',   get_lang('Export'),'',ICON_SIZE_MEDIUM).'</a>';
76
+        $actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&path='.Security::remove_XSS($hotpotatoes_path).' ">'.Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
77 77
     }
78 78
 } else {
79
-    $actions .= '<a href="exercise.php">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
79
+    $actions .= '<a href="exercise.php">'.Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
80 80
 }
81 81
 
82 82
 if ($is_allowedToEdit) {
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
 
99 99
 if ($is_allowedToEdit || $is_tutor) {
100 100
     $nameTools = get_lang('StudentScore');
101
-    $interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
101
+    $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
102 102
     $objExerciseTmp = new Exercise();
103 103
     /*if ($objExerciseTmp->read($exercise_id)) {
104 104
         $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name);
105 105
     }*/
106 106
 } else {
107
-    $interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
107
+    $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
108 108
     $objExerciseTmp = new Exercise();
109 109
     /*if ($objExerciseTmp->read($exercise_id)) {
110 110
         $nameTools = get_lang('Results').': '.$objExerciseTmp->name;
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 $actions = Display::div($actions, array('class'=> 'actions'));
117 117
 
118
-$extra =  '<script type="text/javascript">
118
+$extra = '<script type="text/javascript">
119 119
     $(document).ready(function() {
120 120
 
121 121
         $( "#dialog:ui-dialog" ).dialog( "destroy" );
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 // Generating group list
170 170
 
171 171
 $group_list = GroupManager::get_group_list();
172
-$group_parameters = array('group_all:'.get_lang('All'),'group_none:'.get_lang('None'));
172
+$group_parameters = array('group_all:'.get_lang('All'), 'group_none:'.get_lang('None'));
173 173
 
174 174
 foreach ($group_list as $group) {
175 175
     $group_parameters[] = $group['id'].':'.$group['name'];
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
 
193 193
   // Column config
194 194
   // @todo fix search firstname/lastname that doesn't work. rmove search for the moment
195
-	$column_model   = array(
196
-        array('name'=>'firstname',      'index'=>'firstname',		'width'=>'50',   'align'=>'left', 'search' => 'false'),
197
-        array('name'=>'lastname',		    'index'=>'lastname',		'width'=>'50',   'align'=>'left', 'formatter'=>'action_formatter', 'search' => 'false'),
198
-        array('name'=>'login',          'hidden'=>'true',       'index'=>'username',        'width'=>'40',   'align'=>'left', 'search' => 'false'),
199
-        array('name'=>'group_name',		  'index'=>'group_id',    'width'=>'40',   'align'=>'left', 'search' => 'false'),
200
-        array('name'=>'exe_date',		    'index'=>'exe_date',		'width'=>'60',   'align'=>'left', 'search' => 'false'),
201
-        array('name'=>'score',			    'index'=>'exe_result',	'width'=>'50',   'align'=>'left', 'search' => 'false'),
202
-        array('name'=>'actions',        'index'=>'actions',     'width'=>'60',  'align'=>'left', 'search' => 'false')
195
+	$column_model = array(
196
+        array('name'=>'firstname', 'index'=>'firstname', 'width'=>'50', 'align'=>'left', 'search' => 'false'),
197
+        array('name'=>'lastname', 'index'=>'lastname', 'width'=>'50', 'align'=>'left', 'formatter'=>'action_formatter', 'search' => 'false'),
198
+        array('name'=>'login', 'hidden'=>'true', 'index'=>'username', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
199
+        array('name'=>'group_name', 'index'=>'group_id', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
200
+        array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'false'),
201
+        array('name'=>'score', 'index'=>'exe_result', 'width'=>'50', 'align'=>'left', 'search' => 'false'),
202
+        array('name'=>'actions', 'index'=>'actions', 'width'=>'60', 'align'=>'left', 'search' => 'false')
203 203
     );
204 204
 
205 205
     $action_links = '
@@ -222,10 +222,10 @@  discard block
 block discarded – undo
222 222
 
223 223
     //Column config
224 224
     // @todo fix search firstname/lastname that doesn't work. rmove search for the moment
225
-    $column_model  = array(
226
-        array('name'=>'exe_date',		    'index'=>'exe_date',		'width'=>'60',   'align'=>'left', 'search' => 'false'),
227
-        array('name'=>'score',			    'index'=>'exe_result',	'width'=>'50',   'align'=>'left', 'search' => 'false'),
228
-        array('name'=>'actions',        'index'=>'actions',     'width'=>'60',  'align'=>'left', 'search' => 'false')
225
+    $column_model = array(
226
+        array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'false'),
227
+        array('name'=>'score', 'index'=>'exe_result', 'width'=>'50', 'align'=>'left', 'search' => 'false'),
228
+        array('name'=>'actions', 'index'=>'actions', 'width'=>'60', 'align'=>'left', 'search' => 'false')
229 229
     );
230 230
 }
231 231
 
Please login to merge, or discard this patch.
main/exercice/hotspot.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 $file = file(api_get_path(SYS_LANG_PATH).'english/hotspot.inc.php');
19 19
 
20 20
 foreach ($file as &$value) {
21
-	$variable = explode('=', $value , 2);
21
+	$variable = explode('=', $value, 2);
22 22
 	if (count($variable) > 1) {
23 23
 		$variable = substr(trim($variable[0]), 1);
24 24
 		$variable = '&'.$variable.'='.api_utf8_encode(get_lang($variable)).' ';
Please login to merge, or discard this patch.
main/exercice/tests_category.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 function add_category_form($action) {
148 148
     $action = Security::remove_XSS($action);
149 149
     // initiate the object
150
-    $form = new FormValidator('note', 'post', api_get_self() . '?action=' . $action);
150
+    $form = new FormValidator('note', 'post', api_get_self().'?action='.$action);
151 151
     // Setting the form elements
152 152
     $form->addElement('header', get_lang('AddACategory'));
153 153
     $form->addElement('text', 'category_name', get_lang('CategoryName'), array('size' => '95'));
@@ -189,19 +189,19 @@  discard block
 block discarded – undo
189 189
 
190 190
 function display_add_category() {
191 191
     echo '<div class="actions">';
192
-    echo '<a href="exercise.php?' . api_get_cidreq() . '">' .
193
-            Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>';
194
-    echo '<a href="' . api_get_self() . '?action=addcategory">' .
195
-        Display::return_icon('question_category.gif', get_lang('AddACategory')) . '</a>';
192
+    echo '<a href="exercise.php?'.api_get_cidreq().'">'.
193
+            Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
194
+    echo '<a href="'.api_get_self().'?action=addcategory">'.
195
+        Display::return_icon('question_category.gif', get_lang('AddACategory')).'</a>';
196 196
     echo '</div>';
197 197
     echo "<br/>";
198
-    echo "<fieldset><legend>" . get_lang('QuestionCategory') . "</legend></fieldset>";
198
+    echo "<fieldset><legend>".get_lang('QuestionCategory')."</legend></fieldset>";
199 199
 }
200 200
 
201 201
 // display goback to category list page link
202 202
 function display_goback() {
203 203
     echo '<div class="actions">';
204
-    echo '<a href="' . api_get_self() . '">' .
205
-        Display::return_icon('back.png', get_lang('BackToCategoryList'), array(), 32) . '</a>';
204
+    echo '<a href="'.api_get_self().'">'.
205
+        Display::return_icon('back.png', get_lang('BackToCategoryList'), array(), 32).'</a>';
206 206
     echo '</div>';
207 207
 }
Please login to merge, or discard this patch.
main/exercice/overview.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 require_once '../inc/global.inc.php';
14 14
 
15
-$current_course_tool  = TOOL_QUIZ;
15
+$current_course_tool = TOOL_QUIZ;
16 16
 
17 17
 // Clear the exercise session just in case
18 18
 if (isset($_SESSION['objExercise'])) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 if ($time_control) {
51 51
     // Get time left for expiring time
52
-    $time_left = api_strtotime($clock_expired_time,'UTC') - time();
52
+    $time_left = api_strtotime($clock_expired_time, 'UTC') - time();
53 53
 
54 54
     $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/stylesheet/jquery.epiclock.css');
55 55
     $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/renderers/minute/epiclock.minute.css');
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 $html = '';
74 74
 $message = '';
75
-$html.= '<div class="exercise">';
75
+$html .= '<div class="exercise">';
76 76
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
77 77
 $edit_link = '';
78 78
 if ($is_allowed_to_edit && $objExercise->sessionId == $sessionId) {
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
             $attempt_result['exe_result'],
178 178
             $attempt_result['exe_weighting']
179 179
         );
180
-        $attempt_url = api_get_path(WEB_CODE_PATH) . 'exercice/result.php?';
181
-        $attempt_url .= api_get_cidreq() . '&show_headers=1&';
180
+        $attempt_url = api_get_path(WEB_CODE_PATH).'exercice/result.php?';
181
+        $attempt_url .= api_get_cidreq().'&show_headers=1&';
182 182
         $attempt_url .= http_build_query([
183 183
             'id' => $attempt_result['exe_id']
184 184
         ]);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             get_lang('Show'),
189 189
             $attempt_url,
190 190
             [
191
-                'class' => $btn_class . 'btn btn-default',
191
+                'class' => $btn_class.'btn btn-default',
192 192
                 'data-title' => get_lang('Show'),
193 193
                 'data-size' => 'lg'
194 194
             ]
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             ),
207 207
             'userIp' => $attempt_result['user_ip']
208 208
         );
209
-        $attempt_link .= "&nbsp;&nbsp;&nbsp;" . $teacher_revised;
209
+        $attempt_link .= "&nbsp;&nbsp;&nbsp;".$teacher_revised;
210 210
 
211 211
         if (in_array(
212 212
             $objExercise->results_disabled,
@@ -283,12 +283,12 @@  discard block
 block discarded – undo
283 283
         $attempt_message = Display::return_message($attempt_message, 'info');
284 284
     }
285 285
     if ($visible_return['value'] == true) {
286
-        $message .=   $attempt_message;
286
+        $message .= $attempt_message;
287 287
     }
288 288
 }
289 289
 
290 290
 if ($time_control) {
291
-    $html.= $objExercise->return_time_left_div();
291
+    $html .= $objExercise->return_time_left_div();
292 292
 }
293 293
 
294 294
 $html .= $message;
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     $table_content,
309 309
     ['class' => 'table-responsive']
310 310
 );
311
-$html.= '</div>';
311
+$html .= '</div>';
312 312
 echo $html;
313 313
 
314 314
 Display::display_footer();
Please login to merge, or discard this patch.
main/exercice/multiple_answer_combination.class.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
         $html = '<table class="table table-striped table-hover">';
40 40
         $html .= '<thead>';
41 41
         $html .= '<tr>';
42
-        $html .= '<th width="10">' . get_lang('Number') . '</th>';
43
-        $html .= '<th width="10">' . get_lang('True') . '</th>';
44
-        $html .= '<th width="50%">' . get_lang('Comment') . '</th>';
45
-        $html .= '<th width="50%">' . get_lang('Answer') . '</th>';
42
+        $html .= '<th width="10">'.get_lang('Number').'</th>';
43
+        $html .= '<th width="10">'.get_lang('True').'</th>';
44
+        $html .= '<th width="50%">'.get_lang('Comment').'</th>';
45
+        $html .= '<th width="50%">'.get_lang('Answer').'</th>';
46 46
         $html .= '</tr>';
47 47
         $html .= '</thead>';
48 48
         $html .= '<tbody>';
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
             $form->addHtml('<tr>');
75 75
 
76 76
             if (is_object($answer)) {
77
-                $defaults['answer[' . $i . ']'] = $answer->answer[$i];
78
-                $defaults['comment[' . $i . ']'] = $answer->comment[$i];
79
-                $defaults['weighting[' . $i . ']'] = float_format($answer->weighting[$i], 1);
80
-                $defaults['correct[' . $i . ']'] = $answer->correct[$i];
77
+                $defaults['answer['.$i.']'] = $answer->answer[$i];
78
+                $defaults['comment['.$i.']'] = $answer->comment[$i];
79
+                $defaults['weighting['.$i.']'] = float_format($answer->weighting[$i], 1);
80
+                $defaults['correct['.$i.']'] = $answer->correct[$i];
81 81
             } else {
82 82
                 $defaults['answer[1]'] = get_lang('DefaultMultipleAnswer2');
83 83
                 $defaults['comment[1]'] = get_lang('DefaultMultipleComment2');
@@ -93,44 +93,44 @@  discard block
 block discarded – undo
93 93
 
94 94
             $renderer->setElementTemplate(
95 95
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
96
-                'correct[' . $i . ']'
96
+                'correct['.$i.']'
97 97
             );
98 98
             $renderer->setElementTemplate(
99 99
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
100
-                'counter[' . $i . ']'
100
+                'counter['.$i.']'
101 101
             );
102 102
             $renderer->setElementTemplate(
103 103
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
104
-                'answer[' . $i . ']'
104
+                'answer['.$i.']'
105 105
             );
106 106
             $renderer->setElementTemplate(
107 107
                 '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
108
-                'comment[' . $i . ']'
108
+                'comment['.$i.']'
109 109
             );
110 110
 
111
-            $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
111
+            $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"');
112 112
             $answer_number->freeze();
113 113
 
114 114
             $form->addElement('checkbox',
115
-                'correct[' . $i . ']',
115
+                'correct['.$i.']',
116 116
                 null,
117 117
                 null,
118 118
                 'class="checkbox" style="margin-left: 0em;"'
119 119
             );
120
-            $boxes_names[] = 'correct[' . $i . ']';
120
+            $boxes_names[] = 'correct['.$i.']';
121 121
 
122 122
             $form->addElement(
123 123
                 'html_editor',
124
-                'answer[' . $i . ']',
124
+                'answer['.$i.']',
125 125
                 null,
126 126
                 array(),
127 127
                 array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100')
128 128
             );
129
-            $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
129
+            $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
130 130
 
131 131
             $form->addElement(
132 132
                 'html_editor',
133
-                'comment[' . $i . ']',
133
+                'comment['.$i.']',
134 134
                 null,
135 135
                 array(),
136 136
                 array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100')
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     function return_header($feedback_type = null, $counter = null, $score = null)
227 227
     {
228 228
         $header = parent::return_header($feedback_type, $counter, $score);
229
-        $header .= '<table class="'.$this->question_table_class .'">
229
+        $header .= '<table class="'.$this->question_table_class.'">
230 230
             <tr>
231 231
                 <th>'.get_lang("Choice").'</th>
232 232
                 <th>'. get_lang("ExpectedChoice").'</th>
Please login to merge, or discard this patch.
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.