Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Commits
645ce5ce
Commit
645ce5ce
authored
3 years ago
by
Emil
Browse files
Options
Downloads
Patches
Plain Diff
Feat: question components, needed fix: AnswerMultiple.tsx
parent
a02264d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!126
Resolve "Show question components in editor"
Pipeline
#43668
passed with warnings
3 years ago
Stage: setup
Stage: test
Stage: report
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/package-lock.json
+2
-1
2 additions, 1 deletion
client/package-lock.json
client/src/pages/presentationEditor/components/answerComponents/AnswerMultiple.tsx
+3
-2
3 additions, 2 deletions
...tionEditor/components/answerComponents/AnswerMultiple.tsx
with
5 additions
and
3 deletions
client/package-lock.json
+
2
−
1
View file @
645ce5ce
...
...
@@ -17285,7 +17285,8 @@
},
"ssri": {
"version": "6.0.1",
"resolved": "",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
"requires": {
"figgy-pudding": "^3.5.1"
}
...
...
This diff is collapsed.
Click to expand it.
client/src/pages/presentationEditor/components/answerComponents/AnswerMultiple.tsx
+
3
−
2
View file @
645ce5ce
...
...
@@ -29,14 +29,15 @@ const AnswerMultiple = ({ variant, activeSlide, competitionId }: AnswerMultipleP
}
const
updateAnswer
=
async
(
alternative
:
QuestionAlternative
)
=>
{
// TODO: fix. Make list of alternatives and delete & post instead of put to allow multiple boxes checked.
if
(
activeSlide
)
{
if
(
team
?.
question_answers
.
find
((
answer
)
=>
answer
.
question_id
===
activeSlide
.
questions
[
0
].
id
))
{
console
.
log
(
'
CHECKKKKKKKKKKK
'
)
if
(
answer
?.
answer
===
alternative
.
text
)
{
// Uncheck checkbox
deleteAnswer
()
}
else
{
// Check another box
// TODO
}
}
else
{
// Check first checkbox
...
...
@@ -60,7 +61,7 @@ const AnswerMultiple = ({ variant, activeSlide, competitionId }: AnswerMultipleP
const
deleteAnswer
=
async
()
=>
{
await
axios
.
delete
(
`/api/competitions/
${
competitionId
}
/teams/
${
teamId
}
/answers`
)
.
delete
(
`/api/competitions/
${
competitionId
}
/teams/
${
teamId
}
/answers`
)
// TODO: fix
.
then
(()
=>
{
dispatch
(
getEditorCompetition
(
competitionId
))
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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