From a9e2cd7d24db57c498a583ede690bc1d78b8a704 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 4 Feb 2011 16:32:16 +0100 Subject: [PATCH] Fixing exercise option: feedback type --- main/exercice/exercise.class.php | 7 +++++-- main/exercice/exercise_result.php | 3 ++- main/exercice/exercise_show.php | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index a4aa613cc4..fd45128b80 100755 --- a/main/exercice/exercise.class.php +++ b/main/exercice/exercise.class.php @@ -1658,7 +1658,8 @@ class Exercise { * @return string html code */ function manage_answer($exeId, $questionId, $choice, $from = 'exercise_show', $exerciseResultCoordinates = array(), $saved_results = true, $from_database = false, $show_result = true) { - global $_configuration; + global $_configuration, $feedback_type; + $questionId = intval($questionId); $exeId = intval($exeId); $TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); @@ -1673,6 +1674,7 @@ class Exercise { $answerType = $objQuestionTmp->selectType(); $quesId = $objQuestionTmp->selectId(); $extra = $objQuestionTmp->extra; + //Extra information of the question if (!empty($extra)){ $extra = explode(':', $extra); @@ -2187,7 +2189,8 @@ class Exercise { break; } // end switch Answertype - global $origin; + global $origin; + if ($show_result) { if ($from == 'exercise_result') { diff --git a/main/exercice/exercise_result.php b/main/exercice/exercise_result.php index 270e6fecce..947393b8c7 100755 --- a/main/exercice/exercise_result.php +++ b/main/exercice/exercise_result.php @@ -58,7 +58,7 @@ $main_course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER); //temp values to move to admin settings $dsp_percent = false; //false to display total score as absolute values //debug param. 0: no display - 1: debug display -$debug=1; +$debug=0; if($debug>0){error_log('Entered exercise_result.php: '.print_r($_POST,1));} // general parameters passed via POST/GET @@ -153,6 +153,7 @@ if (api_is_course_admin() && $origin != 'learnpath') { } $exerciseTitle=text_filter($objExercise->selectTitle()); +$feedback_type = $objExercise->feedbacktype; //show exercise title if($origin != 'learnpath') {?> diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index 08ed254440..dae8bcea90 100755 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -94,6 +94,7 @@ if (empty($objExercise)) { $objExercise = new Exercise(); $objExercise->read($exercise_id); } +$feedback_type = $objExercise->feedbacktype; //If is not valid $session_control_key = get_session_time_control_key($exercise_id);