update blank question rule

version 1.0.2
This commit is contained in:
LostInLinearPast 2025-10-31 14:14:05 +08:00
parent 4054862c70
commit 9d8fa35aad

View File

@ -301,6 +301,7 @@ public class PlayerController {
//若标记了分数最大分数减去后续计算未标记分数的答案的均分
if(parseInt == 0) k++;
else maxScore -= parseInt;
//或逻辑
if (Arrays.stream(answerString.split("\\|")).toList().contains(resultList.get(i))) {
score += parseInt;
if(parseInt == 0) j++;
@ -309,13 +310,13 @@ public class PlayerController {
}
if(k > 0) {
//未标记分数的答案的每题平均分
int averageScore = Math.round((float)maxScore / k);
float averageScore = (float)maxScore / k;
//答对的未标记 * 未标记的平均分 = 未标记的答对总分
int rightScore;
//如果答对的未标记 == 总未标记直接给未标记的满分为了弥补四舍五入带来的误差
//否则直接给 未标记平均分 * 未标记答对
if(j == k) rightScore = maxScore;
else rightScore = averageScore * j;
else rightScore = Math.round(averageScore * j);
score += rightScore;
}
playerAnswers.setScore(score);