Skip to content

Commit

Permalink
Course copy: Fix added only documents selected from content - refs BT…
Browse files Browse the repository at this point in the history
…#19212
  • Loading branch information
cfasanando committed Oct 27, 2021
1 parent 11c4c93 commit 956f7b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions main/coursecopy/copy_course.php
Expand Up @@ -45,11 +45,19 @@
// Clear token
Security::clear_token();
if ($action === 'course_select_form') {
$course = CourseSelectForm::get_posted_course('copy_course');
$cb = new CourseBuilder('partial');
$course = $cb->build(0, null, false, array_keys($_POST['resource']), $_POST['resource']);
$course = CourseSelectForm::get_posted_course(null, 0, '', $course);
} else {
$cb = new CourseBuilder();
$cb = new CourseBuilder('complete');
$course = $cb->build();
}

// It builds the documents and items related to the LP
$cb->exportToCourseBuildFormat();
// It builds documents added in text (quizzes, assignments)
$cb->restoreDocumentsFromList();

$cr = new CourseRestorer($course);
$cr->set_file_option($_POST['same_file_name_option']);
$cr->restore($_POST['destination_course']);
Expand Down
Expand Up @@ -117,7 +117,7 @@ function checkLearnPath(message){
if( name.indexOf('learnpath') > 0 || name.indexOf('quiz') > 0){
if(d.elements[i].checked){
if (!backup) {
setCheckbox('document', true);
//setCheckbox('document', true);
}
alert(message);
break;
Expand Down Expand Up @@ -754,7 +754,7 @@ function checkLearnPath(message){
if( name.indexOf('learnpath') > 0 || name.indexOf('quiz') > 0){
if(d.elements[i].checked){
if (!backup) {
setCheckbox('document', true);
//setCheckbox('document', true);
}
alert(message);
break;
Expand Down

0 comments on commit 956f7b0

Please sign in to comment.