Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IDATT-2501-Backend
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TrioTech
IDATT-2501-Backend
Merge requests
!73
Resolve "Split game object and add events readAnswer and questionEnd"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Split game object and add events readAnswer and questionEnd"
151-split-game-object-and-add-events-readanswer-and-questionend
into
main
Overview
0
Commits
12
Pipelines
13
Changes
2
Merged
Pedro Pablo Cardona Arroyave
requested to merge
151-split-game-object-and-add-events-readanswer-and-questionend
into
main
1 year ago
Overview
0
Commits
12
Pipelines
13
Changes
2
Expand
Closes
#151 (closed)
0
0
Merge request reports
Compare
main
version 11
349e04a8
1 year ago
version 10
a9f6d2c7
1 year ago
version 9
3570f7c0
1 year ago
version 8
e1bb3f72
1 year ago
version 7
5af35703
1 year ago
version 6
bc6b2038
1 year ago
version 5
1f399728
1 year ago
version 4
c8e9075e
1 year ago
version 3
26f03bef
1 year ago
version 2
27f532fa
1 year ago
version 1
02015985
1 year ago
main (base)
and
latest version
latest version
b42acbc3
12 commits,
1 year ago
version 11
349e04a8
11 commits,
1 year ago
version 10
a9f6d2c7
10 commits,
1 year ago
version 9
3570f7c0
9 commits,
1 year ago
version 8
e1bb3f72
8 commits,
1 year ago
version 7
5af35703
7 commits,
1 year ago
version 6
bc6b2038
6 commits,
1 year ago
version 5
1f399728
5 commits,
1 year ago
version 4
c8e9075e
4 commits,
1 year ago
version 3
26f03bef
3 commits,
1 year ago
version 2
27f532fa
2 commits,
1 year ago
version 1
02015985
1 commit,
1 year ago
2 files
+
96
−
28
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
models/game.model.js
+
7
−
5
Options
@@ -10,6 +10,7 @@ class Game {
this
.
category
=
{};
this
.
usersAnswers
=
new
Map
();
this
.
pot
=
pot
;
this
.
usersStatus
=
new
Map
();
}
async
setGameData
()
{
@@ -25,7 +26,7 @@ class Game {
10
,
);
}
console
.
log
(
questions
);
//
console.log(questions);
for
(
let
i
=
0
;
i
<
questions
.
length
;
i
++
)
{
const
answers
=
await
answerController
.
getAnswerForQuestion
(
questions
[
i
].
_id
);
this
.
gameData
[
i
]
=
{
@@ -37,16 +38,17 @@ class Game {
this
.
usersAnswers
.
set
(
user
,
[]);
}
console
.
log
(
this
.
gameData
);
//
console.log(this.gameData);
return
this
.
gameData
;
}
addNewAnswer
(
user
,
answer
)
{
this
.
usersAnswers
.
get
(
user
)
.
push
(
answer
)
;
return
this
.
verifyAnswer
(
this
.
usersAnswers
.
get
(
user
).
length
-
1
,
answer
);
addNewAnswer
(
user
,
answer
,
index
)
{
this
.
usersAnswers
.
get
(
user
)
[
index
]
=
answer
;
return
this
.
verifyAnswer
(
index
,
answer
);
}
verifyAnswer
(
questionNumber
,
answer
)
{
console
.
log
(
this
.
gameData
[
questionNumber
]);
return
this
.
gameData
[
questionNumber
].
answers
[
answer
].
is_correct
;
}
Loading