| @@ -46,7 +46,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| options: [], | options: [], | ||||
| answer: ["single threaded"], | answer: ["single threaded"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 40, | |||||
| timeLimit: 60, | |||||
| type: "textInput" | type: "textInput" | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -63,11 +63,10 @@ | |||||
| .textInput { | .textInput { | ||||
| width: 95%; | width: 95%; | ||||
| margin: 0 auto; | margin: 0 auto; | ||||
| width: 30rem; | |||||
| height: 4rem; | |||||
| font-size: 1.4rem; | font-size: 1.4rem; | ||||
| border-radius: 2.5rem; | border-radius: 2.5rem; | ||||
| padding-left: 2rem; | padding-left: 2rem; | ||||
| padding-top: 2rem; | |||||
| } | } | ||||
| ion-item { | ion-item { | ||||
| @@ -19,7 +19,7 @@ const Options: React.FC<OwnProps> = (props) => { | |||||
| const [selectedOptions, setSelectedOptions] = useState<string[]>([]); | const [selectedOptions, setSelectedOptions] = useState<string[]>([]); | ||||
| const [textInput, setTextInput] = useState<string>(""); | const [textInput, setTextInput] = useState<string>(""); | ||||
| const [answers, setAnswers] = useState<number>(0); | const [answers, setAnswers] = useState<number>(0); | ||||
| const inputRef = useRef<HTMLInputElement>(null); | |||||
| const inputRef = useRef<HTMLTextAreaElement>(null); | |||||
| useEffect(() => { | useEffect(() => { | ||||
| setSelected(undefined); | setSelected(undefined); | ||||
| @@ -98,12 +98,14 @@ const Options: React.FC<OwnProps> = (props) => { | |||||
| } | } | ||||
| {props.type === "textInput" && | {props.type === "textInput" && | ||||
| <div className={styles.options}> | <div className={styles.options}> | ||||
| <input | |||||
| type="text" | |||||
| <textarea | |||||
| className={styles.textInput} | className={styles.textInput} | ||||
| placeholder="enter your answer" | |||||
| rows={20} | |||||
| cols={35} | |||||
| placeholder="enter your answer here" | |||||
| ref={inputRef} | ref={inputRef} | ||||
| onChange={handleInput} /> | |||||
| onChange={handleInput}> | |||||
| </textarea> | |||||
| </div> | </div> | ||||
| } | } | ||||
| </IonList> | </IonList> | ||||
| @@ -1,5 +1,4 @@ | |||||
| section { | section { | ||||
| .questionHolder { | .questionHolder { | ||||
| display: flex; | display: flex; | ||||
| flex-direction: column; | flex-direction: column; | ||||
| @@ -14,7 +14,6 @@ interface OwnProp { | |||||
| const Question: React.FC<OwnProp> = (props) => { | const Question: React.FC<OwnProp> = (props) => { | ||||
| const [seconds, setSeconds] = useState<number>(props.timeLimit); | const [seconds, setSeconds] = useState<number>(props.timeLimit); | ||||
| const [duration, setDuration] = useState<number>(props.timeLimit); | |||||
| const displaySeconds = seconds % 60; | const displaySeconds = seconds % 60; | ||||
| const percentage = Math.round(seconds / props.timeLimit * 100); | const percentage = Math.round(seconds / props.timeLimit * 100); | ||||
| const time = `${secondsToMinutes(seconds).toString().padStart(2, '0')}:${displaySeconds.toString().padStart(2, '0')}` | const time = `${secondsToMinutes(seconds).toString().padStart(2, '0')}:${displaySeconds.toString().padStart(2, '0')}` | ||||
| @@ -22,7 +21,6 @@ const Question: React.FC<OwnProp> = (props) => { | |||||
| useEffect(() => { | useEffect(() => { | ||||
| setSeconds(props.timeLimit); | setSeconds(props.timeLimit); | ||||
| setDuration(props.timeLimit); | |||||
| }, [props.questionNumber]); | }, [props.questionNumber]); | ||||
| useEffect(() => { | useEffect(() => { | ||||