The quiz is a simple quiz built on client from a json file.
The quiz has a simple schema:
Property | Definition |
---|---|
title:String |
Title of the quiz |
questions:Array<Object> |
Config of questions |
questions[]:Object |
|
questions[].problem:String |
Question's title |
questions[].input:Object |
Field to display |
questions[].input.type:String |
'radio', 'checkbox', 'inputs' or 'input' (default) |
questions[].input.options:Array |
labels of the options (only for 'radio', 'checkbox' or 'inputs') |
It's a project to practice acquired knowledge in JS Training Course refactoring this code.
This code is not meant to be well done, but meant to be refactored. This way, you can refactor progressively fixing the main mistakes of the code.
Please read the contributing guidelines
Runs the project on watch mode.
Executes end-to-end tests on the app to check your change haven't broken anything.
Executes "npm run dev" with tests so you can reload them when needed.
Safely reinstalls the project.
- Change scopes of variables from global scope to local scope.
- Declare variables with
let
,const
orvar
. - Use destructuring when possible.
- Use operator expressions for conditionals and value assignment.
- Convert strings to template strings.
- Split all logic in functions as pure as possible.
- Use new arrow functions syntax when possible.
- Respect functional principles:
- Immutability
- Absence of side effects
- Function don't depend on state
- Functions with 1 input/ 1 output.