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
0c9bb460
Commit
0c9bb460
authored
Jul 28, 2022
by
Yoon, Daeki
😅
Browse files
코드 정리
parent
b9b919e7
Changes
6
Show whitespace changes
Inline
Side-by-side
frontend/src/results/Accordion.tsx
View file @
0c9bb460
...
...
@@ -7,9 +7,11 @@ import { RDropdownForm } from "./RDropdownForm";
import
{
RFileForm
}
from
"
./RFileForm
"
;
import
{
RRatingForm
}
from
"
./RRatingForm
"
;
import
{
RDateForm
}
from
"
./RDateForm
"
;
type
AccordionProps
=
{
question
:
BasicQuestionType
;
};
export
const
Accordion
=
({
question
}:
AccordionProps
)
=>
{
const
[
isOpened
,
setOpened
]
=
useState
<
boolean
>
(
false
);
const
[
height
,
setHeight
]
=
useState
<
string
>
(
"
0px
"
);
...
...
@@ -39,7 +41,9 @@ export const Accordion = ({ question }: AccordionProps) => {
return
<></>;
}
}
console
.
log
(
question
);
// console.log(question);
return
(
<
div
className
=
"p-1"
>
<
div
onClick
=
{
HandleOpening
}
>
...
...
frontend/src/results/RDropdownForm.tsx
View file @
0c9bb460
...
...
@@ -10,11 +10,11 @@ export const RDropdownForm = ({ question }: Props) => {
acc
[
cur
]
=
(
acc
[
cur
]
||
0
)
+
1
;
return
acc
;
},
{});
console
.
log
(
result
);
return
(
<
div
className
=
"m-5"
>
{
question
.
content
.
choices
.
map
((
choice
:
any
)
=>
(
<
div
className
=
""
>
{
question
.
content
.
choices
.
map
((
choice
:
any
,
index
:
number
)
=>
(
<
div
key
=
{
index
}
className
=
""
>
<
span
className
=
"font-bold"
>
{
choice
.
text
}
</
span
>
<
span
className
=
"ml-3"
>
-
{
result
[
choice
.
text
]
?
result
[
choice
.
text
]
:
0
}
...
...
frontend/src/results/REssayForm.tsx
View file @
0c9bb460
...
...
@@ -8,8 +8,10 @@ type Props = {
export
const
REssayForm
=
({
question
}:
Props
)
=>
{
return
(
<
div
className
=
"m-5"
>
{
question
.
answers
.
map
((
answer
:
any
)
=>
(
<
div
className
=
"font-bold"
>
{
answer
}
</
div
>
{
question
.
answers
.
map
((
answer
:
any
,
index
:
number
)
=>
(
<
div
key
=
{
index
}
className
=
"font-bold"
>
{
answer
}
</
div
>
))
}
</
div
>
);
...
...
frontend/src/results/RRadioForm.tsx
View file @
0c9bb460
...
...
@@ -10,12 +10,12 @@ export const RRadioForm = ({ question }: Props) => {
acc
[
cur
]
=
(
acc
[
cur
]
||
0
)
+
1
;
return
acc
;
},
{});
console
.
log
(
result
);
//
console.log(result);
return
(
<
div
className
=
"m-5"
>
{
question
.
content
.
choices
.
map
((
choice
:
any
)
=>
(
<
div
className
=
""
>
{
question
.
content
.
choices
.
map
((
choice
:
any
,
index
:
number
)
=>
(
<
div
key
=
{
index
}
className
=
""
>
<
span
className
=
"font-bold"
>
{
choice
.
text
}
</
span
>
<
span
className
=
"ml-3"
>
-
{
result
[
choice
.
text
]
?
result
[
choice
.
text
]
:
0
}
...
...
frontend/src/survey/EditSurvey.tsx
View file @
0c9bb460
...
...
@@ -37,7 +37,7 @@ export const EditSurvey = () => {
const
initEditing
=
thisSurvey
.
questions
.
map
((
question
)
=>
{
return
{
qid
:
question
.
_id
,
isEditing
:
false
};
});
console
.
log
(
"
init editing
"
,
initEditing
);
//
console.log("init editing", initEditing);
setIsEditing
(
initEditing
);
setSurvey
(
thisSurvey
);
...
...
@@ -148,8 +148,8 @@ export const EditSurvey = () => {
}
const
questions
=
survey
.
questions
;
console
.
log
(
questions
);
console
.
log
(
"
isediting
"
,
isEditing
);
//
console.log(questions);
//
console.log("isediting", isEditing);
return
(
<>
...
...
frontend/src/survey/ResultSurvey.tsx
View file @
0c9bb460
...
...
@@ -26,7 +26,7 @@ export const ResultSurvey = () => {
try
{
if
(
surveyId
)
{
const
survey
=
await
answerApi
.
getAnswers
(
surveyId
);
console
.
log
(
survey
);
//
console.log(survey);
setSurvey
(
survey
);
}
else
{
setLoading
(
true
);
...
...
@@ -37,6 +37,7 @@ export const ResultSurvey = () => {
setLoading
(
false
);
}
}
return
(
<
div
className
=
"flex flex-col place-items-center"
>
<
div
className
=
"flex flex-col container place-items-center mt-4"
>
...
...
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