diff --git a/README.md b/README.md index 16b93a3..c625867 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ composer require harishdurga/laravel-quiz ### Class Diagram -![LaravelQuiz](https://user-images.githubusercontent.com/10380630/173225090-8dc96205-1a08-4ed2-8954-1a53bccc7359.png) +![LaravelQuiz](https://user-images.githubusercontent.com/10380630/182762726-de5d4b61-af3c-4d0f-b25d-dad986ff5b6e.jpg) ### Publish Vendor Files (config, mingrations,seeder) @@ -182,6 +182,16 @@ $quiz = Quiz::create([ ]); ``` +### Attach Topics To A Quiz + +```php +$quiz->topics()->attach([$topic_one->id, $topic_two->id]); +``` + +### Topicable + +Topics can be attached to a quiz or a question. Questions can exist outside of the quiz context. For example you can create a question bank which you can filter based on the topics if attached. + ### Negative Marking Settings By default negative marking is enabled for backward compatibility. You can disable it by setting the `enable_negative_marks` to false. Two types of negative marking are supported(`negative_marking_type`). `fixed` and `percentage`. Negative marking value defined at question level will be given precedence over the value defined at quiz level. If you want to set the negative marking value at quiz level, set the `negative_mark_value` to the value you want to set. If you want to set the negative marking value at question level, set the `negative_marks` of `QuizQuestion` to your desired value. No need to give a negative number instead the negative marks or percentage should be given in positive.