Commit 0c9bb460 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

코드 정리

parent b9b919e7
......@@ -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}>
......
......@@ -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}
......
......@@ -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>
);
......
......@@ -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}
......
......@@ -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 (
<>
......
......@@ -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">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment