Description
User Story
It would be useful to include a "creation_date" field in the learning_resources API response for courses, particularly for OCW, that approximates the date that the course was created on. This is not the same as the currently existing LearningResource.created_on
field which is omitted from the API and is based on the date that the resource was created in the mit-open database.
It's not a field that's required to be included for a record to be created, but given the range of dates that OCW courses have been published over, it would be helpful for a user to have when evaluating content.
Description/Context
For a course creation field, one thing that has to be considered is how to calculate this for non-OCW courses too. OCW is a bit unique in that "Quantum Physics I Spring 2013" is considered a different course than "Quantum Physics I Spring 2016", whereas for all other sources, those would be two different runs of the same course.
Acceptance Criteria
- A
creation_date
field is included in the learning_resources API response. - A
creation_date
field is included in the learning_resources_search API response.
Plan/Design
Add a creation_date
field to the LearningResource
serializer (or alternately, the Course
serializer).
Approximate the value for this field based on semester and year of the OCW course's one LearningResourceRun
: Since courses are broken out into semester/year, the easiest way to list those would be ballpark dates, e.g. fall 2017 could be 2017/08/01, winter 2009 could be 2019/01/01, etc... If the semester isn't clear, defaulting to the first of the year would be a good proxy.
For non-ocw courses, use the earliest start_date
value from all the course's runs. Or do we want the latest start_date
instead as an indicator of how current it is?
Add this field to the search index schema as well.