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
beab242a
Commit
beab242a
authored
Jan 12, 2023
by
jang dong hyeok
Browse files
.
parent
4c74350f
Changes
1
Show whitespace changes
Inline
Side-by-side
frontend/src/surveys/Question.tsx
View file @
beab242a
...
...
@@ -23,8 +23,6 @@ export const Question = ({
const
[
question
,
setQuestion
]
=
useState
(
element
);
const
isEditing
=
question
.
isEditing
;
const
[
questions
,
setQuestions
]
=
useState
();
async
function
handleEditComplete
()
{
question
.
content
.
choices
.
map
((
choice
)
=>
{
if
(
choice
.
text
.
trim
()
===
""
)
{
...
...
@@ -86,12 +84,11 @@ export const Question = ({
const
dropResult
=
monitor
.
getDropResult
<
DropResult
>
();
if
(
item
&&
dropResult
)
{
alert
(
`You dropped
${
item
.
name
}
`
);
}
else
{
alert
(
"
you dropped wrong place
"
);
}
},
collect
:
(
monitor
)
=>
({
isDragging
:
monitor
.
isDragging
(),
handlerId
:
monitor
.
getHandlerId
(),
}),
}));
...
...
@@ -101,22 +98,19 @@ export const Question = ({
isOver
:
monitor
.
isOver
(),
canDrop
:
monitor
.
canDrop
(),
}),
hover
(
item
,
monitor
)
{
if
(
!
isDragging
)
{
return
;
}
},
}));
//
return
(
<
div
ref
=
{
drop
}
className
=
"flex w-4/5 h-full justify-center"
style
=
{
{
border
:
isOver
?
"
dotted
"
:
""
,
}
}
>
<
div
ref
=
{
drop
}
className
=
"flex w-full h-full justify-center"
>
<
div
ref
=
{
drag
}
style
=
{
{
borderColor
:
isEditing
?
"
red
"
:
"
#0A8A8A
"
,
}
}
style
=
{
{
borderColor
:
isEditing
?
"
red
"
:
"
#0A8A8A
"
}
}
className
=
{
"
flex flex-col container w-full h-auto border-2 items-center m-3 py-2 rounded-lg cursor-move
"
}
...
...
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