preview.page.html 5.33 KB
Newer Older
1 2
<ion-header>
    <ion-toolbar>
3 4
        <ion-buttons slot="start">
            <div class="home-logo">
5
                <a (click)="HelperService.goToHomePage(navCtrl)">
6 7 8 9 10 11 12 13 14 15 16 17
                    <img src="assets/imgs/logo.png" width="32px" height="32px" alt="CALLIDUS Logo">
                </a>
            </div>
            <div>
                <ion-spinner *ngIf="HelperService.isLoading"></ion-spinner>
                <ion-title>{{ 'PREVIEW' | translate }}
                </ion-title>
            </div>
        </ion-buttons>
        <ion-buttons slot="end">
            <ion-menu-button autoHide="false"></ion-menu-button>
        </ion-buttons>
18 19 20 21 22
    </ion-toolbar>
</ion-header>


<ion-content padding>
23
    <div *ngIf="corpusService.annisResponse?.solutions; else loading">
24
        <ion-grid *ngIf="HelperService.config | async as config">
25 26
            <ion-row *ngIf="HelperService.isVocabularyCheck">
                <ion-col>
27
                    <label>
28
                        <input type="checkbox" [(ngModel)]="exerciseService.excludeOOV" (ngModelChange)="switchOOV()"/>
29
                        <span class="checkbox">{{ "EXERCISE_NO_OOV" | translate}}</span>
30 31 32 33 34 35 36
                    </label>
                    <br>
                </ion-col>
            </ion-row>
            <ion-row>
                <ion-col>
                    <!-- TODO: enable solution shuffling for H5P ? -->
37
                    <div class="h5p-container"></div>
38 39 40 41 42
                </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). -->
43 44 45 46
                <ion-col>
                    <a href="{{urlBase + FileType[FileType.docx] + solutionIndicesString}}" download>
                        {{ 'FILE_TYPE_DOCX' | translate }}</a>
                </ion-col>
47
                <ion-col>
48
                    <a href="{{urlBase + FileType[FileType.pdf] + solutionIndicesString}}"
49
                       download>{{ 'FILE_TYPE_PDF' | translate }}</a>
50
                </ion-col>
51 52
                <!--                TODO: ADD MOODLE SUPPORT FOR MARK WORDS EXERCISES -->
                <ion-col *ngIf="corpusService.exercise.type !== ExerciseType.markWords">
53 54 55 56
                    <a href="{{urlBase + FileType[FileType.xml] + solutionIndicesString}}" download>{{ 'FILE_TYPE_XML' |
                        translate }}</a>
                </ion-col>
                <ion-col>
57
                    <a href="{{config['developerMailTo']}}">{{ 'EMAIL_ERROR' | translate }}</a>
58 59 60 61
                </ion-col>
            </ion-row>
            <br>
            <ion-row>
62 63
                <ion-col>
                    <ion-button (click)="navCtrl.pop()">{{ 'BACK' | translate }}
64
                    </ion-button>
65
                </ion-col>
66
                <ion-col>
67 68 69 70 71 72
                    <ion-button (click)="HelperService.goToTextRangePage(navCtrl)">
                        {{ "CHANGE_TEXT_RANGE" | translate}}
                    </ion-button>
                </ion-col>
                <ion-col style="text-align: left;">
                    <ion-button (click)="showShareLink = !showShareLink">
73 74
                        <ion-icon slot="start" name="share"></ion-icon>
                        {{ "SHARE" | translate}}
75
                    </ion-button>
76
                </ion-col>
77 78 79 80
                <ion-col *ngIf="showShareLink">
                    <div>
                        <label>
                            <input type="text" (focus)="selectLink()"
81
                                   value="{{HelperService.baseUrl + '/' + config['frontendExercisePage'] + '?eid=' + this.corpusService.annisResponse.exercise_id}}"/>
82 83 84 85 86 87 88
                        </label>
                    </div>
                    <div>
                        <button class="button-icon-only" (click)="copyLink()">
                            <ion-icon name="copy"></ion-icon>
                        </button>
                    </div>
89
                </ion-col>
90
            </ion-row>
91
            <ion-row *ngIf="corpusService.exercise.type !== ExerciseType.markWords">
92
                <ion-col style="text-align: left;">
93 94 95
                    <h4 (click)="showInstructions = !showInstructions" class="pointer">
                        <button *ngIf="showInstructions; else dropright">
                            <ion-icon name="arrow-dropdown"></ion-icon>
96
                        </button>
97 98 99 100 101
                        <ng-template #dropright>
                            <button>
                                <ion-icon name="arrow-dropright"></ion-icon>
                            </button>
                        </ng-template>
102
                        <span> {{ 'EXERCISE_DOWNLOAD_NEXT_STEPS' | translate }}</span>
103
                    </h4>
104 105 106 107 108 109 110 111 112 113 114 115 116
                    <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>
117
</ion-content>