规定赛个人项目评分显示调整
This commit is contained in:
parent
37e919df25
commit
b86fc02588
@ -20,12 +20,10 @@ class ExecutionScoreCriterion {
|
||||
}
|
||||
|
||||
abstract final class PrescribedExecutionRuleCatalog {
|
||||
static const displayLabels = <String, String>{
|
||||
'动作准确性': '动作的准确性(个人30分/集体20分)',
|
||||
'动作熟练性': '动作的熟练性(个人20分/集体15分)',
|
||||
'动作合拍性': '动作的合拍性(个人30分/集体15分)',
|
||||
'运动能力一致性': '运动能力一致性(集体15分)',
|
||||
'表演技巧一致性': '表演技巧一致性(集体15分)',
|
||||
static const displayNames = <String, String>{
|
||||
'动作准确性': '动作的准确性',
|
||||
'动作熟练性': '动作的熟练性',
|
||||
'动作合拍性': '动作的合拍性',
|
||||
};
|
||||
|
||||
/// 服务端规定赛评分项编码到平板控件键的映射。
|
||||
@ -92,5 +90,6 @@ abstract final class PrescribedExecutionRuleCatalog {
|
||||
PrescribedEntryType.collective => collective,
|
||||
};
|
||||
|
||||
static String displayLabelFor(String item) => displayLabels[item] ?? item;
|
||||
static String displayLabelFor(String item, double maximum) =>
|
||||
'${displayNames[item] ?? item}(${maximum.round()}分)';
|
||||
}
|
||||
|
||||
@ -884,7 +884,10 @@ class ScoringController extends GetxController {
|
||||
|
||||
String performanceItemDisplayLabel(String item) {
|
||||
if (profile.role == ScoreRole.execution) {
|
||||
return PrescribedExecutionRuleCatalog.displayLabelFor(item);
|
||||
return PrescribedExecutionRuleCatalog.displayLabelFor(
|
||||
item,
|
||||
performanceItemMaximum(item),
|
||||
);
|
||||
}
|
||||
return '$item(${performanceItemMaximum(item).round()})';
|
||||
}
|
||||
|
||||
@ -30,26 +30,37 @@ void main() {
|
||||
expect(rules.fold<double>(0, (sum, item) => sum + item.maximum), 80);
|
||||
});
|
||||
|
||||
test('完成质量评分项同时标明个人与集体分值', () {
|
||||
test('完成质量评分项只显示当前项目对应分值', () {
|
||||
final individual = PrescribedExecutionRuleCatalog.forType(
|
||||
PrescribedEntryType.individual,
|
||||
);
|
||||
final collective = PrescribedExecutionRuleCatalog.forType(
|
||||
PrescribedEntryType.collective,
|
||||
);
|
||||
|
||||
expect(
|
||||
PrescribedExecutionRuleCatalog.displayLabelFor('动作准确性'),
|
||||
'动作的准确性(个人30分/集体20分)',
|
||||
individual.map(
|
||||
(item) => PrescribedExecutionRuleCatalog.displayLabelFor(
|
||||
item.name,
|
||||
item.maximum,
|
||||
),
|
||||
),
|
||||
['动作的准确性(30分)', '动作的熟练性(20分)', '动作的合拍性(30分)'],
|
||||
);
|
||||
expect(
|
||||
PrescribedExecutionRuleCatalog.displayLabelFor('动作熟练性'),
|
||||
'动作的熟练性(个人20分/集体15分)',
|
||||
);
|
||||
expect(
|
||||
PrescribedExecutionRuleCatalog.displayLabelFor('动作合拍性'),
|
||||
'动作的合拍性(个人30分/集体15分)',
|
||||
);
|
||||
expect(
|
||||
PrescribedExecutionRuleCatalog.displayLabelFor('运动能力一致性'),
|
||||
'运动能力一致性(集体15分)',
|
||||
);
|
||||
expect(
|
||||
PrescribedExecutionRuleCatalog.displayLabelFor('表演技巧一致性'),
|
||||
'表演技巧一致性(集体15分)',
|
||||
collective.map(
|
||||
(item) => PrescribedExecutionRuleCatalog.displayLabelFor(
|
||||
item.name,
|
||||
item.maximum,
|
||||
),
|
||||
),
|
||||
[
|
||||
'动作的准确性(20分)',
|
||||
'动作的熟练性(15分)',
|
||||
'动作的合拍性(15分)',
|
||||
'运动能力一致性(15分)',
|
||||
'表演技巧一致性(15分)',
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user