Skip to content

Commit

Permalink
Release Teacher 1.26.0 (60)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaskozmer authored Sep 12, 2023
2 parents 7204f8c + 7be0ff9 commit f784872
Show file tree
Hide file tree
Showing 347 changed files with 11,501 additions and 2,706 deletions.
10 changes: 10 additions & 0 deletions apps/flutter_parent/assets/svg/canvas-parent-login-logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions apps/flutter_parent/assets/svg/canvas-parent-login-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/flutter_parent/flutter_parent_sdk_url
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_2.5.3-stable.tar.xz
3 changes: 3 additions & 0 deletions apps/flutter_parent/lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1705,4 +1705,7 @@ class AppLocalizations {

String get aboutVersionTitle =>
Intl.message('Version', desc: 'Title for Version field on about page');

String get aboutLogoSemanticsLabel =>
Intl.message('Instructure logo', desc: 'Semantics label for the Instructure logo on the about page');
}
9 changes: 8 additions & 1 deletion apps/flutter_parent/lib/l10n/res/intl_en.arb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@@last_modified": "2023-04-14T11:04:46.988317",
"@@last_modified": "2023-08-25T11:04:20.901151",
"alertsLabel": "Alerts",
"@alertsLabel": {
"description": "The label for the Alerts tab",
Expand Down Expand Up @@ -2742,5 +2742,12 @@
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Instructure logo": "Instructure logo",
"@Instructure logo": {
"description": "Semantics label for the Instructure logo on the about page",
"type": "text",
"placeholders_order": [],
"placeholders": {}
}
}
9 changes: 8 additions & 1 deletion apps/flutter_parent/lib/l10n/res/intl_messages.arb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@@last_modified": "2023-04-14T11:04:46.988317",
"@@last_modified": "2023-08-25T11:04:20.901151",
"alertsLabel": "Alerts",
"@alertsLabel": {
"description": "The label for the Alerts tab",
Expand Down Expand Up @@ -2742,5 +2742,12 @@
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Instructure logo": "Instructure logo",
"@Instructure logo": {
"description": "Semantics label for the Instructure logo on the about page",
"type": "text",
"placeholders_order": [],
"placeholders": {}
}
}
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
22 changes: 22 additions & 0 deletions apps/flutter_parent/lib/models/course.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ library course;

import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/json_object.dart';
import 'package:built_value/serializer.dart';
import 'package:flutter_parent/models/course_settings.dart';
import 'package:flutter_parent/models/grading_scheme_item.dart';
import 'package:flutter_parent/models/section.dart';
import 'package:flutter_parent/models/term.dart';

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

@nullable
CourseSettings get settings;

@nullable
@BuiltValueField(wireName: 'grading_scheme')
BuiltList<JsonObject> get gradingScheme;

List<GradingSchemeItem> get gradingSchemeItems {
if (gradingScheme == null) return [];
return gradingScheme.map((item) => GradingSchemeItem.fromJson(item)).where((element) => element != null).toList()
..sort((a, b) => b.value.compareTo(a.value));
}

static void _initializeBuilder(CourseBuilder b) => b
..id = ''
..enrollments = ListBuilder<Enrollment>()
Expand Down Expand Up @@ -172,6 +188,12 @@ abstract class Course implements Built<Course, CourseBuilder> {
bool isValidForCurrentStudent(String currentStudentId) {
return enrollments?.any((enrollment) => enrollment.userId == currentStudentId) ?? false;
}

String convertScoreToLetterGrade(double score, double maxScore) {
if (maxScore == 0.0 || gradingSchemeItems.isEmpty) return "";
double percent = score / maxScore;
return gradingSchemeItems.firstWhere((element) => percent >= element.value, orElse: () => gradingSchemeItems.last).grade;
}
}

@BuiltValueEnum(wireName: 'default_view')
Expand Down
Loading

0 comments on commit f784872

Please sign in to comment.