Moodle

Import : missing weeks/topics

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.8.9, 1.9.5
  • Fix Version/s: None
  • Component/s: Backup, Course
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

When using IMPORT function, if the course being imported has more weeks/topics than the course being imported to, the activities and resources are all automatically shoved into week/topic 1. It would be handy if it could auto-create the extra weeks/topics needed for the new course.

Activity

Hide
Ashley Holman added a comment -

Here is a patch which creates additional topic sections as required when importing into an existing course.

It also increases the numsections setting for the target course where required.

Show
Ashley Holman added a comment - Here is a patch which creates additional topic sections as required when importing into an existing course. It also increases the numsections setting for the target course where required.
Hide
Ashley Holman added a comment -

This is an amended patch which is better because it handles the case where the extra topic sections already exist. (eg. teacher creates course with 40 sections, then reduces it to 1 section, then does an import of a course with 10 sections).

This patch is against today's 19_STABLE branch.

Show
Ashley Holman added a comment - This is an amended patch which is better because it handles the case where the extra topic sections already exist. (eg. teacher creates course with 40 sections, then reduces it to 1 section, then does an import of a course with 10 sections). This patch is against today's 19_STABLE branch.
Hide
Nadav Kavalerchik added a comment -

thanks ! works great

( i had that issue on moodle 1.9.4 )

only little update to the second patch
http://tracker.moodle.org/secure/attachment/17188/mdl19-restore-numsections.patch

was that instead of the lines:

$new_section->summary = "";

i used :

$new_section->summary = $sect->summary;
$new_section->visible = $sect->visible;

for a full summery and visibility restore.

Show
Nadav Kavalerchik added a comment - thanks ! works great ( i had that issue on moodle 1.9.4 ) only little update to the second patch http://tracker.moodle.org/secure/attachment/17188/mdl19-restore-numsections.patch was that instead of the lines: $new_section->summary = ""; i used : $new_section->summary = $sect->summary; $new_section->visible = $sect->visible; for a full summery and visibility restore.
Hide
Martin Dougiamas added a comment -

Thanks for the patch, Ashley!

Eloy, can you see any problems with making this behaviour standard?

Show
Martin Dougiamas added a comment - Thanks for the patch, Ashley! Eloy, can you see any problems with making this behaviour standard?

Dates

  • Created:
    Updated: