exercise-parameters.page.html 7.61 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!--
  Generated template for the ExerciseParametersPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>
    <ion-toolbar>
        <div class="toolbar-left">
            <ion-back-button icon="arrow-round-back" defaultHref="home"></ion-back-button>
            <ion-title>{{ 'EXERCISE_PARAMETERS' | translate }}</ion-title>
        </div>
        <div class="toolbar-right">
            <ion-spinner *ngIf="HelperService.isLoading"></ion-spinner>
            <button (click)="HelperService.goToHomePage(navCtrl)">
                <ion-icon name="home"></ion-icon>
            </button>
        </div>
    </ion-toolbar>
</ion-header>


<ion-content padding>
    <ion-grid>
        <ion-row>
            <ion-col>
Konstantin Schulz's avatar
Konstantin Schulz committed
27
                <!-- don't use ion-select because the font-size for ion-option cannot be changed -->
28
                <label>
Konstantin Schulz's avatar
Konstantin Schulz committed
29
                    <span class="label">{{ 'EXERCISE_TYPE' | translate }}</span>
30
                    <select [(ngModel)]="corpusService.exercise.type" name="exerciseType"
Konstantin Schulz's avatar
Konstantin Schulz committed
31
                            (change)="corpusService.adjustTranslations()">
32
33
34
35
36
37
38
                        <option *ngFor="let key of ObjectKeys(ExerciseType)" [value]=ExerciseType[key]>
                            {{ ExerciseTypeTranslation[key] | translate }}
                        </option>
                    </select>
                </label>
            </ion-col>
        </ion-row>
39
        <ion-row *ngFor="let query of corpusService.exercise.queryItems; let i = index">
40
            <ion-col>
41
42
                <ion-grid [class.matching]="corpusService.exercise.type === ExerciseType.matching">
                    <ion-row *ngIf="corpusService.exercise.type === ExerciseType.matching">
43
44
45
46
47
48
49
50
                        <ion-col><h2>{{ (i === 0 ? 'HEAD_WORD' : 'DEPENDENT_WORD') | translate }}</h2>
                        </ion-col>
                    </ion-row>
                    <ion-row>
                        <ion-col>
                            <label>
                                <span class="label">{{ 'QUERY_PHENOMENON' | translate }}</span>
                                <select [(ngModel)]="query.phenomenon" name="queryPhenomenon"
51
                                        (change)="corpusService.adjustQueryValue(query, i)">
52
53
54
55
56
57
58
59
60
                                    <option *ngFor="let phenomenon of ObjectKeys(Phenomenon)" [value]=phenomenon>
                                        {{ PhenomenonTranslation[phenomenon] | translate }}
                                    </option>
                                </select>
                            </label>
                        </ion-col>
                    </ion-row>
                    <ion-row>
                        <ion-col>
Konstantin Schulz's avatar
Konstantin Schulz committed
61
62
63
64
65
                            <ng-container
                                    *ngIf="[ExerciseType.cloze, ExerciseType.markWords].indexOf(corpusService.exercise.type) > -1; else matching">
                                <label>
                                    <span class="label">{{ 'QUERY_VALUE' | translate }}</span>
                                    <select [(ngModel)]="query.values" name="queryValue" multiple>
66
67
                                        <option *ngFor="let key of corpusService.getSortedQueryValues(query, i)"
                                                [value]=key>{{ getDisplayValue(query, key, i) }}
Konstantin Schulz's avatar
Konstantin Schulz committed
68
69
70
71
                                        </option>
                                    </select>
                                </label>
                            </ng-container>
72
73
74
75
76
                            <ng-template #matching>
                                <label>
                                <span class="label">
                                    {{ 'QUERY_VALUE' | translate }}
                                </span>
77
78
79
80
                                    <select [(ngModel)]="query.values[0]" name="queryValue"
                                            (change)="corpusService.updateBaseWord(query, i)">
                                        <option *ngFor="let key of corpusService.getSortedQueryValues(query, i)"
                                                [value]=key>{{ getDisplayValue(query, key, i) }}
81
82
83
84
85
86
87
88
89
90
                                        </option>
                                    </select>
                                </label>
                            </ng-template>
                        </ion-col>
                    </ion-row>
                </ion-grid>
            </ion-col>
        </ion-row>
        <ion-row
91
                *ngIf="corpusService.exercise.type === ExerciseType.kwic; else notKWIC"></ion-row>
92
93
94
95
96
        <ng-template #notKWIC>
            <ion-row>
                <ion-col>
                    <label>
                        <span class="label">{{ 'INSTRUCTIONS' | translate }}</span>
97
                        <input [(ngModel)]="corpusService.exercise.instructionsTranslation" type="text"
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
                               name="instructionsTranslation"/>
                    </label>
                </ion-col>
            </ion-row>
            <ion-row>
                <ion-col>
                    <button *ngIf="showFeedback; else dropright" (click)="showFeedback = !showFeedback">
                        <ion-icon name="arrow-dropdown"></ion-icon>
                    </button>
                    <ng-template #dropright>
                        <button (click)="showFeedback = !showFeedback">
                            <ion-icon name="arrow-dropright"></ion-icon>
                        </button>
                    </ng-template>
                    <h2>{{ 'EXERCISE_FEEDBACK' | translate }}</h2>
                </ion-col>
            </ion-row>
            <div *ngIf="showFeedback">
                <ion-row>
                    <ion-col>
                        <label>
                            <span>{{ 'EXERCISE_FEEDBACK_GENERAL' | translate }}</span>
120
                            <input type="text" [(ngModel)]="corpusService.exercise.feedback.general"
121
122
123
124
125
126
127
128
                                   name="feedbackGeneral"/>
                        </label>
                    </ion-col>
                </ion-row>
                <ion-row>
                    <ion-col>
                        <label>
                            <span>{{ 'EXERCISE_FEEDBACK_CORRECT' | translate }}</span>
129
                            <input type="text" [(ngModel)]="corpusService.exercise.feedback.correct"
130
131
132
133
134
135
136
137
                                   name="feedbackCorrect"/>
                        </label>
                    </ion-col>
                </ion-row>
                <ion-row>
                    <ion-col>
                        <label>
                            <span>{{ 'EXERCISE_FEEDBACK_PARTIALLY_CORRECT' | translate }}</span>
138
                            <input type="text" [(ngModel)]="corpusService.exercise.feedback.partiallyCorrect"
139
140
141
142
143
144
145
146
                                   name="feedbackPartiallyCorrect"/>
                        </label>
                    </ion-col>
                </ion-row>
                <ion-row>
                    <ion-col>
                        <label>
                            <span>{{ 'EXERCISE_FEEDBACK_INCORRECT' | translate }}</span>
147
                            <input type="text" [(ngModel)]="corpusService.exercise.feedback.incorrect"
148
149
150
151
152
153
154
155
156
157
158
159
160
                                   name="feedbackIncorrect"/>
                        </label>
                    </ion-col>
                </ion-row>
            </div>
        </ng-template>
        <ion-row>
            <ion-col>
                <ion-button (click)="generateExercise().then()">{{ 'PREVIEW' | translate }}</ion-button>
            </ion-col>
        </ion-row>
    </ion-grid>
</ion-content>