preview.page.html 5.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<ion-header>
    <ion-toolbar>
        <div class="toolbar-left">
            <ion-back-button icon="arrow-round-back" defaultHref="home"></ion-back-button>
            <ion-title>{{ 'PREVIEW' | 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>
18
    <div *ngIf="corpusService.annisResponse?.solutions; else loading">
19
        <ion-grid>
20 21
            <ion-row>
                <ion-col>
22 23 24
                    <ion-button (click)="HelperService.goToTextRangePage(navCtrl)">
                        {{ "CHANGE_TEXT_RANGE" | translate}}
                    </ion-button>
25 26
                </ion-col>
            </ion-row>
27 28
            <ion-row>
                <ion-col>
29
                    <button class="button-icon-only" (click)="showShareLink = !showShareLink">
30
                        <ion-icon slot="start" name="share"></ion-icon>
31
                        <span style="vertical-align: super">{{ "SHARE" | translate}}</span>
32 33 34
                    </button>
                </ion-col>
            </ion-row>
35
            <ion-row *ngIf="showShareLink">
36
                <ion-col>
37 38 39 40 41 42 43 44
                    <div>
                        <label>
                            <input type="text" (focus)="selectLink()"
                                   value="{{HelperService.baseUrl + '/' + HelperService.config['frontendExercisePage'] + '?eid=' + this.corpusService.annisResponse.exercise_id}}"/>
                        </label>
                    </div>
                    <div>
                        <button class="button-icon-only" (click)="copyLink()">
45 46
                            <ion-icon name="copy"></ion-icon>
                        </button>
47
                    </div>
48 49
                </ion-col>
            </ion-row>
50 51
            <ion-row *ngIf="HelperService.isVocabularyCheck">
                <ion-col>
52
                    <label>
53
                        <input type="checkbox" [(ngModel)]="exerciseService.excludeOOV" (ngModelChange)="switchOOV()"/>
54
                        <span class="checkbox">{{ "EXERCISE_NO_OOV" | translate}}</span>
55 56 57 58 59 60 61
                    </label>
                    <br>
                </ion-col>
            </ion-row>
            <ion-row>
                <ion-col>
                    <!-- TODO: enable solution shuffling for H5P ? -->
62
                    <div class="h5p-container"></div>
63 64 65 66 67 68
                </ion-col>
            </ion-row>
            <ion-row>
                <!-- This is preferable compared to a button click event, because the browser knows from the
beginning that it is going to be a download (instead of an ordinary link or click). -->
                <ion-col>
69 70
                    <a href="{{urlBase + FileType[FileType.pdf] + solutionIndicesString}}"
                       download>{{ 'FILE_TYPE_PDF' | translate }}</a>
71
                </ion-col>
72 73
                <!--                TODO: ADD MOODLE SUPPORT FOR MARK WORDS EXERCISES -->
                <ion-col *ngIf="corpusService.exercise.type !== ExerciseType.markWords">
74 75 76 77 78 79 80
                    <a href="{{urlBase + FileType[FileType.xml] + solutionIndicesString}}" download>{{ 'FILE_TYPE_XML' |
                        translate }}</a>
                </ion-col>
                <ion-col>
                    <a href="{{urlBase + FileType[FileType.docx] + solutionIndicesString}}" download>{{ 'FILE_TYPE_DOCX'
                        | translate }}</a>
                </ion-col>
81
                <ion-col>
82
                    <a href="{{HelperService.config['developerMailTo']}}">{{ 'EMAIL_ERROR' | translate }}</a>
83
                </ion-col>
84
            </ion-row>
85
            <ion-row *ngIf="corpusService.exercise.type !== ExerciseType.markWords">
86
                <ion-col>
87 88 89
                    <h4 (click)="showInstructions = !showInstructions" class="pointer">
                        <button *ngIf="showInstructions; else dropright">
                            <ion-icon name="arrow-dropdown"></ion-icon>
90
                        </button>
91 92 93 94 95 96 97
                        <ng-template #dropright>
                            <button>
                                <ion-icon name="arrow-dropright"></ion-icon>
                            </button>
                        </ng-template>
                        <span>{{ 'EXERCISE_DOWNLOAD_NEXT_STEPS' | translate }}</span>
                    </h4>
98 99 100 101 102 103 104 105 106 107 108 109 110 111
                    <ol *ngIf="showInstructions">
                        <li>{{ 'INSTRUCTION_LOGIN_MOODLE' | translate }}</li>
                        <li>{{ 'INSTRUCTION_COGWHEEL_MORE' | translate }}</li>
                        <li>{{ 'INSTRUCTION_GO_TO_QUESTION_BANK' | translate }}</li>
                        <li>{{ 'INSTRUCTION_CHOOSE_FORMAT_AND_IMPORT' | translate }}</li>
                    </ol>
                </ion-col>
            </ion-row>
        </ion-grid>
    </div>
    <ng-template #loading>
        <ion-spinner></ion-spinner>
    </ng-template>
</ion-content>