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
760fc4bc
Commit
760fc4bc
authored
6 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Finish form control - check if it is a single-choice content
parent
1067952e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!135
Resolve "Refine content-list-view"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/creator/_dialogs/content-edit/content-edit.component.ts
+13
-0
13 additions, 0 deletions
...s/creator/_dialogs/content-edit/content-edit.component.ts
with
13 additions
and
0 deletions
src/app/components/creator/_dialogs/content-edit/content-edit.component.ts
+
13
−
0
View file @
760fc4bc
...
...
@@ -16,6 +16,7 @@ export class ContentEditComponent implements OnInit {
content
:
ContentChoice
;
displayAnswers
:
DisplayAnswer
[]
=
[];
displayedColumns
=
[
'
label
'
,
'
checked
'
];
ansCounter
=
1
;
constructor
(
private
translateService
:
TranslateService
,
private
notificationService
:
NotificationService
,
...
...
@@ -33,8 +34,20 @@ export class ContentEditComponent implements OnInit {
updateAnswer
(
index
:
number
)
{
if
(
this
.
displayAnswers
[
index
].
correct
===
true
)
{
this
.
ansCounter
++
;
console
.
log
(
this
.
ansCounter
);
if
((
!
this
.
content
.
multiple
)
&&
this
.
ansCounter
>
1
)
{
for
(
let
i
=
0
;
i
<
this
.
displayAnswers
.
length
;
i
++
)
{
if
(
!
(
i
===
index
))
{
this
.
displayAnswers
[
i
].
correct
=
false
;
this
.
content
.
options
[
i
].
points
=
-
10
;
}
}
this
.
ansCounter
=
1
;
}
this
.
content
.
options
[
index
].
points
=
10
;
}
else
{
this
.
ansCounter
--
;
this
.
content
.
options
[
index
].
points
=
-
10
;
}
}
...
...
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