Include a creation date field for learning resources (particularly OCW courses) in API responses
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3
- Forks
- 4
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 114
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_datefield is included in the learning_resources API response. - A
creation_datefield 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the LearningResource or Course serializer and the search index schema, then trace LearningResourceRun fields for OCW semester/year and non-OCW start_date values. Confirm how both learning_resources and learning_resources_search responses are built. Done means both responses expose creation_date and the date-selection policy is resolved for OCW and non-OCW courses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, search
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100