mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
portfolio/leap2a MDL-23955 updated leap2a support to 2010-07 version
This commit is contained in:
parent
7817d7c65b
commit
ebb7e78267
8 changed files with 98 additions and 95 deletions
|
@ -98,15 +98,11 @@ class assignment_portfolio_caller extends portfolio_module_caller_base {
|
|||
$baseid = 'assignment' . $this->assignment->assignment->assignmenttype . $this->assignment->assignment->id . 'submission';
|
||||
$entryids = array();
|
||||
foreach ($files as $file) {
|
||||
$id = $baseid . $file->get_id();
|
||||
$entry = new portfolio_format_leap2a_entry($id, $file->get_filename(), 'resource', $file);
|
||||
$entry->add_category('offline', 'resource_type');
|
||||
$entry->published = $file->get_timecreated();
|
||||
$entry->updated = $file->get_timemodified();
|
||||
$entry = new portfolio_format_leap2a_file($file->get_filename(), $file);
|
||||
$entry->author = $this->user;
|
||||
$leapwriter->add_entry($entry);
|
||||
$this->exporter->copy_existing_file($file);
|
||||
$entryids[] = $id;
|
||||
$entryids[] = $entry->id;
|
||||
}
|
||||
if (count($files) > 1) {
|
||||
// if we have multiple files, they should be grouped together into a folder
|
||||
|
|
|
@ -311,9 +311,9 @@ class assignment_online extends assignment_base {
|
|||
$entry->author = $user;
|
||||
$leapwriter->add_entry($entry);
|
||||
if ($files = $exporter->get('caller')->get('multifiles')) {
|
||||
$leapwriter->link_files($entry, $files, 'assignmentonline' . $this->assignment->id . 'file');
|
||||
foreach ($files as $f) {
|
||||
$exporter->copy_existing_file($f);
|
||||
$entry->add_attachment($f);
|
||||
}
|
||||
}
|
||||
$exporter->write_new_file($leapwriter->to_xml(), $exporter->get('format')->manifest_name(), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue