This is an old revision of the document!
1) Admin/Instructor should be able to update the contents created by them. 2) There should also be an option to auto publish the content based on time periods. 3) Users enrolled to these updated contents should be notified and provided an option to refresh the content.
1) In content edit lightbox “Update Content” button should be added, on clicking that it should provide a form to add new item to the content.
2) Once new item is added, all the items of that content should be listed. Beside each item “Publish” link should be shown, the currently active item will have “Published” text mentioned. Only one item can be published at a time, which means a content can have only one active item.
3) Beside each items listed in the content, there should be an optional date time field to set from when the item can be published automatically. The active item will have “Effective Now” text shown instead of date time field. This is to auto publish the items from certain time period.
4) If user is enrolled to a course, the contents of that course will show only the item that got published during course enrolled. Even if that item it set to unpublished state, the same be be seen by the user. The updated contents will reflect on future enrollments only.
5) Enrolled user can get a notification mentioning that the content has been updated and if he would like to refresh the content. This notification will only be should for active enrollments and the progress/score will be reset for the content post refresh.
1) Add a new table to add multiple items for content
Table name - content_versions
content_versions belongs_to content
Also remove contentable_id, contentable_type columns from content table.
| Column_name | Type | Description |
|---|---|---|
| id | integer | primary key |
| name | string | verions name |
| content_id | integer | content id to which it belongs to |
| contentable_id | integer | contentable id to which it belongs to |
| contentable_type | string | contentable type to which it belongs to |
| published | boolean | true or false |
| published_from | datetime | date and time from which the item is active |
| created_at | date_time | created date |
| updated_at | date_time | updated date |
Add a new table to save content details to be viewed by enrolled users
Table name - enrolled_contents
enrolled_contents belongs_to enrollments
content has_many enrolled_contents
| Column_name | Type | Description |
|---|---|---|
| id | integer | primary key |
| enrollment_id | integer | enrollment id to which it belongs to |
| content_id | integer | content id |
| content_version_id | integer | conten_version id |