Skip to content
Open
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
@@ -1,3 +1,65 @@
<div *ngIf="task" class="flex items-center justify-between px-4 py-2 border-b bg-white">
<h3 class="m-0 text-base font-medium">
{{ task.definition.name }}
</h3>

<div class="flex gap-2 items-center">
<button
type="button"
class="px-3 py-1 border rounded"
(click)="setCurrentView(DashboardViews.submission)"
*ngIf="selectedTaskService.hasSubmissionPdf"
>
View Submission
</button>

<button
type="button"
class="px-3 py-1 border rounded"
(click)="setCurrentView(DashboardViews.task)"
*ngIf="selectedTaskService.hasTaskSheet"
>
View Task Sheet
</button>

<button
type="button"
class="px-3 py-1 border rounded"
(click)="setCurrentView(DashboardViews.similarity)"
*ngIf="tutor"
>
View Similarities
</button>

<button
type="button"
class="px-3 py-1 border rounded"
(click)="setCurrentView(DashboardViews.overseer)"
*ngIf="overseerEnabled"
>
View Overseer Reports
</button>

<button
type="button"
class="px-3 py-1 border rounded"
(click)="downloadSubmission()"
*ngIf="selectedTaskService.hasSubmissionPdf"
>
Download PDF
</button>

<button
type="button"
class="px-3 py-1 border rounded"
(click)="downloadSubmittedFiles()"
*ngIf="selectedTaskService.hasSubmissionPdf"
>
Download Files
</button>
</div>
</div>

<div class="w-full h-full overflow-auto">
<ng-container [ngSwitch]="currentView">
<ng-template [ngSwitchCase]="DashboardViews.task">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {DashboardViews} from '../../selected-task.service';
export class TaskDashboardComponent implements OnInit, OnChanges {
@Input() task: Task;
@Input() pdfUrl: string;
@Input() unitRole: any;

public DashboardViews = DashboardViews;

Expand Down Expand Up @@ -75,6 +76,10 @@ export class TaskDashboardComponent implements OnInit, OnChanges {
this.taskAssessmentModal.show(this.task);
}

setCurrentView(view: DashboardViews): void {
this.selectedTaskService.currentView$.next(view);
}

downloadSubmission() {
this.fileDownloader.downloadFile(this.urls.taskSubmissionPdfAttachmentUrl, 'submission.pdf');
}
Expand Down