-
Notifications
You must be signed in to change notification settings - Fork 19
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
ERM model #22
Comments
@alex1897 Yeah it seems I have to update the diagram and README covering the things you have mentioned. $topic1 = Topic::factory()->create(['topic' => 'Test Topic One']);
$topic2 = Topic::factory()->create(['topic' => 'Test Topic Two']);
$question = Question::factory()->create();
$question->topics()->attach($topic1);
$question->topics()->attach($topic2); $quiz = Quiz::factory()->make()->create([
'name' => 'Sample Quiz',
'slug' => 'sample-quiz',
]);
$topic_one = Topic::factory()->make()->create([
'name' => 'Topic One',
'slug' => 'topic-one',
]);
$topic_two = Topic::factory()->make()->create([
'name' => 'Topic Two',
'slug' => 'topic-two',
]);
$quiz->topics()->attach([$topic_one->id, $topic_two->id]); |
I forgot that a question is not directly linked to quiz. A categorization with topics makes defiantly sense, especially when building quizzes afterwards, then you could filter by a specific topic. Also, for your planned "Generate Random Quizzes" it is helpful to make use only a specific topic. However, this is realized with topicables instead of question_topics as in the ERM model, right? |
Yes, that's correct. The diagram needs to be updated. As you already know there is no |
I checked the ERM and I found some differences:
Completely missing seems to be the "QuestionTopic" since I did't find how to connect a "Topic" and a "Question". There is also no migration existing for that. What is the need of "Topic"?
Another question I have is the table "topicables" which is not part or the ERM and seems not be used.
The text was updated successfully, but these errors were encountered: