Skip to content

Commit

Permalink
commenting/formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherLinnett committed Jun 9, 2022
1 parent aa63822 commit f3525c4
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 50 deletions.
42 changes: 21 additions & 21 deletions src/app/quiz/in-progress/in-progress.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
</ion-label>
<ion-item-divider>
</ion-item-divider>
<ion-item-divider color="clear" class="divider-quiz-question"></ion-item-divider>
<ion-radio-group [(ngModel)]="quizAnswered[i]" class="pushLower">
<ion-item>
<ion-label>{{question.answers[0].text}}</ion-label>
<ion-radio slot="end" [value]="question.answers[0].num"></ion-radio>
</ion-item>
<ion-item>
<ion-label>{{question.answers[1].text}}</ion-label>
<ion-radio slot="end" [value]="question.answers[1].num"></ion-radio>
</ion-item>
<ion-item>
<ion-label>{{question.answers[2].text}}</ion-label>
<ion-radio slot="end" [value]="question.answers[2].num"></ion-radio>
</ion-item>
<ion-item>
<ion-label>{{question.answers[3].text}}</ion-label>
<ion-radio slot="end" [value]="question.answers[3].num"></ion-radio>
</ion-item>
</ion-radio-group>
<ion-item-divider color="clear" class="divider-quiz-question"></ion-item-divider>
<ion-radio-group [(ngModel)]="quizAnswered[i]" class="pushLower">
<ion-item>
<ion-label>{{question.answers[0].text}}</ion-label>
<ion-radio slot="end" [value]="question.answers[0].num"></ion-radio>
</ion-item>
<ion-item>
<ion-label>{{question.answers[1].text}}</ion-label>
<ion-radio slot="end" [value]="question.answers[1].num"></ion-radio>
</ion-item>
<ion-item>
<ion-label>{{question.answers[2].text}}</ion-label>
<ion-radio slot="end" [value]="question.answers[2].num"></ion-radio>
</ion-item>
<ion-item>
<ion-label>{{question.answers[3].text}}</ion-label>
<ion-radio slot="end" [value]="question.answers[3].num"></ion-radio>
</ion-item>
</ion-radio-group>
</ng-template>
<ng-template swiperSlide class="verticalcenter">
<ion-card>
Expand All @@ -45,5 +45,5 @@
</swiper>
</ion-content>
<ion-footer>
<app-swipernav (forwardButtonPress)="onNextClick()" (backButtonPress)="onBackClick()"></app-swipernav>
</ion-footer>
<app-swipernav (forwardButtonPress)="onNextClick()" (backButtonPress)="onBackClick()"></app-swipernav>
</ion-footer>
35 changes: 14 additions & 21 deletions src/app/quiz/in-progress/in-progress.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,6 @@ export class InProgressPage implements OnInit {
};
quizAnswered: any[] = [];

/**
* The function creates a quiz object based on the chapter index.
* @param {CurrentModuleService} currentModuleService - CurrentModuleService is a service that I
* created to keep track of the current module that the user is on.
* @param {CourseService} courseService - This is a service that contains the course object.
*/
constructor(
private alertController: AlertController,
private modalController: ModalController,
Expand All @@ -452,23 +446,22 @@ export class InProgressPage implements OnInit {
this.quiz = await this.createQuiz(this.chapterIndex);
}


/**
* The function above is a function that is called when the user clicks on the next button. The
* function moves the content forward one section.
/**
* OnNextClick() is a function that takes in a string and returns nothing. It's a function that is
* called when the next button is clicked.
* @param [value] - 'string' - the value of the button
*/
onNextClick(value?:'string') {
//moves content forward one section
this.swiper.swiperRef.slideNext()

}
/**
* The above function is used to navigate to the previous slide in the swiper.
*/
onBackClick(value?:'string') {
this.swiper.swiperRef.slidePrev()
}
onNextClick(value?: 'string') {
this.swiper.swiperRef.slideNext();
}

/**
* When the back button is clicked, the swiper slides to the previous slide.
* @param [value] - 'string' - the value of the button
*/
onBackClick(value?: 'string') {
this.swiper.swiperRef.slidePrev();
}

/**
* It creates a quiz with 5 questions, each question has 5 answers, one of which is correct.
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/swipernav/swipernav.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<ion-icon slot="icon-only" name="caret-back"></ion-icon>
</ion-button>
<ion-button slot="end" fill="clear" (click)="forwardFunction()">
<ion-icon slot="icon-only" name="caret-forward" ></ion-icon>
<ion-icon slot="icon-only" name="caret-forward"></ion-icon>
</ion-button>
</ion-toolbar>
4 changes: 2 additions & 2 deletions src/app/shared/swipernav/swipernav.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ describe('SwipernavComponent', () => {

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ SwipernavComponent ],
imports: [IonicModule.forRoot()]
declarations: [SwipernavComponent],
imports: [IonicModule.forRoot()],
}).compileComponents();

fixture = TestBed.createComponent(SwipernavComponent);
Expand Down
10 changes: 5 additions & 5 deletions src/app/shared/swipernav/swipernav.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core';
export class SwipernavComponent implements OnInit {
@Output() forwardButtonPress: EventEmitter<any> = new EventEmitter();
@Output() backButtonPress: EventEmitter<any> = new EventEmitter();
constructor() { }
constructor() {}

ngOnInit() {}

forwardFunction(){
this.forwardButtonPress.emit(null)
forwardFunction() {
this.forwardButtonPress.emit(null);
}
backFunction(){
this.backButtonPress.emit(null)
backFunction() {
this.backButtonPress.emit(null);
}
}

0 comments on commit f3525c4

Please sign in to comment.