@@ -124,7 +124,9 @@ |
||
| 124 | 124 | |
| 125 | 125 | if (file_exists($saveDir.'/'.$filename.'.'.$extension)) { |
| 126 | 126 | $i = 1; |
| 127 | - while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) $i++; |
|
| 127 | + while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) { |
|
| 128 | + $i++; |
|
| 129 | + } |
|
| 128 | 130 | $paintFileName = $filename.'_'.$i.'.'.$extension; |
| 129 | 131 | $title = $filename.'_'.$i.'.'.$extension; |
| 130 | 132 | } |
@@ -17,8 +17,7 @@ |
||
| 17 | 17 | $webcamname = $params['webcamname']; |
| 18 | 18 | $webcamdir = $params['webcamdir']; |
| 19 | 19 | $webcamuserid = $params['webcamuserid']; |
| 20 | -} |
|
| 21 | -else { |
|
| 20 | +} else { |
|
| 22 | 21 | api_not_allowed(); |
| 23 | 22 | die(); |
| 24 | 23 | } |
@@ -442,7 +442,8 @@ discard block |
||
| 442 | 442 | $sessionId, |
| 443 | 443 | $userId = null, |
| 444 | 444 | $onlyUserList = array() |
| 445 | -) { |
|
| 445 | +) |
|
| 446 | +{ |
|
| 446 | 447 | $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
| 447 | 448 | $user_table = Database::get_main_table(TABLE_MAIN_USER); |
| 448 | 449 | |
@@ -1369,7 +1370,8 @@ discard block |
||
| 1369 | 1370 | $direction, |
| 1370 | 1371 | $where_condition, |
| 1371 | 1372 | $getCount = false |
| 1372 | -) { |
|
| 1373 | +) |
|
| 1374 | +{ |
|
| 1373 | 1375 | $workTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
| 1374 | 1376 | $workTableAssignment = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); |
| 1375 | 1377 | $courseInfo = api_get_course_info(); |
@@ -1528,7 +1530,8 @@ discard block |
||
| 1528 | 1530 | $direction, |
| 1529 | 1531 | $where_condition, |
| 1530 | 1532 | $getCount = false |
| 1531 | -) { |
|
| 1533 | +) |
|
| 1534 | +{ |
|
| 1532 | 1535 | $workTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
| 1533 | 1536 | $workTableAssignment = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); |
| 1534 | 1537 | |
@@ -1715,7 +1718,8 @@ discard block |
||
| 1715 | 1718 | $studentId = null, |
| 1716 | 1719 | $whereCondition = '', |
| 1717 | 1720 | $getCount = false |
| 1718 | -) { |
|
| 1721 | +) |
|
| 1722 | +{ |
|
| 1719 | 1723 | if ($getCount) { |
| 1720 | 1724 | $select1 = " SELECT count(u.user_id) as count "; |
| 1721 | 1725 | $select2 = " SELECT count(u.user_id) as count "; |
@@ -1916,7 +1920,8 @@ discard block |
||
| 1916 | 1920 | $getCount = false, |
| 1917 | 1921 | $courseId = 0, |
| 1918 | 1922 | $sessionId = 0 |
| 1919 | -) { |
|
| 1923 | +) |
|
| 1924 | +{ |
|
| 1920 | 1925 | $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
| 1921 | 1926 | $user_table = Database::get_main_table(TABLE_MAIN_USER); |
| 1922 | 1927 | |
@@ -2870,7 +2875,8 @@ discard block |
||
| 2870 | 2875 | $groupId = null, |
| 2871 | 2876 | $sessionId = null, |
| 2872 | 2877 | $getCount = false |
| 2873 | -) { |
|
| 2878 | +) |
|
| 2879 | +{ |
|
| 2874 | 2880 | $usersInWork = null; |
| 2875 | 2881 | $usersInCourse = null; |
| 2876 | 2882 | |
@@ -3103,7 +3109,8 @@ discard block |
||
| 3103 | 3109 | $parentId, |
| 3104 | 3110 | $courseInfo = array(), |
| 3105 | 3111 | $sessionId = 0 |
| 3106 | -) { |
|
| 3112 | +) |
|
| 3113 | +{ |
|
| 3107 | 3114 | if (empty($courseInfo)) { |
| 3108 | 3115 | $courseInfo = api_get_course_info(); |
| 3109 | 3116 | } |
@@ -3147,7 +3154,8 @@ discard block |
||
| 3147 | 3154 | $parentId, |
| 3148 | 3155 | $courseInfo = array(), |
| 3149 | 3156 | $sessionId = 0 |
| 3150 | -) { |
|
| 3157 | +) |
|
| 3158 | +{ |
|
| 3151 | 3159 | if (empty($courseInfo)) { |
| 3152 | 3160 | $courseInfo = api_get_course_info(); |
| 3153 | 3161 | } |
@@ -3196,7 +3204,8 @@ discard block |
||
| 3196 | 3204 | $parentInfo, |
| 3197 | 3205 | $courseInfo = array(), |
| 3198 | 3206 | $sessionId = 0 |
| 3199 | -) { |
|
| 3207 | +) |
|
| 3208 | +{ |
|
| 3200 | 3209 | if (empty($courseInfo)) { |
| 3201 | 3210 | $courseInfo = api_get_course_info(); |
| 3202 | 3211 | } |
@@ -3813,7 +3822,8 @@ discard block |
||
| 3813 | 3822 | $file = [], |
| 3814 | 3823 | $checkDuplicated = false, |
| 3815 | 3824 | $showFlashMessage = true |
| 3816 | -) { |
|
| 3825 | +) |
|
| 3826 | +{ |
|
| 3817 | 3827 | $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
| 3818 | 3828 | |
| 3819 | 3829 | $courseId = $courseInfo['real_id']; |
@@ -4921,7 +4931,8 @@ discard block |
||
| 4921 | 4931 | $sidx, |
| 4922 | 4932 | $sord, |
| 4923 | 4933 | $getCount = false |
| 4924 | -) { |
|
| 4934 | +) |
|
| 4935 | +{ |
|
| 4925 | 4936 | $my_folder_data = get_work_data_by_id($workId); |
| 4926 | 4937 | $workParents = array(); |
| 4927 | 4938 | if (empty($my_folder_data)) { |
@@ -5202,7 +5213,8 @@ discard block |
||
| 5202 | 5213 | $courseInfo, |
| 5203 | 5214 | $sessionId, |
| 5204 | 5215 | $format = 'pdf' |
| 5205 | -) { |
|
| 5216 | +) |
|
| 5217 | +{ |
|
| 5206 | 5218 | if (empty($courseInfo)) { |
| 5207 | 5219 | return false; |
| 5208 | 5220 | } |
@@ -1449,7 +1449,8 @@ |
||
| 1449 | 1449 | $value, |
| 1450 | 1450 | $regs |
| 1451 | 1451 | ) |
| 1452 | - ) { // possibly in <...> |
|
| 1452 | + ) { |
|
| 1453 | +// possibly in <...> |
|
| 1453 | 1454 | if (($kwlist = trim($regs[1])) != '') { |
| 1454 | 1455 | $kw = '<i kw="'.htmlspecialchars($kwlist).'">'; |
| 1455 | 1456 | } else { |
@@ -3292,7 +3292,9 @@ discard block |
||
| 3292 | 3292 | ); |
| 3293 | 3293 | } |
| 3294 | 3294 | |
| 3295 | - if ($debug) error_log('Start answer loop '); |
|
| 3295 | + if ($debug) { |
|
| 3296 | + error_log('Start answer loop '); |
|
| 3297 | + } |
|
| 3296 | 3298 | |
| 3297 | 3299 | for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) { |
| 3298 | 3300 | $answer = $objAnswerTmp->selectAnswer($answerId); |
@@ -3406,7 +3408,9 @@ discard block |
||
| 3406 | 3408 | } |
| 3407 | 3409 | $totalScore += $answerWeighting; |
| 3408 | 3410 | |
| 3409 | - if ($debug) error_log("studentChoice: $studentChoice"); |
|
| 3411 | + if ($debug) { |
|
| 3412 | + error_log("studentChoice: $studentChoice"); |
|
| 3413 | + } |
|
| 3410 | 3414 | break; |
| 3411 | 3415 | case GLOBAL_MULTIPLE_ANSWER: |
| 3412 | 3416 | if ($from_database) { |
@@ -3431,7 +3435,9 @@ discard block |
||
| 3431 | 3435 | $real_answers[$answerId] = (bool) $studentChoice; |
| 3432 | 3436 | } |
| 3433 | 3437 | $totalScore += $answerWeighting; |
| 3434 | - if ($debug) error_log("studentChoice: $studentChoice"); |
|
| 3438 | + if ($debug) { |
|
| 3439 | + error_log("studentChoice: $studentChoice"); |
|
| 3440 | + } |
|
| 3435 | 3441 | break; |
| 3436 | 3442 | case MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE: |
| 3437 | 3443 | if ($from_database) { |
@@ -4245,7 +4251,9 @@ discard block |
||
| 4245 | 4251 | } // end switch Answertype |
| 4246 | 4252 | |
| 4247 | 4253 | if ($show_result) { |
| 4248 | - if ($debug) error_log('Showing questions $from '.$from); |
|
| 4254 | + if ($debug) { |
|
| 4255 | + error_log('Showing questions $from '.$from); |
|
| 4256 | + } |
|
| 4249 | 4257 | if ($from == 'exercise_result') { |
| 4250 | 4258 | //display answers (if not matching type, or if the answer is correct) |
| 4251 | 4259 | if ( |
@@ -4529,7 +4537,8 @@ discard block |
||
| 4529 | 4537 | $url_hotspot = $destination_items[4]; |
| 4530 | 4538 | } |
| 4531 | 4539 | } |
| 4532 | - } else { // the first delineation feedback |
|
| 4540 | + } else { |
|
| 4541 | +// the first delineation feedback |
|
| 4533 | 4542 | if ($debug > 0) { |
| 4534 | 4543 | error_log(__LINE__.' first', 0); |
| 4535 | 4544 | } |
@@ -4557,7 +4566,9 @@ discard block |
||
| 4557 | 4566 | } |
| 4558 | 4567 | } |
| 4559 | 4568 | } else { |
| 4560 | - if ($debug) error_log('Showing questions $from '.$from); |
|
| 4569 | + if ($debug) { |
|
| 4570 | + error_log('Showing questions $from '.$from); |
|
| 4571 | + } |
|
| 4561 | 4572 | |
| 4562 | 4573 | switch ($answerType) { |
| 4563 | 4574 | case UNIQUE_ANSWER: |
@@ -4874,7 +4885,8 @@ discard block |
||
| 4874 | 4885 | $url_hotspot = $destination_items[4]; |
| 4875 | 4886 | } |
| 4876 | 4887 | } |
| 4877 | - } else { // the first delineation feedback |
|
| 4888 | + } else { |
|
| 4889 | +// the first delineation feedback |
|
| 4878 | 4890 | if ($debug > 0) { |
| 4879 | 4891 | error_log(__LINE__.' first', 0); |
| 4880 | 4892 | } |
@@ -4919,10 +4931,14 @@ discard block |
||
| 4919 | 4931 | } |
| 4920 | 4932 | } |
| 4921 | 4933 | } |
| 4922 | - if ($debug) error_log(' ------ '); |
|
| 4934 | + if ($debug) { |
|
| 4935 | + error_log(' ------ '); |
|
| 4936 | + } |
|
| 4923 | 4937 | } // end for that loops over all answers of the current question |
| 4924 | 4938 | |
| 4925 | - if ($debug) error_log('-- end answer loop --'); |
|
| 4939 | + if ($debug) { |
|
| 4940 | + error_log('-- end answer loop --'); |
|
| 4941 | + } |
|
| 4926 | 4942 | |
| 4927 | 4943 | $final_answer = true; |
| 4928 | 4944 | |
@@ -4994,7 +5010,9 @@ discard block |
||
| 4994 | 5010 | // TODO Change this, because it is wrong to show the user |
| 4995 | 5011 | // some results that haven't been stored in the database yet |
| 4996 | 5012 | if ($answerType == HOT_SPOT || $answerType == HOT_SPOT_ORDER || $answerType == HOT_SPOT_DELINEATION) { |
| 4997 | - if ($debug) error_log('$from AND this is a hotspot kind of question '); |
|
| 5013 | + if ($debug) { |
|
| 5014 | + error_log('$from AND this is a hotspot kind of question '); |
|
| 5015 | + } |
|
| 4998 | 5016 | $my_exe_id = 0; |
| 4999 | 5017 | $from_database = 0; |
| 5000 | 5018 | if ($answerType == HOT_SPOT_DELINEATION) { |
@@ -5195,8 +5213,12 @@ discard block |
||
| 5195 | 5213 | // stored by exercise_results.php (using the session) |
| 5196 | 5214 | |
| 5197 | 5215 | if ($saved_results) { |
| 5198 | - if ($debug) error_log("Save question results $saved_results"); |
|
| 5199 | - if ($debug) error_log(print_r($choice, 1)); |
|
| 5216 | + if ($debug) { |
|
| 5217 | + error_log("Save question results $saved_results"); |
|
| 5218 | + } |
|
| 5219 | + if ($debug) { |
|
| 5220 | + error_log(print_r($choice, 1)); |
|
| 5221 | + } |
|
| 5200 | 5222 | |
| 5201 | 5223 | if (empty($choice)) { |
| 5202 | 5224 | $choice = 0; |
@@ -166,13 +166,19 @@ |
||
| 166 | 166 | |
| 167 | 167 | <select name="id_coach[]" class="form-control" multiple> |
| 168 | 168 | <option value="0">----- <?php echo get_lang("Choose") ?> -----</option> |
| 169 | - <option value="0" <?php if (count($arr_infos) == 0) echo 'selected="selected"'; ?>> |
|
| 169 | + <option value="0" <?php if (count($arr_infos) == 0) { |
|
| 170 | + echo 'selected="selected"'; |
|
| 171 | +} |
|
| 172 | +?>> |
|
| 170 | 173 | <?php echo get_lang('None') ?> |
| 171 | 174 | </option> |
| 172 | 175 | <?php |
| 173 | 176 | foreach ($coaches as $enreg) { |
| 174 | 177 | ?> |
| 175 | - <option value="<?php echo $enreg['user_id']; ?>" <?php if (((is_array($arr_infos) && in_array($enreg['user_id'], $arr_infos)))) echo 'selected="selected"'; ?>> |
|
| 178 | + <option value="<?php echo $enreg['user_id']; ?>" <?php if (((is_array($arr_infos) && in_array($enreg['user_id'], $arr_infos)))) { |
|
| 179 | + echo 'selected="selected"'; |
|
| 180 | +} |
|
| 181 | +?>> |
|
| 176 | 182 | <?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?> |
| 177 | 183 | </option> |
| 178 | 184 | <?php |
@@ -132,7 +132,8 @@ |
||
| 132 | 132 | */ |
| 133 | 133 | function pptConverterGetCommandBaseParams() |
| 134 | 134 | { |
| 135 | - if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
|
| 135 | + if (IS_WINDOWS_OS) { |
|
| 136 | +// IS_WINDOWS_OS has been defined in main_api.lib.php |
|
| 136 | 137 | $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
| 137 | 138 | $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar'; |
| 138 | 139 | $cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$classPath.'" DokeosConverter'; |
@@ -341,7 +341,10 @@ discard block |
||
| 341 | 341 | $searchForm->display(); |
| 342 | 342 | echo '</div>'; |
| 343 | 343 | ?> |
| 344 | -<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;"> |
|
| 344 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) { |
|
| 345 | + echo '&add=true'; |
|
| 346 | +} |
|
| 347 | +?>" style="margin:0px;"> |
|
| 345 | 348 | <?php |
| 346 | 349 | echo '<legend>'.$tool_name.': '.$data['name'].'</legend>'; |
| 347 | 350 | |
@@ -419,7 +422,10 @@ discard block |
||
| 419 | 422 | ?> |
| 420 | 423 | <br /> |
| 421 | 424 | <label class="control-label"> |
| 422 | - <input type="checkbox" <?php if ($user_with_any_group) echo 'checked="checked"'; ?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id"> |
|
| 425 | + <input type="checkbox" <?php if ($user_with_any_group) { |
|
| 426 | + echo 'checked="checked"'; |
|
| 427 | +} |
|
| 428 | +?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id"> |
|
| 423 | 429 | <?php echo get_lang('UsersRegisteredInAnyGroup'); ?> |
| 424 | 430 | </label> |
| 425 | 431 | </div> |
@@ -48,7 +48,8 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * |
| 50 | 50 | */ |
| 51 | -function fire_vhost_cron($vhost) { |
|
| 51 | +function fire_vhost_cron($vhost) |
|
| 52 | +{ |
|
| 52 | 53 | global $VCRON; |
| 53 | 54 | |
| 54 | 55 | if ($VCRON->TRACE_ENABLE) { |
@@ -140,7 +141,8 @@ discard block |
||
| 140 | 141 | * |
| 141 | 142 | * |
| 142 | 143 | */ |
| 143 | -function exec_vhost_cron($vhost) { |
|
| 144 | +function exec_vhost_cron($vhost) |
|
| 145 | +{ |
|
| 144 | 146 | global $VCRON, $DB, $_configuration; |
| 145 | 147 | |
| 146 | 148 | if ($VCRON->TRACE_ENABLE) { |