@@ -269,7 +269,9 @@ discard block |
||
| 269 | 269 | $clock_expired_time = null; |
| 270 | 270 | |
| 271 | 271 | if (empty($exercise_stat_info)) { |
| 272 | - if ($debug) error_log('5 $exercise_stat_info is empty '); |
|
| 272 | + if ($debug) { |
|
| 273 | + error_log('5 $exercise_stat_info is empty '); |
|
| 274 | + } |
|
| 273 | 275 | $total_weight = 0; |
| 274 | 276 | $questionList = $objExercise->get_validated_question_list(); |
| 275 | 277 | foreach ($questionListUncompressed as $question_id) { |
@@ -280,11 +282,17 @@ discard block |
||
| 280 | 282 | if ($time_control) { |
| 281 | 283 | $expected_time = $current_timestamp + $total_seconds; |
| 282 | 284 | |
| 283 | - if ($debug) error_log('5.1. $current_timestamp '.$current_timestamp); |
|
| 284 | - if ($debug) error_log('5.2. $expected_time '.$expected_time); |
|
| 285 | + if ($debug) { |
|
| 286 | + error_log('5.1. $current_timestamp '.$current_timestamp); |
|
| 287 | + } |
|
| 288 | + if ($debug) { |
|
| 289 | + error_log('5.2. $expected_time '.$expected_time); |
|
| 290 | + } |
|
| 285 | 291 | |
| 286 | 292 | $clock_expired_time = api_get_utc_datetime($expected_time); |
| 287 | - if ($debug) error_log('5.3. $expected_time '.$clock_expired_time); |
|
| 293 | + if ($debug) { |
|
| 294 | + error_log('5.3. $expected_time '.$clock_expired_time); |
|
| 295 | + } |
|
| 288 | 296 | |
| 289 | 297 | //Sessions that contain the expired time |
| 290 | 298 | $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time; |
@@ -304,8 +312,10 @@ discard block |
||
| 304 | 312 | $learnpath_item_id, |
| 305 | 313 | $learnpath_item_view_id |
| 306 | 314 | ); |
| 307 | - if ($debug) error_log("5.5 exercise_stat_info[] exists getting exe_id $exe_id"); |
|
| 308 | -} else { |
|
| 315 | + if ($debug) { |
|
| 316 | + error_log("5.5 exercise_stat_info[] exists getting exe_id $exe_id"); |
|
| 317 | + } |
|
| 318 | + } else { |
|
| 309 | 319 | $exe_id = $exercise_stat_info['exe_id']; |
| 310 | 320 | // Remember last question id position. |
| 311 | 321 | $isFirstTime = Session::read('firstTime'); |
@@ -327,8 +337,10 @@ discard block |
||
| 327 | 337 | } |
| 328 | 338 | } |
| 329 | 339 | |
| 330 | - if ($debug) error_log("5 exercise_stat_info[] exists getting exe_id $exe_id "); |
|
| 331 | -} |
|
| 340 | + if ($debug) { |
|
| 341 | + error_log("5 exercise_stat_info[] exists getting exe_id $exe_id "); |
|
| 342 | + } |
|
| 343 | + } |
|
| 332 | 344 | |
| 333 | 345 | $questionListInSession = Session::read('questionList'); |
| 334 | 346 | |
@@ -384,9 +396,15 @@ discard block |
||
| 384 | 396 | * If the expired time is major that zero(0) then the expired time is compute on this time. |
| 385 | 397 | */ |
| 386 | 398 | if ($time_control) { |
| 387 | - if ($debug) error_log('7.1. Time control is enabled'); |
|
| 388 | - if ($debug) error_log('7.2. $current_expired_time_key '.$current_expired_time_key); |
|
| 389 | - if ($debug) error_log('7.3. $_SESSION[expired_time][$current_expired_time_key] '.$_SESSION['expired_time'][$current_expired_time_key]); |
|
| 399 | + if ($debug) { |
|
| 400 | + error_log('7.1. Time control is enabled'); |
|
| 401 | + } |
|
| 402 | + if ($debug) { |
|
| 403 | + error_log('7.2. $current_expired_time_key '.$current_expired_time_key); |
|
| 404 | + } |
|
| 405 | + if ($debug) { |
|
| 406 | + error_log('7.3. $_SESSION[expired_time][$current_expired_time_key] '.$_SESSION['expired_time'][$current_expired_time_key]); |
|
| 407 | + } |
|
| 390 | 408 | |
| 391 | 409 | if (!isset($_SESSION['expired_time'][$current_expired_time_key])) { |
| 392 | 410 | //Timer - Get expired_time for a student |
@@ -473,7 +491,9 @@ discard block |
||
| 473 | 491 | } |
| 474 | 492 | } |
| 475 | 493 | |
| 476 | -if ($debug) error_log('8. Question list loaded '.print_r($questionList, 1)); |
|
| 494 | +if ($debug) { |
|
| 495 | + error_log('8. Question list loaded '.print_r($questionList, 1)); |
|
| 496 | +} |
|
| 477 | 497 | |
| 478 | 498 | //Real question count |
| 479 | 499 | $question_count = 0; |