Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
arsnova-click-v2-backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
ARSnova
arsnova-click-v2-backend
Commits
79053e9c
Commit
79053e9c
authored
Aug 23, 2019
by
Christopher Mark Fullarton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sends the relevant questionindex always with the notification about changed responses
parent
4471bcfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
src/entities/member/MemberEntity.ts
src/entities/member/MemberEntity.ts
+14
-8
No files found.
src/entities/member/MemberEntity.ts
View file @
79053e9c
...
...
@@ -139,15 +139,17 @@ export class MemberEntity extends AbstractEntity implements IMemberEntity {
}
public
addResponseValue
(
data
:
Array
<
number
>
|
string
|
number
):
void
{
const
responseTime
=
new
Date
().
getTime
()
-
this
.
getCurrentQuiz
().
currentStartTimestamp
;
const
quiz
=
this
.
getCurrentQuiz
();
const
responseTime
=
new
Date
().
getTime
()
-
quiz
.
currentStartTimestamp
;
this
.
responses
[
this
.
getCurrentQuiz
()
.
currentQuestionIndex
].
value
=
data
;
this
.
responses
[
this
.
getCurrentQuiz
()
.
currentQuestionIndex
].
responseTime
=
responseTime
;
this
.
responses
[
quiz
.
currentQuestionIndex
].
value
=
data
;
this
.
responses
[
quiz
.
currentQuestionIndex
].
responseTime
=
responseTime
;
DbDAO
.
updateOne
(
DbCollection
.
Members
,
{
_id
:
this
.
id
,
},
{
responses
:
this
.
responses
});
this
.
getCurrentQuiz
()
.
updatedMemberResponse
({
quiz
.
updatedMemberResponse
({
nickname
:
this
.
name
,
questionIndex
:
quiz
.
currentQuestionIndex
,
update
:
{
value
:
data
,
responseTime
,
...
...
@@ -156,23 +158,27 @@ export class MemberEntity extends AbstractEntity implements IMemberEntity {
}
public
setConfidenceValue
(
confidence
:
number
):
void
{
this
.
responses
[
this
.
getCurrentQuiz
().
currentQuestionIndex
].
confidence
=
confidence
;
const
quiz
=
this
.
getCurrentQuiz
();
this
.
responses
[
quiz
.
currentQuestionIndex
].
confidence
=
confidence
;
DbDAO
.
updateOne
(
DbCollection
.
Members
,
{
_id
:
this
.
id
,
},
{
responses
:
this
.
responses
});
this
.
getCurrentQuiz
()
.
updatedMemberResponse
({
quiz
.
updatedMemberResponse
({
nickname
:
this
.
name
,
questionIndex
:
quiz
.
currentQuestionIndex
,
update
:
{
confidence
:
confidence
},
});
}
public
setReadingConfirmation
():
void
{
this
.
responses
[
this
.
getCurrentQuiz
().
currentQuestionIndex
].
readingConfirmation
=
true
;
const
quiz
=
this
.
getCurrentQuiz
();
this
.
responses
[
quiz
.
currentQuestionIndex
].
readingConfirmation
=
true
;
DbDAO
.
updateOne
(
DbCollection
.
Members
,
{
_id
:
this
.
id
,
},
{
responses
:
this
.
responses
});
this
.
getCurrentQuiz
()
.
updatedMemberResponse
({
quiz
.
updatedMemberResponse
({
nickname
:
this
.
name
,
questionIndex
:
quiz
.
currentQuestionIndex
,
update
:
{
readingConfirmation
:
true
},
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment