Merge pull request #2590 from dpalou/MOBILE-3583

MOBILE-3583 quiz: Fix matching questions in 3.10
main
Juan Leyva 2020-11-05 16:11:08 +01:00 committed by GitHub
commit f780b3afc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 { ILocalNotification } from '@ionic-native/local-notifications';
import { SQLiteDB } from '@classes/sqlitedb'; import { SQLiteDB } from '@classes/sqlitedb';
import { CoreSite } from '@classes/site'; 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. * Data needed to register a device in a Moodle site.
@ -196,8 +194,6 @@ export class CorePushNotificationsProvider {
platform: Platform, platform: Platform,
appProvider: CoreAppProvider, appProvider: CoreAppProvider,
private sitesFactory: CoreSitesFactoryProvider, private sitesFactory: CoreSitesFactoryProvider,
private filterProvider: CoreFilterProvider,
private filterDelegate: CoreFilterDelegate
) { ) {
this.logger = logger.getInstance('CorePushNotificationsProvider'); this.logger = logger.getInstance('CorePushNotificationsProvider');
this.appDB = appProvider.getDB(); this.appDB = appProvider.getDB();

View File

@ -473,8 +473,14 @@ export class CoreQuestionBaseComponent {
this.question.disabled = this.question.disabled && element.disabled; this.question.disabled = this.question.disabled && element.disabled;
// Get the label with the question text. // Get the label with the question text. Try the new format first.
const label = questionEl.querySelector('label[for="' + option.id + '"]'); 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) { if (label) {
option.text = label.innerHTML; option.text = label.innerHTML;