preview.page.html 5.37 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
                    <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">
16
            <ion-menu-button autoHide="false">
17
                <ion-icon name="menu"></ion-icon>
18
            </ion-menu-button>
19
        </ion-buttons>
20 21 22 23
    </ion-toolbar>
</ion-header>


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