Designate certain learning modules as required - a required learning …#7859
Conversation
| plc_module_assignments.destroy_all | ||
|
|
||
| # Make sure the required learning modules are included here | ||
| learning_modules |= self.plc_course_unit.plc_learning_modules.where(required: true) |
There was a problem hiding this comment.
No, this is intentional. Single pipe is array union
There was a problem hiding this comment.
Ah, TIL. I've seen array_a | array_b before but this is the first time I've seen |=.
There was a problem hiding this comment.
Again, I wonder if this is something we should bake into the EnrollmentUnitAssignment (eager) vs. construct dynamically and allow required modules to be added later (lazy).
There was a problem hiding this comment.
https://trello.com/c/lxmPIgUB/26-refactoring-module-completion-lazy is on deck and might get pulled into this sprint if we are ahead of schedule
6b09e47 to
b8bbe49
Compare
|
|
||
| def options_for_evaluation_answer_modules(course_unit) | ||
| course_unit.plc_learning_modules.order(:required, :name).map do |learning_module| | ||
| # Boo Ruby, you can't add nil to a string without choking? |
There was a problem hiding this comment.
String interpolation will handle nil values.
|
LGTM, with a few nits. Looks like the TravisCI failure is legit. |
| = text_field_tag '' | ||
| %td | ||
| = select_tag '', options_for_select(options_for_plc_task_learning_modules), include_blank: '' | ||
| = select_tag '', options_for_select(options_for_evaluation_answer_modules(@course_unit)), include_blank: '' |
…module will always be assigned to a user during enrollment We'll support multiple required learning modules. Spec to come later on how to display required learning modules
38477db to
513c3ac
Compare

…module will always be assigned to a user during enrollment