diff --git a/src/addon/mod/feedback/providers/offline.ts b/src/addon/mod/feedback/providers/offline.ts index 89c7f5e0f..d8c26f1c4 100644 --- a/src/addon/mod/feedback/providers/offline.ts +++ b/src/addon/mod/feedback/providers/offline.ts @@ -38,7 +38,7 @@ export class AddonModFeedbackOfflineProvider { }, { name: 'page', - type: 'TEXT' + type: 'INTEGER' }, { name: 'courseid', @@ -86,9 +86,11 @@ export class AddonModFeedbackOfflineProvider { getAllFeedbackResponses(siteId?: string): Promise { return this.sitesProvider.getSite(siteId).then((site) => { return site.getDb().getAllRecords(AddonModFeedbackOfflineProvider.FEEDBACK_TABLE).then((entries) => { - return entries.map((entry) => { + entries.forEach((entry) => { entry.responses = this.textUtils.parseJSON(entry.responses); }); + + return entries; }); }); } @@ -104,9 +106,11 @@ export class AddonModFeedbackOfflineProvider { return this.sitesProvider.getSite(siteId).then((site) => { return site.getDb().getRecords(AddonModFeedbackOfflineProvider.FEEDBACK_TABLE, {feedbackid: feedbackId}); }).then((entries) => { - return entries.map((entry) => { + entries.forEach((entry) => { entry.responses = this.textUtils.parseJSON(entry.responses); }); + + return entries; }); }