Skip to content

Commit d6a099a

Browse files
committed
Исправление для цвета решения
1 parent 7bc1dc8 commit d6a099a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

hwproj.front/src/services/StudentStatsUtils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ export default class StudentStatsUtils {
4141
solutionsDescription = `${lastSolution.rating}/${taskMaxRating} ${Utils.pluralizeHelper(["балл", "балла", "баллов"], taskMaxRating)}`
4242
else solutionsDescription = "Последняя оценка — " + `${lastRatedSolution.rating}/${taskMaxRating} ${Utils.pluralizeHelper(["балл", "балла", "баллов"], taskMaxRating)}\nНовое решение ожидает проверки`
4343

44-
const color = disabled
45-
? grey[300]
46-
: StudentStatsUtils.getCellBackgroundColor(lastRatedSolution.state, lastRatedSolution.rating, taskMaxRating, isFirstUnratedTry)
44+
let color: string
45+
if (disabled)
46+
color = grey[300]
47+
else if (lastSolution == undefined)
48+
color = "#ffffff"
49+
else
50+
color = StudentStatsUtils.getCellBackgroundColor(lastSolution.state, lastSolution.rating, taskMaxRating, isFirstUnratedTry)
4751

4852
return {
4953
lastRatedSolution: lastRatedSolution,

0 commit comments

Comments
 (0)