Skip to content

Commit

Permalink
Release Student 6.26.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaskozmer authored Sep 5, 2023
2 parents a287ffb + b510575 commit fe47643
Show file tree
Hide file tree
Showing 159 changed files with 1,725 additions and 607 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": {}
}
}
18 changes: 18 additions & 0 deletions apps/flutter_parent/lib/models/course.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +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 @@ -127,6 +129,16 @@ abstract class Course implements Built<Course, CourseBuilder> {
@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 @@ -176,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 fe47643

Please sign in to comment.