@@ -91,6 +91,7 @@ | |||||
<section class="card"> | <section class="card"> | ||||
<ion-slides #slides [options]="slideOpts" (ionSlideDidChange)="selectIndex()"> | <ion-slides #slides [options]="slideOpts" (ionSlideDidChange)="selectIndex()"> | ||||
<ion-slide *ngFor="let matchDay of bookingSeatsData" | <ion-slide *ngFor="let matchDay of bookingSeatsData" | ||||
(click)="showBookingDetails(matchDay)"> | (click)="showBookingDetails(matchDay)"> | ||||
<div class="image-holder"> | <div class="image-holder"> | ||||
@@ -1,10 +1,10 @@ | |||||
<section class="question"> | <section class="question"> | ||||
<h3> {{ text }} </h3> | <h3> {{ text }} </h3> | ||||
<div class="options"> | |||||
<div class="options" [ngClass]="{'inactive' : selectedChoice }"> | |||||
<button *ngFor="let choice of choices" | <button *ngFor="let choice of choices" | ||||
(click)="selectedChoice = choice.value" | (click)="selectedChoice = choice.value" | ||||
[ngClass]="{'active': selectedChoice === choice.value }"> | |||||
[ngClass]="{'correct': selectedChoice === choice.value && selectedChoice === correctAnswer, 'wrong': selectedChoice === choice.value && selectedChoice !== correctAnswer }"> | |||||
{{ choice.text }} | {{ choice.text }} | ||||
<ion-checkbox mode="ios" [checked]="selectedChoice === choice.value"></ion-checkbox> | <ion-checkbox mode="ios" [checked]="selectedChoice === choice.value"></ion-checkbox> | ||||
@@ -10,6 +10,10 @@ h3 { | |||||
.options { | .options { | ||||
margin: 30px auto; | margin: 30px auto; | ||||
&.inactive { | |||||
pointer-events: none; | |||||
} | |||||
button { | button { | ||||
border: 3px solid rgba($sea-blue, 0.3); | border: 3px solid rgba($sea-blue, 0.3); | ||||
display: flex; | display: flex; | ||||
@@ -23,14 +27,26 @@ h3 { | |||||
margin: 15px 0; | margin: 15px 0; | ||||
width: 100%; | width: 100%; | ||||
padding: 0 15px; | padding: 0 15px; | ||||
&.correct { | |||||
background-color: $green; | |||||
border-color: darken($green, 10%); | |||||
font-weight: 500; | |||||
} | |||||
&.wrong { | |||||
background-color: rgba(orange, 0.8); | |||||
border-color: orange; | |||||
font-weight: 500; | |||||
} | |||||
} | } | ||||
ion-checkbox { | ion-checkbox { | ||||
--background: transparent; | --background: transparent; | ||||
--border-color: #2ea9f586; | --border-color: #2ea9f586; | ||||
--border-width: 2px; | --border-width: 2px; | ||||
--border-color-checked: var(--ion-color-primary); | |||||
--background-checked: var(--ion-color-primary); | |||||
--border-color-checked: white; | |||||
--background-checked: transparent; | |||||
--size: 25px; | --size: 25px; | ||||
--checkmark-width: 2px; | --checkmark-width: 2px; | ||||
--checkmark-color: white; | --checkmark-color: white; | ||||
@@ -66,19 +66,40 @@ export class QuizPage implements OnInit { | |||||
this.questions = [{ | this.questions = [{ | ||||
type: 'MCQ', | type: 'MCQ', | ||||
question: faker.lorem.sentence(), | |||||
question: 'Who has highest S/R in KXIP history?', | |||||
choices: [{ | choices: [{ | ||||
value: 'A', | value: 'A', | ||||
text: 'Choice 1' | |||||
text: 'Rahul K L' | |||||
}, { | }, { | ||||
value: 'B', | value: 'B', | ||||
text: 'Choice 2' | |||||
text: 'Glen Maxwell' | |||||
}, { | }, { | ||||
value: 'C', | value: 'C', | ||||
text: 'Choice 3' | |||||
text: 'V Sehwag' | |||||
}, { | |||||
value: 'D', | |||||
text: 'R Ashwin' | |||||
}], | }], | ||||
correctAnswer: 'A', | correctAnswer: 'A', | ||||
secondsAllotted: 50 | |||||
secondsAllotted: 20 | |||||
}, { | |||||
type: 'MCQ', | |||||
question: 'Who Scored highest runs in KXIP History?', | |||||
choices: [{ | |||||
value: 'A', | |||||
text: 'Rahul K L' | |||||
}, { | |||||
value: 'B', | |||||
text: 'Glen Maxwell' | |||||
}, { | |||||
value: 'C', | |||||
text: 'V Sehwag' | |||||
}, { | |||||
value: 'D', | |||||
text: 'N Pooran' | |||||
}], | |||||
correctAnswer: 'C', | |||||
secondsAllotted: 20 | |||||
}, { | }, { | ||||
type: 'CARD', | type: 'CARD', | ||||
question: cardQuestions, | question: cardQuestions, | ||||