As part of the OXCAP project we have had to devise an algorithm to decide when a course should be shown as ‘upcoming’ and when it should be marked as ‘previous’ in WebLearn’s SES tool. I thought it may be useful to outline that algorithm here in case training providers need to reference it.
The process is complex because specifying the start and end date of a course in not mandatory, nor is it mandatory to say when booking opens and closes.
In the following ‘dtf attribute’ is the date and time of a course specified in ISO 8601 format. The <start> and <end> XCRI-CAP elements represent the course start and end date respectively. (For training providers supplying data in XLSX (Excel) format these correspond to columns 10 (J) and 29 (AC) of the spread sheet.)
The <applyUntil> and <applyFrom> XCRI-CAP elements correspond to the booking closes and opens date. None of these XCRI-CAP elements are mandatory.
- if <end> dtf attribute is in future, course as ‘upcoming’, if it is in the past mark course as ‘Previous’
- if <end> dtf is missing look at dtf attribute of <start>
- if <start> dtf attribute is in future, course as ‘upcoming’
- if <start> dtf is missing look at dtf attribute of <applyUntil>
- if <applyUntil> dtf attribute is in future, course as ‘upcoming’, if it is in the past mark course as ‘Previous’
- if <applyUntil> dtf is missing look at dtf attribute of <applyFrom>
- if <applyFrom> dtf attribute is in future, course as ‘upcoming’
- otherwise for the course to be legal it must have text between the <start> tags so must be ‘upcoming’
The upshot of this is that it is important to supply course end dates otherwise, assuming a start date has been specified, a course will be earmarked as ‘previous’ as soon as it has begun.