-
Notifications
You must be signed in to change notification settings - Fork 79
Multiple Reference Timelines: Back-end models, controllers extensions #5491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
66bfb2f
to
a6c3f93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks and good work! @purfectliterature
Some nits and notes below:
- Remove
app/mailers/.keep
. - Add tests to items feature tests (eg submission, video and survey) to ensure that the correct time is selected/shown to a user when the user is assigned to a different timeline.
- I believe you will still make more changes to the API response so I wont comment much yet on the jbuilder as of now. Note: Remember to pass the permissions to the frontend too.
- For the case when an item has different/no
start_time
,end_time
andbonus_end_time
in the default timeline as compared to those in an alternative timeline, line 22 inapp/views/course/assessment/assessments/show.json.jbuilder
may break.start_time
,end_time
,bonus_end_time
should be loaded via time_for instead of accessing the value directly from the item (which only loads the default time). I have listed a few other places below to check (May not be complete, please help to check if I miss anything):-
app/models/course/survey/response.rb
line 27 -
app/services/course/assessment/submission/calculate_exp_service.rb
line 22 and line 23 -
app/views/course/assessment/assessments/show.json.jbuilder
line 22 and line 43 -
app/views/course/survey/surveys/_survey.json.jbuilder
line 4 to 6
-
- Check AR queries using
default_reference_time
. Seems like there's a few places that use the default timeline only:-
app/models/course/video.rb
-
app/models/components/course/surveys_ability_component.rb
-
app/controllers/course/courses_controller.rb
-
app/controllers/course/statistics/aggregate_controller.rb
-
app/models/components/course/surveys_ability_component.rb
(TODO(#3092)
)
-
- Remove
TODO(#3092)
in the course_user model file. It's not relevant anymore.
Note to self:
- Check object duplication from a course with multiple timelines to another course with single/multiple timelines
spec/services/course/duplication/course_duplication_service_spec.rb
Outdated
Show resolved
Hide resolved
def item_is_straggling(personal_time, reference_time) | ||
if reference_time.end_at.present? && personal_time.end_at.present? | ||
reference_time.end_at < personal_time.end_at | ||
elsif reference_time.end_at.present? && personal_time.end_at.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to revisit this.. for unsubmitted items, personal_time might be recomputed (and removed) if the new reference time of a new reference timeline is created with no end_at
a6c3f93
to
420eab9
Compare
9bd4370
to
44d2dd6
Compare
18c5a41
to
8b99b60
Compare
a45cd39
to
d82d829
Compare
redux toolkit already re-exports the same `createSelector` from reselect
Closes #3092.
Feature overview
Multiple Reference Timelines (internally abbreviated as MRT) is a feature that allows different students to follow different assignment opening and closing times, thus following different timelines. This feature is useful for teachers who manage different classes that may have different homework deadlines, yet whose students still belong to the same course.
The building blocks for this feature was originally introduced in #3130, but the application-level implementations were deferred and tracked in #3092. This PR, and subsequent ones, aim to complete these deferred works.
Notable changes
title
andweight
columns tocourse_reference_timelines
table.Course::LessonPlan::Item#reference_time_for
now supports non-default (custom) reference timelines.Course::ReferenceTime
Course::ReferenceTimeline
Course::ReferenceTime
Course::ReferenceTimeline
Database schema
New routes
/courses/:id/timelines
/courses/:id/timelines/:id
/courses/:id/timelines
/courses/:id/timelines/:id
/courses/:id/timelines/:id
/courses/:id/timelines/:id/times
/courses/:id/timelines/:id/times/:id
/courses/:id/timelines/:id/times/:id
/courses/:id/users/assign_timeline
Pending
# TODO(#3092)
s