MOBILE-3583 quiz: Fix matching questions in 3.10

main
Dani Palou 2020-11-05 15:31:58 +01:00
parent b66935cb49
commit 5a95304505
2 changed files with 8 additions and 6 deletions

View File

@ -34,8 +34,6 @@ import { CoreConfigConstants } from '../../../configconstants';
import { ILocalNotification } from '@ionic-native/local-notifications';
import { SQLiteDB } from '@classes/sqlitedb';
import { CoreSite } from '@classes/site';
import { CoreFilterProvider } from '@core/filter/providers/filter';
import { CoreFilterDelegate } from '@core/filter/providers/delegate';
/**
* Data needed to register a device in a Moodle site.
@ -196,8 +194,6 @@ export class CorePushNotificationsProvider {
platform: Platform,
appProvider: CoreAppProvider,
private sitesFactory: CoreSitesFactoryProvider,
private filterProvider: CoreFilterProvider,
private filterDelegate: CoreFilterDelegate
) {
this.logger = logger.getInstance('CorePushNotificationsProvider');
this.appDB = appProvider.getDB();

View File

@ -473,8 +473,14 @@ export class CoreQuestionBaseComponent {
this.question.disabled = this.question.disabled && element.disabled;
// Get the label with the question text.
const label = questionEl.querySelector('label[for="' + option.id + '"]');
// Get the label with the question text. Try the new format first.
const labelId = element.getAttribute('aria-labelledby');
let label = labelId ? questionEl.querySelector('#' + labelId.replace(/:/g, '\\:')) : undefined;
if (!label) {
// Not found, use the old format.
label = questionEl.querySelector('label[for="' + option.id + '"]');
}
if (label) {
option.text = label.innerHTML;