@@ -28,7 +28,7 @@ |
||
28 | 28 | } |
29 | 29 | krsort($langs, SORT_NUMERIC); |
30 | 30 | // Choosing the best match |
31 | - foreach($langs as $weight => $codes) { |
|
31 | + foreach ($langs as $weight => $codes) { |
|
32 | 32 | foreach ($codes as $code) { |
33 | 33 | if (in_array($code, $available_langs)) { |
34 | 34 | return $code; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @package chamilo.custompages |
7 | 7 | */ |
8 | 8 | // Get helper functions |
9 | -require_once __DIR__ . '/language.inc.php'; |
|
9 | +require_once __DIR__.'/language.inc.php'; |
|
10 | 10 | |
11 | 11 | // Define the languages you want to make available for auto-detection here |
12 | 12 | $available_langs = array('en', 'fr', 'es', 'gl', 'eu'); |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | api_protect_admin_script(true); |
20 | 20 | |
21 | 21 | // Setting breadcrumbs. |
22 | -$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
23 | -$interbreadcrumb[] = array('url' => 'usergroups.php','name' => get_lang('Classes')); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
24 | 24 | |
25 | 25 | // Setting the name of the tool. |
26 | 26 | $tool_name = get_lang('SubscribeClassToCourses'); |
27 | 27 | |
28 | 28 | $add_type = 'multiple'; |
29 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ |
|
29 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
30 | 30 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
31 | 31 | } |
32 | 32 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $searchForm = new FormValidator('search', 'get', api_get_self().'?id='.$id); |
99 | 99 | $searchForm->addHeader(get_lang('AdvancedSearch')); |
100 | -$renderer =& $searchForm->defaultRenderer(); |
|
100 | +$renderer = & $searchForm->defaultRenderer(); |
|
101 | 101 | $searchForm->addElement('hidden', 'id', $id); |
102 | 102 | foreach ($filters as $param) { |
103 | 103 | $searchForm->addElement($param['type'], $param['name'], $param['label']); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | //checking for extra field with filter on |
143 | 143 | |
144 | -function search($needle,$type) |
|
144 | +function search($needle, $type) |
|
145 | 145 | { |
146 | 146 | global $elements_in; |
147 | 147 | $xajax_response = new xajaxResponse(); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | echo '<div class="actions">'; |
183 | -echo '<a href="usergroups.php">'.Display::return_icon('back.png',get_lang('Back'), array(), ICON_SIZE_MEDIUM).'</a>'; |
|
183 | +echo '<a href="usergroups.php">'.Display::return_icon('back.png', get_lang('Back'), array(), ICON_SIZE_MEDIUM).'</a>'; |
|
184 | 184 | echo Display::url(get_lang('AdvancedSearch'), '#', array('class' => 'advanced_options', 'id' => 'advanced_search')); |
185 | 185 | echo '</div>'; |
186 | 186 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | ?> |
192 | 192 | |
193 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
193 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
194 | 194 | |
195 | 195 | <?php echo '<legend>'.$data['name'].': '.$tool_name.'</legend>'; |
196 | 196 | echo Display::input('hidden', 'id', $id); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | <td align="center"><b><?php echo get_lang('CoursesInGroup') ?> :</b></td> |
210 | 210 | </tr> |
211 | 211 | |
212 | -<?php if ($add_type=='multiple') { ?> |
|
212 | +<?php if ($add_type == 'multiple') { ?> |
|
213 | 213 | <tr> |
214 | 214 | <td align="center"> |
215 | 215 | <?php echo get_lang('FirstLetterCourseTitle'); ?> : |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | <td align="center"> |
228 | 228 | <div id="content_source"> |
229 | 229 | <?php |
230 | - if (!($add_type=='multiple')) { |
|
230 | + if (!($add_type == 'multiple')) { |
|
231 | 231 | ?> |
232 | 232 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
233 | 233 | <div id="ajax_list_users_single"></div> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | } else { |
236 | 236 | ?> |
237 | 237 | <div id="ajax_list_multiple"> |
238 | - <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?> |
|
238 | + <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_not_in', 'size'=>'15px'), false); ?> |
|
239 | 239 | </div> |
240 | 240 | <?php |
241 | 241 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | </td> |
267 | 267 | <td align="center"> |
268 | 268 | <?php |
269 | - echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),false ); |
|
269 | + echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_in', 'size'=>'15px'), false); |
|
270 | 270 | unset($sessionUsersList); |
271 | 271 | ?> |
272 | 272 | </td> |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | |
66 | 66 | // Breadcrumbs. |
67 | 67 | if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') { |
68 | - $interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin')); |
|
69 | - $interbreadcrumb[] = array('url' => '../session/session_list.php','name' => get_lang('SessionList')); |
|
68 | + $interbreadcrumb[] = array('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin')); |
|
69 | + $interbreadcrumb[] = array('url' => '../session/session_list.php', 'name' => get_lang('SessionList')); |
|
70 | 70 | $interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.api_get_session_id(), 'name' => get_lang('SessionOverview')); |
71 | 71 | } |
72 | 72 | |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | |
135 | 135 | echo '<span style="float:right; padding-top:0px;">'; |
136 | 136 | echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'. |
137 | - Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
137 | + Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
138 | 138 | |
139 | 139 | echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&id_session='.api_get_session_id().'&export=csv"> |
140 | - '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
140 | + '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
141 | 141 | |
142 | 142 | echo '</span>'; |
143 | 143 | echo '</div>'; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $quiz_avg_score = round(($quiz_avg_score / $studentCount), 2).'%'; |
251 | 251 | $url = api_get_path( |
252 | 252 | WEB_CODE_PATH |
253 | - ) . 'exercise/overview.php?exerciseId='.$quiz['id'].$course_path_params; |
|
253 | + ).'exercise/overview.php?exerciseId='.$quiz['id'].$course_path_params; |
|
254 | 254 | |
255 | 255 | echo '<tr><td>'.Display::url( |
256 | 256 | $quiz['title'], |
@@ -39,10 +39,10 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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> |
@@ -61,13 +61,13 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -34,20 +34,20 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -10,7 +10,7 @@ discard block |
||
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 |
||
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 |
||
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'; |
@@ -7,7 +7,7 @@ |
||
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". |