Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MBL-18183][Parent] Fix no submission assignments label #2688

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/flutter_parent/lib/models/assignment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ abstract class Assignment implements Built<Assignment, AssignmentBuilder> {

SubmissionStatus getStatus({required String? studentId}) {
final submission = this.submission(studentId);
if (!isSubmittable() && submission == null) {
if ((!isSubmittable() && submission == null) || (!isSubmittable() && submission?.isGraded() == false)) {
return SubmissionStatus.NONE;
} else if (submission?.isLate == true) {
return SubmissionStatus.LATE;
} else if (_isMissingSubmission(studentId)) {
return SubmissionStatus.MISSING;
} else if (submission?.submittedAt == null) {
} else if (submission?.submittedAt == null && (submission?.isGraded() ?? false) == false) {
return SubmissionStatus.NOT_SUBMITTED;
} else {
return SubmissionStatus.SUBMITTED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ class _AssignmentDetailsScreenState extends State<AssignmentDetailsScreen> {
final missing = submission?.missing == true;
final showStatus = missing || assignment.isSubmittable() || submission?.isGraded() == true;
final submitted = submission?.submittedAt != null;
final submittedColor = submitted ? ParentTheme.of(context)?.successColor : textTheme.bodySmall?.color;
final graded = submission?.isGraded() == true;
final submittedColor = submitted || graded ? ParentTheme.of(context)?.successColor : textTheme.bodySmall?.color;

final points = (assignment.pointsPossible.toInt() == assignment.pointsPossible)
? assignment.pointsPossible.toInt().toString()
Expand All @@ -173,13 +174,13 @@ class _AssignmentDetailsScreenState extends State<AssignmentDetailsScreen> {
semanticsLabel: l10n.assignmentTotalPointsAccessible(points),
key: Key("assignment_details_total_points")),
if (showStatus && !restrictQuantitativeData) SizedBox(width: 16),
if (showStatus) _statusIcon(submitted, submittedColor!),
if (showStatus) _statusIcon(submitted || graded, submittedColor!),
if (showStatus) SizedBox(width: 8),
if (showStatus)
Text(
missing ? l10n.assignmentMissingSubmittedLabel :
!submitted ? l10n.assignmentNotSubmittedLabel :
submission?.isGraded() == true ? l10n.assignmentGradedLabel : l10n.assignmentSubmittedLabel,
graded ? l10n.assignmentGradedLabel :
submitted ? l10n.assignmentSubmittedLabel : l10n.assignmentNotSubmittedLabel,
style: textTheme.bodySmall?.copyWith(
color: submittedColor,
),
Expand Down