MOBILE-3040 submission: Fix isSubmissionEmpty logic

main
Noel De Martin 2019-12-17 10:26:42 +01:00
parent c0e8b8d006
commit 5690fafe20
1 changed files with 9 additions and 1 deletions

View File

@ -193,7 +193,15 @@ export class AddonModAssignHelperProvider {
return true;
}
return !!submission.plugins.find((plugin) => this.submissionDelegate.isPluginEmpty(assign, plugin));
for (const plugin of submission.plugins) {
// If any plugin is not empty, we consider that the submission is not empty either.
if (!this.submissionDelegate.isPluginEmpty(assign, plugin)) {
return false;
}
}
// If all the plugins were empty (or there were no plugins), we consider the submission to be empty.
return true;
}
/**