| @@ -1,4 +1,5 @@ | |||||
| import { QuizDetails } from "../models/QuizDetails"; | |||||
| import { QuizDetails, OptionType } from "../models/QuizDetails"; | |||||
| const QUIZ_DETAILS: QuizDetails[] = [ | const QUIZ_DETAILS: QuizDetails[] = [ | ||||
| { | { | ||||
| @@ -12,7 +13,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: 5, | timeLimit: 5, | ||||
| type: "singleSelect" | |||||
| type: OptionType.SINGLE_SELECT | |||||
| }, | }, | ||||
| { | { | ||||
| question: "How do you write 'Hello World' in an alert box?", | question: "How do you write 'Hello World' in an alert box?", | ||||
| @@ -25,7 +26,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| answer: ["alert('Hello World');"], | answer: ["alert('Hello World');"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 10, | timeLimit: 10, | ||||
| type: "singleSelect" | |||||
| type: OptionType.SINGLE_SELECT | |||||
| }, | }, | ||||
| { | { | ||||
| @@ -38,8 +39,8 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| ], | ], | ||||
| answer: ["B", "C"], | answer: ["B", "C"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 15, | |||||
| type: "multiSelect" | |||||
| timeLimit: 60, | |||||
| type: OptionType.MULTI_SELECT | |||||
| }, | }, | ||||
| { | { | ||||
| question: "Is javascript single threaded or multi threaded? enter the answer in the below box ", | question: "Is javascript single threaded or multi threaded? enter the answer in the below box ", | ||||
| @@ -47,7 +48,7 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| answer: ["single threaded"], | answer: ["single threaded"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 60, | timeLimit: 60, | ||||
| type: "textInput" | |||||
| type: OptionType.INPUT_TEXT | |||||
| }, | }, | ||||
| { | { | ||||
| question: "is javascript", | question: "is javascript", | ||||
| @@ -60,17 +61,8 @@ const QUIZ_DETAILS: QuizDetails[] = [ | |||||
| answer: ["B", "C"], | answer: ["B", "C"], | ||||
| result: false, | result: false, | ||||
| timeLimit: 35, | timeLimit: 35, | ||||
| type: "multiSelect" | |||||
| type: OptionType.MULTI_SELECT | |||||
| }, | }, | ||||
| ]; | ]; | ||||
| export let test = [ | |||||
| { | |||||
| a: "ss" | |||||
| }, | |||||
| { | |||||
| a: "aa" | |||||
| }, | |||||
| ] | |||||
| export default QUIZ_DETAILS; | export default QUIZ_DETAILS; | ||||
| @@ -1,8 +1,14 @@ | |||||
| export enum OptionType { | |||||
| SINGLE_SELECT = "singleSelect", | |||||
| MULTI_SELECT = "multiSelect", | |||||
| INPUT_TEXT = "textInput" | |||||
| } | |||||
| export interface QuizDetails { | export interface QuizDetails { | ||||
| question: string; | question: string; | ||||
| options?: string[]; | options?: string[]; | ||||
| answer: string[]; | answer: string[]; | ||||
| result: boolean; | result: boolean; | ||||
| timeLimit: number; | timeLimit: number; | ||||
| type: string; | |||||
| type: OptionType; | |||||
| } | } | ||||
| @@ -50,9 +50,9 @@ const StepsDescription: React.FC<Props> = (props) => { | |||||
| </p> | </p> | ||||
| {props.isRoundCompleted ? | {props.isRoundCompleted ? | ||||
| <Link to="/interviewRounds" className={styles.button}> | |||||
| <div className={styles.button}> | |||||
| <IonButton shape="round" expand='block' disabled={true}>Completed</IonButton> | <IonButton shape="round" expand='block' disabled={true}>Completed</IonButton> | ||||
| </Link> | |||||
| </div> | |||||
| : | : | ||||
| <Link to={props.link} className={styles.button}> | <Link to={props.link} className={styles.button}> | ||||
| <IonButton shape="round" expand='block'>{props.buttonText}</IonButton> | <IonButton shape="round" expand='block'>{props.buttonText}</IonButton> | ||||
| @@ -2,15 +2,13 @@ import styles from "./PreliminaryRoundResults.module.scss" | |||||
| import { IonButton, IonContent, IonIcon, IonPage } from "@ionic/react"; | import { IonButton, IonContent, IonIcon, IonPage } from "@ionic/react"; | ||||
| import StepHeader from "../../components/stepsHeader/StepHeader"; | import StepHeader from "../../components/stepsHeader/StepHeader"; | ||||
| import goodJobIcon from "../../assets/icons/good_job.svg"; | import goodJobIcon from "../../assets/icons/good_job.svg"; | ||||
| import { closeCircle, checkmarkCircle } from "ionicons/icons"; | import { closeCircle, checkmarkCircle } from "ionicons/icons"; | ||||
| import { Link } from "react-router-dom"; | import { Link } from "react-router-dom"; | ||||
| import Quiz_Details from '../../mockData/QuizDetails'; | import Quiz_Details from '../../mockData/QuizDetails'; | ||||
| const PreliminaryRoundResults: React.FC = () => { | const PreliminaryRoundResults: React.FC = () => { | ||||
| return ( | return ( | ||||
| <IonPage> | <IonPage> | ||||
| <StepHeader stepNumber={2} roundName="Preliminary Round" /> | <StepHeader stepNumber={2} roundName="Preliminary Round" /> | ||||
| @@ -30,21 +30,25 @@ | |||||
| // styles for multiselect checkbox | // styles for multiselect checkbox | ||||
| .checkBoxHolder { | .checkBoxHolder { | ||||
| border: 0.2rem solid #707070; | |||||
| border: 0.2rem solid lighten($color: #707070, $amount: 20); | |||||
| border-radius: 2.5rem; | border-radius: 2.5rem; | ||||
| width: 2rem; | width: 2rem; | ||||
| height: 2rem; | height: 2rem; | ||||
| margin-left: 2rem; | |||||
| margin-left: 1.5rem; | |||||
| .checkBox { | .checkBox { | ||||
| --background-checked: var(--primary-button-color); | --background-checked: var(--primary-button-color); | ||||
| --checkmark-color: var(--primary-button-color); | --checkmark-color: var(--primary-button-color); | ||||
| --border-width: 0; | --border-width: 0; | ||||
| margin: 0; | margin: 0; | ||||
| margin-top: 0.26rem; | |||||
| margin-left: 0.27rem; | |||||
| width: 1.2rem; | |||||
| height: 1.2rem; | |||||
| margin-top: 0.3rem; | |||||
| margin-left: 0.3rem; | |||||
| width: 1rem; | |||||
| height: 1rem; | |||||
| } | |||||
| &.activeCheck { | |||||
| border: 0.2rem solid var(--primary-button-color); | |||||
| } | } | ||||
| } | } | ||||
| @@ -2,15 +2,15 @@ import { IonButton, IonCheckbox, IonItem, IonLabel, IonList, IonRadio, IonRadioG | |||||
| import { useEffect, useRef, useState } from 'react'; | import { useEffect, useRef, useState } from 'react'; | ||||
| import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||
| import styles from './Options.module.scss'; | import styles from './Options.module.scss'; | ||||
| import { OptionType } from '../../models/QuizDetails' | |||||
| interface OwnProps { | interface OwnProps { | ||||
| options: string[] | undefined; | options: string[] | undefined; | ||||
| type: string; | |||||
| type: OptionType; | |||||
| answer: string[]; | answer: string[]; | ||||
| lastQuestion: boolean; | lastQuestion: boolean; | ||||
| questionNumber: number; | questionNumber: number; | ||||
| updateQuestionNumber: () => void; | updateQuestionNumber: () => void; | ||||
| } | } | ||||
| const Options: React.FC<OwnProps> = (props) => { | const Options: React.FC<OwnProps> = (props) => { | ||||
| @@ -75,8 +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 : ""}> | <IonItem lines='none' key={key} className={(selectedOptions.includes(option)) ? styles.highlighted : ""}> | ||||
| <div className={styles.checkBoxHolder}> | |||||
| <IonCheckbox slot="start" mode='ios' className={styles.checkBox} onIonChange={e => selectChecked(option)} /> | |||||
| <div className={(selectedOptions.includes(option)) ? (styles.activeCheck + " " + styles.checkBoxHolder) : styles.checkBoxHolder}> | |||||
| <IonCheckbox | |||||
| slot="start" | |||||
| mode='ios' | |||||
| className={styles.checkBox} | |||||
| onIonChange={e => selectChecked(option)} /> | |||||
| </div> | </div> | ||||
| <IonLabel className={styles.multiSelectLabel}>{option}</IonLabel> | <IonLabel className={styles.multiSelectLabel}>{option}</IonLabel> | ||||
| </IonItem> | </IonItem> | ||||
| @@ -1,6 +1,6 @@ | |||||
| import styles from './Quiz.module.scss'; | import styles from './Quiz.module.scss'; | ||||
| import { IonButton, IonIcon } from '@ionic/react'; | |||||
| import { IonIcon } from '@ionic/react'; | |||||
| import Options from './Options'; | import Options from './Options'; | ||||
| import { closeOutline } from 'ionicons/icons' | import { closeOutline } from 'ionicons/icons' | ||||
| import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||
| @@ -11,7 +11,7 @@ import QUIZ_DETAILS from '../../mockData/QuizDetails'; | |||||
| const Quiz: React.FC = () => { | const Quiz: React.FC = () => { | ||||
| const [questionNumber, setQuestionNumber] = useState<number>(1); | const [questionNumber, setQuestionNumber] = useState<number>(1); | ||||
| const timeLimit = QUIZ_DETAILS[questionNumber - 1].timeLimit; | |||||
| const currentQuestion = QUIZ_DETAILS[questionNumber - 1]; | |||||
| const updateQuestionNumber = () => { | const updateQuestionNumber = () => { | ||||
| if (QUIZ_DETAILS.length > questionNumber) { | if (QUIZ_DETAILS.length > questionNumber) { | ||||
| @@ -30,9 +30,9 @@ const Quiz: React.FC = () => { | |||||
| </header> | </header> | ||||
| <Question | <Question | ||||
| question={QUIZ_DETAILS[questionNumber - 1].question} | |||||
| question={currentQuestion.question} | |||||
| questionNumber={questionNumber} | questionNumber={questionNumber} | ||||
| timeLimit={timeLimit} | |||||
| timeLimit={currentQuestion.timeLimit} | |||||
| updateQuestionNumber={updateQuestionNumber} /> | updateQuestionNumber={updateQuestionNumber} /> | ||||
| </div> | </div> | ||||
| @@ -40,10 +40,10 @@ const Quiz: React.FC = () => { | |||||
| <div className={styles.quizOptions}> | <div className={styles.quizOptions}> | ||||
| <div className={styles.options}> | <div className={styles.options}> | ||||
| <Options | <Options | ||||
| options={QUIZ_DETAILS[questionNumber - 1].options} | |||||
| options={currentQuestion.options} | |||||
| updateQuestionNumber={updateQuestionNumber} | updateQuestionNumber={updateQuestionNumber} | ||||
| type={QUIZ_DETAILS[questionNumber - 1].type} | |||||
| answer={QUIZ_DETAILS[questionNumber - 1].answer} | |||||
| type={currentQuestion.type} | |||||
| answer={currentQuestion.answer} | |||||
| lastQuestion={QUIZ_DETAILS.length === questionNumber} | lastQuestion={QUIZ_DETAILS.length === questionNumber} | ||||
| questionNumber={questionNumber} /> | questionNumber={questionNumber} /> | ||||
| </div> | </div> | ||||