Skip to content

Commit

Permalink
Merge pull request #489 from correctexam/471-suggestions-for-the-stud…
Browse files Browse the repository at this point in the history
…ent-view

471 suggestions for the student view
  • Loading branch information
barais authored Feb 19, 2024
2 parents 1335bc5 + 2cc79d4 commit e589e36
Show file tree
Hide file tree
Showing 4 changed files with 392 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3 jhiTranslate="scanexam.confirmation"></h3>
</ng-template>
</p-confirmDialog>
<ng-keyboard-shortcuts [shortcuts]="shortcuts"></ng-keyboard-shortcuts>
<ng-container *ngIf="testdisableAndEnableKeyBoardShortCut">
<ng-container *ngIf="testdisableAndEnableKeyBoardShortCutSignal">
<jhi-keyboardshortcut
(toggleTCommentById)="toggleTCommentById($event)"
(toggleGCommentById)="toggleGCommentById($event)"
Expand Down Expand Up @@ -643,7 +643,12 @@ <h3 jhiTranslate="scanexam.layoutoptions">Layout options</h3>
</span>

<div *ngIf="!minimizeComment">
<p-inplace #texttitle [active]="active.get(comment.id!)" [closable]="true" (onDeactivate)="closeEditComment(comment)">
<p-inplace
#texttitle
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
[closable]="true"
(onDeactivate)="closeEditComment(comment)"
>
<ng-template pTemplate="display">
<h5 class="card-title">{{ comment.text }}</h5>
</ng-template>
Expand All @@ -661,7 +666,7 @@ <h5 class="card-title">{{ comment.text }}</h5>
</p-inplace>
<p-inplace
#textdescription
[active]="active.get(comment.id!)"
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
[closable]="true"
(onDeactivate)="closeEditComment(comment)"
>
Expand All @@ -685,14 +690,14 @@ <h5 class="card-title">{{ comment.text }}</h5>
<a
*ngIf="!checked(comment)"
class="p-button p-button-primary"
(click)="ajouterTComment(comment)"
(click)="toggleTComment(comment)"
jhiTranslate="scanexam.add"
>Ajouter</a
>
<a
*ngIf="checked(comment)"
class="p-button p-button-primary"
(click)="retirerTComment(comment)"
(click)="toggleTComment(comment)"
jhiTranslate="scanexam.remove"
>Retirer</a
>
Expand Down Expand Up @@ -794,7 +799,12 @@ <h5 class="card-title">{{ comment.text }}</h5>
</div>

<div *ngIf="currentQuestion?.typeAlgoName !== 'QCM'">
<p-inplace #gradedtitle [closable]="true" [active]="active.get(comment.id!)" (onDeactivate)="closeEditComment(comment)">
<p-inplace
#gradedtitle
[closable]="true"
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
(onDeactivate)="closeEditComment(comment)"
>
<ng-template pTemplate="display">
<h5 class="card-title">{{ comment.text }}</h5>
</ng-template>
Expand All @@ -813,7 +823,7 @@ <h5 class="card-title">{{ comment.text }}</h5>
<p-inplace
#gradeddescription
[closable]="true"
[active]="active.get(comment.id!)"
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
(onDeactivate)="closeEditComment(comment)"
>
<ng-template pTemplate="display">
Expand All @@ -833,7 +843,11 @@ <h5 class="card-title">{{ comment.text }}</h5>
/>
</ng-template>
</p-inplace>
<p-inplace [closable]="true" [active]="active.get(comment.id!)" (onDeactivate)="closeEditComment(comment)">
<p-inplace
[closable]="true"
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
(onDeactivate)="closeEditComment(comment)"
>
<ng-template pTemplate="display">
<p class="card-text" *ngIf="currentQuestion && currentQuestion?.gradeType !== 'DIRECT'">
<span jhiTranslate="scanexam.noteassociecomment"> Note associée à ce commentaire : </span>
Expand All @@ -857,14 +871,14 @@ <h5 class="card-title">{{ comment.text }}</h5>
<a
*ngIf="!checked(comment)"
class="p-button p-button-primary"
(click)="ajouterGComment(comment)"
(click)="toggleGComment(comment)"
jhiTranslate="scanexam.add"
>Ajouter</a
>
<a
*ngIf="checked(comment)"
class="p-button p-button-primary"
(click)="retirerGComment(comment)"
(click)="toggleGComment(comment)"
jhiTranslate="scanexam.remove"
>Retirer</a
>
Expand All @@ -880,7 +894,7 @@ <h5 class="card-title">{{ comment.text }}</h5>
{{ comment.text }}<span style="font-size: x-small"> ({{ comment.shortcut }}) </span>
</p>
</div>
<div *ngIf="currentQuestion?.typeAlgoName! !== 'QCM'" (click)="toggleGComment(comment)">
<div *ngIf="currentQuestion?.typeAlgoName! !== 'QCM'">
<p
[tooltipZIndex]="'3000'"
[escape]="false"
Expand Down Expand Up @@ -972,7 +986,12 @@ <h5 class="card-title">{{ comment.text }}</h5>
</span>
<div *ngIf="!minimizeComment">
<div>
<p-inplace #hybridtitle [closable]="true" [active]="active.get(comment.id!)" (onDeactivate)="closeEditComment(comment)">
<p-inplace
#hybridtitle
[closable]="true"
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
(onDeactivate)="closeEditComment(comment)"
>
<ng-template pTemplate="display">
<h5 class="card-title">{{ comment.text }}</h5>
</ng-template>
Expand All @@ -991,7 +1010,7 @@ <h5 class="card-title">{{ comment.text }}</h5>
<p-inplace
#hybriddescription
[closable]="true"
[active]="active.get(comment.id!)"
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
(onDeactivate)="closeEditComment(comment)"
>
<ng-template pTemplate="display">
Expand All @@ -1010,7 +1029,11 @@ <h5 class="card-title">{{ comment.text }}</h5>
</ng-template>
</p-inplace>

<p-inplace [closable]="true" [active]="active.get(comment.id!)" (onDeactivate)="closeEditComment(comment)">
<p-inplace
[closable]="true"
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
(onDeactivate)="closeEditComment(comment)"
>
<ng-template pTemplate="display">
<span *ngIf="comment.grade !== null && comment.grade !== undefined && comment.grade > 0"> + </span>
{{ comment.grade }} <span *ngIf="!comment.relative"> pt</span> <span *ngIf="comment.relative"> %</span>
Expand Down Expand Up @@ -1058,7 +1081,11 @@ <h5 class="card-title">{{ comment.text }}</h5>
</ng-template>
</p-inplace>

<p-inplace [closable]="true" [active]="active.get(comment.id!)" (onDeactivate)="closeEditComment(comment)">
<p-inplace
[closable]="true"
[active]="active.has(comment.id!) && active.get(comment.id!)!()"
(onDeactivate)="closeEditComment(comment)"
>
<ng-template pTemplate="display">
<span jhiTranslate="scanexam.hybridcommentStep"> Nombre de pas:</span>
{{ comment.step }}
Expand Down Expand Up @@ -1139,7 +1166,8 @@ <h5 class="card-title">{{ comment.text }}</h5>
*ngIf="
(!minimizeComment ||
((currentGradedComment4Question === undefined || currentGradedComment4Question?.length === 0) &&
(currentTextComment4Question === undefined || currentTextComment4Question?.length === 0))) &&
(currentTextComment4Question === undefined || currentTextComment4Question?.length === 0) &&
(currentHybridGradedComment4Question === undefined || currentHybridGradedComment4Question?.length === 0))) &&
currentQuestion &&
currentQuestion?.typeAlgoName !== 'QCM'
"
Expand Down
Loading

0 comments on commit e589e36

Please sign in to comment.