@@ -84,120 +84,120 @@ |
||
84 | 84 | */ |
85 | 85 | public $author; |
86 | 86 | |
87 | - /** |
|
88 | - * Author's image |
|
89 | - */ |
|
90 | - public $preview_image; |
|
87 | + /** |
|
88 | + * Author's image |
|
89 | + */ |
|
90 | + public $preview_image; |
|
91 | 91 | |
92 | - /** |
|
93 | - * Create a new learnpath |
|
94 | - * @param integer ID |
|
95 | - * @param integer Type (1,2,3,...) |
|
96 | - * @param string $name |
|
97 | - * @param string $path |
|
98 | - * @param string $ref |
|
99 | - * @param string $description |
|
100 | - * @param string $content_local |
|
101 | - * @param string $default_encoding |
|
102 | - * @param string $default_view_mode |
|
103 | - * @param bool $prevent_reinit |
|
104 | - * @param bool $force_commit |
|
105 | - * @param string $content_maker |
|
106 | - * @param integer $display_order |
|
107 | - * @param string $js_lib |
|
108 | - * @param string $content_license |
|
109 | - * @param integer $debug |
|
110 | - * @param string $visibility |
|
111 | - * @param array $items |
|
112 | - */ |
|
113 | - public function __construct( |
|
114 | - $id, |
|
115 | - $type, |
|
116 | - $name, |
|
117 | - $path, |
|
118 | - $ref, |
|
119 | - $description, |
|
120 | - $content_local, |
|
121 | - $default_encoding, |
|
122 | - $default_view_mode, |
|
123 | - $prevent_reinit, |
|
124 | - $force_commit, |
|
125 | - $content_maker, |
|
126 | - $display_order, |
|
127 | - $js_lib, |
|
128 | - $content_license, |
|
129 | - $debug, |
|
130 | - $visibility, |
|
131 | - $author, |
|
132 | - $preview_image, |
|
133 | - $use_max_score, |
|
134 | - $autolaunch, |
|
135 | - $created_on, |
|
136 | - $modified_on, |
|
137 | - $publicated_on, |
|
138 | - $expired_on, |
|
139 | - $session_id, |
|
140 | - $items |
|
141 | - ) { |
|
142 | - parent::__construct($id, RESOURCE_LEARNPATH); |
|
143 | - $this->lp_type = $type; |
|
144 | - $this->name = $name; |
|
145 | - $this->path = $path; |
|
146 | - $this->ref = $ref; |
|
147 | - $this->description = $description; |
|
148 | - $this->content_local = $content_local; |
|
149 | - $this->default_encoding = $default_encoding; |
|
150 | - $this->default_view_mod = $default_view_mode; |
|
151 | - $this->prevent_reinit = $prevent_reinit; |
|
152 | - $this->force_commit = $force_commit; |
|
153 | - $this->content_maker = $content_maker; |
|
154 | - $this->display_order = $display_order; |
|
155 | - $this->js_lib = $js_lib; |
|
156 | - $this->content_license = $content_license; |
|
157 | - $this->debug = $debug; |
|
158 | - $this->visibility=$visibility; |
|
92 | + /** |
|
93 | + * Create a new learnpath |
|
94 | + * @param integer ID |
|
95 | + * @param integer Type (1,2,3,...) |
|
96 | + * @param string $name |
|
97 | + * @param string $path |
|
98 | + * @param string $ref |
|
99 | + * @param string $description |
|
100 | + * @param string $content_local |
|
101 | + * @param string $default_encoding |
|
102 | + * @param string $default_view_mode |
|
103 | + * @param bool $prevent_reinit |
|
104 | + * @param bool $force_commit |
|
105 | + * @param string $content_maker |
|
106 | + * @param integer $display_order |
|
107 | + * @param string $js_lib |
|
108 | + * @param string $content_license |
|
109 | + * @param integer $debug |
|
110 | + * @param string $visibility |
|
111 | + * @param array $items |
|
112 | + */ |
|
113 | + public function __construct( |
|
114 | + $id, |
|
115 | + $type, |
|
116 | + $name, |
|
117 | + $path, |
|
118 | + $ref, |
|
119 | + $description, |
|
120 | + $content_local, |
|
121 | + $default_encoding, |
|
122 | + $default_view_mode, |
|
123 | + $prevent_reinit, |
|
124 | + $force_commit, |
|
125 | + $content_maker, |
|
126 | + $display_order, |
|
127 | + $js_lib, |
|
128 | + $content_license, |
|
129 | + $debug, |
|
130 | + $visibility, |
|
131 | + $author, |
|
132 | + $preview_image, |
|
133 | + $use_max_score, |
|
134 | + $autolaunch, |
|
135 | + $created_on, |
|
136 | + $modified_on, |
|
137 | + $publicated_on, |
|
138 | + $expired_on, |
|
139 | + $session_id, |
|
140 | + $items |
|
141 | + ) { |
|
142 | + parent::__construct($id, RESOURCE_LEARNPATH); |
|
143 | + $this->lp_type = $type; |
|
144 | + $this->name = $name; |
|
145 | + $this->path = $path; |
|
146 | + $this->ref = $ref; |
|
147 | + $this->description = $description; |
|
148 | + $this->content_local = $content_local; |
|
149 | + $this->default_encoding = $default_encoding; |
|
150 | + $this->default_view_mod = $default_view_mode; |
|
151 | + $this->prevent_reinit = $prevent_reinit; |
|
152 | + $this->force_commit = $force_commit; |
|
153 | + $this->content_maker = $content_maker; |
|
154 | + $this->display_order = $display_order; |
|
155 | + $this->js_lib = $js_lib; |
|
156 | + $this->content_license = $content_license; |
|
157 | + $this->debug = $debug; |
|
158 | + $this->visibility=$visibility; |
|
159 | 159 | |
160 | - $this->use_max_score=$use_max_score; |
|
161 | - $this->autolaunch=$autolaunch; |
|
162 | - $this->created_on=$created_on; |
|
163 | - $this->modified_on=$modified_on; |
|
164 | - $this->publicated_on=$publicated_on; |
|
165 | - $this->expired_on=$expired_on; |
|
166 | - $this->session_id=$session_id; |
|
160 | + $this->use_max_score=$use_max_score; |
|
161 | + $this->autolaunch=$autolaunch; |
|
162 | + $this->created_on=$created_on; |
|
163 | + $this->modified_on=$modified_on; |
|
164 | + $this->publicated_on=$publicated_on; |
|
165 | + $this->expired_on=$expired_on; |
|
166 | + $this->session_id=$session_id; |
|
167 | 167 | |
168 | - $this->author= $author; |
|
169 | - $this->preview_image= $preview_image; |
|
168 | + $this->author= $author; |
|
169 | + $this->preview_image= $preview_image; |
|
170 | 170 | |
171 | - $this->items = $items; |
|
172 | - } |
|
173 | - /** |
|
174 | - * Get the items |
|
175 | - */ |
|
176 | - function get_items() |
|
177 | - { |
|
178 | - return $this->items; |
|
179 | - } |
|
171 | + $this->items = $items; |
|
172 | + } |
|
173 | + /** |
|
174 | + * Get the items |
|
175 | + */ |
|
176 | + function get_items() |
|
177 | + { |
|
178 | + return $this->items; |
|
179 | + } |
|
180 | 180 | |
181 | - /** |
|
182 | - * Check if a given resource is used as an item in this chapter |
|
183 | - */ |
|
184 | - function has_item($resource) |
|
185 | - { |
|
186 | - foreach ($this->items as $item) { |
|
187 | - if ($item['id'] == $resource->get_id() && |
|
188 | - isset($item['type']) && $item['type'] == $resource->get_type() |
|
189 | - ) { |
|
190 | - return true; |
|
191 | - } |
|
192 | - } |
|
193 | - return false; |
|
194 | - } |
|
181 | + /** |
|
182 | + * Check if a given resource is used as an item in this chapter |
|
183 | + */ |
|
184 | + function has_item($resource) |
|
185 | + { |
|
186 | + foreach ($this->items as $item) { |
|
187 | + if ($item['id'] == $resource->get_id() && |
|
188 | + isset($item['type']) && $item['type'] == $resource->get_type() |
|
189 | + ) { |
|
190 | + return true; |
|
191 | + } |
|
192 | + } |
|
193 | + return false; |
|
194 | + } |
|
195 | 195 | |
196 | - /** |
|
197 | - * Show this learnpath |
|
198 | - */ |
|
199 | - function show() { |
|
200 | - parent::show(); |
|
201 | - echo $this->name; |
|
202 | - } |
|
196 | + /** |
|
197 | + * Show this learnpath |
|
198 | + */ |
|
199 | + function show() { |
|
200 | + parent::show(); |
|
201 | + echo $this->name; |
|
202 | + } |
|
203 | 203 | } |
@@ -11,13 +11,13 @@ |
||
11 | 11 | { |
12 | 12 | public $params = array(); |
13 | 13 | public $thematic_advance_list = array(); |
14 | - public $thematic_plan_list = array(); |
|
14 | + public $thematic_plan_list = array(); |
|
15 | 15 | |
16 | 16 | /** |
17 | - * Create a new Thematic |
|
18 | - * |
|
19 | - * @param array $params |
|
20 | - */ |
|
17 | + * Create a new Thematic |
|
18 | + * |
|
19 | + * @param array $params |
|
20 | + */ |
|
21 | 21 | public function __construct($params) |
22 | 22 | { |
23 | 23 | parent::__construct($params['id'], RESOURCE_THEMATIC); |
@@ -291,16 +291,16 @@ |
||
291 | 291 | Duis bibendum elementum justo. Duis posuere. Fusce nulla odio, posuere eget, condimentum nec, venenatis eu, elit. In hac habitasse platea dictumst. Aenean ac sem in enim imperdiet feugiat. Integer tincidunt lectus at elit. Integer magna lacus, vehicula quis, eleifend eget, suscipit vitae, leo. Nunc porta augue nec enim. Curabitur vehicula volutpat enim. Aliquam consequat. Vestibulum rhoncus tellus vitae erat. Integer est. Quisque fermentum leo nec odio. Suspendisse lobortis sollicitudin augue. Nullam urna mi, suscipit eu, sagittis laoreet, ultrices ac, sem. Aliquam enim tortor, hendrerit non, cursus a, tristique sit amet, sapien. Suspendisse potenti. Aenean semper placerat neque.'; |
292 | 292 | switch($type) |
293 | 293 | { |
294 | - case 'description': |
|
294 | + case 'description': |
|
295 | 295 | $descriptions = explode(".",$dummy_text); |
296 | 296 | return $descriptions[rand(0,count($descriptions)-1)]; |
297 | 297 | break; |
298 | - case 'title': |
|
298 | + case 'title': |
|
299 | 299 | $dummy_text = str_replace(array("\n",'.',',',"\t"),array(' ','','',' '),$dummy_text); |
300 | 300 | $titles = explode(" ",$dummy_text); |
301 | 301 | return trim($titles[rand(0,count($titles)-1)]); |
302 | 302 | break; |
303 | - case 'text': |
|
303 | + case 'text': |
|
304 | 304 | $texts = explode("\n",$dummy_text); |
305 | 305 | return $texts[rand(0,count($texts)-1)]; |
306 | 306 | break; |
@@ -29,11 +29,11 @@ |
||
29 | 29 | krsort($langs, SORT_NUMERIC); |
30 | 30 | // Choosing the best match |
31 | 31 | foreach($langs as $weight => $codes) { |
32 | - foreach ($codes as $code) { |
|
33 | - if (in_array($code, $available_langs)) { |
|
34 | - return $code; |
|
35 | - } |
|
36 | - } |
|
32 | + foreach ($codes as $code) { |
|
33 | + if (in_array($code, $available_langs)) { |
|
34 | + return $code; |
|
35 | + } |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | // No match |
39 | 39 | return null; |
@@ -24,15 +24,15 @@ |
||
24 | 24 | $lang_match = $chamilo_langs[get_preferred_language($available_langs)]; |
25 | 25 | // recover previous value ... |
26 | 26 | if (isset($_SESSION['user_language_choice'])) |
27 | - $lang_match = $_SESSION['user_language_choice']; |
|
27 | + $lang_match = $_SESSION['user_language_choice']; |
|
28 | 28 | |
29 | 29 | // Chamilo parameter, on logout |
30 | 30 | if (isset($_REQUEST['language']) && !empty($_REQUEST['language']) && in_array($_REQUEST['language'], $chamilo_langs)) { |
31 | - $lang_match = $_REQUEST['language']; |
|
31 | + $lang_match = $_REQUEST['language']; |
|
32 | 32 | } |
33 | 33 | // Incoming link parameter |
34 | 34 | if (isset($_REQUEST['lang']) && !empty($_REQUEST['lang']) && in_array($_REQUEST['lang'], $available_langs)) { |
35 | - $lang_match = $chamilo_langs[$_REQUEST['lang']]; |
|
35 | + $lang_match = $chamilo_langs[$_REQUEST['lang']]; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $detect = api_get_setting('auto_detect_language_custom_pages'); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $result = $objExercise->read($exercise_id); |
18 | 18 | |
19 | 19 | if (!$result) { |
20 | - api_not_allowed(true); |
|
20 | + api_not_allowed(true); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | $interbreadcrumb[] = array( |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
181 | - * abstract function which creates the form to create/edit the answers of the question |
|
182 | - * @param FormValidator $form |
|
183 | - */ |
|
181 | + * abstract function which creates the form to create/edit the answers of the question |
|
182 | + * @param FormValidator $form |
|
183 | + */ |
|
184 | 184 | public function processAnswersCreation($form) |
185 | 185 | { |
186 | 186 | $questionWeighting = $nbrGoodAnswers = 0; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | // sets the total weighting of the question |
222 | 222 | $this->updateWeighting($questionWeighting); |
223 | 223 | $this->save(); |
224 | - } |
|
224 | + } |
|
225 | 225 | |
226 | 226 | function return_header($feedback_type = null, $counter = null, $score = null) |
227 | 227 | { |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $result = $objExercise->read($exercise_id); |
13 | 13 | |
14 | 14 | if (!$result) { |
15 | - api_not_allowed(true); |
|
15 | + api_not_allowed(true); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | $sessionId = api_get_session_id(); |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | $data = array(); |
30 | 30 | // Question title # of students who tool it Lowest score Average Highest score Maximum score |
31 | 31 | $headers = array( |
32 | - get_lang('Question'), |
|
32 | + get_lang('Question'), |
|
33 | 33 | get_lang('QuestionType'), |
34 | 34 | get_lang('NumberStudentWhoSelectedIt'), |
35 | - get_lang('LowestScore'), |
|
36 | - get_lang('AverageScore'), |
|
37 | - get_lang('HighestScore'), |
|
38 | - get_lang('Weighting') |
|
35 | + get_lang('LowestScore'), |
|
36 | + get_lang('AverageScore'), |
|
37 | + get_lang('HighestScore'), |
|
38 | + get_lang('Weighting') |
|
39 | 39 | ); |
40 | 40 | |
41 | 41 | if (!empty($question_list)) { |
42 | - foreach ($question_list as $question_id) { |
|
42 | + foreach ($question_list as $question_id) { |
|
43 | 43 | $question_obj = Question::read($question_id); |
44 | 44 | |
45 | 45 | $exercise_stats = ExerciseLib::get_student_stats_by_question( |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $data[$question_id]['average_score'] = round($exercise_stats['average'], 2); |
74 | 74 | $data[$question_id]['highest_score'] = round($exercise_stats['max'], 2); |
75 | 75 | $data[$question_id]['max_score'] = round($question_obj->weighting, 2); |
76 | - } |
|
76 | + } |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // Format A table |
@@ -81,37 +81,37 @@ discard block |
||
81 | 81 | $row = 0; |
82 | 82 | $column = 0; |
83 | 83 | foreach ($headers as $header) { |
84 | - $table->setHeaderContents($row, $column, $header); |
|
85 | - $column++; |
|
84 | + $table->setHeaderContents($row, $column, $header); |
|
85 | + $column++; |
|
86 | 86 | } |
87 | 87 | $row++; |
88 | 88 | foreach ($data as $row_table) { |
89 | - $column = 0; |
|
90 | - foreach ($row_table as $cell) { |
|
91 | - $table->setCellContents($row, $column, $cell); |
|
92 | - $table->updateCellAttributes($row, $column, 'align="center"'); |
|
93 | - $column++; |
|
94 | - } |
|
95 | - $table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true); |
|
96 | - $row++; |
|
89 | + $column = 0; |
|
90 | + foreach ($row_table as $cell) { |
|
91 | + $table->setCellContents($row, $column, $cell); |
|
92 | + $table->updateCellAttributes($row, $column, 'align="center"'); |
|
93 | + $column++; |
|
94 | + } |
|
95 | + $table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true); |
|
96 | + $row++; |
|
97 | 97 | } |
98 | 98 | $content = $table->toHtml(); |
99 | 99 | |
100 | 100 | // Format B |
101 | 101 | |
102 | 102 | $headers = array( |
103 | - get_lang('Question'), |
|
104 | - get_lang('Answer'), |
|
105 | - get_lang('Correct'), |
|
106 | - get_lang('NumberStudentWhoSelectedIt') |
|
103 | + get_lang('Question'), |
|
104 | + get_lang('Answer'), |
|
105 | + get_lang('Correct'), |
|
106 | + get_lang('NumberStudentWhoSelectedIt') |
|
107 | 107 | ); |
108 | 108 | |
109 | 109 | $data = array(); |
110 | 110 | |
111 | 111 | if (!empty($question_list)) { |
112 | 112 | $id = 0; |
113 | - foreach ($question_list as $question_id) { |
|
114 | - $question_obj = Question::read($question_id); |
|
113 | + foreach ($question_list as $question_id) { |
|
114 | + $question_obj = Question::read($question_id); |
|
115 | 115 | $exercise_stats = ExerciseLib::get_student_stats_by_question( |
116 | 116 | $question_id, |
117 | 117 | $exercise_id, |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | ); |
121 | 121 | |
122 | 122 | $answer = new Answer($question_id); |
123 | - $answer_count = $answer->selectNbrAnswers(); |
|
123 | + $answer_count = $answer->selectNbrAnswers(); |
|
124 | 124 | |
125 | 125 | for ($answer_id = 1; $answer_id <= $answer_count; $answer_id++) { |
126 | 126 | $answer_info = $answer->selectAnswer($answer_id); |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | $correct = ''; |
176 | 176 | |
177 | 177 | for ($i = 1; $i <= $answer_count; $i++) { |
178 | - $is_correct_i = $answer->isCorrect($i); |
|
179 | - if ($is_correct_i != 0 && $is_correct_i == $answer_id) { |
|
180 | - $correct = $answer->selectAnswer($i); |
|
181 | - break; |
|
182 | - } |
|
178 | + $is_correct_i = $answer->isCorrect($i); |
|
179 | + if ($is_correct_i != 0 && $is_correct_i == $answer_id) { |
|
180 | + $correct = $answer->selectAnswer($i); |
|
181 | + break; |
|
182 | + } |
|
183 | 183 | } |
184 | 184 | $data[$id]['answer'] = $correct; |
185 | 185 | $data[$id]['correct'] = $answer_info; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | } |
246 | 246 | $id++; |
247 | 247 | } |
248 | - } |
|
248 | + } |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | // Format A table |
@@ -253,19 +253,19 @@ discard block |
||
253 | 253 | $row = 0; |
254 | 254 | $column = 0; |
255 | 255 | foreach ($headers as $header) { |
256 | - $table->setHeaderContents($row, $column, $header); |
|
257 | - $column++; |
|
256 | + $table->setHeaderContents($row, $column, $header); |
|
257 | + $column++; |
|
258 | 258 | } |
259 | 259 | $row++; |
260 | 260 | foreach ($data as $row_table) { |
261 | - $column = 0; |
|
262 | - foreach ($row_table as $cell) { |
|
263 | - $table->setCellContents($row, $column, $cell); |
|
264 | - $table->updateCellAttributes($row, $column, 'align="center"'); |
|
265 | - $column++; |
|
266 | - } |
|
267 | - $table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true); |
|
268 | - $row++; |
|
261 | + $column = 0; |
|
262 | + foreach ($row_table as $cell) { |
|
263 | + $table->setCellContents($row, $column, $cell); |
|
264 | + $table->updateCellAttributes($row, $column, 'align="center"'); |
|
265 | + $column++; |
|
266 | + } |
|
267 | + $table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true); |
|
268 | + $row++; |
|
269 | 269 | } |
270 | 270 | $content .= $table->toHtml(); |
271 | 271 |
@@ -98,10 +98,10 @@ |
||
98 | 98 | }*/ |
99 | 99 | } |
100 | 100 | |
101 | - // This is a good answer, count + 1 for nmbr of clicks |
|
102 | - if ($answers['weighting'][$i] > 0) { |
|
103 | - $nmbrTries++; |
|
104 | - } |
|
101 | + // This is a good answer, count + 1 for nmbr of clicks |
|
102 | + if ($answers['weighting'][$i] > 0) { |
|
103 | + $nmbrTries++; |
|
104 | + } |
|
105 | 105 | |
106 | 106 | $hotSpot['coord'] = $answers['hotspot_coordinates'][$i]; |
107 | 107 | $data['hotspots'][] = $hotSpot; |