File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
core/src/main/java/org/openedx/core/data/model Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -93,30 +93,33 @@ data class CourseProgressResponse(
9393 @SerializedName(" assignment_colors" ) val assignmentColors : List <String >?
9494 ) {
9595 // TODO Temporary solution. Backend will returns color list later
96- val defaultColors = listOf (
97- " #D24242" ,
98- " #7B9645" ,
99- " #5A5AD8" ,
100- " #B0842C" ,
101- " #2E90C2" ,
102- " #D13F88" ,
103- " #36A17D" ,
104- " #AE5AD8" ,
105- " #3BA03B"
106- )
96+ companion object {
97+ val DEFAULT_COLORS = listOf (
98+ " #D24242" ,
99+ " #7B9645" ,
100+ " #5A5AD8" ,
101+ " #B0842C" ,
102+ " #2E90C2" ,
103+ " #D13F88" ,
104+ " #36A17D" ,
105+ " #AE5AD8" ,
106+ " #3BA03B"
107+ )
108+ }
109+
107110
108111 fun mapToRoomEntity () = GradingPolicyDb (
109112 assignmentPolicies = assignmentPolicies?.map { it.mapToRoomEntity() } ? : emptyList(),
110113 gradeRange = gradeRange ? : emptyMap(),
111- assignmentColors = assignmentColors ? : defaultColors
114+ assignmentColors = assignmentColors ? : DEFAULT_COLORS
112115 )
113116
114117 fun mapToDomain () = CourseProgress .GradingPolicy (
115118 assignmentPolicies = assignmentPolicies?.map { it.mapToDomain() } ? : emptyList(),
116119 gradeRange = gradeRange ? : emptyMap(),
117120 assignmentColors = assignmentColors?.map { colorString ->
118121 Color (colorString.toColorInt())
119- } ? : defaultColors .map { Color (it.toColorInt()) }
122+ } ? : DEFAULT_COLORS .map { Color (it.toColorInt()) }
120123 )
121124
122125 data class AssignmentPolicy (
You can’t perform that action at this time.
0 commit comments