You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-59Lines changed: 71 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ react-quiz-component is a ReactJS component allowing users to attempt a quiz.
23
23
- Allow markdown in Question
24
24
- Allow Picture in Question
25
25
- Scoring System
26
+
- Shuffling Questions / Answers
26
27
27
28
## Installing
28
29
@@ -32,13 +33,14 @@ npm i react-quiz-component
32
33
33
34
## Importing react-quiz-component
34
35
35
-
```
36
+
```js
36
37
importQuizfrom'react-quiz-component';
37
38
```
38
39
39
40
## Defining Your Quiz Source
40
41
The quiz source is a JSON object. You can use [react-quiz-form](https://github.com/wingkwong/react-quiz-form/) to generate it.
41
-
```javascript
42
+
43
+
```js
42
44
exportconstquiz= {
43
45
"quizTitle":"React Quiz Component Demo",
44
46
"quizSynopsis":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim",
@@ -143,73 +145,83 @@ export const quiz = {
143
145
### Locale Customization
144
146
145
147
If you want to use your customized text, you can add appLocale into your quiz source. Below is the default one. <questionLength> and <correctIndexLength> will be replaced dynamically.
146
-
```javascript
147
-
"appLocale": {
148
-
"landingHeaderText":"<questionLength> Questions",
149
-
"question":"Question",
150
-
"startQuizBtn":"Start Quiz",
151
-
"resultFilterAll":"All",
152
-
"resultFilterCorrect":"Correct",
153
-
"resultFilterIncorrect":"Incorrect",
154
-
"prevQuestionBtn":"Prev",
155
-
"nextQuestionBtn":"Next",
156
-
"resultPageHeaderText":"You have completed the quiz. You got <correctIndexLength> out of <questionLength> questions."
0 commit comments