Commit 71c4de41 authored by Konstantin Schulz's avatar Konstantin Schulz

exercise repository should not interfere with your own exercise texts

parent d0ce822c
{ {
"name": "mc_frontend", "name": "mc_frontend",
"version": "1.4.5", "version": "1.4.8",
"author": "Ionic Framework", "author": "Ionic Framework",
"homepage": "https://ionicframework.com/", "homepage": "https://ionicframework.com/",
"scripts": { "scripts": {
......
...@@ -107,21 +107,21 @@ ...@@ -107,21 +107,21 @@
</ion-row> </ion-row>
<ion-row> <ion-row>
</ion-row> </ion-row>
<ion-row *ngIf="exercises; else loading" style="padding: 1em 0 0 0"> <ion-row *ngIf="exercises; else loading">
<ion-grid style="padding: 0"> <ion-grid style="padding: 0">
<ion-row *ngFor="let exercise of exercises" (click)="showExercise(exercise)" class="exercises"> <ion-row *ngFor="let exercise of exercises" (click)="showExercise(exercise)" class="exercises">
<ion-grid style="padding: 0"> <ion-grid style="padding: 0">
<ion-row style="text-align: left"> <ion-row style="text-align: left">
<ion-col> <ion-col size="4">
{{exercise.exercise_type_translation}} {{exercise.exercise_type_translation}}
</ion-col> </ion-col>
<ion-col> <ion-col size="4">
{{ getDateString(exercise.last_access_time) }} {{ getDateString(exercise.last_access_time) }}
</ion-col> </ion-col>
<ion-col> <ion-col size="2">
{{Math.round(exercise.text_complexity)}} {{Math.round(exercise.text_complexity)}}
</ion-col> </ion-col>
<ion-col> <ion-col size="2">
{{getMatchingDegree(exercise)}} {{getMatchingDegree(exercise)}}
</ion-col> </ion-col>
</ion-row> </ion-row>
......
...@@ -116,8 +116,8 @@ export class ExerciseListPage implements OnInit { ...@@ -116,8 +116,8 @@ export class ExerciseListPage implements OnInit {
const url: string = HelperService.config['backendBaseUrl'] + HelperService.config['backendApiExercisePath']; const url: string = HelperService.config['backendBaseUrl'] + HelperService.config['backendApiExercisePath'];
const params: HttpParams = new HttpParams().set('eid', exercise.eid); const params: HttpParams = new HttpParams().set('eid', exercise.eid);
HelperService.makeGetRequest(this.http, this.toastCtrl, url, params).then((ar: AnnisResponse) => { HelperService.makeGetRequest(this.http, this.toastCtrl, url, params).then((ar: AnnisResponse) => {
HelperService.mostRecentSetup.annisResponse = ar; // save this exercise only locally in the CorpusService (not as MostRecentSetup in the HelperService) because
this.helperService.saveMostRecentSetup().then(); // users just want to have a quick look at it
this.corpusService.annisResponse = ar; this.corpusService.annisResponse = ar;
const met: MoodleExerciseType = MoodleExerciseType[exercise.exercise_type]; const met: MoodleExerciseType = MoodleExerciseType[exercise.exercise_type];
this.corpusService.exercise.type = ExerciseType[met.toString()]; this.corpusService.exercise.type = ExerciseType[met.toString()];
......
/* tslint:disable:no-string-literal */ /* tslint:disable:no-string-literal */
import {Component} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {NavController, ToastController} from '@ionic/angular'; import {NavController, ToastController} from '@ionic/angular';
import {CorpusService} from 'src/app/corpus.service'; import {CorpusService} from 'src/app/corpus.service';
import {VocabularyService} from 'src/app/vocabulary.service'; import {VocabularyService} from 'src/app/vocabulary.service';
import {ExerciseService} from 'src/app/exercise.service'; import {ExerciseService} from 'src/app/exercise.service';
import {HelperService} from 'src/app/helper.service'; import {HelperService} from 'src/app/helper.service';
import {TranslateService} from '@ngx-translate/core'; import {TranslateService} from '@ngx-translate/core';
import {FileType} from '../models/enum'; import {FileType, VocabularyCorpus} from '../models/enum';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
@Component({ @Component({
...@@ -14,7 +14,7 @@ import {HttpClient} from '@angular/common/http'; ...@@ -14,7 +14,7 @@ import {HttpClient} from '@angular/common/http';
templateUrl: './show-text.page.html', templateUrl: './show-text.page.html',
styleUrls: ['./show-text.page.scss'], styleUrls: ['./show-text.page.scss'],
}) })
export class ShowTextPage { export class ShowTextPage implements OnInit {
FileType = FileType; FileType = FileType;
HelperService = HelperService; HelperService = HelperService;
ObjectKeys = Object.keys; ObjectKeys = Object.keys;
...@@ -93,4 +93,8 @@ export class ShowTextPage { ...@@ -93,4 +93,8 @@ export class ShowTextPage {
} }
return ''; return '';
} }
ngOnInit(): void {
this.vocService.currentReferenceVocabulary = this.vocService.currentReferenceVocabulary || VocabularyCorpus.bws;
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment