Forums
Hi guys,
I know it's possible at Course level to have prerequisite Courses, however is it also possible at Lesson level?
i.e.
Course A
Lesson 1
Lesson 2 (You must pass lesson 1 first)
Lesson 3 (You must pass lesson 2 first)
If it's not currently possible, do you think it would be easy to achieve without a big performance hit? I'm thinking about adding an additional field to content type 'Lesson' (->Required lesson), which is of type node-reference (pulling available lessons from a View using OG_Group) to make sure only lessons within the current course are available,
In order to check if required lesson exists & is completed, I would then need to run a little loop over every lesson in the course and change their availability in the front-end accordingly.
I think that will work, but it doesn't seem too great. Any ideas?
Thanks as always,
Gavin
Hi aotu,
Hi aotu,
Sure it is possible to implement.
Start by create a entity reference field (restricted to lesson node content types) in the lesson content type.
Then you have to deny access to a quiz if the user is a student and has not completed the prerequisite. You can implement a hook_node_access to do this.
https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_access/7
To have the best performance you should not get the lessons from the view. For that look at the table structure in the database and do db_query. db_query is more efficient that db_select.
Best regards
In reply to Hi aotu, by James Aparicio
Hi James,
In reply to Hi James, by aotu
Hi aotu
In reply to Hi aotu, by James Aparicio
Lesson prerequisites
Lesson prerequisites
Same issue here
In reply to Lesson prerequisites by IASO
Do have resolved the issue ?