portfolio/leap2a MDL-23955 updated leap2a support to 2010-07 version

This commit is contained in:
Penny Leach 2010-08-28 10:00:27 +00:00
parent 7817d7c65b
commit ebb7e78267
8 changed files with 98 additions and 95 deletions

View file

@ -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

View file

@ -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);