forked from doubtfire-lms/doubtfire-web
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use modal for Numbas and enable authentication
- Loading branch information
Showing
11 changed files
with
83 additions
and
182 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 4 additions & 3 deletions
7
src/app/common/numbas-component/numbas-component.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,3 +1,4 @@ | ||
<button class="btn btn-default" (click)="launchNumbasTest()"> | ||
<i class="fa fa-check-square-o"></i> Launch Numbas Test | ||
</button> | ||
<div mat-dialog-content> | ||
<iframe [src]="iframeSrc"></iframe> | ||
<button mat-dialog-close mat-stroked-button color="warn" (click)="removeNumbasTest()">Exit</button> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.mat-dialog-content { | ||
position: relative; | ||
} | ||
|
||
iframe { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 95%; | ||
} | ||
|
||
button { | ||
position: absolute; | ||
bottom: 20px; | ||
right: 20px; | ||
} |
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,20 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { MatDialog, MatDialogRef } from '@angular/material/dialog'; | ||
import { NumbasComponent } from './numbas-component.component'; | ||
import { Task } from 'src/app/api/models/task'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class NumbasModal { | ||
constructor(public dialog: MatDialog) { } | ||
|
||
public show(task: Task, mode: 'attempt' | 'review'): void { | ||
let dialogRef: MatDialogRef<NumbasComponent, any>; | ||
|
||
dialogRef = this.dialog.open(NumbasComponent, { | ||
data: { task, mode }, | ||
width: '95%', height: '90%' | ||
}); | ||
} | ||
} |
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
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