<h1 mat-dialog-title>{{'discussion_title' | translate}}</h1>
<mat-dialog-content>
    <div class="form-intitule">
        <label for="intitule">{{'discussion_name_label' | translate}}</label>
        <input name="intitule" type="text" [(ngModel)]="discussion.name"/>
    </div>
    <div class="form-firstDiscussion"
    [matTooltip]="translate.instant('discussion_firstDiscussion_tooltip')"
    matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips || isSelectableAsFirstDiscussion()">
        <input name="firstDiscussion" type="checkbox" [(ngModel)]="discussion.isFirstDiscussion"
            [disabled]="!isSelectableAsFirstDiscussion()"/>
        <label for="firstDiscussion">{{'discussion_firstDiscussion_label' | translate}}</label>
    </div>
    <div class="form-result">
        <label for="result">{{'discussion_result_label' | translate}}</label>
        <!--
        <select name="result">
            <option [ngValue]="" disabled selected>{{'discussion_result_placeholder' | translate}}</option>
        </select>
        -->
        <div class="form-result-results">

            <div class="form-result-results-result" *ngFor="let reward of discussion.rewards, let rewardIndex = index">
                <div class="form-result-results-result-type">
                    <label>{{'role_reward_type_label' | translate}}</label>
                    <select [(ngModel)]="reward.type" (change)="discussion.changeRewardType(rewardIndex, reward.type)"
                    [matTooltip]="translate.instant('discussion_reward_type_discussion_tooltip')"
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                        <option value="quest">{{'role_reward_type_newQuest' | translate}}</option>
                        <option value="skill">{{'role_reward_type_skill' | translate}}</option>
                        <option value="character">{{'role_reward_type_character' | translate}}</option>
                        <option value="object">{{'role_reward_type_object' | translate}}</option>
                        <option value="discussion">{{'role_reward_type_discussion' | translate}}</option>
                    </select> 
                </div>

                <div class="form-result-results-result-quest" *ngIf="reward.type == 'quest'">
                    <select (change)="discussion.changeQuestReward(role.intitule, rewardIndex, $event)"
                    [matTooltip]="translate.instant('role_reward_type_newQuest_tooltip')"
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                    <option [ngValue]="null" selected disabled>{{'role_reward_quest_placeholder' | translate}}</option>
                        <ng-container *ngFor="let mission of scenario.missions; let indexMission = index">
                            <ng-container *ngFor="let quest of mission.roles; let indexRole = index">
                                <option [ngValue]="quest.questName" [selected]="discussion.getQuestReward(rewardIndex).intitule == quest.intitule && discussion.getQuestReward(rewardIndex).questName == quest.questName"
                                    *ngIf="role.intitule && quest.questName && role.intitule == quest.intitule && role.questName != quest.questName">
                                    {{quest.questName}}
                                </option>
                            </ng-container>
                        </ng-container>
                    </select>
                </div>
                
                <div class="form-result-results-result-skill" *ngIf="reward.type == 'skill'">
                    <input type="number" [(ngModel)]="discussion.getSkillReward(rewardIndex).quantity"/>
                    <select [(ngModel)]="discussion.getSkillReward(rewardIndex).skill"
                    [matTooltip]="translate.instant('role_reward_type_skill_tooltip')"
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                        <ng-container *ngFor="let skill of role.ressources">
                            <option [ngValue]="skill" *ngIf="skill.type == 'attribut'">{{skill.name}}</option>
                        </ng-container>
                    </select>
                </div>

                <div class="form-result-results-result-character" *ngIf="reward.type == 'character'">
                    <select [(ngModel)]="discussion.getCharacterReward(rewardIndex).character"
                    [matTooltip]="translate.instant('role_reward_type_character_tooltip')"
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                        <option [ngValue]="character" *ngFor="let character of scenario.characters">{{character.name}}</option>
                    </select>
                </div>

                <div class="form-result-results-result-discussion" *ngIf="reward.type == 'discussion'">
                    <select [(ngModel)]="discussion.getDiscussionReward(rewardIndex).discussionId"
                    [matTooltip]="translate.instant('role_reward_type_discussion_tooltip')"
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                        <option [ngValue]="-1" selected disabled>{{'role_reward_type_discussion_placeholder' | translate}}</option>
                        <ng-container *ngFor="let character of scenario.characters">
                            <optgroup [label]="character.name" *ngIf="role.characterHasDiscussion(character)">
                                <ng-container *ngFor="let discuss of role.discussions">
                                    <option [ngValue]="discuss.ID" *ngIf="discuss.character == character && discussion.ID != discuss.ID">{{discuss.name}}</option>
                                </ng-container>
                            </optgroup>                        
                        </ng-container>
                    </select>
                </div>

                <div class="form-result-results-result-object" *ngIf="reward.type == 'object'">
                    <input type="number" [(ngModel)]="discussion.getObjectReward(rewardIndex).quantity"/>
                    <select [(ngModel)]="discussion.getObjectReward(rewardIndex).object"
                    [matTooltip]="translate.instant('role_reward_type_object_tooltip')"
                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                        <ng-container *ngFor="let ressource of scenario.ressources">
                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                        </ng-container>
                        <ng-container *ngFor="let ressource of role.ressources">
                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                        </ng-container>
                    </select>
                </div>

                <button mat-button class="form-result-button-remove" (click)="discussion.removeReward(rewardIndex)"><mat-icon fontIcon="remove"></mat-icon></button>
            </div>

            <button mat-button class="form-result-button-add" (click)="discussion.addReward()"><mat-icon fontIcon="add"></mat-icon></button>
        </div>
        
    </div>
    <div class="form-addSentence">
        <button mat-button (click)="addDeclarativeSentence()">{{'discussion_buttons_newDeclarativeSentence' | translate}}</button>
        <button mat-button (click)="addInterrogativeSentence()">{{'discussion_buttons_newInterrogativeSentence' | translate}}</button>
    </div>

    <mat-accordion>
        <ng-container *ngFor="let sentence of role.sentences">
            <mat-expansion-panel *ngIf="sentence.idDiscussion == discussion.ID && isDeclarativeSentence(sentence)">
                <mat-expansion-panel-header>
                    <mat-panel-title>{{'discussion_declarativeSentence' | translate}} (ID: {{sentence.ID}})</mat-panel-title>
                    <mat-panel-description>
                        <p>{{sentence.value}}</p>
                        <mat-icon fontIcon="looks_one" *ngIf="sentence.ID == discussion.firstSentenceID"
                        [matTooltip]="translate.instant('discussion_firstSentence_label')"
                        matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
                    </mat-panel-description>
                </mat-expansion-panel-header>
                <div class="form-sentence">
                    <div class="form-sentence-sentence">
                        <label for="sentence">{{'discussion_declarativeSentence' | translate}}</label>
                        <textarea name="sentence" [(ngModel)]="sentence.value"></textarea>
                    </div>
                    <div class="form-sentence-firstSentence"
                    [matTooltip]="translate.instant('discussion_firstSentence_tooltip')"
                    matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips || discussion.firstSentenceID == -1 || discussion.firstSentenceID == sentence.ID">
                        <input name="firstSentence" type="checkbox" (click)="onCheckFirstSentence($event, sentence.ID)"
                            [checked]="discussion.firstSentenceID == sentence.ID ? true : false"
                            [disabled]="discussion.firstSentenceID != -1 && discussion.firstSentenceID != sentence.ID"/>
                        <label for="firstSentence">{{'discussion_firstSentence_label' | translate}}</label>
                    </div>
                    <div class="form-nextSentence">
                        <label for="nextSentence">{{'discussion_nextSentence_label' | translate}}</label>
                        <select name="nextSentence" [(ngModel)]="getSentenceAsDeclarativeSentence(sentence).nextSentence">
                            <option [ngValue]="-1" disabled selected>{{'discussion_nextSentence_placeholder' | translate}}</option>
                            <ng-container *ngFor="let nextSentence of role.sentences">
                                <option [ngValue]="nextSentence.ID" *ngIf="sentence.ID != nextSentence.ID && sentence.idDiscussion == nextSentence.idDiscussion">ID: {{nextSentence.ID}}</option>
                            </ng-container>
                        </select>
                    </div>
                    <div class="form-result">
                        <label for="result">{{'discussion_result_label' | translate}}</label>
                        <!--
                        <select name="result">
                            <option [ngValue]="" disabled selected>{{'discussion_result_placeholder' | translate}}</option>
                        </select>
                        -->
                        <div class="form-result-results">
                
                            <div class="form-result-results-result" *ngFor="let reward of sentence.rewards, let rewardIndex = index">
                                <div class="form-result-results-result-type">
                                    <label>{{'role_reward_type_label' | translate}}</label>
                                    <select [(ngModel)]="reward.type" (change)="sentence.changeRewardType(rewardIndex, reward.type)"
                                    [matTooltip]="translate.instant('discussion_reward_type_declarativeSentence_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <option value="quest">{{'role_reward_type_newQuest' | translate}}</option>
                                        <option value="skill">{{'role_reward_type_skill' | translate}}</option>
                                        <option value="character">{{'role_reward_type_character' | translate}}</option>
                                        <option value="object">{{'role_reward_type_object' | translate}}</option>
                                        <option value="discussion">{{'role_reward_type_discussion' | translate}}</option>
                                    </select> 
                                </div>
                
                                <div class="form-result-results-result-quest" *ngIf="reward.type == 'quest'">
                                    <select (change)="sentence.changeQuestReward(role.intitule, rewardIndex, $event)"
                                    [matTooltip]="translate.instant('role_reward_type_newQuest_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                    <option [ngValue]="null" selected disabled>{{'role_reward_quest_placeholder' | translate}}</option>
                                        <ng-container *ngFor="let mission of scenario.missions; let indexMission = index">
                                            <ng-container *ngFor="let quest of mission.roles; let indexRole = index">
                                                <option [ngValue]="quest.questName" [selected]="sentence.getQuestReward(rewardIndex).intitule == quest.intitule && sentence.getQuestReward(rewardIndex).questName == quest.questName"
                                                    *ngIf="role.intitule && quest.questName && role.intitule == quest.intitule && role.questName != quest.questName">
                                                    {{quest.questName}}
                                                </option>
                                            </ng-container>
                                        </ng-container>
                                    </select>
                                </div>
                                
                                <div class="form-result-results-result-skill" *ngIf="reward.type == 'skill'">
                                    <input type="number" [(ngModel)]="sentence.getSkillReward(rewardIndex).quantity"/>
                                    <select [(ngModel)]="sentence.getSkillReward(rewardIndex).skill"
                                    [matTooltip]="translate.instant('role_reward_type_skill_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <ng-container *ngFor="let skill of role.ressources">
                                            <option [ngValue]="skill" *ngIf="skill.type == 'attribut'">{{skill.name}}</option>
                                        </ng-container>
                                    </select>
                                </div>
                
                                <div class="form-result-results-result-character" *ngIf="reward.type == 'character'">
                                    <select [(ngModel)]="sentence.getCharacterReward(rewardIndex).character"
                                    [matTooltip]="translate.instant('role_reward_type_character_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <option [ngValue]="character" *ngFor="let character of scenario.characters">{{character.name}}</option>
                                    </select>
                                </div>

                                <div class="form-result-results-result-discussion" *ngIf="reward.type == 'discussion'">
                                    <select [(ngModel)]="sentence.getDiscussionReward(rewardIndex).discussionId"
                                    [matTooltip]="translate.instant('role_reward_type_discussion_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <option [ngValue]="-1" selected disabled>{{'role_reward_type_discussion_placeholder' | translate}}</option>
                                        <ng-container *ngFor="let character of scenario.characters">
                                            <optgroup [label]="character.name" *ngIf="role.characterHasDiscussion(character)">
                                                <ng-container *ngFor="let discuss of role.discussions">
                                                    <option [ngValue]="discuss.ID" *ngIf="discuss.character == character && discussion.ID != discuss.ID">{{discuss.name}}</option>
                                                </ng-container>
                                            </optgroup>                        
                                        </ng-container>
                                    </select>
                                </div>
                
                                <div class="form-result-results-result-object" *ngIf="reward.type == 'object'">
                                    <input type="number" [(ngModel)]="sentence.getObjectReward(rewardIndex).quantity"/>
                                    <select [(ngModel)]="sentence.getObjectReward(rewardIndex).object"
                                    [matTooltip]="translate.instant('role_reward_type_object_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <ng-container *ngFor="let ressource of scenario.ressources">
                                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                        </ng-container>
                                        <ng-container *ngFor="let ressource of role.ressources">
                                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                        </ng-container>
                                    </select>
                                </div>
                
                                <button mat-button class="form-result-button-remove" (click)="sentence.removeReward(rewardIndex)"><mat-icon fontIcon="remove"></mat-icon></button>
                            </div>
                
                            <button mat-button class="form-result-button-add" (click)="sentence.addReward()"><mat-icon fontIcon="add"></mat-icon></button>
                        </div>
                        
                    </div>
                    <button mat-button class="form-sentence-delete" (click)="deleteDeclarativeSentence(sentence.ID)">{{'discussion_buttons_deleteDeclarativeSentence' | translate}}</button>
                </div>
            </mat-expansion-panel>


            <mat-expansion-panel *ngIf="sentence.idDiscussion == discussion.ID && isInterrogativeSentence(sentence)">
                <mat-expansion-panel-header>
                    <mat-panel-title>{{'discussion_interrogativeSentence' | translate}} (ID: {{sentence.ID}})</mat-panel-title>
                    <mat-panel-description>
                        <p>{{sentence.value}}</p>
                        <mat-icon fontIcon="looks_one" *ngIf="sentence.ID == discussion.firstSentenceID"
                        [matTooltip]="translate.instant('discussion_firstSentence_label')"
                        matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips"></mat-icon>
                    </mat-panel-description>
                </mat-expansion-panel-header>
                <div class="form-sentence">
                    <div class="form-sentence-sentence">
                        <label for="sentence">{{'discussion_interrogativeSentence' | translate}}</label>
                        <textarea name="sentence" [(ngModel)]="sentence.value"></textarea>
                    </div>
                    <div class="form-sentence-firstSentence"
                    [matTooltip]="translate.instant('discussion_firstSentence_tooltip')"
                    matTooltipPosition="before" [matTooltipDisabled]="!tooltipService.activatedTooltips || discussion.firstSentenceID == -1 || discussion.firstSentenceID == sentence.ID">
                        <input name="firstSentence" type="checkbox" (click)="onCheckFirstSentence($event, sentence.ID)"
                            [checked]="discussion.firstSentenceID == sentence.ID ? true : false"
                            [disabled]="discussion.firstSentenceID != -1 && discussion.firstSentenceID != sentence.ID"/>
                        <label for="firstSentence">{{'discussion_firstSentence_label' | translate}}</label>
                    </div>
                    <div class="form-result">
                        <label for="result">{{'discussion_result_label' | translate}}</label>
                        <div class="form-result-results">
                            <div class="form-result-results-result" *ngFor="let reward of sentence.rewards, let rewardIndex = index">
                                <div class="form-result-results-result-type">
                                    <label>{{'role_reward_type_label' | translate}}</label>
                                    <select [(ngModel)]="reward.type" (change)="sentence.changeRewardType(rewardIndex, reward.type)"
                                    [matTooltip]="translate.instant('discussion_reward_type_interrogativeSentence_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <option value="quest">{{'role_reward_type_newQuest' | translate}}</option>
                                        <option value="skill">{{'role_reward_type_skill' | translate}}</option>
                                        <option value="character">{{'role_reward_type_character' | translate}}</option>
                                        <option value="object">{{'role_reward_type_object' | translate}}</option>
                                        <option value="discussion">{{'role_reward_type_discussion' | translate}}</option>
                                    </select> 
                                </div>
                
                                <div class="form-result-results-result-quest" *ngIf="reward.type == 'quest'">
                                    <select (change)="sentence.changeQuestReward(role.intitule, rewardIndex, $event)"
                                    [matTooltip]="translate.instant('role_reward_type_newQuest_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                    <option [ngValue]="null" selected disabled>{{'role_reward_quest_placeholder' | translate}}</option>
                                        <ng-container *ngFor="let mission of scenario.missions; let indexMission = index">
                                            <ng-container *ngFor="let quest of mission.roles; let indexRole = index">
                                                <option [ngValue]="quest.questName" [selected]="sentence.getQuestReward(rewardIndex).intitule == quest.intitule && sentence.getQuestReward(rewardIndex).questName == quest.questName"
                                                    *ngIf="role.intitule && quest.questName && role.intitule == quest.intitule && role.questName != quest.questName">
                                                    {{quest.questName}}
                                                </option>
                                            </ng-container>
                                        </ng-container>
                                    </select>
                                </div>
                                
                                <div class="form-result-results-result-skill" *ngIf="reward.type == 'skill'">
                                    <input type="number" [(ngModel)]="sentence.getSkillReward(rewardIndex).quantity"/>
                                    <select [(ngModel)]="sentence.getSkillReward(rewardIndex).skill"
                                    [matTooltip]="translate.instant('role_reward_type_skill_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <ng-container *ngFor="let skill of role.ressources">
                                            <option [ngValue]="skill" *ngIf="skill.type == 'attribut'">{{skill.name}}</option>
                                        </ng-container>
                                    </select>
                                </div>
                
                                <div class="form-result-results-result-character" *ngIf="reward.type == 'character'">
                                    <select [(ngModel)]="sentence.getCharacterReward(rewardIndex).character"
                                    [matTooltip]="translate.instant('role_reward_type_character_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <option [ngValue]="character" *ngFor="let character of scenario.characters">{{character.name}}</option>
                                    </select>
                                </div>

                                <div class="form-result-results-result-discussion" *ngIf="reward.type == 'discussion'">
                                    <select [(ngModel)]="sentence.getDiscussionReward(rewardIndex).discussionId"
                                    [matTooltip]="translate.instant('role_reward_type_discussion_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <option [ngValue]="-1" selected disabled>{{'role_reward_type_discussion_placeholder' | translate}}</option>
                                        <ng-container *ngFor="let character of scenario.characters">
                                            <optgroup [label]="character.name" *ngIf="role.characterHasDiscussion(character)">
                                                <ng-container *ngFor="let discuss of role.discussions">
                                                    <option [ngValue]="discuss.ID" *ngIf="discuss.character == character && discussion.ID != discuss.ID">{{discuss.name}}</option>
                                                </ng-container>
                                            </optgroup>                        
                                        </ng-container>
                                    </select>
                                </div>
                
                                <div class="form-result-results-result-object" *ngIf="reward.type == 'object'">
                                    <input type="number" [(ngModel)]="sentence.getObjectReward(rewardIndex).quantity"/>
                                    <select [(ngModel)]="sentence.getObjectReward(rewardIndex).object"
                                    [matTooltip]="translate.instant('role_reward_type_object_tooltip')"
                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                        <ng-container *ngFor="let ressource of scenario.ressources">
                                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                        </ng-container>
                                        <ng-container *ngFor="let ressource of role.ressources">
                                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                        </ng-container>
                                    </select>
                                </div>
                
                                <button mat-button class="form-result-button-remove" (click)="sentence.removeReward(rewardIndex)"><mat-icon fontIcon="remove"></mat-icon></button>
                            </div>
                
                            <button mat-button class="form-result-button-add" (click)="sentence.addReward()"><mat-icon fontIcon="add"></mat-icon></button>
                        </div>
                    </div>
                    <button mat-button class="form-sentence-addResponse" (click)="addResponse(getSentenceAsInterrogativeSentence(sentence))">{{'discussion_buttons_newResponse' | translate}}</button>


                    <mat-accordion>
                        <ng-container *ngFor="let response of role.responses">
                            <mat-expansion-panel *ngIf="response.idInterrogativeSentence == sentence.ID">
                                <mat-expansion-panel-header>
                                    <mat-panel-title>{{'discussion_response' | translate}} (ID: {{response.ID}})</mat-panel-title>
                                    <mat-panel-description>
                                        <p>{{response.value}}</p>
                                    </mat-panel-description>
                                </mat-expansion-panel-header>
                                <div class="form-sentence">
                                    <div class="form-sentence-sentence">
                                        <label for="sentence">{{'discussion_response' | translate}}</label>
                                        <textarea name="sentence" [(ngModel)]="response.value"></textarea>
                                    </div>
                                    <div class="form-nextSentence">
                                        <label for="nextSentence">{{'discussion_nextSentence_label' | translate}}</label>
                                        <select name="nextSentence" [(ngModel)]="response.nextSentence">
                                            <option [ngValue]="-1" disabled selected>{{'discussion_nextSentence_placeholder' | translate}}</option>
                                            <ng-container *ngFor="let nextSentence of role.sentences">
                                                <option [ngValue]="nextSentence.ID" *ngIf="sentence.ID != nextSentence.ID && sentence.idDiscussion == nextSentence.idDiscussion">ID: {{nextSentence.ID}}</option>
                                            </ng-container>
                                        </select>
                                    </div>
                                    <div class="form-result">
                                        <label for="result">{{'discussion_result_label' | translate}}</label>
                                        <div class="form-result-results">
                    
                                            <div class="form-result-results-result" *ngFor="let reward of response.rewards, let rewardIndex = index">
                                                <div class="form-result-results-result-type">
                                                    <label>{{'role_reward_type_label' | translate}}</label>
                                                    <select [(ngModel)]="reward.type" (change)="response.changeRewardType(rewardIndex, reward.type)"
                                                    [matTooltip]="translate.instant('discussion_reward_type_response_tooltip')"
                                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                                        <option value="quest">{{'role_reward_type_newQuest' | translate}}</option>
                                                        <option value="skill">{{'role_reward_type_skill' | translate}}</option>
                                                        <option value="character">{{'role_reward_type_character' | translate}}</option>
                                                        <option value="object">{{'role_reward_type_object' | translate}}</option>
                                                        <option value="discussion">{{'role_reward_type_discussion' | translate}}</option>
                                                    </select> 
                                                </div>
                                
                                                <div class="form-result-results-result-quest" *ngIf="reward.type == 'quest'">
                                                    <select (change)="response.changeQuestReward(role.intitule, rewardIndex, $event)"
                                                    [matTooltip]="translate.instant('role_reward_type_newQuest_tooltip')"
                                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                                    <option [ngValue]="null" selected disabled>{{'role_reward_quest_placeholder' | translate}}</option>
                                                        <ng-container *ngFor="let mission of scenario.missions; let indexMission = index">
                                                            <ng-container *ngFor="let quest of mission.roles; let indexRole = index">
                                                                <option [ngValue]="quest.questName" [selected]="response.getQuestReward(rewardIndex).intitule == quest.intitule && response.getQuestReward(rewardIndex).questName == quest.questName"
                                                                    *ngIf="role.intitule && quest.questName && role.intitule == quest.intitule && role.questName != quest.questName">
                                                                    {{quest.questName}}
                                                                </option>
                                                            </ng-container>
                                                        </ng-container>
                                                    </select>
                                                </div>
                                                
                                                <div class="form-result-results-result-skill" *ngIf="reward.type == 'skill'">
                                                    <input type="number" [(ngModel)]="response.getSkillReward(rewardIndex).quantity"/>
                                                    <select [(ngModel)]="response.getSkillReward(rewardIndex).skill"
                                                    [matTooltip]="translate.instant('role_reward_type_skill_tooltip')"
                                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                                        <ng-container *ngFor="let skill of role.ressources">
                                                            <option [ngValue]="skill" *ngIf="skill.type == 'attribut'">{{skill.name}}</option>
                                                        </ng-container>
                                                    </select>
                                                </div>
                                
                                                <div class="form-result-results-result-character" *ngIf="reward.type == 'character'">
                                                    <select [(ngModel)]="response.getCharacterReward(rewardIndex).character"
                                                    [matTooltip]="translate.instant('role_reward_type_character_tooltip')"
                                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                                        <option [ngValue]="character" *ngFor="let character of scenario.characters">{{character.name}}</option>
                                                    </select>
                                                </div>

                                                <div class="form-result-results-result-discussion" *ngIf="reward.type == 'discussion'">
                                                    <select [(ngModel)]="response.getDiscussionReward(rewardIndex).discussionId"
                                                    [matTooltip]="translate.instant('role_reward_type_discussion_tooltip')"
                                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                                        <option [ngValue]="-1" selected disabled>{{'role_reward_type_discussion_placeholder' | translate}}</option>
                                                        <ng-container *ngFor="let character of scenario.characters">
                                                            <optgroup [label]="character.name" *ngIf="role.characterHasDiscussion(character)">
                                                                <ng-container *ngFor="let discuss of role.discussions">
                                                                    <option [ngValue]="discuss.ID" *ngIf="discuss.character == character && discussion.ID != discuss.ID">{{discuss.name}}</option>
                                                                </ng-container>
                                                            </optgroup>                        
                                                        </ng-container>
                                                    </select>
                                                </div>
                                
                                                <div class="form-result-results-result-object" *ngIf="reward.type == 'object'">
                                                    <input type="number" [(ngModel)]="response.getObjectReward(rewardIndex).quantity"/>
                                                    <select [(ngModel)]="response.getObjectReward(rewardIndex).object"
                                                    [matTooltip]="translate.instant('role_reward_type_object_tooltip')"
                                                    matTooltipPosition="above" [matTooltipDisabled]="!tooltipService.activatedTooltips">
                                                        <ng-container *ngFor="let ressource of scenario.ressources">
                                                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                                        </ng-container>
                                                        <ng-container *ngFor="let ressource of role.ressources">
                                                            <option [ngValue]="ressource" *ngIf="ressource.type == 'ressource'">{{ressource.name}}</option>
                                                        </ng-container>
                                                    </select>
                                                </div>
                                
                                                <button mat-button class="form-result-button-remove" (click)="response.removeReward(rewardIndex)"><mat-icon fontIcon="remove"></mat-icon></button>
                                            </div>
                                
                                            <button mat-button class="form-result-button-add" (click)="response.addReward()"><mat-icon fontIcon="add"></mat-icon></button>
                                        </div>
                                    </div>
                                    <button mat-button class="form-sentence-delete" (click)="deleteResponse(getSentenceAsInterrogativeSentence(sentence), response.ID)" *ngIf="countResponses(sentence.ID) > 1">{{'discussion_buttons_deleteResponse' | translate}}</button>
                                </div>
                            </mat-expansion-panel>
                        </ng-container>


                    </mat-accordion>


                    <button mat-button class="form-sentence-delete" (click)="deleteInterrogativeSentence(sentence.ID)">{{'discussion_buttons_deleteInterrogativeSentence' | translate}}</button>
                </div>
            </mat-expansion-panel>
    </ng-container>

    </mat-accordion>
</mat-dialog-content>


<mat-dialog-actions align="end">
    <button mat-button mat-dialog-close>{{'discussion_buttons_close' | translate}}</button>
</mat-dialog-actions>