MOBILE-2345 lesson: Fix issues with prefetch and offline

main
Dani Palou 2018-05-07 08:34:54 +02:00
parent b1469987e2
commit b350c7a52e
4 changed files with 9 additions and 2 deletions

View File

@ -462,7 +462,9 @@ export class AddonModLessonProvider {
return;
}
if (typeof data.answer == 'object') {
if (typeof data['answer[text]'] != 'undefined') {
studentAnswer = data['answer[text]'];
} else if (typeof data.answer == 'object') {
studentAnswer = data.answer.text;
} else {
studentAnswer = data.answer;

View File

@ -139,7 +139,7 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy {
this.spinner = true;
// Get download size to ask for confirm if it's high.
this.prefetchHandler.getDownloadSize(this.module, this.courseId).then((size) => {
this.prefetchHandler.getDownloadSize(this.module, this.courseId, true).then((size) => {
return this.courseHelper.prefetchModule(this.prefetchHandler, this.module, size, this.courseId, refresh);
}).catch((error) => {
// Error, hide spinner.

View File

@ -17,6 +17,7 @@
"disableall": "Disable notifications",
"disabled": "Disabled",
"displayformat": "Display format",
"enabledownloadsection": "Enable download sections",
"enablerichtexteditor": "Enable text editor",
"enablerichtexteditordescription": "If enabled, a text editor will be available when entering content.",
"enablesyncwifi": "Allow sync only when on Wi-Fi",

View File

@ -131,6 +131,10 @@ export class CoreTextUtilsProvider {
* @return {string} Clean text.
*/
cleanTags(text: string, singleLine?: boolean): string {
if (typeof text == 'number') {
return text;
}
if (!text) {
return '';
}