Completed
Pull Request — 1.11.x (#1421)
by José
46:34 queued 10:32
created
main/exercise/exercise.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 if (!empty($gradebook) && $gradebook == 'view') {
110 110
     $interbreadcrumb[] = array(
111
-        'url' => '../gradebook/' . $_SESSION['gradebook_dest'],
111
+        'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
112 112
         'name' => get_lang('ToolGradebook')
113 113
     );
114 114
 }
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
                     );
699 699
 
700 700
                     // Exercise results
701
-                    $actions .='<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'.
701
+                    $actions .= '<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'.
702 702
                         Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>';
703 703
 
704 704
                     // Export
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
                         }
763 763
                     }
764 764
 
765
-                    $actions .='<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'.
765
+                    $actions .= '<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'.
766 766
                         Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>';
767 767
                     $actions .= Display::url(Display::return_icon('cd.gif', get_lang('CopyExercise')), '', array('onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToCopy'), ENT_QUOTES, $charset))." ".addslashes($row['title'])."?"."')) return false;", 'href' => 'exercise.php?'.api_get_cidreq().'&choice=copy_exercise&sec_token='.$token.'&exerciseId='.$row['id']));
768 768
                 }
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
                 $item .= Display::tag('td', $actions, array('class' => 'td_actions'));
953 953
             } else {
954 954
                 if ($isDrhOfCourse) {
955
-                    $actions ='<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'.
955
+                    $actions = '<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'.
956 956
                         Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>';
957 957
                     $item .= Display::tag('td', $actions, array('class' => 'td_actions'));
958 958
                 }
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
                 'tr',
963 963
                 $item,
964 964
                 array(
965
-                    'id' => 'exercise_list_' . $my_exercise_id,
965
+                    'id' => 'exercise_list_'.$my_exercise_id,
966 966
                 )
967 967
             );
968 968
 
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
                 'adminhp.php?'.api_get_cidreq().'&hotpotatoesName='.$path
1034 1034
             );
1035 1035
 
1036
-            $actions .='<a href="hotpotatoes_exercise_report.php?'.api_get_cidreq().'&path='.$path.'">'.
1036
+            $actions .= '<a href="hotpotatoes_exercise_report.php?'.api_get_cidreq().'&path='.$path.'">'.
1037 1037
                 Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>';
1038 1038
 
1039 1039
             // if active
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
                 $actions .= '      <a href="'.$exercisePath.'?'.api_get_cidreq().'&hpchoice=disable&page='.$page.'&file='.$path.'">'.
1043 1043
                     Display::return_icon('visible.png', get_lang('Deactivate'), '', ICON_SIZE_SMALL).'</a>';
1044 1044
             } else { // else if not active
1045
-                $actions .='    <a href="'.$exercisePath.'?'.api_get_cidreq().'&hpchoice=enable&page='.$page.'&file='.$path.'">'.
1045
+                $actions .= '    <a href="'.$exercisePath.'?'.api_get_cidreq().'&hpchoice=enable&page='.$page.'&file='.$path.'">'.
1046 1046
                     Display::return_icon('invisible.png', get_lang('Activate'), '', ICON_SIZE_SMALL).'</a>';
1047 1047
             }
1048 1048
             $actions .= '<a href="'.$exercisePath.'?'.api_get_cidreq().'&hpchoice=delete&file='.$path.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('AreYouSureToDeleteJS'), ENT_QUOTES, $charset).' '.$title."?").'\')) return false;">'.
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
                 $item .= Display::tag('td', $attemptText);
1076 1076
 
1077 1077
                 if ($isDrhOfCourse) {
1078
-                    $actions ='<a href="hotpotatoes_exercise_report.php?'.api_get_cidreq().'&path='.$path.'">'.
1078
+                    $actions = '<a href="hotpotatoes_exercise_report.php?'.api_get_cidreq().'&path='.$path.'">'.
1079 1079
                         Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>';
1080 1080
 
1081 1081
                     $item .= Display::tag('td', $actions, array('class' => 'td_actions'));
Please login to merge, or discard this patch.
main/exercise/result.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	api_not_allowed($show_headers);
27 27
 }
28 28
 
29
-$is_allowedToEdit = api_is_allowed_to_edit(null,true) || $is_courseTutor;
29
+$is_allowedToEdit = api_is_allowed_to_edit(null, true) || $is_courseTutor;
30 30
 
31 31
 //Getting results from the exe_id. This variable also contain all the information about the exercise
32 32
 $track_exercise_info = ExerciseLib::get_exercise_track_exercise_info($id);
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
     }
54 54
 }
55 55
 
56
-$htmlHeadXtra[] = '<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/css/hotspot.css">';
57
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/js/hotspot.js"></script>';
56
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_JS_PATH).'hotspot/css/hotspot.css">';
57
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'hotspot/js/hotspot.js"></script>';
58 58
 
59 59
 if ($show_headers) {
60 60
     $interbreadcrumb[] = array(
Please login to merge, or discard this patch.
main/exercise/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/exercise/global_multiple_answer.class.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -34,20 +34,20 @@  discard block
 block discarded – undo
34 34
         $html = '<table class="data_table">
35 35
                 <tr>
36 36
                     <th width="10px">
37
-                        ' . get_lang('Number') . '
37
+                        ' . get_lang('Number').'
38 38
                     </th>
39 39
                     <th width="10px">
40
-                        ' . get_lang('True') . '
40
+                        ' . get_lang('True').'
41 41
                     </th>
42 42
                     <th width="50%">
43
-                        ' . get_lang('Answer') . '
43
+                        ' . get_lang('Answer').'
44 44
                     </th>';
45 45
 
46
-        $html .='<th>' . get_lang('Comment') . '</th>';
47
-        $html .='</tr>';
46
+        $html .= '<th>'.get_lang('Comment').'</th>';
47
+        $html .= '</tr>';
48 48
         $form->addElement(
49 49
             'label',
50
-            get_lang('Answers') .
50
+            get_lang('Answers').
51 51
             '<br /> '.Display::return_icon('fill_field.png'),
52 52
             $html
53 53
         );
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
         for ($i = 1; $i <= $nb_answers; ++$i) {
83 83
             /* si la reponse est de type objet */
84 84
             if (is_object($answer)) {
85
-                $defaults['answer[' . $i . ']'] = $answer->answer[$i];
86
-                $defaults['comment[' . $i . ']'] = $answer->comment[$i];
87
-                $defaults['correct[' . $i . ']'] = $answer->correct[$i];
85
+                $defaults['answer['.$i.']'] = $answer->answer[$i];
86
+                $defaults['comment['.$i.']'] = $answer->comment[$i];
87
+                $defaults['correct['.$i.']'] = $answer->correct[$i];
88 88
 
89 89
                 // start
90 90
                 $scoreA = $answer->weighting[$i];
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
             $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
107 107
             //$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
108 108
 
109
-            $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
109
+            $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"');
110 110
             $answer_number->freeze();
111 111
 
112
-            $form->addElement('checkbox', 'correct[' . $i . ']', null, null, 'class="checkbox"');
113
-            $boxes_names[] = 'correct[' . $i . ']';
112
+            $form->addElement('checkbox', 'correct['.$i.']', null, null, 'class="checkbox"');
113
+            $boxes_names[] = 'correct['.$i.']';
114 114
 
115
-            $form->addElement('html_editor', 'answer[' . $i . ']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
116
-            $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
115
+            $form->addElement('html_editor', 'answer['.$i.']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
116
+            $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
117 117
 
118
-            $form->addElement('html_editor', 'comment[' . $i . ']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
118
+            $form->addElement('html_editor', 'comment['.$i.']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
119 119
 
120 120
             $form->addElement('html', '</tr>');
121 121
         }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         // Reponses correctes
182 182
         $nbr_corrects = 0;
183 183
         for ($i = 1; $i <= $nb_answers; $i++) {
184
-            $goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
184
+            $goodAnswer = trim($form->getSubmitValue('correct['.$i.']'));
185 185
             if ($goodAnswer) {
186 186
                 $nbr_corrects++;
187 187
             }
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
         $test = $form->getSubmitValue('pts');
201 201
 
202 202
         for ($i = 1; $i <= $nb_answers; $i++) {
203
-            $answer = trim($form->getSubmitValue('answer[' . $i . ']'));
204
-            $comment = trim($form->getSubmitValue('comment[' . $i . ']'));
205
-            $goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
203
+            $answer = trim($form->getSubmitValue('answer['.$i.']'));
204
+            $comment = trim($form->getSubmitValue('comment['.$i.']'));
205
+            $goodAnswer = trim($form->getSubmitValue('correct['.$i.']'));
206 206
 
207 207
             if ($goodAnswer) {
208 208
                 $weighting = abs($answer_score);
@@ -230,12 +230,12 @@  discard block
 block discarded – undo
230 230
         $score = null
231 231
     ) {
232 232
         $header = parent::return_header($feedback_type, $counter, $score);
233
-        $header .= '<table class="'.$this->question_table_class .'">
233
+        $header .= '<table class="'.$this->question_table_class.'">
234 234
         <tr>
235
-            <th>' . get_lang("Choice") . '</th>
236
-            <th>' . get_lang("ExpectedChoice") . '</th>
237
-            <th>' . get_lang("Answer") . '</th>';
238
-        $header .= '<th>' . get_lang("Comment") . '</th>';
235
+            <th>' . get_lang("Choice").'</th>
236
+            <th>' . get_lang("ExpectedChoice").'</th>
237
+            <th>' . get_lang("Answer").'</th>';
238
+        $header .= '<th>'.get_lang("Comment").'</th>';
239 239
         $header .= '</tr>';
240 240
 
241 241
         return $header;
Please login to merge, or discard this patch.
main/exercise/hotspot_actionscript_admin.as.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 api_protect_course_script(false);
12 12
 
13
-$isAllowedToEdit = api_is_allowed_to_edit(null,true);
13
+$isAllowedToEdit = api_is_allowed_to_edit(null, true);
14 14
 
15 15
 if (!$isAllowedToEdit) {
16 16
     api_not_allowed(true);
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 $objQuestion = Question::read($questionId);
23 23
 $_course = api_get_course_info();
24 24
 
25
-$documentPath  = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
25
+$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
26 26
 
27 27
 $picturePath = $documentPath.'/images';
28 28
 $pictureName = $objQuestion->selectPicture();
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 $answers = $_SESSION['tmp_answers'];
66 66
 $nbrAnswers = count($answers['answer']);
67 67
 
68
-for ($i=1;$i <= $nbrAnswers; $i++) {
68
+for ($i = 1; $i <= $nbrAnswers; $i++) {
69 69
     $hotSpot = [];
70 70
     $hotSpot['id'] = null;
71
-    $hotSpot['answer']= $answers['answer'][$i];
71
+    $hotSpot['answer'] = $answers['answer'][$i];
72 72
 
73 73
     if ($answer_type == HOT_SPOT_DELINEATION) {
74
-        if ($i==1) {
74
+        if ($i == 1) {
75 75
             $hotSpot['type'] = 'delineation';
76 76
         } else {
77 77
             $hotSpot['type'] = 'oar';
Please login to merge, or discard this patch.
main/exercise/question_list_admin.inc.php 1 patch
Spacing   +13 added lines, -14 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             .sortable({
109 109
                 cursor: "move", // works?
110 110
                 update: function(event, ui) {
111
-                    var order = $(this).sortable("serialize") + "&a=update_question_order&exercise_id=<?php echo intval($_GET['exerciseId']);?>";
111
+                    var order = $(this).sortable("serialize") + "&a=update_question_order&exercise_id=<?php echo intval($_GET['exerciseId']); ?>";
112 112
                     $.post("<?php echo $ajax_url ?>", order, function(reponse){
113 113
                         $("#message").html(reponse);
114 114
                     });
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
     echo "<div class='table-responsive'>";
142 142
     echo "<table class='table table-condensed'>";
143 143
     echo "<tr>";
144
-    echo "<th style=\"width: 50%;\">" .get_lang('Questions'). "</th>";
145
-    echo "<th style=\"width: 6%;\">" .get_lang('Type'). "</th>";
146
-    echo "<th style=\"width: 22%; text-align:center;\">" .get_lang('Category'). "</th>";
147
-    echo "<th style=\"width: 6%;\">" .get_lang('Difficulty'). "</th>";
148
-    echo "<th style=\"width: 16%; float:left;\">" .get_lang('Score'). "</th>";
144
+    echo "<th style=\"width: 50%;\">".get_lang('Questions')."</th>";
145
+    echo "<th style=\"width: 6%;\">".get_lang('Type')."</th>";
146
+    echo "<th style=\"width: 22%; text-align:center;\">".get_lang('Category')."</th>";
147
+    echo "<th style=\"width: 6%;\">".get_lang('Difficulty')."</th>";
148
+    echo "<th style=\"width: 16%; float:left;\">".get_lang('Score')."</th>";
149 149
     echo "</tr>";
150 150
     echo "</table>";
151 151
     echo "</div>";
@@ -172,15 +172,14 @@  discard block
 block discarded – undo
172 172
                 $question_class = get_class($objQuestionTmp);
173 173
 
174 174
                 $clone_link = '<a href="'.api_get_self().'?'.api_get_cidreq().'&clone_question='.$id.'">'.
175
-                    Display::return_icon('cd.gif',get_lang('Copy'), array(), ICON_SIZE_SMALL).'</a>';
175
+                    Display::return_icon('cd.gif', get_lang('Copy'), array(), ICON_SIZE_SMALL).'</a>';
176 176
                 $edit_link = ($objQuestionTmp->type == CALCULATED_ANSWER && $objQuestionTmp->isAnswered()) ?
177 177
                     '<a>'.Display::return_icon(
178 178
                         'edit_na.png',
179 179
                         get_lang('QuestionEditionNotAvailableBecauseItIsAlreadyAnsweredHoweverYouCanCopyItAndModifyTheCopy'),
180 180
                         array(),
181 181
                         ICON_SIZE_SMALL
182
-                    ).'</a>' :
183
-                    '<a href="'.api_get_self().'?'.api_get_cidreq().'&type='.
182
+                    ).'</a>' : '<a href="'.api_get_self().'?'.api_get_cidreq().'&type='.
184 183
                     $objQuestionTmp->selectType().'&myid=1&editQuestion='.$id.'">'.
185 184
                     Display::return_icon(
186 185
                         'edit.png',
@@ -190,16 +189,16 @@  discard block
 block discarded – undo
190 189
                     ).'</a>';
191 190
                 $delete_link = null;
192 191
                 if ($objExercise->edit_exercise_in_lp == true) {
193
-                    $delete_link = '<a id="delete_'.$id.'" class="opener"  href="'.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId.'&deleteQuestion='.$id.'" >'.Display::return_icon('delete.png',get_lang('RemoveFromTest'), array(), ICON_SIZE_SMALL).'</a>';
192
+                    $delete_link = '<a id="delete_'.$id.'" class="opener"  href="'.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId.'&deleteQuestion='.$id.'" >'.Display::return_icon('delete.png', get_lang('RemoveFromTest'), array(), ICON_SIZE_SMALL).'</a>';
194 193
                 }
195 194
 
196
-                $edit_link = Display::tag('div', $edit_link,   array('style'=>'float:left; padding:0px; margin:0px'));
197
-                $clone_link = Display::tag('div', $clone_link,  array('style'=>'float:left; padding:0px; margin:0px'));
195
+                $edit_link = Display::tag('div', $edit_link, array('style'=>'float:left; padding:0px; margin:0px'));
196
+                $clone_link = Display::tag('div', $clone_link, array('style'=>'float:left; padding:0px; margin:0px'));
198 197
                 $delete_link = Display::tag('div', $delete_link, array('style'=>'float:left; padding:0px; margin:0px'));
199 198
                 $actions = Display::tag(
200 199
                     'div',
201 200
                     $edit_link.$clone_link.$delete_link,
202
-                    array('class'=>'edition','style'=>'width:100px; right:10px; margin-top: 8px; position: absolute; top: 10%;')
201
+                    array('class'=>'edition', 'style'=>'width:100px; right:10px; margin-top: 8px; position: absolute; top: 10%;')
203 202
                 );
204 203
 
205 204
                 $title = Security::remove_XSS($objQuestionTmp->selectTitle());
@@ -248,7 +247,7 @@  discard block
 block discarded – undo
248 247
                 echo $actions;
249 248
                 echo '</div>';
250 249
                 echo '<div class="question-list-description-block">';
251
-                echo '<p class="lead">' . get_lang($question_class) . '</p>';
250
+                echo '<p class="lead">'.get_lang($question_class).'</p>';
252 251
                 //echo get_lang('Level').': '.$objQuestionTmp->selectLevel();
253 252
                 ExerciseLib::showQuestion($id, false, null, null, false, true, false, true, $objExercise->feedback_type, true);
254 253
                 echo '</div>';
Please login to merge, or discard this patch.
main/exercise/evalmathnotation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 get_lang('MultiplicationStar')."\n".
8 8
 get_lang('DivisionSlash')."\n".
9 9
 get_lang('ExponentiationCircumflex')."\n".
10
-get_lang('ModuloPercentage') . "\n" .
10
+get_lang('ModuloPercentage')."\n".
11 11
 "\n".
12 12
 get_lang('SquareRootSqrt')."\n".
13 13
 get_lang('AbsoluteValueAbs')."\n".
Please login to merge, or discard this patch.
main/exercise/calculated_answer.class.php 1 patch
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
             ),
134 134
             array('ToolbarSet' => 'TestQuestionDescription', 'Width' => '100%', 'Height' => '350'));
135 135
 
136
-        $form->addRule('answer', get_lang('GiveText'),'required');
137
-        $form->addRule('answer', get_lang('DefineBlanks'),'regex','/\[.*\]/');
136
+        $form->addRule('answer', get_lang('GiveText'), 'required');
137
+        $form->addRule('answer', get_lang('DefineBlanks'), 'regex', '/\[.*\]/');
138 138
 
139 139
         $form->addElement('label', null, get_lang('IfYouWantOnlyIntegerValuesWriteBothLimitsWithoutDecimals'));
140 140
         $form->addElement('html', '<div id="blanks_weighting"></div>');
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $form->setDefaults(array('weighting' => '10'));
162 162
 
163 163
         $form->addElement('text', 'answerVariations', get_lang('AnswerVariations'));
164
-        $form->addRule('answerVariations', get_lang('GiveAnswerVariations'),'required');
164
+        $form->addRule('answerVariations', get_lang('GiveAnswerVariations'), 'required');
165 165
         $form->setDefaults(array('answerVariations' => '1'));
166 166
 
167 167
         global $text;
@@ -201,22 +201,21 @@  discard block
 block discarded – undo
201 201
             $answerVariations = $form->getSubmitValue('answerVariations');
202 202
             $this->weighting = $form->getSubmitValue('weighting');
203 203
             // Create as many answers as $answerVariations
204
-            for ($j=0 ; $j < $answerVariations; $j++) {
204
+            for ($j = 0; $j < $answerVariations; $j++) {
205 205
                 $auxAnswer = $answer;
206 206
                 $auxFormula = $formula;
207 207
                 $nb = preg_match_all('/\[[^\]]*\]/', $auxAnswer, $blanks);
208 208
                 if ($nb > 0) {
209
-                    for ($i=0 ; $i < $nb; ++$i) {
209
+                    for ($i = 0; $i < $nb; ++$i) {
210 210
                         $blankItem = $blanks[0][$i];
211 211
                         $replace = array("[", "]");
212 212
                         $newBlankItem = str_replace($replace, "", $blankItem);
213 213
                         $newBlankItem = "[".trim($newBlankItem)."]";
214 214
                         // take random float values when one or both edge values have a decimal point
215 215
                         $randomValue =
216
-                            (strpos($lowestValues[$i],'.') !== false ||
217
-                            strpos($highestValues[$i],'.') !== false) ?
218
-                            mt_rand($lowestValues[$i]*100,$highestValues[$i]*100)/100 :
219
-                            mt_rand($lowestValues[$i],$highestValues[$i]);
216
+                            (strpos($lowestValues[$i], '.') !== false ||
217
+                            strpos($highestValues[$i], '.') !== false) ?
218
+                            mt_rand($lowestValues[$i] * 100, $highestValues[$i] * 100) / 100 : mt_rand($lowestValues[$i], $highestValues[$i]);
220 219
                         $auxAnswer = str_replace($blankItem, $randomValue, $auxAnswer);
221 220
                         $auxFormula = str_replace($blankItem, $randomValue, $auxFormula);
222 221
                     }
@@ -250,7 +249,7 @@  discard block
 block discarded – undo
250 249
     function return_header($feedback_type = null, $counter = null, $score = null)
251 250
     {
252 251
         $header = parent::return_header($feedback_type, $counter, $score);
253
-        $header .= '<table class="'.$this->question_table_class .'">
252
+        $header .= '<table class="'.$this->question_table_class.'">
254 253
             <tr>
255 254
                 <th>'.get_lang("Answer").'</th>
256 255
             </tr>';
Please login to merge, or discard this patch.
main/exercise/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.