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

exercise repository should not interfere with your own exercise texts

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