mv-quiz
v1.1.7
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.0.
Downloads
5
Readme
Quiz from MyVokabeln platform
This library was generated with Angular CLI version 12.1.0.
Overview
npm i mv-quiz
or npm install mv-quiz
Instalation
- Bootstrap
Add
boostrap
in your project. For Angular framework you can use npm-repository npm.npm i bootstrap
- Install Angular-Quiz
Install
quiz
from npm-repository.npm i mv-quiz
Usage
In your HTML-component add following lines:
<lib-mv-quiz [quiz]="this.quiz" [quizSettings]="quizSetting"> </lib-mv-quiz>
start new quiz
If you want to start new quiz, you have to change input variable. Module recognize the change and start the quiz from the start.
Structure of quiz variable
quiz:Quiz
= Quiz to show is variableQuiz
interface with following structure:Quiz = { quizId?: string, questions: Questions[] };
quizId
= actually not using paramnterquestions
= contain all quiz item to shoOne item of quiest is variable with following structure:
{ question: string, answer: string[4], correctAnswer: number }
question
= question for one itemanswer
= field with constant length (4), represent the possible answercorrectAnswer
= say on which position is the correct answer, start with index 0
Structure of setting variable
You can also a little change of displaing of quiz by input variable quizSettings: QuizSetting
with following structure:
QuizSetting {
isPercentShow: boolean
}