Browse Source

Replacing feedbacktype with feedback_type

Julio Montoya 12 năm trước cách đây
mục cha
commit
e75b640566

+ 8 - 8
main/exercice/exercise.class.php

@@ -40,7 +40,7 @@ class Exercise {
 	public $active;
 	public $timeLimit;
     public $attempts;
-    public $feedbacktype;
+    public $feedback_type;
 	public $end_time;
 	public $start_time;
 	public $questionList;  // array with the list of this exercise's questions
@@ -123,7 +123,7 @@ class Exercise {
 			$this->active                   = $object->active;
 			$this->results_disabled         = $object->results_disabled;
 			$this->attempts                 = $object->max_attempt;
-			$this->feedbacktype             = $object->feedback_type;
+			$this->feedback_type            = $object->feedback_type;
 			$this->propagate_neg            = $object->propagate_neg;
 			$this->randomByCat              = $object->random_by_category;
 			$this->text_when_finished       = $object->text_when_finished; 
@@ -208,7 +208,7 @@ class Exercise {
 	 * @return - numeric - exercise attempts
 	 */
 	function selectFeedbackType() {
-		return $this->feedbacktype;
+		return $this->feedback_type;
 	}
 
 
@@ -504,7 +504,7 @@ class Exercise {
 	 * @param - numeric $attempts - exercise max attempts
 	 */
 	function updateFeedbackType($feedback_type) {
-		$this->feedbacktype=$feedback_type;
+		$this->feedback_type=$feedback_type;
 	}
 
 	/**
@@ -652,7 +652,7 @@ class Exercise {
 		$sound                  = $this->sound;
 		$type                   = $this->type;
 		$attempts               = $this->attempts;
-		$feedbacktype           = $this->feedbacktype;
+		$feedback_type           = $this->feedback_type;
 		$random                 = $this->random;
 		$random_answers         = $this->random_answers;
 		$active                 = $this->active;
@@ -666,7 +666,7 @@ class Exercise {
 		$session_id             = api_get_session_id();
 		 
 		//If direct we do not show results
-		if ($feedbacktype == EXERCISE_FEEDBACK_TYPE_DIRECT) {
+		if ($feedback_type == EXERCISE_FEEDBACK_TYPE_DIRECT) {
 			$results_disabled = 0;
 		} else {
 			$results_disabled = intval($this->results_disabled);
@@ -697,7 +697,7 @@ class Exercise {
 					random         ='".Database::escape_string($random)."',
 					random_answers ='".Database::escape_string($random_answers)."',
 					active         ='".Database::escape_string($active)."',
-					feedback_type  ='".Database::escape_string($feedbacktype)."',
+					feedback_type  ='".Database::escape_string($feedback_type)."',
 					start_time     = '$start_time',
 					end_time       = '$end_time',
 					max_attempt    ='".Database::escape_string($attempts)."',
@@ -736,7 +736,7 @@ class Exercise {
 						'".Database::escape_string($active)."',
 						'".Database::escape_string($results_disabled)."',
 						'".Database::escape_string($attempts)."',
-						'".Database::escape_string($feedbacktype)."',
+						'".Database::escape_string($feedback_type)."',
 						'".Database::escape_string($expired_time)."',
 						'".Database::escape_string($session_id)."',
 						'".Database::escape_string($review_answers)."',

+ 1 - 1
main/exercice/exercise_admin.php

@@ -209,7 +209,7 @@ if ($form->validate()) {
 	}
 	echo '</div>';	
 	
-	if ($objExercise->feedbacktype==1)
+	if ($objExercise->feedback_type==1)
 		Display::display_normal_message(get_lang('DirectFeedbackCantModifyTypeQuestion'));
 		
 	if (api_get_setting('search_enabled')=='true' && !extension_loaded('xapian')) {

+ 3 - 4
main/exercice/exercise_result.php

@@ -110,7 +110,7 @@ if (api_is_course_admin() && $origin != 'learnpath') {
 	echo '</div>';
 }
 
-$feedback_type           = $objExercise->feedbacktype;
+$feedback_type           = $objExercise->feedback_type;
 $exercise_stat_info      = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
 
 if (!empty($exercise_stat_info['data_tracking'])) {
@@ -215,9 +215,8 @@ if ($origin != 'learnpath') {
 
 //	Updates the empty exercise
 
-$quizDuration = (!empty($_SESSION['quizStartTime']) ? time() - $_SESSION['quizStartTime'] : 0);
+$quiz_duration = (!empty($_SESSION['quizStartTime']) ? time() - $_SESSION['quizStartTime'] : 0);
 
-$feed = $objExercise->feedbacktype; 
 if (api_is_allowed_to_session_edit()) {	
 	update_event_exercice($exercise_stat_info['exe_id'], $objExercise->selectId(), $total_score, $total_weight, api_get_session_id(), $safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id, $quiz_duration, $question_list, '');	
 }
@@ -237,7 +236,7 @@ if ($origin != 'learnpath') {
 	Display::display_footer();
 } else {
 	$lp_mode =  $_SESSION['lp_mode'];
-	$url = '../newscorm/lp_controller.php?cidReq='.api_get_course_id().'&action=view&lp_id='.$safe_lp_id.'&lp_item_id='.$safe_lp_item_id.'&exeId='.$exercise_stat_info['exe_id'].'&fb_type='.$feed;
+	$url = '../newscorm/lp_controller.php?cidReq='.api_get_course_id().'&action=view&lp_id='.$safe_lp_id.'&lp_item_id='.$safe_lp_item_id.'&exeId='.$exercise_stat_info['exe_id'].'&fb_type='.$objExercise->feedback_type;
 	//echo $total_score.','.$total_weight;	exit;	
 	$href = ($lp_mode == 'fullscreen')?' window.opener.location.href="'.$url.'" ':' top.location.href="'.$url.'" ';
 	echo '<script type="text/javascript">'.$href.'</script>'."\n";

+ 1 - 1
main/exercice/exercise_show.php

@@ -88,7 +88,7 @@ if (empty($objExercise)) {
 	$objExercise = new Exercise();
     $objExercise->read($exercise_id);
 }
-$feedback_type = $objExercise->feedbacktype;
+$feedback_type = $objExercise->feedback_type;
 
 //If is not valid
 $session_control_key = get_session_time_control_key($exercise_id);

+ 2 - 2
main/exercice/exercise_submit.php

@@ -415,7 +415,7 @@ if ($formSent && isset($_POST)) {
                 // stores the user answer into the array
                 $exerciseResult[$key] = $choice[$key];
                 //saving each question
-                if ($objExercise->feedbacktype != EXERCISE_FEEDBACK_TYPE_DIRECT) {
+                if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) {
                     $nro_question = $current_question; // - 1;
                  	$questionId   = $key;                    
                     // gets the student choice for this question
@@ -950,7 +950,7 @@ if (!empty($error)) {
                 $i++;
                 continue;
             } else {
-                if ($objExercise->feedbacktype != EXERCISE_FEEDBACK_TYPE_DIRECT) {
+                if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) {
                     // if the user has already answered this question
                     if (isset($exerciseResult[$questionId])) {
                         // construction of the Question object

+ 4 - 4
main/exercice/question.class.php

@@ -1242,15 +1242,15 @@ abstract class Question
 	/**
 	 * Displays the menu of question types
 	 */
-	static function display_type_menu ($feedbacktype = 0) {
+	static function display_type_menu ($feedback_type = 0) {
 		global $exerciseId;
         $course_id = api_get_course_int_id();
         
 		// 1. by default we show all the question types
 		$question_type_custom_list = self::get_question_type_list();
 
-		if (!isset($feedbacktype)) $feedbacktype=0;
-		if ($feedbacktype==1) {
+		if (!isset($feedback_type)) $feedback_type=0;
+		if ($feedback_type==1) {
 			//2. but if it is a feedback DIRECT we only show the UNIQUE_ANSWER type that is currently available
 			//$question_type_custom_list = array ( UNIQUE_ANSWER => self::$questionTypes[UNIQUE_ANSWER]);
 			$question_type_custom_list = array ( UNIQUE_ANSWER => self::$questionTypes[UNIQUE_ANSWER],HOT_SPOT_DELINEATION => self::$questionTypes[HOT_SPOT_DELINEATION]);  
@@ -1300,7 +1300,7 @@ abstract class Question
 		echo '<li>';
 		echo '<div class="icon_image_content">';
 		if ($show_quiz_edition) {
-			if ($feedbacktype==1) {
+			if ($feedback_type==1) {
 				echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&type=1&fromExercise='.$exerciseId.'">';
 			} else {
 				echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&fromExercise='.$exerciseId.'">';

+ 1 - 1
main/exercice/question_list_admin.inc.php

@@ -135,7 +135,7 @@ $(function() {
 
 echo '<div class="actionsbig">';
 //we filter the type of questions we can add
-Question :: display_type_menu ($objExercise->feedbacktype);
+Question :: display_type_menu ($objExercise->feedback_type);
 echo '</div><div style="clear:both;"></div>';
 echo '<div id="message"></div>';
 $token = Security::get_token();

+ 3 - 3
main/exercice/question_pool.php

@@ -384,7 +384,7 @@ $new_question_list['-1']  = get_lang('All');
 $objExercise = new Exercise();
 $objExercise->read($fromExercise);
 foreach ($question_list as $key=>$item) {
-    if ($objExercise->feedbacktype == EXERCISE_FEEDBACK_TYPE_DIRECT) {
+    if ($objExercise->feedback_type == EXERCISE_FEEDBACK_TYPE_DIRECT) {
         if (!in_array($key, array(HOT_SPOT_DELINEATION, UNIQUE_ANSWER))) {
             continue;
         }
@@ -488,7 +488,7 @@ else {
 		$filter .= ' AND qu.type='.$answerType.' ';
 	}
 //	// why these lines ?
-//  if ($objExercise->feedbacktype != EXERCISE_FEEDBACK_TYPE_DIRECT) {
+//  if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) {
 //      $filter .= ' AND qu.type <> '.HOT_SPOT_DELINEATION.' ';
 //  }
 //  // fwhy
@@ -525,7 +525,7 @@ else {
                 if ($courseCategoryId > 0 && Testcategory::getCategoryForQuestion($question_obj->id, $selected_course)) {
                 	continue;
                 }
-                if ($objExercise->feedbacktype != EXERCISE_FEEDBACK_TYPE_DIRECT) {
+                if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) {
                    if ($question_obj->type == HOT_SPOT_DELINEATION)  {
                      continue;
                    }

+ 1 - 1
main/exercice/result.php

@@ -137,7 +137,7 @@ if (!empty($question_list)) {
 	 	if ($show_results) { 	    
             // display question category, if any
  	        Testcategory::displayCategoryAndTitle($questionId, $display_category_name );	 	    
-		    echo $objQuestionTmp->return_header($objExercise->feedbacktype, $counter);
+		    echo $objQuestionTmp->return_header($objExercise->feedback_type, $counter);
 		}
 		$counter++;	
 		if ($answerType == MULTIPLE_ANSWER || $answerType == MULTIPLE_ANSWER_TRUE_FALSE) {

+ 1 - 1
main/exercice/unique_answer.class.php

@@ -356,7 +356,7 @@ class UniqueAnswer extends Question {
 			<tr>
 				<td><i>'.get_lang("Choice").'</i> </td>
 				<td><i>'. get_lang("ExpectedChoice").'</i></td>
-				<td><i>'. get_lang("Answer").'</i></td>';
+				<td><i>'. get_lang("Answer").'</i></td>';        
 				if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { 
     				$header .= '<td><i>'.get_lang("Comment").'</i></td>';
 				} else {