Skip to content

Commit 52412c2

Browse files
committed
挑戦中の問題にわかりやすく色をつけた
1 parent aae60ca commit 52412c2

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

ui/components/problems/ProblemCardPlayer.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ export default {
7979
},
8080
},
8181
computed: {
82+
isChallenging() {
83+
return this.problem.environments.filter((env) => env.status == "UNDER_CHALLENGE").length > 0
84+
},
8285
scoredAnswers() {
8386
return this.problem.answers.filter((answer) => answer.hasPoint)
8487
},
@@ -114,7 +117,10 @@ export default {
114117
return `${this.maxScoreAnswer.percent}% ${this.maxScoreAnswer.point}/${this.problem.perfectPoint}`
115118
},
116119
currentState() {
117-
if (this.problem.answers.length === 0) {
120+
if (this.isChallenging) {
121+
this.changeColor('orange')
122+
return '挑戦中'
123+
} else if (this.problem.answers.length === 0) {
118124
this.changeColor('')
119125
return '未解答'
120126
} else if (this.maxScoreAnswer && this.maxScoreAnswer.percent >= 100) {

ui/orm/Queries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default class Queries {
116116
}
117117

118118
static problemsAnswersPenalties() {
119-
return orm.Problem.eagerFetch({}, ['body', 'answers', 'penalties'])
119+
return orm.Problem.eagerFetch({}, ['body', 'answers', 'penalties', "environments"])
120120
}
121121

122122
static scoreboardsTeam() {

ui/pages/problems/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export default {
6767
'problems.body',
6868
'problems.answers',
6969
'problems.penalties',
70+
'problems.environments'
7071
]
7172
: ['problems.body', 'problems.category']
7273

0 commit comments

Comments
 (0)