Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
survey
Commits
ab4ecce7
Commit
ab4ecce7
authored
Jul 23, 2022
by
Yoon, Daeki
😅
Browse files
배열에 키 추가
parent
35d3386f
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/questions/Question.tsx
View file @
ab4ecce7
...
@@ -153,6 +153,7 @@ export const Question = ({
...
@@ -153,6 +153,7 @@ export const Question = ({
name
=
"type"
name
=
"type"
onChange
=
{
handleSelect
}
onChange
=
{
handleSelect
}
disabled
=
{
save
}
disabled
=
{
save
}
value
=
{
element
.
type
}
className
=
"w-36 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-themeColor w-full mr-3 p-2.5"
className
=
"w-36 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-themeColor w-full mr-3 p-2.5"
>
>
{
Array
.
from
(
QUESTION_TYPES
.
entries
()).
map
(([
key
,
value
])
=>
(
{
Array
.
from
(
QUESTION_TYPES
.
entries
()).
map
(([
key
,
value
])
=>
(
...
@@ -160,7 +161,7 @@ export const Question = ({
...
@@ -160,7 +161,7 @@ export const Question = ({
key
=
{
key
}
key
=
{
key
}
id
=
{
element
.
_id
}
id
=
{
element
.
_id
}
value
=
{
key
}
value
=
{
key
}
selected
=
{
key
===
element
.
type
}
//
selected={key === element.type}
>
>
{
value
}
{
value
}
</
option
>
</
option
>
...
...
frontend/src/survey/EditSurvey.tsx
View file @
ab4ecce7
...
@@ -129,6 +129,7 @@ export const EditSurvey = () => {
...
@@ -129,6 +129,7 @@ export const EditSurvey = () => {
</
div
>
</
div
>
{
questions
.
map
((
question
)
=>
(
{
questions
.
map
((
question
)
=>
(
<
Question
<
Question
key
=
{
question
.
_id
}
element
=
{
question
}
element
=
{
question
}
handleQuestion
=
{
handleQuestion
}
handleQuestion
=
{
handleQuestion
}
deleteQuestion
=
{
deleteQuestion
}
deleteQuestion
=
{
deleteQuestion
}
...
...
Write
Preview
Markdown
is supported
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