Fix update when updating quiz "hide_question_title"

- fix course restorer
- minor format code
remotes/angel/1.11.x
jmontoyaa 8 years ago
parent bc22a13e7a
commit 5c30282880
  1. 2
      main/exercise/exercise.class.php
  2. 5
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php

@ -101,7 +101,6 @@ class Exercise
$this->text_when_finished = '';
$this->display_category_name = 0;
$this->pass_percentage = '';
$this->modelType = 1;
$this->questionSelectionType = EX_Q_SELECTION_ORDERED;
$this->endButton = 0;
@ -167,6 +166,7 @@ class Exercise
$this->review_answers = (isset($object->review_answers) && $object->review_answers == 1) ? true : false;
$this->globalCategoryId = isset($object->global_category_id) ? $object->global_category_id : null;
$this->questionSelectionType = isset($object->question_selection_type) ? $object->question_selection_type : null;
$this->hideQuestionTitle = isset($object->hide_question_title) ? $object->hide_question_title : null;
$sql = "SELECT lp_id, max_score
FROM $table_lp_item

@ -1681,10 +1681,10 @@ class CourseRestorer
foreach ($resources[RESOURCE_QUIZ] as $id => $quiz) {
if (isset($quiz->obj)) {
//For new imports
// For new imports
$quiz = $quiz->obj;
} else {
//For backward compatibility
// For backward compatibility
$quiz->obj = $quiz;
}
@ -1746,6 +1746,7 @@ class CourseRestorer
'end_time' => $quiz->end_time,
'save_correct_answers' => 0,
'display_category_name' => 0,
'hide_question_title' => isset($quiz->hide_question_title) ? $quiz->hide_question_title : 0,
);
if ($respect_base_content) {

Loading…
Cancel
Save