Skip to content

Commit f780b3a

Browse files
authored
Merge pull request #2590 from dpalou/MOBILE-3583
MOBILE-3583 quiz: Fix matching questions in 3.10
2 parents ac4ad42 + 5a95304 commit f780b3a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/core/pushnotifications/providers/pushnotifications.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ import { CoreConfigConstants } from '../../../configconstants';
3434
import { ILocalNotification } from '@ionic-native/local-notifications';
3535
import { SQLiteDB } from '@classes/sqlitedb';
3636
import { CoreSite } from '@classes/site';
37-
import { CoreFilterProvider } from '@core/filter/providers/filter';
38-
import { CoreFilterDelegate } from '@core/filter/providers/delegate';
3937

4038
/**
4139
* Data needed to register a device in a Moodle site.
@@ -196,8 +194,6 @@ export class CorePushNotificationsProvider {
196194
platform: Platform,
197195
appProvider: CoreAppProvider,
198196
private sitesFactory: CoreSitesFactoryProvider,
199-
private filterProvider: CoreFilterProvider,
200-
private filterDelegate: CoreFilterDelegate
201197
) {
202198
this.logger = logger.getInstance('CorePushNotificationsProvider');
203199
this.appDB = appProvider.getDB();

src/core/question/classes/base-question-component.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,14 @@ export class CoreQuestionBaseComponent {
473473

474474
this.question.disabled = this.question.disabled && element.disabled;
475475

476-
// Get the label with the question text.
477-
const label = questionEl.querySelector('label[for="' + option.id + '"]');
476+
// Get the label with the question text. Try the new format first.
477+
const labelId = element.getAttribute('aria-labelledby');
478+
let label = labelId ? questionEl.querySelector('#' + labelId.replace(/:/g, '\\:')) : undefined;
479+
if (!label) {
480+
// Not found, use the old format.
481+
label = questionEl.querySelector('label[for="' + option.id + '"]');
482+
}
483+
478484
if (label) {
479485
option.text = label.innerHTML;
480486

0 commit comments

Comments
 (0)