Skip to content

Commit

Permalink
Release Student 6.26.0 (254)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaskozmer authored Aug 21, 2023
2 parents fe1009c + 155fab5 commit a287ffb
Show file tree
Hide file tree
Showing 285 changed files with 9,786 additions and 2,208 deletions.
16 changes: 16 additions & 0 deletions apps/flutter_parent/lib/models/alert.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ abstract class Alert implements Built<Alert, AlertBuilder> {
int index2 = htmlUrl.lastIndexOf('/discussion_topics');
return htmlUrl.substring(index1, index2);
}

String getCourseIdForGradeAlerts() {
if (alertType == AlertType.courseGradeLow || alertType == AlertType.courseGradeHigh) {
return contextId;
} else if (alertType == AlertType.assignmentGradeLow || alertType == AlertType.assignmentGradeHigh) {
return _getCourseIdFromUrl();
} else {
return null;
}
}

String _getCourseIdFromUrl() {
RegExp regex = RegExp(r'/courses/(\d+)/');
Match match = regex.firstMatch(htmlUrl);
return (match != null && match.groupCount >= 1) ? match.group(1) : null;
}
}

/// If you need to change the values sent over the wire when serializing you
Expand Down
4 changes: 4 additions & 0 deletions apps/flutter_parent/lib/models/assignment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ abstract class Assignment implements Built<Assignment, AssignmentBuilder> {
bool get isDiscussion => submissionTypes.contains(SubmissionTypes.discussionTopic);

bool get isQuiz => submissionTypes.contains(SubmissionTypes.onlineQuiz);

bool isGradingTypeQuantitative() {
return gradingType == GradingType.points || gradingType == GradingType.percent;
}
}

@BuiltValueEnum(wireName: 'grading_type')
Expand Down
4 changes: 4 additions & 0 deletions apps/flutter_parent/lib/models/course.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ library course;
import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:flutter_parent/models/course_settings.dart';
import 'package:flutter_parent/models/section.dart';
import 'package:flutter_parent/models/term.dart';

Expand Down Expand Up @@ -123,6 +124,9 @@ abstract class Course implements Built<Course, CourseBuilder> {
@nullable
BuiltList<Section> get sections;

@nullable
CourseSettings get settings;

static void _initializeBuilder(CourseBuilder b) => b
..id = ''
..enrollments = ListBuilder<Enrollment>()
Expand Down
Loading

0 comments on commit a287ffb

Please sign in to comment.