Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37679

Course duplication without content

$
0
0
by john doe.  

Hi everybody!

I'm working on a duplication block. The aim is simple, on a course, when you click on a link in the block, you have to select the category of the new instance of your course , and this one will be duplicate in this new category.

my problem is that the duplication (backup and restore) works well but, all the content of the different resource are not transfered. 

I give you my sources of the two functions I use.

 

$bc = new backup_controller(backup::TYPE_1COURSE, $courseid, backup::FORMAT_MOODLE,
backup::INTERACTIVE_NO, backup::MODE_IMPORT, $userid);

$backupid = $bc->get_backupid();
$backupbasepath = $bc->get_plan()->get_basepath();
$bc->execute_plan();

[...]

$controller = new restore_controller($backupid, $ci,
backup::INTERACTIVE_NO, backup::MODE_SAMESITE, $ui,
backup::TARGET_NEW_COURSE);
$controller->execute_precheck();
$controller->execute_plan();

 

I don't understand where is my mistake. I am losing all my hair over this problem!

Please help!


Viewing all articles
Browse latest Browse all 37679

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>