Parcourir la source

Fix mysql error see #1965

jmontoyaa il y a 7 ans
Parent
commit
d980a6c584

+ 6 - 6
src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php

@@ -1759,8 +1759,8 @@ class CourseRestorer
                         'c_id' => $this->destination_course_id,
                         'title' => self::DBUTF8($quiz->title),
                         'description' => ($quiz->description === false ? '' : self::DBUTF8($quiz->description)),
-                        'type' => isset($quiz->quiz_type) ? $quiz->quiz_type : $quiz->type,
-                        'random' => $quiz->random,
+                        'type' => isset($quiz->quiz_type) ? (int) $quiz->quiz_type : $quiz->type,
+                        'random' => (int) $quiz->random,
                         'active' => $quiz->active,
                         'sound' => self::DBUTF8($doc),
                         'max_attempt' => (int) $quiz->max_attempt,
@@ -1769,10 +1769,10 @@ class CourseRestorer
                         'pass_percentage' => $quiz->pass_percentage,
                         'feedback_type' => (int) $quiz->feedback_type,
                         'random_answers' => (int) $quiz->random_answers,
-                        'random_by_category' => $quiz->random_by_category,
-                        'review_answers' => $quiz->review_answers,
-                        'propagate_neg' => $quiz->propagate_neg,
-                        'text_when_finished' => $quiz->text_when_finished,
+                        'random_by_category' => (int) $quiz->random_by_category,
+                        'review_answers' => (int) $quiz->review_answers,
+                        'propagate_neg' => (int) $quiz->propagate_neg,
+                        'text_when_finished' => (string) $quiz->text_when_finished,
                         'expired_time' => (int) $quiz->expired_time,
                         'start_time' => $quiz->start_time,
                         'end_time' => $quiz->end_time,