Compare commits
2 Commits
f8d2a87fba
...
5480427d65
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5480427d65 | ||
|
|
f0571b1f03 |
@ -51,14 +51,17 @@ class JudgeApiRepository {
|
||||
}
|
||||
}
|
||||
|
||||
Future<ApiLoad<JudgeScoreSheet>> loadSheet(String sessionEntryId) async {
|
||||
Future<ApiLoad<JudgeScoreSheet>> loadSheet(
|
||||
String sessionEntryId, {
|
||||
bool requireFresh = false,
|
||||
}) async {
|
||||
final key = _key('sheet-$sessionEntryId');
|
||||
try {
|
||||
final data = await _client.getSheet(sessionEntryId);
|
||||
await _putJson(key, data.toJson());
|
||||
return ApiLoad(data, fromCache: false);
|
||||
} on ApiException catch (error) {
|
||||
if (error.isUnauthorized) rethrow;
|
||||
if (error.isUnauthorized || requireFresh) rethrow;
|
||||
final source = _storage.settings.get(key) as String?;
|
||||
if (source != null) {
|
||||
return ApiLoad(JudgeScoreSheet.decode(source), fromCache: true);
|
||||
|
||||
@ -1,6 +1,30 @@
|
||||
/// Maps server labels to the existing scoring controls without allowing a
|
||||
/// shorter label (e.g. 违例) to shadow a more specific one (e.g. 空间违例).
|
||||
abstract final class ScoreItemKeyMatcher {
|
||||
static const _performanceDimensions = <String, String>{
|
||||
'MUSIC': '音乐',
|
||||
'QUALITY': '完成质量',
|
||||
'ENTERTAINMENT': '娱乐',
|
||||
'CREATIVITY': '创意',
|
||||
'VARIETY': '多样性',
|
||||
};
|
||||
|
||||
/// Scoring item codes remain stable even when a rule version changes labels.
|
||||
static String? performanceDimension(
|
||||
Iterable<String> keys, {
|
||||
String? dimensionCode,
|
||||
required String itemCode,
|
||||
required String label,
|
||||
}) {
|
||||
final code = (dimensionCode?.trim().isNotEmpty == true
|
||||
? dimensionCode!.trim()
|
||||
: itemCode.split('_').first)
|
||||
.toUpperCase();
|
||||
final key = _performanceDimensions[code];
|
||||
if (key != null && keys.contains(key)) return key;
|
||||
return match(keys, label);
|
||||
}
|
||||
|
||||
static String? match(
|
||||
Iterable<String> keys,
|
||||
String source, {
|
||||
|
||||
@ -344,7 +344,7 @@ class _HomePageState extends State<HomePage> {
|
||||
(item) => item.entry.sessionEntryId == entryId,
|
||||
);
|
||||
if (index >= 0) {
|
||||
await _openTask(index, _remoteTasks[index]);
|
||||
await _openTask(index, _remoteTasks[index], correction: true);
|
||||
} else {
|
||||
await _openCorrectionTask(entryId);
|
||||
}
|
||||
@ -420,12 +420,23 @@ class _HomePageState extends State<HomePage> {
|
||||
Get.offAllNamed(AppRoutes.login);
|
||||
}
|
||||
|
||||
Future<void> _openTask(int index, _RemoteTask remoteTask) async {
|
||||
Future<void> _openTask(
|
||||
int index,
|
||||
_RemoteTask remoteTask, {
|
||||
bool correction = false,
|
||||
}) async {
|
||||
setState(() => _openingEntryId = remoteTask.entry.sessionEntryId);
|
||||
try {
|
||||
final sheetResult = await _api.loadSheet(remoteTask.entry.sessionEntryId);
|
||||
final sheetResult = await _api.loadSheet(
|
||||
remoteTask.entry.sessionEntryId,
|
||||
requireFresh: correction || remoteTask.entry.scoreStatus == 3,
|
||||
);
|
||||
final session = _auth.session!;
|
||||
final sheet = sheetResult.data;
|
||||
if (correction && (!sheet.isCorrection || !sheet.canEdit)) {
|
||||
Get.snackbar('修正任务暂不可用', sheet.lockReason ?? '请刷新任务后重试');
|
||||
return;
|
||||
}
|
||||
final assignmentChanged = !RemoteScoringAdapter.sheetRoleMatchesSession(
|
||||
sheet,
|
||||
remoteTask.session,
|
||||
@ -522,6 +533,7 @@ class _HomePageState extends State<HomePage> {
|
||||
task: _taskFor(indexedSession.$2, entry),
|
||||
sessionOrder: indexedSession.$1,
|
||||
),
|
||||
correction: true,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -408,7 +408,12 @@ class ScoringController extends GetxController {
|
||||
if (profile.role == ScoreRole.presentation) {
|
||||
final subject =
|
||||
'${item.subjectName ?? ''}${item.dimensionCode ?? ''}${item.name}';
|
||||
final key = _matchingKey(performanceItems.keys, subject);
|
||||
final key = ScoreItemKeyMatcher.performanceDimension(
|
||||
performanceItems.keys,
|
||||
dimensionCode: item.dimensionCode,
|
||||
itemCode: item.code,
|
||||
label: subject,
|
||||
);
|
||||
if (item.isFailureCount) {
|
||||
performanceErrorCount.value = count;
|
||||
} else if (key != null && item.adjustSign > 0) {
|
||||
|
||||
@ -20,6 +20,7 @@ import '../widgets/competition_header.dart';
|
||||
import '../widgets/drawing_board_dialog.dart';
|
||||
import '../widgets/record_button.dart';
|
||||
import '../widgets/scoring_dialogs.dart';
|
||||
import '../widgets/submission_score_details.dart';
|
||||
|
||||
class ScoringPage extends StatefulWidget {
|
||||
const ScoringPage({super.key});
|
||||
@ -101,7 +102,7 @@ class _ScoringPageState extends State<ScoringPage> with WidgetsBindingObserver {
|
||||
}
|
||||
final correctionSubmission = controller.isCorrectionMode.value;
|
||||
final confirmed = await showSubmitConfirmation(
|
||||
details: _submissionScoreDetails(controller),
|
||||
details: buildSubmissionScoreDetails(controller),
|
||||
correctionMode: controller.isCorrectionMode.value,
|
||||
);
|
||||
if (confirmed != true) return;
|
||||
@ -253,6 +254,7 @@ class _ScoringPageState extends State<ScoringPage> with WidgetsBindingObserver {
|
||||
try {
|
||||
final refreshed = await Get.find<JudgeApiRepository>().loadSheet(
|
||||
selected.candidate.sessionEntryId,
|
||||
requireFresh: true,
|
||||
);
|
||||
if (!refreshed.data.isCorrection || !refreshed.data.canEdit) {
|
||||
Get.snackbar('任务暂不可修改', refreshed.data.lockReason ?? '请刷新后重试');
|
||||
@ -2419,81 +2421,6 @@ String _formatScore(num value) {
|
||||
return fixed.replaceFirst(RegExp(r'\.?0+$'), '');
|
||||
}
|
||||
|
||||
List<SubmissionScoreDetail> _submissionScoreDetails(
|
||||
ScoringController controller,
|
||||
) {
|
||||
switch (controller.profile.role) {
|
||||
case ScoreRole.difficulty:
|
||||
if (controller.usesShowDifficultyMatrix) {
|
||||
return [
|
||||
for (final category in controller.showDifficultyCategories)
|
||||
SubmissionScoreDetail(
|
||||
label: category,
|
||||
description: _showDifficultyCountSummary(controller, category),
|
||||
),
|
||||
];
|
||||
}
|
||||
return [
|
||||
for (final entry in controller.requiredElementCounts.entries)
|
||||
SubmissionScoreDetail(
|
||||
label: entry.key,
|
||||
description: '规定元素完成数量:${entry.value} 个',
|
||||
),
|
||||
for (final entry in controller.difficultyCounts.entries)
|
||||
SubmissionScoreDetail(
|
||||
label: '${entry.key}级难度',
|
||||
description: '记录数量:${entry.value}',
|
||||
),
|
||||
];
|
||||
case ScoreRole.presentation:
|
||||
return [
|
||||
for (final item in controller.performanceItems.keys)
|
||||
SubmissionScoreDetail(
|
||||
label: item,
|
||||
description:
|
||||
'人工减 ${controller.performanceMinusCount(item)}、失误自动减 ${controller.performanceErrorCount.value} / 加 ${controller.performancePlusCount(item)}',
|
||||
),
|
||||
SubmissionScoreDetail(
|
||||
label: '失误',
|
||||
description:
|
||||
'已记录 ${controller.performanceErrorCount.value} 次,计分时从五个表现类别各减去该次数,并上传参与综合扣分',
|
||||
),
|
||||
];
|
||||
case ScoreRole.creative:
|
||||
case ScoreRole.execution:
|
||||
return [
|
||||
for (final entry in controller.performanceItems.entries)
|
||||
SubmissionScoreDetail(label: entry.key, description: '评分项已完成录入'),
|
||||
];
|
||||
case ScoreRole.technical:
|
||||
return [
|
||||
for (final entry in controller.requiredElementCounts.entries)
|
||||
SubmissionScoreDetail(
|
||||
label: entry.key,
|
||||
description: '规定元素完成数量:${entry.value} 个',
|
||||
),
|
||||
for (final rule in controller.deductionRules)
|
||||
SubmissionScoreDetail(
|
||||
label: rule.key,
|
||||
description:
|
||||
'已记录 ${controller.deductionCounts[rule.key] ?? 0} 次 · ${rule.standard}',
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
String _showDifficultyCountSummary(
|
||||
ScoringController controller,
|
||||
String category,
|
||||
) {
|
||||
final recorded = <String>[];
|
||||
for (final level in controller.showDifficultyLevels) {
|
||||
final count = controller.showDifficultyCount(category, level);
|
||||
if (count > 0) recorded.add('$level级×$count');
|
||||
}
|
||||
return recorded.isEmpty ? '尚未记录动作' : recorded.join('、');
|
||||
}
|
||||
|
||||
class _TableRow extends StatelessWidget {
|
||||
const _TableRow({required this.cells, this.statusColor});
|
||||
final List<Widget> cells;
|
||||
|
||||
@ -328,38 +328,19 @@ class _SubmissionDetailCard extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
detail.label,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
color: AppColors.textPrimary,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
detail.description,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
color: AppColors.textPrimary,
|
||||
fontSize: 14,
|
||||
height: 1.3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
const SizedBox(height: 7),
|
||||
Text(
|
||||
detail.description,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
color: AppColors.textSecondary,
|
||||
fontSize: 11,
|
||||
height: 1.25,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
105
lib/modules/scoring/widgets/submission_score_details.dart
Normal file
105
lib/modules/scoring/widgets/submission_score_details.dart
Normal file
@ -0,0 +1,105 @@
|
||||
import '../../../core/models/judge_account.dart';
|
||||
import '../controllers/scoring_controller.dart';
|
||||
import 'scoring_dialogs.dart';
|
||||
|
||||
/// 提交前复核各评分项的原始录入,不展示裁判合计分或平台最终成绩。
|
||||
List<SubmissionScoreDetail> buildSubmissionScoreDetails(
|
||||
ScoringController controller,
|
||||
) {
|
||||
switch (controller.profile.role) {
|
||||
case ScoreRole.difficulty:
|
||||
if (controller.usesShowDifficultyMatrix) {
|
||||
return [
|
||||
for (final category in controller.showDifficultyCategories)
|
||||
SubmissionScoreDetail(
|
||||
label: category,
|
||||
description: _showDifficultyCountSummary(controller, category),
|
||||
),
|
||||
];
|
||||
}
|
||||
return [
|
||||
for (final entry in controller.requiredElementCounts.entries)
|
||||
SubmissionScoreDetail(
|
||||
label: entry.key,
|
||||
description: '${entry.key}:${entry.value}个',
|
||||
),
|
||||
for (final entry in controller.difficultyCounts.entries)
|
||||
SubmissionScoreDetail(
|
||||
label: '${entry.key}级难度',
|
||||
description: '${entry.key}级难度:${entry.value}个',
|
||||
),
|
||||
];
|
||||
case ScoreRole.presentation:
|
||||
return [
|
||||
for (final item in controller.performanceItems.keys)
|
||||
SubmissionScoreDetail(
|
||||
label: item,
|
||||
description:
|
||||
'$item:加${controller.performancePlusCount(item)}次、人工减${controller.performanceMinusCount(item)}次、失误联动减${controller.performanceErrorCount.value}次',
|
||||
),
|
||||
SubmissionScoreDetail(
|
||||
label: '失误',
|
||||
description: '失误:${controller.performanceErrorCount.value}次',
|
||||
),
|
||||
];
|
||||
case ScoreRole.creative:
|
||||
case ScoreRole.execution:
|
||||
return [
|
||||
for (final entry in controller.performanceItems.entries)
|
||||
SubmissionScoreDetail(
|
||||
label: entry.key,
|
||||
description: '${entry.key}:${_formatInputValue(entry.value)}分',
|
||||
),
|
||||
];
|
||||
case ScoreRole.technical:
|
||||
return [
|
||||
for (final entry in controller.requiredElementCounts.entries)
|
||||
SubmissionScoreDetail(
|
||||
label: entry.key,
|
||||
description: '${entry.key}:${entry.value}个',
|
||||
),
|
||||
for (final rule in controller.deductionRules)
|
||||
SubmissionScoreDetail(
|
||||
label: rule.key,
|
||||
description:
|
||||
'${rule.key}:${controller.deductionCounts[rule.key] ?? 0}次',
|
||||
),
|
||||
if (controller.disqualified.value)
|
||||
SubmissionScoreDetail(
|
||||
label: '取消比赛资格',
|
||||
description:
|
||||
'取消比赛资格:1项(${_disqualificationDescription(controller)})',
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
String _formatInputValue(double value) {
|
||||
final fixed = value.toStringAsFixed(2);
|
||||
return fixed.replaceFirst(RegExp(r'\.?0+$'), '');
|
||||
}
|
||||
|
||||
String _disqualificationDescription(ScoringController controller) {
|
||||
final code = controller.selectedDisqualifyReasonCode;
|
||||
var label = code ?? '已选择原因';
|
||||
for (final item in controller.disqualifyReasonItems) {
|
||||
if (item.code == code) {
|
||||
label = item.name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
final remark = controller.disqualifyRemark;
|
||||
return remark == null || remark.isEmpty ? label : '$label · $remark';
|
||||
}
|
||||
|
||||
String _showDifficultyCountSummary(
|
||||
ScoringController controller,
|
||||
String category,
|
||||
) {
|
||||
var total = 0;
|
||||
for (final level in controller.showDifficultyLevels) {
|
||||
final count = controller.showDifficultyCount(category, level);
|
||||
total += count;
|
||||
}
|
||||
return '$category:$total个';
|
||||
}
|
||||
@ -6,6 +6,34 @@ import 'package:yd_pattern_scoring_system/core/models/prescribed_execution_rule.
|
||||
import 'package:yd_pattern_scoring_system/core/network/score_item_key_matcher.dart';
|
||||
|
||||
void main() {
|
||||
test('车轮跳表现裁判修正时按稳定编码回填已提交的五项加减数量', () {
|
||||
const dimensions = ['音乐', '完成质量', '娱乐', '创意', '多样性'];
|
||||
const codes = {
|
||||
'MUSIC_PLUS': '音乐',
|
||||
'MUSIC_MINUS': '音乐',
|
||||
'QUALITY_PLUS': '完成质量',
|
||||
'QUALITY_MINUS': '完成质量',
|
||||
'ENTERTAINMENT_PLUS': '娱乐',
|
||||
'ENTERTAINMENT_MINUS': '娱乐',
|
||||
'CREATIVITY_PLUS': '创意',
|
||||
'CREATIVITY_MINUS': '创意',
|
||||
'VARIETY_PLUS': '多样性',
|
||||
'VARIETY_MINUS': '多样性',
|
||||
};
|
||||
final restored = <String, int>{};
|
||||
for (final entry in codes.entries) {
|
||||
final dimension = ScoreItemKeyMatcher.performanceDimension(
|
||||
dimensions,
|
||||
itemCode: entry.key,
|
||||
label: '历史评分项',
|
||||
);
|
||||
expect(dimension, entry.value);
|
||||
restored[entry.key] = dimension == null ? 0 : 2;
|
||||
}
|
||||
expect(restored.length, 10);
|
||||
expect(restored.values, everyElement(2));
|
||||
});
|
||||
|
||||
test('规定赛完成质量项按稳定编码匹配平板控件', () {
|
||||
const keys = ['动作准确性', '动作熟练性', '动作合拍性'];
|
||||
const aliases = PrescribedExecutionRuleCatalog.serverItemAliases;
|
||||
|
||||
@ -16,8 +16,11 @@ void main() {
|
||||
onPressed: () => showSubmitConfirmation(
|
||||
correctionMode: false,
|
||||
details: const [
|
||||
SubmissionScoreDetail(label: '音乐', description: '减 1 / 加 2'),
|
||||
SubmissionScoreDetail(label: '完成质量', description: '评分项已完成录入'),
|
||||
SubmissionScoreDetail(label: '音乐', description: '音乐:加2次、减1次'),
|
||||
SubmissionScoreDetail(
|
||||
label: '完成质量',
|
||||
description: '完成质量:12.5分',
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Text('打开'),
|
||||
@ -32,8 +35,8 @@ void main() {
|
||||
|
||||
expect(find.text('确认提交成绩'), findsOneWidget);
|
||||
expect(find.text('评分内容(2项)'), findsOneWidget);
|
||||
expect(find.text('音乐'), findsOneWidget);
|
||||
expect(find.text('完成质量'), findsOneWidget);
|
||||
expect(find.text('音乐:加2次、减1次'), findsOneWidget);
|
||||
expect(find.text('完成质量:12.5分'), findsOneWidget);
|
||||
expect(find.textContaining('裁判总分'), findsNothing);
|
||||
expect(find.textContaining('本次裁判得分'), findsNothing);
|
||||
});
|
||||
|
||||
123
test/submission_score_details_test.dart
Normal file
123
test/submission_score_details_test.dart
Normal file
@ -0,0 +1,123 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:yd_pattern_scoring_system/core/models/deduction_rule_item.dart';
|
||||
import 'package:yd_pattern_scoring_system/core/models/judge_account.dart';
|
||||
import 'package:yd_pattern_scoring_system/core/storage/local_storage_service.dart';
|
||||
import 'package:yd_pattern_scoring_system/modules/scoring/controllers/scoring_controller.dart';
|
||||
import 'package:yd_pattern_scoring_system/modules/scoring/repositories/score_repository.dart';
|
||||
import 'package:yd_pattern_scoring_system/modules/scoring/widgets/submission_score_details.dart';
|
||||
|
||||
class _ScoreRepository extends Fake implements ScoreRepository {}
|
||||
|
||||
class _Storage extends Fake implements LocalStorageService {}
|
||||
|
||||
ScoringController _controller(ScoreRole role, CompetitionKind competition) {
|
||||
final controller = ScoringController(_ScoreRepository(), _Storage());
|
||||
controller.profile = JudgeAccount(
|
||||
account: 'test',
|
||||
name: '测试裁判',
|
||||
competition: competition,
|
||||
role: role,
|
||||
roleCode: role == ScoreRole.technical ? 'T' : 'P',
|
||||
seat: 1,
|
||||
);
|
||||
return controller;
|
||||
}
|
||||
|
||||
void main() {
|
||||
test('规定赛创意编排与完成质量逐项展示实际录入分值,包括零分', () {
|
||||
final creative = _controller(
|
||||
ScoreRole.creative,
|
||||
CompetitionKind.prescribed,
|
||||
);
|
||||
creative.performanceItems.assignAll({'过渡连接、成套创编、场地运用': 3.5, '现场表现效果': 0});
|
||||
final creativeDetails = buildSubmissionScoreDetails(creative);
|
||||
expect(creativeDetails.map((item) => item.description), [
|
||||
'过渡连接、成套创编、场地运用:3.5分',
|
||||
'现场表现效果:0分',
|
||||
]);
|
||||
|
||||
final execution = _controller(
|
||||
ScoreRole.execution,
|
||||
CompetitionKind.prescribed,
|
||||
);
|
||||
execution.performanceItems.assignAll({'动作准确性': 24, '动作熟练性': 12.5});
|
||||
final executionDetails = buildSubmissionScoreDetails(execution);
|
||||
expect(executionDetails.map((item) => item.label), ['动作准确性', '动作熟练性']);
|
||||
expect(executionDetails.map((item) => item.description), [
|
||||
'动作准确性:24分',
|
||||
'动作熟练性:12.5分',
|
||||
]);
|
||||
expect(
|
||||
executionDetails.any((item) => item.description == '评分项已完成录入'),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
|
||||
test('难度裁判列出规定元素与各等级的原始数量', () {
|
||||
final controller = _controller(
|
||||
ScoreRole.difficulty,
|
||||
CompetitionKind.individual,
|
||||
);
|
||||
controller.requiredElementCounts.assignAll({'n3+(3级及以上)': 2});
|
||||
controller.difficultyCounts.assignAll({'3': 4, '4': 0});
|
||||
final details = buildSubmissionScoreDetails(controller);
|
||||
expect(details.map((item) => item.description), [
|
||||
'n3+(3级及以上):2个',
|
||||
'3级难度:4个',
|
||||
'4级难度:0个',
|
||||
]);
|
||||
});
|
||||
|
||||
test('表现裁判展示加减和失误次数,主裁展示规定元素、扣分及取消资格原因', () {
|
||||
final performance = _controller(
|
||||
ScoreRole.presentation,
|
||||
CompetitionKind.individual,
|
||||
);
|
||||
performance.performanceItems['音乐'] = 12;
|
||||
performance.performancePlusCounts['音乐'] = 3;
|
||||
performance.performanceMinusCounts['音乐'] = 1;
|
||||
performance.performanceErrorCount.value = 2;
|
||||
final performanceDetails = buildSubmissionScoreDetails(performance);
|
||||
expect(performanceDetails.first.description, '音乐:加3次、人工减1次、失误联动减2次');
|
||||
expect(performanceDetails.last.description, '失误:2次');
|
||||
|
||||
final chief = _controller(ScoreRole.technical, CompetitionKind.individual);
|
||||
chief.requiredElementCounts['互动配合'] = 1;
|
||||
chief.deductionRules = DeductionRuleCatalog.forCompetition(
|
||||
CompetitionKind.individual,
|
||||
);
|
||||
chief.deductionCounts['失误'] = 2;
|
||||
chief.disqualified.value = true;
|
||||
chief.selectedDisqualifyReasonCode = 'GENERIC_NO_SHOW';
|
||||
chief.disqualifyRemark = '未到场';
|
||||
final chiefDetails = buildSubmissionScoreDetails(chief);
|
||||
expect(chiefDetails.first.description, '互动配合:1个');
|
||||
expect(
|
||||
chiefDetails.firstWhere((item) => item.label == '失误').description,
|
||||
'失误:2次',
|
||||
);
|
||||
expect(chiefDetails.last.description, '取消比赛资格:1项(GENERIC_NO_SHOW · 未到场)');
|
||||
});
|
||||
|
||||
test('表演赛难度 A 组按类别显示动作总数', () {
|
||||
final controller = _controller(ScoreRole.difficulty, CompetitionKind.show);
|
||||
controller.profile = const JudgeAccount(
|
||||
account: 'show-a',
|
||||
name: 'A组裁判',
|
||||
competition: CompetitionKind.show,
|
||||
role: ScoreRole.difficulty,
|
||||
roleCode: 'DGA',
|
||||
seat: 1,
|
||||
);
|
||||
final category = controller.showDifficultyCategories.first;
|
||||
controller.difficultyCategoryCounts['$category::3'] = 2;
|
||||
controller.difficultyCategoryCounts['$category::4'] = 1;
|
||||
final details = buildSubmissionScoreDetails(controller);
|
||||
expect(details.first.description, '$category:3个');
|
||||
expect(
|
||||
details[1].description,
|
||||
'${controller.showDifficultyCategories[1]}:0个',
|
||||
);
|
||||
});
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user