diff --git a/src/components/AnswerSheet/index.js b/src/components/AnswerSheet/index.js new file mode 100644 index 0000000..8e0c2d3 --- /dev/null +++ b/src/components/AnswerSheet/index.js @@ -0,0 +1,68 @@ +import React, { useEffect, useState } from "react"; + +const AnswerSheet = ({questionsQuantity, optionsQuantity }) => { + const [data, setData] = useState([]); + const [options, setOptions] = useState([]); + useEffect(() => { + let array = []; + let optionsArray = []; + for(var i =1; i <= questionsQuantity; i++){ + array.push({ + questionId : i, + answer: null, + }); + } + for(var i =1; i<= optionsQuantity; i++){ + optionsArray.push({ + id: i, + active: false, + }) + } + setOptions(optionsArray); + setData(array) + console.log(data, options) + }, []) + + return( +
+ {item.questionId} +
+ + + ++
تعداد سوالات
- +
ضریب
- +
تعداد گزینه
- +
نمره منفی
- +