Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
ARSnova
arsnova-click-v2-backend
Commits
79053e9c
Commit
79053e9c
authored
Aug 23, 2019
by
Christopher Mark Fullarton
Browse files
Sends the relevant questionindex always with the notification about changed responses
parent
4471bcfe
Changes
1
Show whitespace changes
Inline
Side-by-side
src/entities/member/MemberEntity.ts
View file @
79053e9c
...
@@ -139,15 +139,17 @@ export class MemberEntity extends AbstractEntity implements IMemberEntity {
...
@@ -139,15 +139,17 @@ export class MemberEntity extends AbstractEntity implements IMemberEntity {
}
}
public
addResponseValue
(
data
:
Array
<
number
>
|
string
|
number
):
void
{
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
.
getCurrentQ
uiz
()
.
currentQuestionIndex
].
value
=
data
;
this
.
responses
[
q
uiz
.
currentQuestionIndex
].
value
=
data
;
this
.
responses
[
this
.
getCurrentQ
uiz
()
.
currentQuestionIndex
].
responseTime
=
responseTime
;
this
.
responses
[
q
uiz
.
currentQuestionIndex
].
responseTime
=
responseTime
;
DbDAO
.
updateOne
(
DbCollection
.
Members
,
{
DbDAO
.
updateOne
(
DbCollection
.
Members
,
{
_id
:
this
.
id
,
_id
:
this
.
id
,
},
{
responses
:
this
.
responses
});
},
{
responses
:
this
.
responses
});
this
.
getCurrentQ
uiz
()
.
updatedMemberResponse
({
q
uiz
.
updatedMemberResponse
({
nickname
:
this
.
name
,
nickname
:
this
.
name
,
questionIndex
:
quiz
.
currentQuestionIndex
,
update
:
{
update
:
{
value
:
data
,
value
:
data
,
responseTime
,
responseTime
,
...
@@ -156,23 +158,27 @@ export class MemberEntity extends AbstractEntity implements IMemberEntity {
...
@@ -156,23 +158,27 @@ export class MemberEntity extends AbstractEntity implements IMemberEntity {
}
}
public
setConfidenceValue
(
confidence
:
number
):
void
{
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
,
{
DbDAO
.
updateOne
(
DbCollection
.
Members
,
{
_id
:
this
.
id
,
_id
:
this
.
id
,
},
{
responses
:
this
.
responses
});
},
{
responses
:
this
.
responses
});
this
.
getCurrentQ
uiz
()
.
updatedMemberResponse
({
q
uiz
.
updatedMemberResponse
({
nickname
:
this
.
name
,
nickname
:
this
.
name
,
questionIndex
:
quiz
.
currentQuestionIndex
,
update
:
{
confidence
:
confidence
},
update
:
{
confidence
:
confidence
},
});
});
}
}
public
setReadingConfirmation
():
void
{
public
setReadingConfirmation
():
void
{
this
.
responses
[
this
.
getCurrentQuiz
().
currentQuestionIndex
].
readingConfirmation
=
true
;
const
quiz
=
this
.
getCurrentQuiz
();
this
.
responses
[
quiz
.
currentQuestionIndex
].
readingConfirmation
=
true
;
DbDAO
.
updateOne
(
DbCollection
.
Members
,
{
DbDAO
.
updateOne
(
DbCollection
.
Members
,
{
_id
:
this
.
id
,
_id
:
this
.
id
,
},
{
responses
:
this
.
responses
});
},
{
responses
:
this
.
responses
});
this
.
getCurrentQ
uiz
()
.
updatedMemberResponse
({
q
uiz
.
updatedMemberResponse
({
nickname
:
this
.
name
,
nickname
:
this
.
name
,
questionIndex
:
quiz
.
currentQuestionIndex
,
update
:
{
readingConfirmation
:
true
},
update
:
{
readingConfirmation
:
true
},
});
});
}
}
...
...
Write
Preview
Supports
Markdown
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