Course copy: fix exercise matching question copy BT#16224

pull/3023/head
Julio 6 years ago
parent 1d7259ceec
commit b088b03c6a
  1. 20
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php

@ -1951,7 +1951,13 @@ class CourseRestorer
$imageNewId = $documentsToRestore->destination_id;
}
}
$question->question = DocumentManager::replaceUrlWithNewCourseCode(
$question->question,
$this->course->code,
$this->course->destination_path,
$this->course->backup_path,
$this->course->info['path']
);
$params = [
'c_id' => $this->destination_course_id,
'question' => self::DBUTF8($question->question),
@ -1978,7 +1984,17 @@ class CourseRestorer
$onlyAnswers = [];
if (in_array($question->quiz_type, [DRAGGABLE, MATCHING, MATCHING_DRAGGABLE])) {
$allAnswers = array_column($question->answers, 'answer', 'id');
$tempAnswerList = $question->answers;
foreach ($tempAnswerList as &$value) {
$value['answer'] = DocumentManager::replaceUrlWithNewCourseCode(
$value['answer'],
$this->course->code,
$this->course->destination_path,
$this->course->backup_path,
$this->course->info['path']
);
}
$allAnswers = array_column($tempAnswerList, 'answer', 'id');
}
if (in_array($question->quiz_type, [MATCHING, MATCHING_DRAGGABLE])) {

Loading…
Cancel
Save