-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added 20 point and 30 point tasks
- Loading branch information
Дмитрий Никифоров
committed
Apr 24, 2022
1 parent
73df96e
commit 38dbef8
Showing
4 changed files
with
145 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
class Quiz { | ||
currentQuestionId = 1; | ||
rightAnswers = 0; | ||
questions = { | ||
1: { | ||
question: "HTML - это язык программирования?", | ||
rightAnswer: "Нет", | ||
}, | ||
2: { | ||
question: "Что быстрее python или java?", | ||
rightAnswer: "python", | ||
}, | ||
3: { | ||
question: "Google создал Яндекс?", | ||
rightAnswer: "Нет", | ||
}, | ||
4: { | ||
question: "Имя и фамилия человека, кто первым придумал концепцию интернета?", | ||
rightAnswer: "Джозеф Ликлайдер", | ||
}, | ||
5: { | ||
question: "Нужны ли тестировщики?", | ||
rightAnswer: "Да", | ||
}, | ||
6: { | ||
question: "Node это фреймворк python?", | ||
rightAnswer: "Нет", | ||
}, | ||
7: { | ||
question: "JS это java?", | ||
rightAnswer: "Нет", | ||
}, | ||
8: { | ||
question: "В каком году был представлен typescript?", | ||
rightAnswer: "2012", | ||
}, | ||
}; | ||
topics = [ | ||
"Gamedev", | ||
"Java", | ||
"Mobile", | ||
"PHP", | ||
"Back end", | ||
"Маруся", | ||
"Чат-боты", | ||
"VK Mini Apps", | ||
]; | ||
|
||
constructor() {} | ||
|
||
nextQuestion() { | ||
return this.questions[this.currentQuestionId].question; | ||
} | ||
|
||
getRecomendations() { | ||
if (this.rightAnswers === 0) { | ||
return "Рекомедуем Вам стоит подтянуть свои навыки, прежде чем учавствовать в вездекоде"; | ||
} | ||
return `Рекомедуем Вам тему ${ | ||
this.topics[Math.round(Math.random() * (this.topics.length - 1))] | ||
}`; | ||
} | ||
|
||
destroy() { | ||
this.sessionId = ""; | ||
this.currentQuestionId = 1; | ||
this.rightAnswers = 0; | ||
} | ||
} | ||
|
||
module.exports = { Quiz }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
let skillState = new Map(); | ||
|
||
const getState = (sessionId) => { | ||
let state = skillState.get(sessionId); | ||
if (!state) { | ||
state = { | ||
[sessionId]: {}, | ||
}; | ||
skillState.set(sessionId, state); | ||
} | ||
return state; | ||
}; | ||
|
||
const removeState = (sessionId) => { | ||
skillState.delete(sessionId); | ||
}; | ||
|
||
module.exports = { | ||
getState, | ||
removeState, | ||
}; |