Skip to content

Commit

Permalink
[Math-Checker] Add submission content view for lectures and students (#…
Browse files Browse the repository at this point in the history
…1548)

* feat(math-checker): add submission content view for lectures and students

* chore(mathe-checker): fix style
  • Loading branch information
Zitrone44 authored Jan 2, 2024
1 parent 721ad84 commit 9067095
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ <h3>{{ "result.comparison.resultsOfSubmissions" | i18nextEager }}</h3>
<mat-icon>content_copy</mat-icon>
</button>
</div>
<div *ngIf="!isText">
<div *ngIf="mathResult">
<div *ngFor="let resultField of mathResult; index as i">
<app-math-input
*ngIf="resultField[0] !== 'complete'"
[label]="resultField[0]"
[defaultValue]="{
latex: resultField[1] || '\\text{Keine Abgabe!}'
}"
[disabled]="true"
></app-math-input>
</div>
</div>
<div *ngIf="!isText && !mathResult">
<button
mat-flat-button
color="accent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class ResultsComponent implements OnInit {

submission: Submission;

mathResult: Array<[string, string]> | null;

handleSubmission(event): void {
this.submission = this.allSubmissions.find(
(item) => this.allSubmissions.indexOf(item) == event.index
Expand Down Expand Up @@ -98,9 +100,15 @@ export class ResultsComponent implements OnInit {
this.resultColumns = [];
this.expectedDataSource = [];
this.expectedColumns = [];
this.mathResult = null;

submission.results.forEach((res) => {
const extInfo: any = res.extInfo;

if (res.checkerType === "spreadsheet") {
this.mathResult = Object.entries(extInfo);
}

if (extInfo && extInfo.type === "compareTable") {
this.resultColumns.push(extInfo.result.head);
const resultSource = new MatTableDataSource<any>();
Expand Down

0 comments on commit 9067095

Please sign in to comment.