Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ <h2 mat-dialog-title>Edit Quest</h2>
</mat-form-field>
</form>

<div class="add-question">
<div class="modify-question">
<button mat-stroked-button type="button" (click)="onAddQuestion()">
<mat-icon fontIcon="add"></mat-icon> Add Questions
<mat-icon fontIcon="edit"></mat-icon> Manage Questions
</button>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
width: 100%;
}

.add-question {
.modify-question {
padding-top: 1rem;
width: 100%;
}
22 changes: 4 additions & 18 deletions src/app/preview-quest/preview-quest.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<mat-card-title>{{ quest?.questName }}</mat-card-title>
<mat-card-subtitle>{{ quest?.questDescription }}</mat-card-subtitle>
<span class="spacer"></span>
<button mat-icon-button (click)="openEditQuestDialog(quest)">
<button mat-stroked-button (click)="openEditQuestDialog(quest)">
<mat-icon>edit</mat-icon>
</button>
Edit Quest / Questions
</button>
</mat-card-header>
<mat-card-content>
<mat-chip color="primary" selected>{{ quest?.questSubject }}</mat-chip>
Expand All @@ -15,7 +16,7 @@
<button mat-raised-button color="primary" (click)="startQuest()" [disabled]="quest?.questions?.length === 0">
Start the Quest
</button>
<mat-tab-group (selectedTabChange)="onTabChange($event)">
<mat-tab-group>
<mat-tab label="Preview Questions">
<ng-container *ngIf="quest; else loading">
<!-- Check if there are questions associated with the quest -->
Expand All @@ -31,21 +32,6 @@
</ng-template>
</ng-container>
</mat-tab>
<mat-tab label="Manage Questions">
<ng-container *ngIf="quest; else loading">
<div *ngIf="quest?.questions?.length === 0; else manageQuestions">
<p>No questions have been assigned to this quest.</p>
</div>

<ng-template #manageQuestions>
<app-questions
[quest]="quest"
[questions]="quest?.questions || []"
[questionsEditable]="false">
</app-questions>
</ng-template>
</ng-container>
</mat-tab>
</mat-tab-group>

<ng-template #loading>
Expand Down
3 changes: 0 additions & 3 deletions src/app/preview-quest/preview-quest.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ export class PreviewQuestComponent implements OnInit {
});
}

onTabChange($event: MatTabChangeEvent) {
// Handle tab changes if needed
}

startQuest() {
this.router.navigate(['/quest/start/', this.quest?.id], {
Expand Down