From e265e442eddc46b2f1bd91edf391ba94b103f7ac Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Tue, 17 Feb 2009 19:08:58 +0100 Subject: [PATCH] [svn r18549] Logic change - Fixed difficulty of the question lost - see FS#3659 --- documentation/changelog.html | 1 + main/coursecopy/classes/CourseBuilder.class.php | 4 ++-- main/coursecopy/classes/CourseRestorer.class.php | 6 +++--- main/coursecopy/classes/QuizQuestion.class.php | 9 +++++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 6071a51ae2..7b17489103 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -169,6 +169,7 @@
  • Fixed qualification of themes into forum tool - see FS#3609
  • allow show results with floating point,in exercice tool - (partial FS#3630) - SVN#18367
  • Fixed event into agenda when it's sent from assignment and Improved display form when you create an assignment - see FS#3583
  • +
  • Fixed difficulty of the question lost - see FS#3659

  • CSS changes

    diff --git a/main/coursecopy/classes/CourseBuilder.class.php b/main/coursecopy/classes/CourseBuilder.class.php index 5783a385a0..d607a30ec3 100644 --- a/main/coursecopy/classes/CourseBuilder.class.php +++ b/main/coursecopy/classes/CourseBuilder.class.php @@ -1,4 +1,4 @@ -id, $obj->question, $obj->description, $obj->ponderation, $obj->type, $obj->position, $obj->picture); + $question = new QuizQuestion($obj->id, $obj->question, $obj->description, $obj->ponderation, $obj->type, $obj->position, $obj->picture,$obj->level); $sql = 'SELECT * FROM '.$table_ans.' WHERE question_id = '.$obj->id; $db_result2 = api_sql_query($sql, __FILE__, __LINE__); while ($obj2 = Database::fetch_object($db_result2)) diff --git a/main/coursecopy/classes/CourseRestorer.class.php b/main/coursecopy/classes/CourseRestorer.class.php index 5d11df4d72..45154814ea 100644 --- a/main/coursecopy/classes/CourseRestorer.class.php +++ b/main/coursecopy/classes/CourseRestorer.class.php @@ -1,4 +1,4 @@ -course->destination_db); $table_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER, $this->course->destination_db); - $sql = "INSERT INTO ".$table_que." SET question = '".addslashes($question->question)."', description = '".addslashes($question->description)."', ponderation = '".addslashes($question->ponderation)."', position = '".addslashes($question->position)."', type='".addslashes($question->quiz_type)."', picture='".addslashes($question->picture)."'"; + $sql = "INSERT INTO ".$table_que." SET question = '".addslashes($question->question)."', description = '".addslashes($question->description)."', ponderation = '".addslashes($question->ponderation)."', position = '".addslashes($question->position)."', type='".addslashes($question->quiz_type)."', picture='".addslashes($question->picture)."', level='".addslashes($question->level)."'"; api_sql_query($sql, __FILE__, __LINE__); $new_id = Database::get_last_insert_id(); foreach ($question->answers as $index => $answer) @@ -751,7 +751,7 @@ class CourseRestorer // getting the information of the survey (used for when the survey is shared) require_once(api_get_path(SYS_CODE_PATH).'survey/survey.lib.php'); - $sql_select_existing_survey = "SELECT * FROM $table_sur WHERE survey_id='".Database::escape_string(mysql_result($result_check,0,0))."'"; + $sql_select_existing_survey = "SELECT * FROM $table_sur WHERE survey_id='".Database::escape_string(Database::result($result_check,0,0))."'"; $result = api_sql_query($sql_select_existing_survey, __FILE__, __LINE__); $survey_data = Database::fetch_array($result,'ASSOC'); diff --git a/main/coursecopy/classes/QuizQuestion.class.php b/main/coursecopy/classes/QuizQuestion.class.php index 4f11c295fc..f3ff7b2c56 100644 --- a/main/coursecopy/classes/QuizQuestion.class.php +++ b/main/coursecopy/classes/QuizQuestion.class.php @@ -1,4 +1,4 @@ -question = $question; @@ -71,6 +75,7 @@ class QuizQuestion extends Resource $this->quiz_type = $type; $this->position = $position; $this->picture = $picture; + $this->level = $level; $this->answers = array(); } /**