Create course module like laracast?
Hello,
I need to create a learning course module similar to Laracasts. Each course will consist of units, and each unit will have topics.
Here’s the flow:
-
Users must complete all topics within a unit.
-
After completing the topics of a unit, a quiz for that unit becomes available.
-
Once users complete all units, their topics, and the corresponding unit quizzes, they will be eligible to attempt a final exam.
Can you suggest an optimal database structure to implement this functionality?
Or any suggestions..
You can for example do something like this.
You don't specify if a unit can belong to only one or to several courses.
courses: id, name
units: id, name
topics: id, name
course_unit: course_id, unit_id
unit_topic: unit_id, topic_id
user_topic: user_id, topic_id, completed
user_unit: user_id, unit_id, completed
unit_course: user_id, course_id, completed
@vincent15000 thanks, and what about quizzes table thats belongs to course_units
and unit can only belongs to single course and same for topics
I think this unit_course table should be user_courses, am I right?
@amitsolanki24_
user_course ... by default in Laravel I think that pivot table are named in singular.
What about quizzes ?
A unit can have one or many quizzes.
quizzes : id, unit_id
Then you have to build the quizz business logic and also when the quizz has to be called.
Please or to participate in this conversation.