forked from doubtfire-lms/doubtfire-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4842f84
commit 48ba01c
Showing
9 changed files
with
89 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div *ngIf="fileType === 'pdf'"> | ||
<pdf-viewer [src]="src" [render-text]="true" style="display: block"></pdf-viewer> | ||
</div> | ||
|
||
<div *ngIf="fileType === 'html'"> | ||
<iframe [src]="src | safe" width="100%" height="100%"></iframe> | ||
</div> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { FileViewerComponent } from './file-viewer.component'; | ||
|
||
describe('FileViewerComponent', () => { | ||
let component: FileViewerComponent; | ||
let fixture: ComponentFixture<FileViewerComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ FileViewerComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(FileViewerComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'f-file-viewer', | ||
templateUrl: './file-viewer.component.html', | ||
styleUrls: ['./file-viewer.component.scss'], | ||
}) | ||
export class FileViewerComponent { | ||
@Input() src: string; | ||
@Input() fileType: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 28 additions & 24 deletions
52
...ctives/task-dashboard/directives/task-similarity-view/task-similarity-view.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
<div> | ||
<p>Ensure student_0 task 1.1P in COS1001 is flagged in inbox.</p> | ||
<h1>Similarities</h1> | ||
<ul> | ||
<li *ngFor="let similarity of task?.similarityCache.values | async"> | ||
<div> | ||
<h2>{{ similarity.type }} - {{ similarity.id }} - {{ similarity.pct }}%</h2> | ||
<p>Show files/parts if flagged, otherwise click to load...</p> | ||
<ul> | ||
<li *ngFor="let part of similarity.parts"> | ||
<div> | ||
<h3>{{ part.description }}</h3> | ||
<p>{{ part.idx }} {{ part.format }} {{ part.pct }}%</p> | ||
<p> | ||
We need a "blob viewer" here -- parent of a html view / image view / pdf viewer -- handle resource | ||
downloading and freeing blob on destroy. The url for this blob is {{ similarity.fileUrl(part.idx) }}. | ||
The blob viewer can then also go into the comment viewer for images. | ||
</p> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</li> | ||
</ul> | ||
<div class="p-4"> | ||
<div class="flex items-center"> | ||
<mat-icon class="mr-2">crisis_alert</mat-icon> | ||
<h1 class="mat-headline m-0">Similarities</h1> | ||
<span class="grow"></span> | ||
<div class="example-action-buttons"> | ||
<button mat-button (click)="accordion.openAll()">Expand All</button> | ||
<button mat-button (click)="accordion.closeAll()">Collapse All</button> | ||
</div> | ||
</div> | ||
|
||
<mat-accordion multi> | ||
<ng-container *ngFor="let similarity of task?.similarityCache.values | async"> | ||
<h1 class="mat-headline"></h1> | ||
<mat-expansion-panel | ||
*ngFor="let part of similarity.parts" | ||
hideToggle | ||
(opened)="panelOpenState = true" | ||
(closed)="panelOpenState = false" | ||
> | ||
<mat-expansion-panel-header> | ||
<mat-panel-title>{{ similarity.friendlyTypeName }} </mat-panel-title> | ||
<mat-panel-description> {{ part.description }} </mat-panel-description> | ||
</mat-expansion-panel-header> | ||
<f-file-viewer [fileType]="part.format" [src]="similarity.fileUrl(part.idx)"></f-file-viewer> | ||
</mat-expansion-panel> | ||
</ng-container> | ||
</mat-accordion> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters