Fixing double exercise attempt when resolving an exercise within a LP

skala
Julio Montoya 14 years ago
parent 4aa2230827
commit a871812361
  1. 2
      main/exercice/exercice_submit.php
  2. 8
      main/exercice/exercise.class.php
  3. 9
      main/exercice/exercise_result.php

@ -652,7 +652,7 @@ if (!empty ($error)) {
</tr>
</table></form>';
}
if ($_configuration['live_exercise_tracking'] && $objExercise->feedbacktype != EXERCISE_FEEDBACK_TYPE_DIRECT) {
if ($objExercise->type == ONE_PER_PAGE) {
if (empty($exercise_stat_info)) {
$objExercise->save_stat_track_exercise_info($clock_expired_time, $safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id, $questionList);
}

@ -47,7 +47,7 @@ class Exercise {
$this->exercise = '';
$this->description = '';
$this->sound = '';
$this->type = 1;
$this->type = ALL_ON_ONE_PAGE;
$this->random = 0;
$this->random_answers = 0;
$this->active = 1;
@ -112,9 +112,9 @@ class Exercise {
//load questions only for exercises of type 'one question per page'
//this is needed only is there is no questions
//
// @todo not sure were in the code this is used
// @todo not sure were in the code this is used somebody mess with the exercise
global $_configuration, $questionList;
if ($this->type == 2 && $_configuration['live_exercise_tracking'] && $_SERVER['REQUEST_METHOD'] != 'POST' && defined('QUESTION_LIST_ALREADY_LOGGED')) {
if ($this->type == ONE_PER_PAGE && $_configuration['live_exercise_tracking'] && $_SERVER['REQUEST_METHOD'] != 'POST' && defined('QUESTION_LIST_ALREADY_LOGGED')) {
//if(empty($_SESSION['questionList']))
$this->questionList = $questionList;
}
@ -1407,7 +1407,7 @@ class Exercise {
public function save_stat_track_exercise_info($clock_expired_time = 0, $safe_lp_id = 0, $safe_lp_item_id = 0, $safe_lp_item_view_id = 0, $questionList = array()) {
$track_exercises = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
error_log('save_stat_track_exercise_info');
if (empty($safe_lp_id)) {
$safe_lp_id = 0;
}

@ -335,11 +335,10 @@ if (api_is_course_admin() && $origin != 'learnpath') {
$exerciseTitle=text_filter($exerciseTitle);
//show exercise title
?>
<?php if($origin != 'learnpath') {?>
<h2><?php echo Display::return_icon('quiz_big.png', get_lang('Result')).' '; echo $exerciseTitle; ?> : <?php echo get_lang("Result"); ?></h2>
<?php echo $exerciseDescription; ?>
<?php } ?>
if($origin != 'learnpath') {?>
<h2><?php echo Display::return_icon('quiz_big.png', get_lang('Result')).' '; echo $exerciseTitle; ?> : <?php echo get_lang("Result"); ?></h2>
<?php echo $exerciseDescription; ?>
<?php } ?>
<form method="get" action="exercice.php?<?php echo api_get_cidreq() ?>">
<input type="hidden" name="origin" value="<?php echo $origin; ?>" />

Loading…
Cancel
Save