@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | session_cache_limiter('public'); |
16 | 16 | |
17 | 17 | require_once '../inc/global.inc.php'; |
18 | -$this_section=SECTION_COURSES; |
|
18 | +$this_section = SECTION_COURSES; |
|
19 | 19 | |
20 | 20 | // IMPORTANT to avoid caching of documents |
21 | 21 | header('Expires: Wed, 01 Jan 1990 00:00:00 GMT'); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $doc_url = str_replace(' ', '+', $doc_url); |
33 | 33 | $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url; |
34 | 34 | |
35 | -if (! isset($_course)) { |
|
35 | +if (!isset($_course)) { |
|
36 | 36 | api_not_allowed(true); |
37 | 37 | } |
38 | 38 | $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | //if the rewrite rule asks for a directory, we redirect to the course view |
41 | 41 | if (is_dir($full_file_name)) { |
42 | 42 | //remove last slash if present |
43 | - while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); |
|
43 | + while ($doc_url{$dul = strlen($doc_url) - 1} == '/') $doc_url = substr($doc_url, 0, $dul); |
|
44 | 44 | //create the path |
45 | 45 | $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path |
46 | 46 | //redirect |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | exit; |
49 | 49 | } |
50 | 50 | |
51 | -$tbl_blogs_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT); |
|
51 | +$tbl_blogs_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT); |
|
52 | 52 | $course_id = api_get_course_int_id(); |
53 | 53 | |
54 | 54 | // launch event |
@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | api_not_allowed(true); |
14 | 14 | } |
15 | 15 | |
16 | -$this_section = SECTION_COURSES; |
|
17 | -$current_course_tool = TOOL_BLOGS; |
|
16 | +$this_section = SECTION_COURSES; |
|
17 | +$current_course_tool = TOOL_BLOGS; |
|
18 | 18 | |
19 | 19 | /* ACCESS RIGHTS */ |
20 | 20 | // notice for unauthorized people. |
21 | 21 | api_protect_course_script(true); |
22 | 22 | |
23 | 23 | $lib_path = api_get_path(LIBRARY_PATH); |
24 | -$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT); |
|
24 | +$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT); |
|
25 | 25 | |
26 | 26 | $nameTools = get_lang('Blogs'); |
27 | 27 | $DaysShort = api_get_week_days_short(); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $safe_comment_title, |
136 | 136 | $safe_comment_text, |
137 | 137 | $blog_id, |
138 | - (int)$_GET['post_id'], |
|
138 | + (int) $_GET['post_id'], |
|
139 | 139 | $_POST['comment_parent_id'], |
140 | 140 | $_POST['task_id'] |
141 | 141 | ); |
@@ -147,29 +147,29 @@ discard block |
||
147 | 147 | if (!empty($_POST['register'])) { |
148 | 148 | if (is_array($_POST['user'])) { |
149 | 149 | foreach ($_POST['user'] as $index => $user_id) { |
150 | - Blog :: set_user_subscribed((int)$_GET['blog_id'], $user_id); |
|
150 | + Blog :: set_user_subscribed((int) $_GET['blog_id'], $user_id); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | } |
154 | 154 | if (!empty($_POST['unregister'])) { |
155 | 155 | if (is_array($_POST['user'])) { |
156 | 156 | foreach ($_POST['user'] as $index => $user_id) { |
157 | - Blog :: set_user_unsubscribed((int)$_GET['blog_id'], $user_id); |
|
157 | + Blog :: set_user_unsubscribed((int) $_GET['blog_id'], $user_id); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |
161 | 161 | if (!empty($_GET['register'])) { |
162 | - Blog :: set_user_subscribed((int)$_GET['blog_id'], (int)$_GET['user_id']); |
|
162 | + Blog :: set_user_subscribed((int) $_GET['blog_id'], (int) $_GET['user_id']); |
|
163 | 163 | $return_message = array('type' => 'confirmation', 'message' => get_lang('UserRegistered')); |
164 | 164 | $flag = 1; |
165 | 165 | } |
166 | 166 | if (!empty($_GET['unregister'])) { |
167 | - Blog :: set_user_unsubscribed((int)$_GET['blog_id'], (int)$_GET['user_id']); |
|
167 | + Blog :: set_user_unsubscribed((int) $_GET['blog_id'], (int) $_GET['user_id']); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') { |
171 | 171 | if (isset($_GET['do']) && $_GET['do'] == 'delete') { |
172 | - Blog :: delete_task($blog_id, (int)$_GET['task_id']); |
|
172 | + Blog :: delete_task($blog_id, (int) $_GET['task_id']); |
|
173 | 173 | $return_message = array('type' => 'confirmation', 'message' => get_lang('TaskDeleted')); |
174 | 174 | } |
175 | 175 | |
@@ -182,9 +182,9 @@ discard block |
||
182 | 182 | if (isset($_GET['action']) && $_GET['action'] == 'view_post') { |
183 | 183 | $task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0; |
184 | 184 | |
185 | - if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') { |
|
185 | + if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') { |
|
186 | 186 | if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) { |
187 | - Blog :: delete_comment($blog_id, (int)$_GET['post_id'],(int)$_GET['comment_id']); |
|
187 | + Blog :: delete_comment($blog_id, (int) $_GET['post_id'], (int) $_GET['comment_id']); |
|
188 | 188 | $return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted')); |
189 | 189 | } else { |
190 | 190 | $error = true; |
@@ -192,9 +192,9 @@ discard block |
||
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | - if (isset($_GET['do']) && $_GET['do'] == 'delete_article') { |
|
195 | + if (isset($_GET['do']) && $_GET['do'] == 'delete_article') { |
|
196 | 196 | if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) { |
197 | - Blog :: delete_post($blog_id, (int)$_GET['article_id']); |
|
197 | + Blog :: delete_post($blog_id, (int) $_GET['article_id']); |
|
198 | 198 | $action = ''; // Article is gone, go to blog home |
199 | 199 | $return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted')); |
200 | 200 | } else { |
@@ -205,13 +205,13 @@ discard block |
||
205 | 205 | if (isset($_GET['do']) && $_GET['do'] == 'rate') { |
206 | 206 | if (isset($_GET['type']) && $_GET['type'] == 'post') { |
207 | 207 | if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) { |
208 | - Blog :: add_rating('post', $blog_id, (int)$_GET['post_id'], (int)$_GET['rating']); |
|
208 | + Blog :: add_rating('post', $blog_id, (int) $_GET['post_id'], (int) $_GET['rating']); |
|
209 | 209 | $return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded')); |
210 | 210 | } |
211 | 211 | } |
212 | 212 | if (isset($_GET['type']) && $_GET['type'] == 'comment') { |
213 | 213 | if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) { |
214 | - Blog :: add_rating('comment', $blog_id, (int)$_GET['comment_id'], (int)$_GET['rating']); |
|
214 | + Blog :: add_rating('comment', $blog_id, (int) $_GET['comment_id'], (int) $_GET['rating']); |
|
215 | 215 | $return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded')); |
216 | 216 | } |
217 | 217 | } |
@@ -290,16 +290,16 @@ discard block |
||
290 | 290 | echo '<div class=actions>'; |
291 | 291 | ?> |
292 | 292 | <a href="<?php echo api_get_self(); ?>?blog_id=<?php echo $blog_id ?>&<?php echo api_get_cidreq(); ?>" title="<?php echo get_lang('Home') ?>"> |
293 | - <?php echo Display::return_icon('blog.png', get_lang('Home'),'',ICON_SIZE_MEDIUM); ?></a> |
|
294 | - <?php if(api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?> |
|
293 | + <?php echo Display::return_icon('blog.png', get_lang('Home'), '', ICON_SIZE_MEDIUM); ?></a> |
|
294 | + <?php if (api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?> |
|
295 | 295 | <a href="<?php echo api_get_self(); ?>?action=new_post&blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>"> |
296 | - <?php echo Display::return_icon('new_article.png', get_lang('NewPost'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?> |
|
297 | - <?php if(api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?> |
|
296 | + <?php echo Display::return_icon('new_article.png', get_lang('NewPost'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?> |
|
297 | + <?php if (api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?> |
|
298 | 298 | <a href="<?php echo api_get_self(); ?>?action=manage_tasks&blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>"> |
299 | - <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?> |
|
300 | - <?php if(api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?> |
|
299 | + <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?> |
|
300 | + <?php if (api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?> |
|
301 | 301 | <a href="<?php echo api_get_self(); ?>?action=manage_members&blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>"> |
302 | - <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?> |
|
302 | + <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?> |
|
303 | 303 | <?php |
304 | 304 | echo '</div>'; |
305 | 305 | |
@@ -317,8 +317,8 @@ discard block |
||
317 | 317 | <div class="panel-heading"><?php echo get_lang('Calendar') ?></div> |
318 | 318 | <div class="panel-body"> |
319 | 319 | <?php |
320 | - $month = isset($_GET['month']) ? (int)$_GET['month'] : (int) date('m'); |
|
321 | - $year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y'); |
|
320 | + $month = isset($_GET['month']) ? (int) $_GET['month'] : (int) date('m'); |
|
321 | + $year = isset($_GET['year']) ? (int) $_GET['year'] : date('Y'); |
|
322 | 322 | Blog::display_minimonthcalendar($month, $year, $blog_id); |
323 | 323 | ?> |
324 | 324 | </div> |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $course_id = api_get_course_int_id(); |
364 | 364 | |
365 | 365 | if (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) { |
366 | - $task_id = (int)$_GET['task_id']; |
|
366 | + $task_id = (int) $_GET['task_id']; |
|
367 | 367 | } else { |
368 | 368 | $task_id = 0; |
369 | 369 | $tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER); |
@@ -31,7 +31,7 @@ |
||
31 | 31 | function createAnswersForm($form) |
32 | 32 | { |
33 | 33 | |
34 | - $form -> addElement('text','weighting', get_lang('Weighting'), array('class' => 'span1')); |
|
34 | + $form -> addElement('text', 'weighting', get_lang('Weighting'), array('class' => 'span1')); |
|
35 | 35 | global $text, $class; |
36 | 36 | // setting the save button here and not in the question class.php |
37 | 37 | $form->addButtonSave($text, 'submitQuestion'); |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | if ($is_allowedToEdit && $origin != 'learnpath') { |
74 | 74 | // the form |
75 | 75 | if (api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) { |
76 | - $actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&path='.Security::remove_XSS($hotpotatoes_path).' ">'.Display::return_icon('save.png', get_lang('Export'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
76 | + $actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&path='.Security::remove_XSS($hotpotatoes_path).' ">'.Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
77 | 77 | } |
78 | 78 | } else { |
79 | - $actions .= '<a href="exercise.php">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
79 | + $actions .= '<a href="exercise.php">'.Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | if ($is_allowedToEdit) { |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | |
99 | 99 | if ($is_allowedToEdit || $is_tutor) { |
100 | 100 | $nameTools = get_lang('StudentScore'); |
101 | - $interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises')); |
|
101 | + $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); |
|
102 | 102 | $objExerciseTmp = new Exercise(); |
103 | 103 | /*if ($objExerciseTmp->read($exercise_id)) { |
104 | 104 | $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name); |
105 | 105 | }*/ |
106 | 106 | } else { |
107 | - $interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises')); |
|
107 | + $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); |
|
108 | 108 | $objExerciseTmp = new Exercise(); |
109 | 109 | /*if ($objExerciseTmp->read($exercise_id)) { |
110 | 110 | $nameTools = get_lang('Results').': '.$objExerciseTmp->name; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $actions = Display::div($actions, array('class'=> 'actions')); |
117 | 117 | |
118 | -$extra = '<script type="text/javascript"> |
|
118 | +$extra = '<script type="text/javascript"> |
|
119 | 119 | $(document).ready(function() { |
120 | 120 | |
121 | 121 | $( "#dialog:ui-dialog" ).dialog( "destroy" ); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | // Generating group list |
170 | 170 | |
171 | 171 | $group_list = GroupManager::get_group_list(); |
172 | -$group_parameters = array('group_all:'.get_lang('All'),'group_none:'.get_lang('None')); |
|
172 | +$group_parameters = array('group_all:'.get_lang('All'), 'group_none:'.get_lang('None')); |
|
173 | 173 | |
174 | 174 | foreach ($group_list as $group) { |
175 | 175 | $group_parameters[] = $group['id'].':'.$group['name']; |
@@ -192,14 +192,14 @@ discard block |
||
192 | 192 | |
193 | 193 | // Column config |
194 | 194 | // @todo fix search firstname/lastname that doesn't work. rmove search for the moment |
195 | - $column_model = array( |
|
196 | - array('name'=>'firstname', 'index'=>'firstname', 'width'=>'50', 'align'=>'left', 'search' => 'false'), |
|
197 | - array('name'=>'lastname', 'index'=>'lastname', 'width'=>'50', 'align'=>'left', 'formatter'=>'action_formatter', 'search' => 'false'), |
|
198 | - array('name'=>'login', 'hidden'=>'true', 'index'=>'username', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
199 | - array('name'=>'group_name', 'index'=>'group_id', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
200 | - array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'false'), |
|
201 | - array('name'=>'score', 'index'=>'exe_result', 'width'=>'50', 'align'=>'left', 'search' => 'false'), |
|
202 | - array('name'=>'actions', 'index'=>'actions', 'width'=>'60', 'align'=>'left', 'search' => 'false') |
|
195 | + $column_model = array( |
|
196 | + array('name'=>'firstname', 'index'=>'firstname', 'width'=>'50', 'align'=>'left', 'search' => 'false'), |
|
197 | + array('name'=>'lastname', 'index'=>'lastname', 'width'=>'50', 'align'=>'left', 'formatter'=>'action_formatter', 'search' => 'false'), |
|
198 | + array('name'=>'login', 'hidden'=>'true', 'index'=>'username', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
199 | + array('name'=>'group_name', 'index'=>'group_id', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
200 | + array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'false'), |
|
201 | + array('name'=>'score', 'index'=>'exe_result', 'width'=>'50', 'align'=>'left', 'search' => 'false'), |
|
202 | + array('name'=>'actions', 'index'=>'actions', 'width'=>'60', 'align'=>'left', 'search' => 'false') |
|
203 | 203 | ); |
204 | 204 | |
205 | 205 | $action_links = ' |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | |
223 | 223 | //Column config |
224 | 224 | // @todo fix search firstname/lastname that doesn't work. rmove search for the moment |
225 | - $column_model = array( |
|
226 | - array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'false'), |
|
227 | - array('name'=>'score', 'index'=>'exe_result', 'width'=>'50', 'align'=>'left', 'search' => 'false'), |
|
228 | - array('name'=>'actions', 'index'=>'actions', 'width'=>'60', 'align'=>'left', 'search' => 'false') |
|
225 | + $column_model = array( |
|
226 | + array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'false'), |
|
227 | + array('name'=>'score', 'index'=>'exe_result', 'width'=>'50', 'align'=>'left', 'search' => 'false'), |
|
228 | + array('name'=>'actions', 'index'=>'actions', 'width'=>'60', 'align'=>'left', 'search' => 'false') |
|
229 | 229 | ); |
230 | 230 | } |
231 | 231 |
@@ -18,7 +18,7 @@ |
||
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)).' '; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | function add_category_form($action) { |
148 | 148 | $action = Security::remove_XSS($action); |
149 | 149 | // initiate the object |
150 | - $form = new FormValidator('note', 'post', api_get_self() . '?action=' . $action); |
|
150 | + $form = new FormValidator('note', 'post', api_get_self().'?action='.$action); |
|
151 | 151 | // Setting the form elements |
152 | 152 | $form->addElement('header', get_lang('AddACategory')); |
153 | 153 | $form->addElement('text', 'category_name', get_lang('CategoryName'), array('size' => '95')); |
@@ -189,19 +189,19 @@ discard block |
||
189 | 189 | |
190 | 190 | function display_add_category() { |
191 | 191 | echo '<div class="actions">'; |
192 | - echo '<a href="exercise.php?' . api_get_cidreq() . '">' . |
|
193 | - Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
194 | - echo '<a href="' . api_get_self() . '?action=addcategory">' . |
|
195 | - Display::return_icon('question_category.gif', get_lang('AddACategory')) . '</a>'; |
|
192 | + echo '<a href="exercise.php?'.api_get_cidreq().'">'. |
|
193 | + Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
194 | + echo '<a href="'.api_get_self().'?action=addcategory">'. |
|
195 | + Display::return_icon('question_category.gif', get_lang('AddACategory')).'</a>'; |
|
196 | 196 | echo '</div>'; |
197 | 197 | echo "<br/>"; |
198 | - echo "<fieldset><legend>" . get_lang('QuestionCategory') . "</legend></fieldset>"; |
|
198 | + echo "<fieldset><legend>".get_lang('QuestionCategory')."</legend></fieldset>"; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | // display goback to category list page link |
202 | 202 | function display_goback() { |
203 | 203 | echo '<div class="actions">'; |
204 | - echo '<a href="' . api_get_self() . '">' . |
|
205 | - Display::return_icon('back.png', get_lang('BackToCategoryList'), array(), 32) . '</a>'; |
|
204 | + echo '<a href="'.api_get_self().'">'. |
|
205 | + Display::return_icon('back.png', get_lang('BackToCategoryList'), array(), 32).'</a>'; |
|
206 | 206 | echo '</div>'; |
207 | 207 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | require_once '../inc/global.inc.php'; |
14 | 14 | |
15 | -$current_course_tool = TOOL_QUIZ; |
|
15 | +$current_course_tool = TOOL_QUIZ; |
|
16 | 16 | |
17 | 17 | // Clear the exercise session just in case |
18 | 18 | if (isset($_SESSION['objExercise'])) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | if ($time_control) { |
51 | 51 | // Get time left for expiring time |
52 | - $time_left = api_strtotime($clock_expired_time,'UTC') - time(); |
|
52 | + $time_left = api_strtotime($clock_expired_time, 'UTC') - time(); |
|
53 | 53 | |
54 | 54 | $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/stylesheet/jquery.epiclock.css'); |
55 | 55 | $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/renderers/minute/epiclock.minute.css'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | $html = ''; |
74 | 74 | $message = ''; |
75 | -$html.= '<div class="exercise">'; |
|
75 | +$html .= '<div class="exercise">'; |
|
76 | 76 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
77 | 77 | $edit_link = ''; |
78 | 78 | if ($is_allowed_to_edit && $objExercise->sessionId == $sessionId) { |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | $attempt_result['exe_result'], |
178 | 178 | $attempt_result['exe_weighting'] |
179 | 179 | ); |
180 | - $attempt_url = api_get_path(WEB_CODE_PATH) . 'exercice/result.php?'; |
|
181 | - $attempt_url .= api_get_cidreq() . '&show_headers=1&'; |
|
180 | + $attempt_url = api_get_path(WEB_CODE_PATH).'exercice/result.php?'; |
|
181 | + $attempt_url .= api_get_cidreq().'&show_headers=1&'; |
|
182 | 182 | $attempt_url .= http_build_query([ |
183 | 183 | 'id' => $attempt_result['exe_id'] |
184 | 184 | ]); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | get_lang('Show'), |
189 | 189 | $attempt_url, |
190 | 190 | [ |
191 | - 'class' => $btn_class . 'btn btn-default', |
|
191 | + 'class' => $btn_class.'btn btn-default', |
|
192 | 192 | 'data-title' => get_lang('Show'), |
193 | 193 | 'data-size' => 'lg' |
194 | 194 | ] |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | ), |
207 | 207 | 'userIp' => $attempt_result['user_ip'] |
208 | 208 | ); |
209 | - $attempt_link .= " " . $teacher_revised; |
|
209 | + $attempt_link .= " ".$teacher_revised; |
|
210 | 210 | |
211 | 211 | if (in_array( |
212 | 212 | $objExercise->results_disabled, |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | $attempt_message = Display::return_message($attempt_message, 'info'); |
284 | 284 | } |
285 | 285 | if ($visible_return['value'] == true) { |
286 | - $message .= $attempt_message; |
|
286 | + $message .= $attempt_message; |
|
287 | 287 | } |
288 | 288 | } |
289 | 289 | |
290 | 290 | if ($time_control) { |
291 | - $html.= $objExercise->return_time_left_div(); |
|
291 | + $html .= $objExercise->return_time_left_div(); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | $html .= $message; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $table_content, |
309 | 309 | ['class' => 'table-responsive'] |
310 | 310 | ); |
311 | -$html.= '</div>'; |
|
311 | +$html .= '</div>'; |
|
312 | 312 | echo $html; |
313 | 313 | |
314 | 314 | Display::display_footer(); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $row = Database::fetch_array($res); |
58 | 58 | $this->id = $row['id']; |
59 | 59 | $this->name = $row['title']; |
60 | - $this->description = $row['description']; |
|
60 | + $this->description = $row['description']; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | /** |
197 | 197 | * @param string $in_color |
198 | 198 | */ |
199 | - public function display($in_color="#E0EBF5") |
|
199 | + public function display($in_color = "#E0EBF5") |
|
200 | 200 | { |
201 | 201 | echo "<textarea style='background-color:$in_color; width:60%; height:100px;'>"; |
202 | 202 | print_r($this); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public static function getCategoryListInfo($in_field = "", $courseId = "") |
213 | 213 | { |
214 | - if (empty($courseId) || $courseId=="") { |
|
214 | + if (empty($courseId) || $courseId == "") { |
|
215 | 215 | $courseId = api_get_course_int_id(); |
216 | 216 | } |
217 | 217 | $table = Database :: get_course_table(TABLE_QUIZ_QUESTION_CATEGORY); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * |
252 | 252 | * @return int |
253 | 253 | */ |
254 | - public static function getCategoryForQuestion($questionId, $courseId ="") |
|
254 | + public static function getCategoryForQuestion($questionId, $courseId = "") |
|
255 | 255 | { |
256 | 256 | $result = 0; |
257 | 257 | if (empty($courseId) || $courseId == "") { |
@@ -291,11 +291,11 @@ discard block |
||
291 | 291 | $questionId, |
292 | 292 | $courseId = "" |
293 | 293 | ) { |
294 | - if (empty($courseId) || $courseId=="") { |
|
294 | + if (empty($courseId) || $courseId == "") { |
|
295 | 295 | $courseId = api_get_course_int_id(); |
296 | 296 | } |
297 | 297 | $catid = TestCategory::getCategoryForQuestion($questionId, $courseId); |
298 | - $result = ""; // result |
|
298 | + $result = ""; // result |
|
299 | 299 | $table = Database::get_course_table(TABLE_QUIZ_QUESTION_CATEGORY); |
300 | 300 | $catid = intval($catid); |
301 | 301 | $sql = "SELECT title FROM $table |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $quiz->read($in_testid); |
324 | 324 | $tabQuestionList = $quiz->selectQuestionList(); |
325 | 325 | // the array given by selectQuestionList start at indice 1 and not at indice 0 !!! ??? |
326 | - for ($i=1; $i <= count($tabQuestionList); $i++) { |
|
326 | + for ($i = 1; $i <= count($tabQuestionList); $i++) { |
|
327 | 327 | if (!in_array(TestCategory::getCategoryForQuestion($tabQuestionList[$i]), $result)) { |
328 | 328 | $result[] = TestCategory::getCategoryForQuestion($tabQuestionList[$i]); |
329 | 329 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | { |
344 | 344 | $tabcatName = array(); |
345 | 345 | $tabcatID = self::getListOfCategoriesIDForTest($in_testid); |
346 | - for ($i=0; $i < count($tabcatID); $i++) { |
|
346 | + for ($i = 0; $i < count($tabcatID); $i++) { |
|
347 | 347 | $cat = new TestCategory($tabcatID[$i]); |
348 | 348 | $tabcatName[$cat->id] = $cat->name; |
349 | 349 | } |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | $quiz->read($exerciseId); |
378 | 378 | $tabQuestionList = $quiz->selectQuestionList(); |
379 | 379 | // the array given by selectQuestionList start at indice 1 and not at indice 0 !!! ? ? ? |
380 | - for ($i=1; $i <= count($tabQuestionList); $i++) { |
|
380 | + for ($i = 1; $i <= count($tabQuestionList); $i++) { |
|
381 | 381 | if (TestCategory::getCategoryForQuestion($tabQuestionList[$i]) == $categoryId) { |
382 | 382 | $nbCatResult++; |
383 | 383 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | { |
397 | 397 | $nbquestionresult = 0; |
398 | 398 | $tabcatid = TestCategory::getListOfCategoriesIDForTest($exerciseId); |
399 | - for ($i=0; $i < count($tabcatid); $i++) { |
|
399 | + for ($i = 0; $i < count($tabcatid); $i++) { |
|
400 | 400 | if ($tabcatid[$i] > 0) { // 0 = no category for this questio |
401 | 401 | $nbQuestionInThisCat = TestCategory::getNumberOfQuestionsInCategoryForTest($exerciseId, $tabcatid[$i]); |
402 | 402 | if ($nbQuestionInThisCat > $in_nbrandom) { |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | } |
427 | 427 | $tabcatobject = TestCategory::getCategoryListInfo("", $courseId); |
428 | 428 | $tabresult = array("0"=>get_lang('NoCategorySelected')); |
429 | - for ($i=0; $i < count($tabcatobject); $i++) { |
|
429 | + for ($i = 0; $i < count($tabcatobject); $i++) { |
|
430 | 430 | $tabresult[$tabcatobject[$i]->id] = $tabcatobject[$i]->name; |
431 | 431 | } |
432 | 432 | return $tabresult; |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | */ |
501 | 501 | public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1) |
502 | 502 | { |
503 | - $is_student = !(api_is_allowed_to_edit(null,true) || api_is_session_admin()); |
|
503 | + $is_student = !(api_is_allowed_to_edit(null, true) || api_is_session_admin()); |
|
504 | 504 | // @todo fix $_SESSION['objExercise'] |
505 | 505 | $objExercise = isset($_SESSION['objExercise']) ? $_SESSION['objExercise'] : null; |
506 | 506 | if (!empty($objExercise)) { |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | public static function sortTabByBracketLabel($in_tab) |
539 | 539 | { |
540 | 540 | $tabResult = array(); |
541 | - $tabCatName = array(); // tab of category name |
|
541 | + $tabCatName = array(); // tab of category name |
|
542 | 542 | while (list($cat_id, $tabquestion) = each($in_tab)) { |
543 | 543 | $catTitle = new TestCategory($cat_id); |
544 | 544 | $tabCatName[$cat_id] = $catTitle->name; |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | $res_num_max = 0; |
565 | 565 | // foreach question |
566 | 566 | $tabcatid = TestCategory::getListOfCategoriesIDForTest($exerciseId); |
567 | - for ($i=0; $i < count($tabcatid); $i++) { |
|
567 | + for ($i = 0; $i < count($tabcatid); $i++) { |
|
568 | 568 | if ($tabcatid[$i] > 0) { // 0 = no category for this question |
569 | 569 | $nbQuestionInThisCat = TestCategory::getNumberOfQuestionsInCategoryForTest($exerciseId, $tabcatid[$i]); |
570 | 570 | if ($nbQuestionInThisCat > $res_num_max) { |
@@ -750,20 +750,20 @@ discard block |
||
750 | 750 | $tmpobj = new TestCategory($category['id']); |
751 | 751 | $nb_question = $tmpobj->getCategoryQuestionsNumber(); |
752 | 752 | $rowname = self::protectJSDialogQuote($category['title']); |
753 | - $nb_question_label = $nb_question == 1 ? $nb_question . ' ' . get_lang('Question') : $nb_question . ' ' . get_lang('Questions'); |
|
753 | + $nb_question_label = $nb_question == 1 ? $nb_question.' '.get_lang('Question') : $nb_question.' '.get_lang('Questions'); |
|
754 | 754 | |
755 | 755 | //$html .= '<div class="sectiontitle" id="id_cat' . $category['id'] . '">'; |
756 | - $content = "<span style='float:right'>" . $nb_question_label . "</span>"; |
|
756 | + $content = "<span style='float:right'>".$nb_question_label."</span>"; |
|
757 | 757 | |
758 | 758 | $content .= '<div class="sectioncomment">'; |
759 | 759 | $content .= $category['description']; |
760 | 760 | $content .= '</div>'; |
761 | 761 | |
762 | - $links = '<a href="' . api_get_self() . '?action=editcategory&category_id=' . $category['id'] . '">' . |
|
763 | - Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
764 | - $links .= ' <a href="' . api_get_self() . '?action=deletecategory&category_id=' . $category['id'] . '" '; |
|
765 | - $links .= 'onclick="return confirmDelete(\'' . self::protectJSDialogQuote(get_lang('DeleteCategoryAreYouSure') . '[' . $rowname) . '] ?\', \'id_cat' . $category['id'] . '\');">'; |
|
766 | - $links .= Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
762 | + $links = '<a href="'.api_get_self().'?action=editcategory&category_id='.$category['id'].'">'. |
|
763 | + Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
764 | + $links .= ' <a href="'.api_get_self().'?action=deletecategory&category_id='.$category['id'].'" '; |
|
765 | + $links .= 'onclick="return confirmDelete(\''.self::protectJSDialogQuote(get_lang('DeleteCategoryAreYouSure').'['.$rowname).'] ?\', \'id_cat'.$category['id'].'\');">'; |
|
766 | + $links .= Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
767 | 767 | $html .= Display::panel($content, $category['title'].$links); |
768 | 768 | } |
769 | 769 |
@@ -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> |