Skip to content

Commit

Permalink
Merge pull request #24 from harishdurga/22-erm-model
Browse files Browse the repository at this point in the history
22 Readme updated with latest ERM digram and topicable section added
  • Loading branch information
harishdurga authored Aug 4, 2022
2 parents 0343916 + 795c6ac commit fac057d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit fac057d

Please sign in to comment.