From c8b35013399290fb34b1d618ecf19cf9a78e63a5 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 8 Jan 2019 12:39:19 +0100 Subject: [PATCH] MOBILE-2795 assign: Fix fetching grades when assingment has no submissions --- src/addon/mod/assign/providers/assign.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/addon/mod/assign/providers/assign.ts b/src/addon/mod/assign/providers/assign.ts index b30a7490d..c6c3bf8cf 100644 --- a/src/addon/mod/assign/providers/assign.ts +++ b/src/addon/mod/assign/providers/assign.ts @@ -269,6 +269,11 @@ export class AddonModAssignProvider { return assignment.grades; } } else if (response.warnings && response.warnings.length) { + if (response.warnings[0].warningcode == 3) { + // No grades found. + return []; + } + return Promise.reject(response.warnings[0]); }