Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arsnova-lite
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
arsnova-lite
Commits
105a16c9
Commit
105a16c9
authored
7 years ago
by
Hagen Dreßler
Browse files
Options
Downloads
Patches
Plain Diff
Edit component answer-statistic (get Answers)
parent
549aa1df
No related merge requests found
This commit is part of merge request
!85
. Comments created here will be created in the context of that merge request.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/answer-statistics/answer-statistics.component.ts
+14
-3
14 additions, 3 deletions
src/app/answer-statistics/answer-statistics.component.ts
src/app/in-memory-data.service.ts
+4
-4
4 additions, 4 deletions
src/app/in-memory-data.service.ts
with
18 additions
and
7 deletions
src/app/answer-statistics/answer-statistics.component.ts
+
14
−
3
Edit
View file @
105a16c9
...
...
@@ -3,8 +3,8 @@ import { ActivatedRoute } from '@angular/router';
import
{
RoomService
}
from
'
../room.service
'
;
import
{
Content
}
from
'
../content
'
;
import
{
ContentService
}
from
'
../content.service
'
;
import
{
AnswerText
}
from
'
../answer-text
'
;
import
{
ContentAnswerService
}
from
'
../content-answer.service
'
;
import
{
AnswerText
}
from
'
../answer-text
'
;
@
Component
({
selector
:
'
app-answer-statistics
'
,
...
...
@@ -13,6 +13,7 @@ import { ContentAnswerService } from '../content-answer.service';
})
export
class
AnswerStatisticsComponent
implements
OnInit
{
@
Input
()
content
:
Content
[];
@
Input
()
answers
:
AnswerText
[]
=
[];
statistics
:
any
=
null
;
states
=
[
{
value
:
'
1
'
,
viewValue
:
'
Responded
'
},
...
...
@@ -24,7 +25,7 @@ export class AnswerStatisticsComponent implements OnInit {
private
route
:
ActivatedRoute
,
private
roomService
:
RoomService
,
private
contentService
:
ContentService
,
private
contentAnswer
:
ContentAnswerService
)
{
}
private
contentAnswer
Service
:
ContentAnswerService
)
{
}
ngOnInit
():
void
{
this
.
route
.
params
.
subscribe
(
params
=>
{
...
...
@@ -33,10 +34,20 @@ export class AnswerStatisticsComponent implements OnInit {
}
getContent
(
roomId
:
string
):
void
{
this
.
contentService
.
getContents
(
roomId
).
subscribe
(
content
=>
this
.
content
=
content
);
this
.
contentService
.
getContents
(
roomId
).
subscribe
(
content
=>
{
this
.
content
=
content
;
this
.
getAnswers
();
});
}
getAnswers
():
void
{
for
(
const
question
of
this
.
content
)
{
this
.
contentAnswerService
.
getAnswerTexts
(
question
.
id
).
subscribe
(
answer
=>
[].
push
.
apply
(
this
.
answers
,
answer
));
}
}
showStatistic
(
value
)
{
console
.
log
(
this
.
answers
);
this
.
statistics
=
[];
for
(
const
question
of
this
.
content
)
{
this
.
statistics
.
push
(
{
...
...
This diff is collapsed.
Click to expand it.
src/app/in-memory-data.service.ts
+
4
−
4
Edit
View file @
105a16c9
...
...
@@ -145,8 +145,8 @@ export class InMemoryDataService implements InMemoryDbService {
creationTimestamp
:
Date
,
},
{
id
:
'
1
'
,
revision
:
'
1
'
,
id
:
'
2
'
,
revision
:
'
2
'
,
contentId
:
'
1
'
,
round
:
'
1
'
,
subject
:
'
Textaufgabe 1
'
,
...
...
@@ -155,8 +155,8 @@ export class InMemoryDataService implements InMemoryDbService {
creationTimestamp
:
Date
,
},
{
id
:
'
2
'
,
revision
:
'
2
'
,
id
:
'
3
'
,
revision
:
'
3
'
,
contentId
:
'
2
'
,
round
:
'
3
'
,
subject
:
'
Textaufgabe 2
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment