@@ -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,4 +7,4 @@ |
||
7 | 7 | // directly to exercise.php. This redirection is enabled for 1.10.x (2015-04-21) |
8 | 8 | // The final goal of this file is to be removed in a few years time, if |
9 | 9 | // considered realistically not harmful |
10 | -require __DIR__ . '/exercise.php'; |
|
10 | +require __DIR__.'/exercise.php'; |
@@ -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". |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | 'Height' => '125' |
39 | 39 | ); |
40 | 40 | |
41 | - $nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759. |
|
41 | + $nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759. |
|
42 | 42 | $nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0)); |
43 | 43 | |
44 | 44 | $obj_ex = $_SESSION['objExercise']; |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | $html = '<table class="table table-striped table-hover"> |
49 | 49 | <thead> |
50 | 50 | <tr> |
51 | - <th width="10">' . get_lang('Number') . '</th> |
|
52 | - <th width="10">' . get_lang('True') . '</th> |
|
53 | - <th width="50%">' . get_lang('Answer') . '</th> |
|
54 | - <th width="50%">' . get_lang('Comment') . '</th> |
|
55 | - <th width="10">' . get_lang('Weighting') . '</th> |
|
51 | + <th width="10">' . get_lang('Number').'</th> |
|
52 | + <th width="10">' . get_lang('True').'</th> |
|
53 | + <th width="50%">' . get_lang('Answer').'</th> |
|
54 | + <th width="50%">' . get_lang('Comment').'</th> |
|
55 | + <th width="10">' . get_lang('Weighting').'</th> |
|
56 | 56 | </tr> |
57 | 57 | </thead> |
58 | 58 | <tbody>'; |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | $form->addHtml('<tr>'); |
83 | 83 | |
84 | 84 | if (is_object($answer)) { |
85 | - $defaults['answer[' . $i . ']'] = $answer->answer[$i]; |
|
86 | - $defaults['comment[' . $i . ']'] = $answer->comment[$i]; |
|
87 | - $defaults['weighting[' . $i . ']'] = float_format($answer->weighting[$i], 1); |
|
88 | - $defaults['correct[' . $i . ']'] = $answer->correct[$i]; |
|
85 | + $defaults['answer['.$i.']'] = $answer->answer[$i]; |
|
86 | + $defaults['comment['.$i.']'] = $answer->comment[$i]; |
|
87 | + $defaults['weighting['.$i.']'] = float_format($answer->weighting[$i], 1); |
|
88 | + $defaults['correct['.$i.']'] = $answer->correct[$i]; |
|
89 | 89 | } else { |
90 | 90 | $defaults['answer[1]'] = get_lang('DefaultMultipleAnswer2'); |
91 | 91 | $defaults['comment[1]'] = get_lang('DefaultMultipleComment2'); |
@@ -101,38 +101,38 @@ discard block |
||
101 | 101 | |
102 | 102 | $renderer->setElementTemplate( |
103 | 103 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
104 | - 'correct[' . $i . ']' |
|
104 | + 'correct['.$i.']' |
|
105 | 105 | ); |
106 | 106 | $renderer->setElementTemplate( |
107 | 107 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
108 | - 'counter[' . $i . ']' |
|
108 | + 'counter['.$i.']' |
|
109 | 109 | ); |
110 | 110 | $renderer->setElementTemplate( |
111 | 111 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
112 | - 'answer[' . $i . ']' |
|
112 | + 'answer['.$i.']' |
|
113 | 113 | ); |
114 | 114 | $renderer->setElementTemplate( |
115 | 115 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
116 | - 'comment[' . $i . ']' |
|
116 | + 'comment['.$i.']' |
|
117 | 117 | ); |
118 | 118 | $renderer->setElementTemplate( |
119 | 119 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
120 | - 'weighting[' . $i . ']' |
|
120 | + 'weighting['.$i.']' |
|
121 | 121 | ); |
122 | 122 | |
123 | - $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"'); |
|
123 | + $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"'); |
|
124 | 124 | $answer_number->freeze(); |
125 | 125 | |
126 | - $form->addElement('checkbox', 'correct[' . $i . ']', null, null, |
|
126 | + $form->addElement('checkbox', 'correct['.$i.']', null, null, |
|
127 | 127 | 'class="checkbox" style="margin-left: 0em;"'); |
128 | - $boxes_names[] = 'correct[' . $i . ']'; |
|
128 | + $boxes_names[] = 'correct['.$i.']'; |
|
129 | 129 | |
130 | 130 | $form->addHtmlEditor("answer[$i]", null, null, true, $editorConfig); |
131 | - $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required'); |
|
131 | + $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required'); |
|
132 | 132 | |
133 | 133 | $form->addHtmlEditor("comment[$i]", null, null, true, $editorConfig); |
134 | 134 | |
135 | - $form->addElement('text', 'weighting[' . $i . ']', null, array('style' => "width: 60px;", 'value' => '0')); |
|
135 | + $form->addElement('text', 'weighting['.$i.']', null, array('style' => "width: 60px;", 'value' => '0')); |
|
136 | 136 | $form->addHtml('</tr>'); |
137 | 137 | } |
138 | 138 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $objAnswer = new Answer($this->id); |
178 | 178 | $nb_answers = $form->getSubmitValue('nb_answers'); |
179 | 179 | |
180 | - for($i=1 ; $i <= $nb_answers ; $i++) { |
|
180 | + for ($i = 1; $i <= $nb_answers; $i++) { |
|
181 | 181 | $answer = trim(str_replace(['<p>', '</p>'], '', $form -> getSubmitValue('answer['.$i.']'))); |
182 | 182 | $comment = trim(str_replace(['<p>', '</p>'], '', $form -> getSubmitValue('comment['.$i.']'))); |
183 | 183 | $weighting = trim($form -> getSubmitValue('weighting['.$i.']')); |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | $weighting = abs($weighting); |
190 | 190 | $weighting = -$weighting; |
191 | 191 | } |
192 | - if($weighting > 0) { |
|
192 | + if ($weighting > 0) { |
|
193 | 193 | $questionWeighting += $weighting; |
194 | 194 | } |
195 | - $objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i); |
|
195 | + $objAnswer -> createAnswer($answer, $goodAnswer, $comment, $weighting, $i); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | // saves the answers into the data base |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | function return_header($feedback_type = null, $counter = null, $score = null) |
207 | 207 | { |
208 | 208 | $header = parent::return_header($feedback_type, $counter, $score); |
209 | - $header .= '<table class="'.$this->question_table_class .'"> |
|
209 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
210 | 210 | <tr> |
211 | 211 | <th>'.get_lang("Choice").'</th> |
212 | 212 | <th>'. get_lang("ExpectedChoice").'</th> |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | $time = time(); |
15 | 15 | $doc_url = str_replace(array('../', '\\', '\\0', '..'), array('', '', '', ''), urldecode($_GET['file'])); |
16 | 16 | $cid = api_get_course_id(); |
17 | -$document_path = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document'; |
|
18 | -$document_web_path = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document'; |
|
17 | +$document_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
18 | +$document_web_path = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'; |
|
19 | 19 | $origin = isset($_REQUEST['origin']) ? $_REQUEST['origin'] : null; |
20 | 20 | $learnpath_id = isset($_REQUEST['learnpath_id']) ? $_REQUEST['learnpath_id'] : null; |
21 | 21 | $learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? $_REQUEST['learnpath_item_id'] : null; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $my_file = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), urldecode($my_file)); |
70 | 70 | |
71 | 71 | $title = GetQuizName($my_file, $documentPath); |
72 | -if ($title =='') { |
|
72 | +if ($title == '') { |
|
73 | 73 | $title = basename($my_file); |
74 | 74 | } |
75 | 75 | $nameTools = $title; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | }); |
87 | 87 | </script>'; |
88 | 88 | |
89 | -$interbreadcrumb[]= array ("url"=>"./exercise.php", "name"=> get_lang('Exercises')); |
|
89 | +$interbreadcrumb[] = array("url"=>"./exercise.php", "name"=> get_lang('Exercises')); |
|
90 | 90 | if ($origin == 'learnpath') { |
91 | 91 | Display::display_reduced_header($nameTools, "Exercise"); |
92 | 92 | } else { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | if ($title == '') { |
67 | 67 | $title = basename($fname); |
68 | 68 | } |
69 | - return (string)$title; |
|
69 | + return (string) $title; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | if ($src == '') { |
177 | 177 | return ''; |
178 | 178 | } else { |
179 | - $tmp_src = basename($src) ; |
|
179 | + $tmp_src = basename($src); |
|
180 | 180 | if ($tmp_src == '') { |
181 | 181 | return $src; |
182 | 182 | } else { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | // Select src tag from img tag. |
200 | 200 | $match = array(); |
201 | - preg_match("|(src=\".*\" )|U", $imgtag, $match); //src |
|
201 | + preg_match("|(src=\".*\" )|U", $imgtag, $match); //src |
|
202 | 202 | list($key, $srctag) = each($match); |
203 | 203 | $src = substr($srctag, 5, (strlen($srctag) - 7)); |
204 | 204 | if (stristr($src, 'http') === false) { |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | while (list($key, $imgtag) = each($match)) { |
231 | 231 | $imgname = GetImgName($imgtag); |
232 | 232 | if ($imgname != '' && !in_array($imgname, $imgparams)) { |
233 | - array_push($imgparams, $imgname); // name (+ type) of the images in the html test |
|
234 | - $imgcount = $imgcount + 1; // number of images in the html test |
|
233 | + array_push($imgparams, $imgname); // name (+ type) of the images in the html test |
|
234 | + $imgcount = $imgcount + 1; // number of images in the html test |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | if ($file != '..') { |
405 | 405 | $full_name = $folder.'/'.$file; |
406 | 406 | if (is_dir($full_name)) { |
407 | - $dflag = 1; // first directory |
|
407 | + $dflag = 1; // first directory |
|
408 | 408 | } |
409 | 409 | } |
410 | 410 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | for ($i = 1; $i <= $answer->nbrAnswers; $i++) { |
68 | 68 | if ($answer->isCorrect($i)) { |
69 | 69 | $nb_matches++; |
70 | - $defaults['answer[' . $nb_matches . ']'] = $answer->selectAnswer($i); |
|
71 | - $defaults['weighting[' . $nb_matches . ']'] = float_format($answer->selectWeighting($i), 1); |
|
72 | - $defaults['matches[' . $nb_matches . ']'] = $answer->correct[$i]; |
|
70 | + $defaults['answer['.$nb_matches.']'] = $answer->selectAnswer($i); |
|
71 | + $defaults['weighting['.$nb_matches.']'] = float_format($answer->selectWeighting($i), 1); |
|
72 | + $defaults['matches['.$nb_matches.']'] = $answer->correct[$i]; |
|
73 | 73 | } else { |
74 | 74 | $nb_options++; |
75 | - $defaults['option[' . $nb_options . ']'] = $answer->selectAnswer($i); |
|
75 | + $defaults['option['.$nb_options.']'] = $answer->selectAnswer($i); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | } |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | $html = '<table class="table table-striped table-hover"> |
104 | 104 | <thead> |
105 | 105 | <tr> |
106 | - <th width="10">' . get_lang('Number') . '</th> |
|
107 | - <th width="85%">' . get_lang('Answer') . '</th> |
|
108 | - <th width="15%">' . get_lang('MatchesTo') . '</th> |
|
109 | - <th width="10">' . get_lang('Weighting') . '</th> |
|
106 | + <th width="10">' . get_lang('Number').'</th> |
|
107 | + <th width="85%">' . get_lang('Answer').'</th> |
|
108 | + <th width="15%">' . get_lang('MatchesTo').'</th> |
|
109 | + <th width="10">' . get_lang('Weighting').'</th> |
|
110 | 110 | </tr> |
111 | 111 | </thead> |
112 | 112 | <tbody>'; |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | $html = '<table class="table table-striped table-hover"> |
155 | 155 | <thead> |
156 | 156 | <tr> |
157 | - <th width="15%">' . get_lang('Number') . '</th> |
|
158 | - <th width="85%">' . get_lang('Answer') . '</th> |
|
157 | + <th width="15%">' . get_lang('Number').'</th> |
|
158 | + <th width="85%">' . get_lang('Answer').'</th> |
|
159 | 159 | </tr> |
160 | 160 | </thead> |
161 | 161 | <tbody>'; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | ); |
177 | 177 | |
178 | 178 | $form->addHtml('<tr>'); |
179 | - $form->addHtml('<td>' . chr(64 + $i) . '</td>'); |
|
179 | + $form->addHtml('<td>'.chr(64 + $i).'</td>'); |
|
180 | 180 | $form->addText("option[$i]", null); |
181 | 181 | $form->addHtml('</tr>'); |
182 | 182 | } |
@@ -258,10 +258,10 @@ discard block |
||
258 | 258 | public function return_header($feedback_type = null, $counter = null, $score = null) |
259 | 259 | { |
260 | 260 | $header = parent::return_header($feedback_type, $counter, $score); |
261 | - $header .= '<table class="' . $this->question_table_class . '"> |
|
261 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
262 | 262 | <tr> |
263 | - <th>' . get_lang('ElementList') . '</th> |
|
264 | - <th>' . get_lang('CorrespondsTo') . '</th> |
|
263 | + <th>' . get_lang('ElementList').'</th> |
|
264 | + <th>' . get_lang('CorrespondsTo').'</th> |
|
265 | 265 | </tr>'; |
266 | 266 | |
267 | 267 | return $header; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $editor_config = array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '125'); |
40 | 40 | |
41 | 41 | //this line define how many question by default appear when creating a choice question |
42 | - $nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3; // The previous default value was 2. See task #1759. |
|
42 | + $nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3; // The previous default value was 2. See task #1759. |
|
43 | 43 | $nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0)); |
44 | 44 | |
45 | 45 | /* |
@@ -55,20 +55,20 @@ discard block |
||
55 | 55 | if ($obj_ex->selectFeedbackType() == 1) { |
56 | 56 | $editor_config['Width'] = '250'; |
57 | 57 | $editor_config['Height'] = '110'; |
58 | - $comment_title = '<th width="50%" >' . get_lang('Comment') . '</th>'; |
|
59 | - $feedback_title = '<th width="50%" >' . get_lang('Scenario') . '</th>'; |
|
58 | + $comment_title = '<th width="50%" >'.get_lang('Comment').'</th>'; |
|
59 | + $feedback_title = '<th width="50%" >'.get_lang('Scenario').'</th>'; |
|
60 | 60 | } else { |
61 | - $comment_title = '<th width="50%">' . get_lang('Comment') . '</th>'; |
|
61 | + $comment_title = '<th width="50%">'.get_lang('Comment').'</th>'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $html = '<table class="table table-striped table-hover">'; |
65 | 65 | $html .= '<thead>'; |
66 | 66 | $html .= '<tr>'; |
67 | - $html .= '<th>' . get_lang('Number') . '</th>'; |
|
68 | - $html .= '<th>' . get_lang('True') . '</th>'; |
|
69 | - $html .= '<th width="50%">' . get_lang('Answer') . '</th>'; |
|
70 | - $html .= $comment_title . $feedback_title; |
|
71 | - $html .= '<th>' . get_lang('Weighting') . '</th>'; |
|
67 | + $html .= '<th>'.get_lang('Number').'</th>'; |
|
68 | + $html .= '<th>'.get_lang('True').'</th>'; |
|
69 | + $html .= '<th width="50%">'.get_lang('Answer').'</th>'; |
|
70 | + $html .= $comment_title.$feedback_title; |
|
71 | + $html .= '<th>'.get_lang('Weighting').'</th>'; |
|
72 | 72 | $html .= '</tr>'; |
73 | 73 | $html .= '</thead>'; |
74 | 74 | $html .= '<tbody>'; |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | $weight_result = '0'; |
136 | 136 | } |
137 | 137 | |
138 | - $defaults['answer[' . $i . ']'] = $answer_result; |
|
139 | - $defaults['comment[' . $i . ']'] = $answer->comment[$i]; |
|
140 | - $defaults['weighting[' . $i . ']'] = $weight_result; |
|
138 | + $defaults['answer['.$i.']'] = $answer_result; |
|
139 | + $defaults['comment['.$i.']'] = $answer->comment[$i]; |
|
140 | + $defaults['weighting['.$i.']'] = $weight_result; |
|
141 | 141 | |
142 | 142 | $item_list = explode('@@', $answer->destination[$i]); |
143 | 143 | |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | else |
157 | 157 | $url_result = $url; |
158 | 158 | |
159 | - $temp_scenario['url' . $i] = $url_result; |
|
160 | - $temp_scenario['try' . $i] = $try_result; |
|
161 | - $temp_scenario['lp' . $i] = $lp; |
|
162 | - $temp_scenario['destination' . $i] = $list_dest; |
|
159 | + $temp_scenario['url'.$i] = $url_result; |
|
160 | + $temp_scenario['try'.$i] = $try_result; |
|
161 | + $temp_scenario['lp'.$i] = $lp; |
|
162 | + $temp_scenario['destination'.$i] = $list_dest; |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
@@ -172,30 +172,30 @@ discard block |
||
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 | - $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"'); |
|
190 | + $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"'); |
|
191 | 191 | $answer_number->freeze(); |
192 | 192 | |
193 | 193 | |
194 | 194 | $form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"'); |
195 | - $form->addElement('html_editor', 'answer[' . $i . ']', null, array(), $editor_config); |
|
195 | + $form->addElement('html_editor', 'answer['.$i.']', null, array(), $editor_config); |
|
196 | 196 | |
197 | - $form->addElement('html_editor', 'comment[' . $i . ']', null, array(), $editor_config); |
|
198 | - $form->addElement('text', 'weighting[' . $i . ']', null, array('style' => 'width: 60px;', 'value' => '0')); |
|
197 | + $form->addElement('html_editor', 'comment['.$i.']', null, array(), $editor_config); |
|
198 | + $form->addElement('text', 'weighting['.$i.']', null, array('style' => 'width: 60px;', 'value' => '0')); |
|
199 | 199 | $form->addElement('html', '</tr>'); |
200 | 200 | $i++; |
201 | 201 | } |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $i = 666; |
210 | 210 | $form->addHtml('<tr>'); |
211 | 211 | |
212 | - $defaults['answer[' . $i . ']'] = get_lang('DontKnow'); |
|
213 | - $defaults['weighting[' . $i . ']'] = 0; |
|
212 | + $defaults['answer['.$i.']'] = get_lang('DontKnow'); |
|
213 | + $defaults['weighting['.$i.']'] = 0; |
|
214 | 214 | $defaults['scenario'] = $temp_scenario; |
215 | 215 | $renderer = & $form->defaultRenderer(); |
216 | 216 | |
@@ -220,31 +220,31 @@ discard block |
||
220 | 220 | ); |
221 | 221 | $renderer->setElementTemplate( |
222 | 222 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
223 | - 'counter[' . $i . ']' |
|
223 | + 'counter['.$i.']' |
|
224 | 224 | ); |
225 | 225 | $renderer->setElementTemplate( |
226 | 226 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
227 | - 'answer[' . $i . ']' |
|
227 | + 'answer['.$i.']' |
|
228 | 228 | ); |
229 | 229 | $renderer->setElementTemplate( |
230 | 230 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
231 | - 'comment[' . $i . ']' |
|
231 | + 'comment['.$i.']' |
|
232 | 232 | ); |
233 | 233 | $renderer->setElementTemplate( |
234 | 234 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
235 | - 'weighting[' . $i . ']' |
|
235 | + 'weighting['.$i.']' |
|
236 | 236 | ); |
237 | 237 | |
238 | - $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="-"'); |
|
238 | + $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="-"'); |
|
239 | 239 | $answer_number->freeze(); |
240 | 240 | |
241 | - $form->addElement('hidden', 'position[' . $i . ']', '666'); |
|
241 | + $form->addElement('hidden', 'position['.$i.']', '666'); |
|
242 | 242 | |
243 | 243 | $form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"'); |
244 | - $form->addElement('html_editor', 'answer[' . $i . ']', null, array(), $editor_config); |
|
244 | + $form->addElement('html_editor', 'answer['.$i.']', null, array(), $editor_config); |
|
245 | 245 | |
246 | - $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required'); |
|
247 | - $form->addElement('html_editor', 'comment[' . $i . ']', null, array(), $editor_config); |
|
246 | + $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required'); |
|
247 | + $form->addElement('html_editor', 'comment['.$i.']', null, array(), $editor_config); |
|
248 | 248 | |
249 | 249 | //$form->addElement('select', 'destination'.$i, get_lang('SelectQuestion').' : ',$select_question,'multiple'); |
250 | 250 | |
@@ -298,9 +298,9 @@ discard block |
||
298 | 298 | $minus = 0; |
299 | 299 | } |
300 | 300 | |
301 | - for ($i=1 ; $i <= $nb_answers - $minus; $i++) { |
|
302 | - $position = trim($form -> getSubmitValue('position['.$i.']')); |
|
303 | - $answer = trim($form -> getSubmitValue('answer['.$i.']')); |
|
301 | + for ($i = 1; $i <= $nb_answers - $minus; $i++) { |
|
302 | + $position = trim($form -> getSubmitValue('position['.$i.']')); |
|
303 | + $answer = trim($form -> getSubmitValue('answer['.$i.']')); |
|
304 | 304 | $comment = trim($form -> getSubmitValue('comment['.$i.']')); |
305 | 305 | $weighting = trim($form -> getSubmitValue('weighting['.$i.']')); |
306 | 306 | $scenario = $form -> getSubmitValue('scenario'); |
@@ -308,8 +308,8 @@ discard block |
||
308 | 308 | //$list_destination = $form -> getSubmitValue('destination'.$i); |
309 | 309 | //$destination_str = $form -> getSubmitValue('destination'.$i); |
310 | 310 | |
311 | - $try = $scenario['try'.$i]; |
|
312 | - $lp = $scenario['lp'.$i]; |
|
311 | + $try = $scenario['try'.$i]; |
|
312 | + $lp = $scenario['lp'.$i]; |
|
313 | 313 | $destination = $scenario['destination'.$i]; |
314 | 314 | $url = trim($scenario['url'.$i]); |
315 | 315 | |
@@ -333,34 +333,34 @@ discard block |
||
333 | 333 | $destination_str.=$destination_id.';'; |
334 | 334 | }*/ |
335 | 335 | |
336 | - $goodAnswer= ($correct == $i) ? true : false; |
|
336 | + $goodAnswer = ($correct == $i) ? true : false; |
|
337 | 337 | |
338 | 338 | if ($goodAnswer) { |
339 | 339 | $nbrGoodAnswers++; |
340 | 340 | $weighting = abs($weighting); |
341 | - if($weighting > 0) { |
|
341 | + if ($weighting > 0) { |
|
342 | 342 | $questionWeighting += $weighting; |
343 | 343 | } |
344 | 344 | } |
345 | 345 | |
346 | 346 | if (empty($try)) |
347 | - $try=0; |
|
347 | + $try = 0; |
|
348 | 348 | |
349 | 349 | if (empty($lp)) { |
350 | - $lp=0; |
|
350 | + $lp = 0; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | if (empty($destination)) { |
354 | - $destination=0; |
|
354 | + $destination = 0; |
|
355 | 355 | } |
356 | 356 | |
357 | - if ($url=='') { |
|
358 | - $url=0; |
|
357 | + if ($url == '') { |
|
358 | + $url = 0; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | //1@@1;2;@@2;4;4;@@http://www.chamilo.org |
362 | - $dest= $try.'@@'.$lp.'@@'.$destination.'@@'.$url; |
|
363 | - $objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest); |
|
362 | + $dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url; |
|
363 | + $objAnswer -> createAnswer($answer, $goodAnswer, $comment, $weighting, $i, NULL, NULL, $dest); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | //Create 666 answer |
@@ -368,10 +368,10 @@ discard block |
||
368 | 368 | $answer = trim($form -> getSubmitValue('answer['.$i.']')); |
369 | 369 | $comment = trim($form -> getSubmitValue('comment['.$i.']')); |
370 | 370 | $weighting = trim($form -> getSubmitValue('weighting['.$i.']')); |
371 | - $goodAnswer= ($correct == $i) ? true : false; |
|
371 | + $goodAnswer = ($correct == $i) ? true : false; |
|
372 | 372 | $dest = ''; |
373 | 373 | |
374 | - $objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest); |
|
374 | + $objAnswer -> createAnswer($answer, $goodAnswer, $comment, $weighting, $i, NULL, NULL, $dest); |
|
375 | 375 | |
376 | 376 | // saves the answers into the data base |
377 | 377 | $objAnswer -> save(); |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | function return_header($feedback_type = null, $counter = null, $score = null) |
385 | 385 | { |
386 | 386 | $header = parent::return_header($feedback_type, $counter, $score); |
387 | - $header .= '<table class="'.$this->question_table_class .'"> |
|
387 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
388 | 388 | <tr> |
389 | 389 | <th>'.get_lang("Choice").'</th> |
390 | 390 | <th>'. get_lang("ExpectedChoice").'</th> |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | api_block_anonymous_users(); |
10 | 10 | GradebookUtils::block_students(); |
11 | 11 | |
12 | -$interbreadcrumb[] = array ( |
|
12 | +$interbreadcrumb[] = array( |
|
13 | 13 | 'url' => $_SESSION['gradebook_dest'].'?', |
14 | 14 | 'name' => get_lang('Gradebook' |
15 | 15 | )); |
16 | -$interbreadcrumb[] = array ( |
|
16 | +$interbreadcrumb[] = array( |
|
17 | 17 | 'url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['selectcat']), |
18 | 18 | 'name' => get_lang('Details' |
19 | 19 | )); |
20 | -$interbreadcrumb[] = array ( |
|
20 | +$interbreadcrumb[] = array( |
|
21 | 21 | 'url' => 'gradebook_showlog_eval.php?visiblelog='.Security::remove_XSS($_GET['visiblelog']).'&selectcat='.Security::remove_XSS($_GET['selectcat']), |
22 | 22 | 'name' => get_lang('GradebookQualifyLog') |
23 | 23 | ); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $t_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG); |
30 | 30 | $t_user = Database :: get_main_table(TABLE_MAIN_USER); |
31 | -$visible_log=Security::remove_XSS($_GET['visiblelog']); |
|
31 | +$visible_log = Security::remove_XSS($_GET['visiblelog']); |
|
32 | 32 | |
33 | 33 | $evaledit = Evaluation :: load($visible_log); |
34 | 34 | $sql = "SELECT le.name,le.description,le.weight,le.visible,le.type,le.created_at,us.username |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $list_info[] = $row; |
43 | 43 | } |
44 | 44 | |
45 | -foreach($list_info as $key => $info_log) { |
|
46 | - $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
47 | - $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
45 | +foreach ($list_info as $key => $info_log) { |
|
46 | + $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
47 | + $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $parameters = array( |