| @@ -7,7 +7,7 @@ | |||||
| border: 1px solid #DBDBDB; | border: 1px solid #DBDBDB; | ||||
| border-radius: 25px; | border-radius: 25px; | ||||
| height: 4rem; | height: 4rem; | ||||
| .icon { | .icon { | ||||
| width: 2rem; | width: 2rem; | ||||
| height: 2rem; | height: 2rem; | ||||
| @@ -24,6 +24,7 @@ | |||||
| box-shadow: 0px 0px 10px #00000029; | box-shadow: 0px 0px 10px #00000029; | ||||
| .icon { | .icon { | ||||
| color: var(--primary-button-color); | color: var(--primary-button-color); | ||||
| transform: scale(1.1); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,5 @@ | |||||
| import styles from "./RadioButton.module.scss"; | import styles from "./RadioButton.module.scss"; | ||||
| import { radioButtonOff, radioButtonOn } from "ionicons/icons"; | |||||
| import { radioButtonOff, radioButtonOn, checkmarkCircle } from "ionicons/icons"; | |||||
| import { IonIcon } from "@ionic/react"; | import { IonIcon } from "@ionic/react"; | ||||
| import { useEffect, useState } from "react"; | import { useEffect, useState } from "react"; | ||||
| @@ -7,6 +7,7 @@ interface OwnProps { | |||||
| option: string; | option: string; | ||||
| isChecked: boolean; | isChecked: boolean; | ||||
| isHighlighted?: boolean; | isHighlighted?: boolean; | ||||
| isCheckBox?: boolean; | |||||
| } | } | ||||
| const RadioButton: React.FC<OwnProps> = (props) => { | const RadioButton: React.FC<OwnProps> = (props) => { | ||||
| @@ -16,6 +17,9 @@ const RadioButton: React.FC<OwnProps> = (props) => { | |||||
| useEffect(() => { | useEffect(() => { | ||||
| if (props.isChecked) { | if (props.isChecked) { | ||||
| setIcon(radioButtonOn); | setIcon(radioButtonOn); | ||||
| if (props.isCheckBox) { | |||||
| setIcon(checkmarkCircle); | |||||
| } | |||||
| } else { | } else { | ||||
| setIcon(radioButtonOff); | setIcon(radioButtonOff); | ||||
| } | } | ||||
| @@ -12,7 +12,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| ], | ], | ||||
| answer: ["System.out.println('Hello, how are you?');"], | answer: ["System.out.println('Hello, how are you?');"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 5000, | |||||
| timeLimit: 60, | |||||
| type: OptionType.SINGLE_SELECT | type: OptionType.SINGLE_SELECT | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -25,7 +25,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| ], | ], | ||||
| answer: ["alert('Hello World');"], | answer: ["alert('Hello World');"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 5, | |||||
| timeLimit: 30, | |||||
| type: OptionType.SINGLE_SELECT | type: OptionType.SINGLE_SELECT | ||||
| }, | }, | ||||
| @@ -39,7 +39,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| ], | ], | ||||
| answer: ["B", "C"], | answer: ["B", "C"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 60, | |||||
| timeLimit: 120, | |||||
| type: OptionType.MULTI_SELECT | type: OptionType.MULTI_SELECT | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -47,7 +47,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| options: [], | options: [], | ||||
| answer: ["single threaded"], | answer: ["single threaded"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 60, | |||||
| timeLimit: 120, | |||||
| type: OptionType.INPUT_TEXT | type: OptionType.INPUT_TEXT | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -60,7 +60,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| ], | ], | ||||
| answer: ["B", "C"], | answer: ["B", "C"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 35, | |||||
| timeLimit: 60, | |||||
| type: OptionType.MULTI_SELECT | type: OptionType.MULTI_SELECT | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -73,7 +73,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| ], | ], | ||||
| answer: ["B", "C"], | answer: ["B", "C"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 35, | |||||
| timeLimit: 60, | |||||
| type: OptionType.MULTI_SELECT | type: OptionType.MULTI_SELECT | ||||
| } | } | ||||
| ]; | ]; | ||||
| @@ -18,7 +18,7 @@ const PreliminaryRoundResults: React.FC = () => { | |||||
| <IonIcon src={goodJobIcon} /> | <IonIcon src={goodJobIcon} /> | ||||
| <div className={styles.score}> | <div className={styles.score}> | ||||
| <h5>You have scored</h5> | <h5>You have scored</h5> | ||||
| <h5 className={styles.result}>{(parseInt(localStorage.getItem("answer")!) / Quiz_Details.length) * 100}%</h5> | |||||
| <h5 className={styles.result}>{((parseInt(localStorage.getItem("answer")!) / Quiz_Details.length) * 100).toFixed(2)}%</h5> | |||||
| </div> | </div> | ||||
| <p className={styles.description}> | <p className={styles.description}> | ||||
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. | ||||
| @@ -65,10 +65,6 @@ const Options: React.FC<OwnProps> = (props) => { | |||||
| localStorage.setItem("answer", answers.toString()); | localStorage.setItem("answer", answers.toString()); | ||||
| } | } | ||||
| const getAnswer = () => { | |||||
| } | |||||
| const options = props.options!.map((option, key) => { | const options = props.options!.map((option, key) => { | ||||
| return ( | return ( | ||||
| <div key={key} onClick={() => setSelected(option)}> | <div key={key} onClick={() => setSelected(option)}> | ||||
| @@ -79,16 +75,12 @@ const Options: React.FC<OwnProps> = (props) => { | |||||
| const MultiSelectOptions = props.options!.map((option, key) => { | const MultiSelectOptions = props.options!.map((option, key) => { | ||||
| return ( | return ( | ||||
| <IonItem lines='none' key={key} className={(selectedOptions.includes(option)) ? styles.highlighted : ""}> | |||||
| <div className={(selectedOptions.includes(option)) ? (styles.activeCheck + " " + styles.checkBoxHolder) : styles.checkBoxHolder}> | |||||
| <IonCheckbox | |||||
| slot="start" | |||||
| mode='ios' | |||||
| className={styles.checkBox} | |||||
| onIonChange={e => selectChecked(option)} /> | |||||
| </div> | |||||
| <IonLabel className={styles.multiSelectLabel}>{option}</IonLabel> | |||||
| </IonItem> | |||||
| <div key={key} onClick={() => selectChecked(option)}> | |||||
| <RadioButton | |||||
| isCheckBox={true} | |||||
| option={option} | |||||
| isChecked={selectedOptions.includes(option)} /> | |||||
| </div> | |||||
| ); | ); | ||||
| }); | }); | ||||