Skip to content

Commit afb4849

Browse files
authored
Fix oppia#18697: Hints are absent in embedding. (oppia#19656)
Fix Hints in Iframe
1 parent 1a1bb9a commit afb4849

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

core/templates/components/button-directives/hint-and-solution-buttons.component.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</button>
2727
</li>
2828
</ul>
29-
<div class="hint-container" *ngIf="isVisible && isTooltipVisible()">
29+
<div class="hint-container" *ngIf="isVisible && isTooltipVisible() && !iframed">
3030
<div class="hint-box hint-box-add-ons">
3131
<span [innerHTML]="'I18N_HINT_NEED_HELP' | translate"></span>
3232
<button type="button"
@@ -37,7 +37,8 @@
3737
</button>
3838
</div>
3939
</div>
40-
<div class="hint-container solution-container" *ngIf="isTooltipForSolutionVisible && isSolutionTooltipVisible()">
40+
<div class="hint-container solution-container"
41+
*ngIf="isTooltipForSolutionVisible && isSolutionTooltipVisible() && !iframed">
4142
<div class="hint-box hint-box-add-ons">
4243
<span [innerHTML]="'I18N_SOLUTION_NEED_HELP' | translate"></span>
4344
<button type="button"

core/templates/components/button-directives/hint-and-solution-buttons.component.ts

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { StatsReportingService } from 'pages/exploration-player-page/services/st
2828
import { Subscription } from 'rxjs';
2929
import { ContextService } from 'services/context.service';
3030
import { I18nLanguageCodeService } from 'services/i18n-language-code.service';
31+
import { UrlService } from 'services/contextual/url.service';
3132

3233
import './hint-and-solution-buttons.component.css';
3334

@@ -48,6 +49,7 @@ export class HintAndSolutionButtonsComponent implements OnInit, OnDestroy {
4849
activeHintIndex!: number | null;
4950
displayedCard!: StateCard;
5051
hintIndexes: number[] = [];
52+
iframed!: boolean;
5153
solutionModalIsActive: boolean = false;
5254
currentlyOnLatestCard: boolean = true;
5355
isVisible: boolean = true;
@@ -56,6 +58,7 @@ export class HintAndSolutionButtonsComponent implements OnInit, OnDestroy {
5658
constructor(
5759
private changeDetectorRef: ChangeDetectorRef,
5860
private contextService: ContextService,
61+
private urlService: UrlService,
5962
private explorationPlayerStateService: ExplorationPlayerStateService,
6063
private hintAndSolutionModalService: HintAndSolutionModalService,
6164
private hintsAndSolutionManagerService: HintsAndSolutionManagerService,
@@ -67,6 +70,7 @@ export class HintAndSolutionButtonsComponent implements OnInit, OnDestroy {
6770

6871
ngOnInit(): void {
6972
this._editorPreviewMode = this.contextService.isInExplorationEditorPage();
73+
this.iframed = this.urlService.isIframed();
7074
this.resetLocalHintsArray();
7175
this.directiveSubscriptions.add(
7276
this.playerPositionService.onNewCardOpened.subscribe(

core/templates/pages/exploration-player-page/layout-directives/exploration-footer.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="footer navbar-fixed-bottom oppia-exploration-footer" *ngIf="!iframed">
1+
<div class="footer navbar-fixed-bottom oppia-exploration-footer">
22
<div *ngIf="shouldRenderLessonInfoTooltip()" aria-live="assertive">
33
<div class="close-tooltip e2e-test-close-lesson-info-tooltip" (click)="learnerHasViewedLessonInfo()" (keydown.enter)="learnerHasViewedLessonInfo()" tabindex="0"></div>
44
<div class="lesson-info-tooltip lesson-info-tooltip-add-ons"
@@ -11,7 +11,7 @@
1111
#lessonInfoButton
1212
(keydown.escape)="learnerHasViewedLessonInfo()"
1313
(click)="showInformationCard()"
14-
*ngIf="!footerIsInQuestionPlayerMode">
14+
*ngIf="!footerIsInQuestionPlayerMode && !iframed">
1515
<img [src]="getStaticImageUrl('/general/apple.svg')"
1616
class="exploration-footer-img"
1717
alt=""

core/templates/pages/exploration-player-page/modals/display-hint-modal.component.html

+5
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@
3333
.oppia-learner-got-it-button {
3434
float: right;
3535
}
36+
37+
.modal-body {
38+
max-height: calc(85vh - 125px);
39+
overflow-y: auto;
40+
}
3641
</style>

0 commit comments

Comments
 (0)