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
8d57a8d9
Commit
8d57a8d9
authored
7 years ago
by
Hagen Dreßler
Browse files
Options
Downloads
Patches
Plain Diff
Edit component answer-statistic
parent
b5c45f9e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!93
Resolve "answer statistics (logic)" 2nd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/answer-statistics/answer-statistics.component.html
+3
-3
3 additions, 3 deletions
src/app/answer-statistics/answer-statistics.component.html
src/app/answer-statistics/answer-statistics.component.ts
+9
-5
9 additions, 5 deletions
src/app/answer-statistics/answer-statistics.component.ts
with
12 additions
and
8 deletions
src/app/answer-statistics/answer-statistics.component.html
+
3
−
3
View file @
8d57a8d9
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<div
align=
"right"
>
Responded answers: {{ statistic.answers }}
</div>
<div
align=
"right"
>
Responded answers: {{ statistic.answers }}
</div>
</div>
</div>
</mat-tab>
</mat-tab>
<mat-tab
label=
"Evaluation"
>
<mat-tab
label=
"Evaluation"
(choose)=
"showEvaluation(selectedContent.index)"
>
<h2
fxLayoutAlign=
"center"
>
{{ selectedContent.name }}
</h2>
<h2
fxLayoutAlign=
"center"
>
{{ selectedContent.name }}
</h2>
<div
class=
"evaluation"
*ngFor=
"let choice of evaluation"
>
<div
class=
"evaluation"
*ngFor=
"let choice of evaluation"
>
{{ choice.name }}
{{ choice.name }}
...
@@ -25,9 +25,9 @@
...
@@ -25,9 +25,9 @@
<div
align=
"right"
>
Selected: {{ choice.answers }} times
</div>
<div
align=
"right"
>
Selected: {{ choice.answers }} times
</div>
</div>
</div>
<div
fxLayoutAlign=
"center"
fxLayoutGap=
"10px"
>
<div
fxLayoutAlign=
"center"
fxLayoutGap=
"10px"
>
<button
mat-raised-button
color=
"primary"
>
Before
</button>
<button
mat-raised-button
color=
"primary"
(click)=
"showEvaluation(selectedContent.index-1)"
>
Before
</button>
<div><b>
{{ selectedContent.index }} / {{ selectedContent.length }}
</b></div>
<div><b>
{{ selectedContent.index }} / {{ selectedContent.length }}
</b></div>
<button
mat-raised-button
color=
"primary"
>
Next
</button>
<button
mat-raised-button
color=
"primary"
(click)=
"showEvaluation(selectedContent.index+1)"
>
Next
</button>
</div>
</div>
</mat-tab>
</mat-tab>
</mat-tab-group>
</mat-tab-group>
...
...
This diff is collapsed.
Click to expand it.
src/app/answer-statistics/answer-statistics.component.ts
+
9
−
5
View file @
8d57a8d9
...
@@ -19,15 +19,15 @@ export class AnswerStatisticsComponent implements OnInit {
...
@@ -19,15 +19,15 @@ export class AnswerStatisticsComponent implements OnInit {
@
Input
()
choiceAnswers
:
ChoiceAnswer
[]
=
[];
@
Input
()
choiceAnswers
:
ChoiceAnswer
[]
=
[];
statistics
:
any
=
null
;
statistics
:
any
=
null
;
selectedContent
:
any
=
{
selectedContent
:
any
=
{
name
:
'
HOW TO MAKE CONTENT
'
,
name
:
'
HOW TO MAKE CONTENT
GREAT AGAIN
'
,
index
:
'
1
'
,
index
:
'
1
'
,
length
:
'
1
'
length
:
'
1
'
};
};
evaluation
:
any
=
[
evaluation
:
any
=
[
{
name
:
'
test
'
,
percent
:
5
0
,
correct
:
false
,
answers
:
50
,
},
{
name
:
'
Skill
'
,
percent
:
1
0
,
correct
:
false
,
answers
:
1
,
},
{
name
:
'
test
'
,
percent
:
10
,
correct
:
false
,
answers
:
1
0
,
},
{
name
:
'
Knowledge
'
,
percent
:
10
,
correct
:
false
,
answers
:
1
,
},
{
name
:
'
test
'
,
percent
:
30
,
correct
:
true
,
answers
:
3
0
,
},
{
name
:
'
???
'
,
percent
:
30
,
correct
:
true
,
answers
:
3
,
},
{
name
:
'
test
'
,
percent
:
4
0
,
correct
:
fals
e
,
answers
:
40
,
}
{
name
:
'
Not at all
'
,
percent
:
5
0
,
correct
:
tru
e
,
answers
:
5
,
}
];
];
states
=
[
states
=
[
{
value
:
'
1
'
,
viewValue
:
'
Text answers
'
},
{
value
:
'
1
'
,
viewValue
:
'
Text answers
'
},
...
@@ -94,4 +94,8 @@ export class AnswerStatisticsComponent implements OnInit {
...
@@ -94,4 +94,8 @@ export class AnswerStatisticsComponent implements OnInit {
countChoiceAnswers
(
contentId
:
string
):
number
{
countChoiceAnswers
(
contentId
:
string
):
number
{
return
this
.
choiceAnswers
.
filter
(
answer
=>
answer
.
contentId
===
contentId
).
length
;
return
this
.
choiceAnswers
.
filter
(
answer
=>
answer
.
contentId
===
contentId
).
length
;
}
}
showEvaluation
(
index
:
number
)
{
/** coming with api connection, logic doesnt make sense without knowledge about api **/
}
}
}
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