Kaynağa Gözat

Fixing exercise option: feedback type

Julio Montoya 14 yıl önce
ebeveyn
işleme
a9e2cd7d24

+ 5 - 2
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') {       

+ 2 - 1
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') {?>

+ 1 - 0
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);