Linking between courses - redirect

Linking between courses - redirect

by Anastasia Leyva -
Number of replies: 1

Hi,

All of our Moodle courses are year specific. All courses are placed under year specific categories e.g 

  • 2020-21 Courses > Chemistry > Modules.
  • 2021-22 Courses > Chemistry > Modules.

In addition to thought modules, we also have some key courses where we provide useful information to departments such as general guidelines, general information, best practices, showcases...These general courses are also year specific.

  • 2020-21 Courses > Chemistry > General 
  • 2021-22 Courses > Chemistry > General 

Our end of year Moodle rollover process moves current year courses to an archive section and creates a new empty course for the following year (all in the same Moodle instance). Staff will then need to import content from one year to the next one.

This has been a great solution to ensure content is up to date and reviewed on yearly basis. However, it is a problem when linking between courses. For example, in 2020/21 we have a GENERAL_2021 information course with useful content that other courses want to refer to. Course CHEM101_2021 links to GENERAL_2021 or to specific resources/activities either via sharing cart, course import, or direct link.

Next year, new courses are created: GENERAL_2022 and CHEM101_2022

Both courses import the contents from their previous year (GENERAL_2021 and CHEM101_2021).

The problem is that now in CHEM101_2022, the links to GENERAL are still pointing to 2021 and not to its 2022 counterparts.

This creates additional work for staff to find this links and fix them so in their courses they refer to GENERAL2022 and its resources/activities rather than having their new year courses pointing to the archived version of GENERAL2021.

Is there a plugin or a script available that will allow us to:

1) Check links pointing to 2021 that are in 2022 courses

2) Redirect links pointing to 2021 to their 2022 counterparts 

Is there any other workaround for this issue?


Thank you!

Average of ratings: -
In reply to Anastasia Leyva

Re: Linking between courses - redirect

by Colin Fraser -
Picture of Documentation writers Picture of Testers
AFAIK, there is no plugin to accommodate that, and as all links appear to be absolute in Moodle, I have never found a way to automate this process. It's a minor annoyance for me, but I don't have that many courses to deal with. 

Thinking about it for a moment, is there another way to archive your courses? For example, all courses are copied to an archive folder, then reset in the present. This would mean that current courses would always be in the "CurrentCourses" Category, with  Chemistry > General always in the Current Courses > Chemistry > General category and so on, whereas the archived courses are copied off to Archive>2020-2021 Courses>. There is no  2021-2022 Courses until they are copied off to Archive>2021-2022 Courses > ...   The resetting can be done with a predetermined cron job that runs at the appropriate times. this would mean you wouldn't have to update any links, they are all current. 

I don't suggest this structure will work, but it might be worth the time testing it in your test site.