-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Description
Hi @tmuras...
Some items take too long to restore from the web, especially when it is a quiz with very large question pools.
I implemented a script to restore items based on their ID. It's very basic, but you might want to add it to Moosh, it's very useful for solving that performance issue.
$itemid = (int)$itemid;
$item = $DB->get_record('tool_recyclebin_course', ['id' => $itemid]);
if (!$item) {
echo "Item not found: $itemid\n";
die;
}
$context = context_course::instance($item->courseid, MUST_EXIST);
$recyclebin = new \tool_recyclebin\course_bin($context->instanceid);
echo "Restoring item with ID: $itemid\n";
$recyclebin->restore_item($item);
die;
Saludos
Metadata
Metadata
Assignees
Labels
No labels