Compare commits
2 Commits
main
...
update_sco
| Author | SHA1 | Date |
|---|---|---|
|
|
1104862e84 | |
|
|
6a3601df9b |
|
|
@ -230,3 +230,4 @@ marking_app/lib/pages/homework_correction/widget/answer_handwriting.g.dart
|
|||
marking_app/lib/pages/report_detail/report_history.g.dart
|
||||
marking_app/lib/common/model/report/report_student_history_record.g.dart
|
||||
marking_app/lib/common/model/report/report_student_info.g.dart
|
||||
marking_app/lib/common/model/marking/marking_exam_status_flag.g.dart
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
enum KeyboardType {
|
||||
INPUT_TYPE, // 输入型
|
||||
RIGHT_SELECTION, // 右侧选择型
|
||||
BOTTOM_SELECTION // 底部选择型
|
||||
BOTTOM_SELECTION, // 底部选择型
|
||||
CLICK_TO_RATE_AND_REVIEW, // 点击打分批阅
|
||||
}
|
||||
|
||||
// 键盘排序规则
|
||||
|
|
@ -17,3 +18,12 @@ enum ScreenDirection {
|
|||
HORIZONTAL_SCREEN, // 横屏
|
||||
VERTICAL_SCREEN // 竖屏
|
||||
}
|
||||
|
||||
// 点击打分打分方式
|
||||
enum ClickOnScoringMethod {
|
||||
INCREMENTAL(title: '点击递增'),
|
||||
DECREASING(title: '点击递减');
|
||||
|
||||
const ClickOnScoringMethod({required this.title});
|
||||
final String title;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,6 +166,10 @@ class DoMarkingKeyboardModel extends Object {
|
|||
@JsonKey(name: 'commonScores', includeIfNull: false)
|
||||
MarkingCommonScoreItems? commonScores;
|
||||
|
||||
// 常用打分项
|
||||
@JsonKey(name: 'clickOnScoringMethod', includeIfNull: false)
|
||||
ClickOnScoringMethod? clickOnScoringMethod;
|
||||
|
||||
// 默认输入型键盘
|
||||
DoMarkingKeyboardModel({
|
||||
this.hideQuestionId = false,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'marking_exam_status_flag.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class MarkingExamStatusFlag extends Object {
|
||||
@JsonKey(name: 'markingUserDetailId')
|
||||
int markingUserDetailId;
|
||||
|
||||
@JsonKey(name: 'markingFlag')
|
||||
int? markingFlag;
|
||||
|
||||
MarkingExamStatusFlag({required this.markingUserDetailId, this.markingFlag});
|
||||
|
||||
factory MarkingExamStatusFlag.fromJson(Map<String, dynamic> srcJson) => _$MarkingExamStatusFlagFromJson(srcJson);
|
||||
|
||||
Map<String, dynamic> toJson() => _$MarkingExamStatusFlagToJson(this);
|
||||
}
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
* @FilePath: \marking_app\lib\common\model\marking\marking_text_question.dart
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:marking_app/common/model/marking/progress_of_marking.dart';
|
||||
import 'package:marking_app/utils/image/gallery_example_item_model.dart';
|
||||
|
|
@ -46,6 +44,10 @@ class MarkingTextQuestion extends Object {
|
|||
@JsonKey(name: 'subQuestionDetailList')
|
||||
List<SubQuestions> subQuestionDetailList;
|
||||
|
||||
// 点击打分 打分位置
|
||||
@JsonKey(name: 'scorePosition')
|
||||
List<ScorePositionModel> scorePosition;
|
||||
|
||||
// 当前试题位置
|
||||
// @JsonKey(name: 'questionIndex')
|
||||
// int questionIndex;
|
||||
|
|
@ -57,6 +59,9 @@ class MarkingTextQuestion extends Object {
|
|||
// @JsonKey(name: 'currentIndex')
|
||||
// int currentIndex;
|
||||
|
||||
@JsonKey(name: 'markingFlag') // 试题状态 默认null 1:优秀 2:错误卷
|
||||
int? markingFlag;
|
||||
|
||||
@JsonKey(name: 'lastOne')
|
||||
bool lastOne;
|
||||
|
||||
|
|
@ -126,6 +131,7 @@ class MarkingTextQuestion extends Object {
|
|||
this.scoreInterval = 1,
|
||||
this.markingProgress,
|
||||
this.completeRating = false,
|
||||
this.scorePosition = const [],
|
||||
this.originalPaperAbsoluteUrl = const [],
|
||||
// this.totalCount = 0,
|
||||
// this.currentIndex = 0,
|
||||
|
|
@ -159,7 +165,6 @@ class MarkingTextQuestion extends Object {
|
|||
// return HistoricalScoring.fromJson(e as Map<String, dynamic>);
|
||||
// }).toList();
|
||||
// }
|
||||
// TODO 删除
|
||||
// this.historicalScorings = [
|
||||
// HistoricalScoring.fromJson({'scorel': 1.5, 'name': 'wy', 'markingUserld': 121321231313}),
|
||||
// HistoricalScoring.fromJson({'scorel': 5, 'name': '汪杨', 'markingUserld': 121321231313})
|
||||
|
|
@ -290,3 +295,21 @@ class ExceptionInfo extends Object {
|
|||
|
||||
Map<String, dynamic> toJson() => _$ExceptionInfoToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ScorePositionModel extends Object {
|
||||
@JsonKey(name: 'position')
|
||||
List<dynamic> position;
|
||||
|
||||
@JsonKey(name: 'questionNum')
|
||||
String questionNum;
|
||||
|
||||
@JsonKey(name: 'subQuestionNum')
|
||||
String? subQuestionNum;
|
||||
|
||||
ScorePositionModel({required this.position, required this.questionNum, this.subQuestionNum});
|
||||
|
||||
factory ScorePositionModel.fromJson(Map<String, dynamic> srcJson) => _$ScorePositionModelFromJson(srcJson);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ScorePositionModelToJson(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,16 @@ class MarkingKeyboardSwitch extends ConsumerWidget {
|
|||
submitCall: submitCall,
|
||||
synchroScore: synchroScore,
|
||||
);
|
||||
case KeyboardType.CLICK_TO_RATE_AND_REVIEW:
|
||||
return SelectableKeyboard(
|
||||
data: data,
|
||||
markingUserId: markingUserId,
|
||||
subtopicIndex: subtopicIndex,
|
||||
questScore: questScore,
|
||||
totalScore: data.totalScore,
|
||||
submitCall: submitCall,
|
||||
synchroScore: synchroScore,
|
||||
);
|
||||
case KeyboardType.BOTTOM_SELECTION:
|
||||
return const SizedBox();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
late double scoreInterval; // 分值间隔设置
|
||||
late int keyboardIndex; // 键盘下标
|
||||
late bool autoSubmitToNextQuestion; // 提交并自动跳转下一题
|
||||
ClickOnScoringMethod? _clickOnScoringMethod; //点击打分计分方式
|
||||
late RemoveListener _markingKeyboardListener;
|
||||
MarkingCommonScoreItems? _commonScoreItems;
|
||||
@override
|
||||
|
|
@ -57,17 +58,15 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
// 当前
|
||||
_markingKeyboardListener = ref.read(markingKeyboardProvider.notifier).addListener((state) {
|
||||
MarkingCommonScoreItems? theCommonScores = state.commonScores;
|
||||
if (theCommonScores != null &&
|
||||
widget.questionNum == theCommonScores.questionNum &&
|
||||
widget.markingUserId == theCommonScores.id) {
|
||||
if (theCommonScores != null && widget.questionNum == theCommonScores.questionNum && widget.markingUserId == theCommonScores.id) {
|
||||
_commonScoreItems = state.commonScores;
|
||||
}
|
||||
keyboardModel = state;
|
||||
keyboardIndex = state.keyboard.index;
|
||||
sortType = state.sort;
|
||||
autoSubmitToNextQuestion = state.autoSubmitToNextQuestion;
|
||||
scoreInterval = state.getScoreStepSize(
|
||||
widget.markingUserId, widget.questionNum, widget.defaultScoreInterval); // 或者对应试卷和试题的步长
|
||||
_clickOnScoringMethod = state.clickOnScoringMethod;
|
||||
scoreInterval = state.getScoreStepSize(widget.markingUserId, widget.questionNum, widget.defaultScoreInterval); // 或者对应试卷和试题的步长
|
||||
isHorizontal = state.screenDirection == ScreenDirection.HORIZONTAL_SCREEN;
|
||||
|
||||
keyboardTypes = KeyboardType.values.map((e) {
|
||||
|
|
@ -112,54 +111,19 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
case KeyboardType.RIGHT_SELECTION:
|
||||
case KeyboardType.BOTTOM_SELECTION:
|
||||
// 底部键盘和右侧键盘
|
||||
model.setScoreStepSize(
|
||||
widget.markingUserId, widget.questionNum, widget.defaultScoreInterval, scoreInterval); // 设置分值
|
||||
model.setScoreStepSize(widget.markingUserId, widget.questionNum, widget.defaultScoreInterval, scoreInterval); // 设置分值
|
||||
model.sort = sortType;
|
||||
break;
|
||||
case KeyboardType.CLICK_TO_RATE_AND_REVIEW:
|
||||
// 点击打分 (打分步长、计分方式)
|
||||
model.clickOnScoringMethod = _clickOnScoringMethod;
|
||||
break;
|
||||
}
|
||||
model.screenDirection = keyboardModel.screenDirection;
|
||||
model.autoSubmitToNextQuestion = autoSubmitToNextQuestion;
|
||||
if (_commonScoreItems != null) model.commonScores = _commonScoreItems!.score.isNotEmpty ? _commonScoreItems : null;
|
||||
ref.read(markingKeyboardProvider.notifier).toggleKeyboard(model);
|
||||
setTimeOut(300, () => widget.close(true));
|
||||
|
||||
/// 取消保存数据确认按钮
|
||||
// showDialog(
|
||||
// // 表示点击灰色背景的时候是否消失弹出框
|
||||
// barrierDismissible: false,
|
||||
// context: context,
|
||||
// builder: (context1) {
|
||||
// return AlertDialog(content: quickText("请确定当前阅卷习惯配置?"), actions: <Widget>[
|
||||
// TextButton(
|
||||
// child: quickText("取消"),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context1, 'Cancle');
|
||||
// },
|
||||
// ),
|
||||
// TextButton(
|
||||
// child: quickText("确定", color: Theme.of(context).primaryColor),
|
||||
// onPressed: () {
|
||||
// TheDoMarkingKeyboardModel theCurrent = keyboardTypes[keyboardIndex]; // 当前选中的键盘
|
||||
// DoMarkingKeyboardModel model = theCurrent.model;
|
||||
// switch (model.keyboard) {
|
||||
// case KeyboardType.INPUT_TYPE:
|
||||
// // 输入型键盘
|
||||
// break;
|
||||
// case KeyboardType.RIGHT_SELECTION:
|
||||
// case KeyboardType.BOTTOM_SELECTION:
|
||||
// // 底部键盘和右侧键盘
|
||||
// model.setScoreStepSize(widget.markingUserId, widget.questionNum, widget.defaultScoreInterval, scoreInterval); // 设置分值
|
||||
// model.sort = sortType;
|
||||
// break;
|
||||
// }
|
||||
// model.screenDirection = keyboardModel.screenDirection;
|
||||
// model.autoSubmitToNextQuestion = autoSubmitToNextQuestion;
|
||||
// ref.read(markingKeyboardProvider.notifier).toggleKeyboard(model);
|
||||
// Navigator.pop(context1, 'Cancle');
|
||||
// setTimeOut(300, () => widget.close(true));
|
||||
// })
|
||||
// ]);
|
||||
// });
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -191,9 +155,9 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
getKeyboardBox(),
|
||||
getAutoNextQuestBox(),
|
||||
getScoreIntervalSetBox(),
|
||||
if (keyboardIndex != 0)
|
||||
if (keyboardIndex != KeyboardType.CLICK_TO_RATE_AND_REVIEW.index) getAutoNextQuestBox(), // 自动提交 点击打分不能自动提交
|
||||
getScoreIntervalSetBox(), // 分值间隔
|
||||
if (![0, KeyboardType.CLICK_TO_RATE_AND_REVIEW.index].contains(keyboardIndex))
|
||||
$CommonScoringList(
|
||||
score: widget.questTotalScore!,
|
||||
scoreInterval: scoreInterval,
|
||||
|
|
@ -208,6 +172,10 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
},
|
||||
),
|
||||
getSetScoringRulesBox(),
|
||||
$ClickOnScoringMethod(keyboardTypes[keyboardIndex].model.keyboard, _clickOnScoringMethod, (ClickOnScoringMethod mode) {
|
||||
_clickOnScoringMethod = mode;
|
||||
toUpState(setState, () {}, mounted);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -323,7 +291,7 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
|
||||
// 给分规则区域
|
||||
Widget getSetScoringRulesBox() {
|
||||
if (keyboardTypes[keyboardIndex].model.keyboard == KeyboardType.INPUT_TYPE) {
|
||||
if ([KeyboardType.INPUT_TYPE, KeyboardType.CLICK_TO_RATE_AND_REVIEW].contains(keyboardTypes[keyboardIndex].model.keyboard)) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
|
|
@ -342,9 +310,7 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
Wrap(
|
||||
children: SortKeyboard.values
|
||||
.where((element) => element != SortKeyboard.FULL_AND_AERO_TOP_INVERTED_ORDER)
|
||||
.map((e) {
|
||||
children: SortKeyboard.values.where((element) => element != SortKeyboard.FULL_AND_AERO_TOP_INVERTED_ORDER).map((e) {
|
||||
String title;
|
||||
switch (e) {
|
||||
case SortKeyboard.INVERTED_ORDER:
|
||||
|
|
@ -399,7 +365,7 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
|
||||
// 分值间隔设置
|
||||
Widget getScoreIntervalSetBox() {
|
||||
if (keyboardTypes[keyboardIndex].model.keyboard == KeyboardType.INPUT_TYPE) {
|
||||
if ([KeyboardType.INPUT_TYPE].contains(keyboardTypes[keyboardIndex].model.keyboard)) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
|
|
@ -413,8 +379,7 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
AchievementView(title: "分值间隔", subTitle: "设定当前题目的分数按钮的间隔分值", color: Theme.of(context).primaryColor)
|
||||
.show(context);
|
||||
AchievementView(title: "分值间隔", subTitle: "设定当前题目的分数按钮的间隔分值", color: Theme.of(context).primaryColor).show(context);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
|
|
@ -507,8 +472,6 @@ class _MarkingSetingState extends ConsumerState<MarkingSeting> {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showPopover(BuildContext context) {}
|
||||
}
|
||||
|
||||
class TheDoMarkingKeyboardModel {
|
||||
|
|
@ -527,6 +490,9 @@ class TheDoMarkingKeyboardModel {
|
|||
case KeyboardType.BOTTOM_SELECTION:
|
||||
title = '底部选择型键盘';
|
||||
break;
|
||||
case KeyboardType.CLICK_TO_RATE_AND_REVIEW:
|
||||
title = '点击打分';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -551,8 +517,7 @@ Widget $commonScoringList(BuildContext context,
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child:
|
||||
quickText('常用打分项', size: 14.sp, color: const Color.fromRGBO(45, 56, 76, 1), fontWeight: FontWeight.bold),
|
||||
child: quickText('常用打分项', size: 14.sp, color: const Color.fromRGBO(45, 56, 76, 1), fontWeight: FontWeight.bold),
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Expanded(
|
||||
|
|
@ -579,9 +544,7 @@ Widget $commonScoringList(BuildContext context,
|
|||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 1.h,
|
||||
color: isSelected
|
||||
? Theme.of(context).primaryColor.withOpacity(0.5)
|
||||
: const Color.fromRGBO(224, 230, 255, 1),
|
||||
color: isSelected ? Theme.of(context).primaryColor.withOpacity(0.5) : const Color.fromRGBO(224, 230, 255, 1),
|
||||
),
|
||||
color: isSelected ? Colors.white : Colors.grey[300],
|
||||
borderRadius: BorderRadius.all(Radius.circular(2.w)),
|
||||
|
|
@ -600,3 +563,51 @@ Widget $commonScoringList(BuildContext context,
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 点击打分打分方式
|
||||
@swidget
|
||||
Widget $clickOnScoringMethod(
|
||||
BuildContext context, KeyboardType keyboard, ClickOnScoringMethod? clickOnScoringMethod, Function(ClickOnScoringMethod) call) {
|
||||
if (keyboard != KeyboardType.CLICK_TO_RATE_AND_REVIEW) return SizedBox();
|
||||
|
||||
List<ClickOnScoringMethod> modes = ClickOnScoringMethod.values;
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 50.h),
|
||||
quickText(
|
||||
'计分方式',
|
||||
size: 14.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: const Color.fromRGBO(45, 56, 76, 1),
|
||||
),
|
||||
SizedBox(height: 12.h),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: modes.map((e) {
|
||||
return InkWell(
|
||||
onTap: () => call(e),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 20.w),
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 4.h),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4.r), boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
offset: Offset(1, 1), // 阴影与容器的距离
|
||||
blurRadius: 6.r, // 高斯的标准偏差与盒子的形状卷积。
|
||||
spreadRadius: 1.r,
|
||||
),
|
||||
]),
|
||||
child: quickText(
|
||||
e.title,
|
||||
size: 14.sp,
|
||||
color: clickOnScoringMethod == e ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 87, 103, 1),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:marking_app/common/model/enum/review_marks_bottom_btns_enum.dart';
|
||||
import 'package:marking_app/common/model/event_bus/bottom_annotation_switch_cleanall.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_text_question.dart';
|
||||
import 'package:marking_app/pages/common/event_bus_mixin.dart';
|
||||
import 'package:marking_app/utils/anti_shake_throttling.dart';
|
||||
import 'package:marking_app/utils/my_text.dart';
|
||||
|
|
@ -12,7 +13,9 @@ import '../provider/do_paper_bottom_review_marks_provider.dart';
|
|||
|
||||
// 底部批阅动作切换区域
|
||||
class DoPaperBottomReviewMarks extends StatefulHookConsumerWidget {
|
||||
const DoPaperBottomReviewMarks({super.key});
|
||||
final MarkingTextQuestion data;
|
||||
final Function(int) examStatusCall;
|
||||
const DoPaperBottomReviewMarks(this.data, this.examStatusCall, {super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<DoPaperBottomReviewMarks> createState() => _DoPaperBottomReviewMarksState();
|
||||
|
|
@ -35,6 +38,9 @@ class _DoPaperBottomReviewMarksState extends ConsumerState<DoPaperBottomReviewMa
|
|||
Widget build(BuildContext context) {
|
||||
var btnEnum = ref.watch(doPaperBottomReviewMarksProvider);
|
||||
Color actionColor = Theme.of(context).primaryColor.withOpacity(0.9);
|
||||
var markingFlag = widget.data.markingFlag; // 试卷状态 默认null 1:优秀 2:错误卷
|
||||
|
||||
print('状态:$markingFlag');
|
||||
return Positioned(
|
||||
left: 3.w,
|
||||
bottom: 6.h,
|
||||
|
|
@ -80,41 +86,77 @@ class _DoPaperBottomReviewMarksState extends ConsumerState<DoPaperBottomReviewMa
|
|||
icon: Icon(Icons.reply_outlined,
|
||||
color: btnEnum == ReviewMarksBottomBtnsEnum.RETURN_PREVIOUS_LEVEL ? actionColor : Colors.white, size: 34.r),
|
||||
),
|
||||
SizedBox(width: 4.w),
|
||||
SizedBox(width: 10.w),
|
||||
// 批阅痕迹 ==> 清空
|
||||
IconButton(
|
||||
onPressed: () => easyThrottle(
|
||||
// IconButton(
|
||||
// onPressed: () => easyThrottle(
|
||||
// 'REVIEW_MARKS_BOTTOM_BTNS',
|
||||
// duration: const Duration(milliseconds: 100),
|
||||
// () async {
|
||||
// var resFlag = await showDialog<bool>(
|
||||
// context: context,
|
||||
// builder: (BuildContext context) {
|
||||
// return CupertinoAlertDialog(
|
||||
// title: quickText('撤销批阅痕迹', size: 14.sp, color: Color.fromARGB(255, 53, 52, 52)),
|
||||
// content: SingleChildScrollView(
|
||||
// padding: EdgeInsets.only(top: 4.h),
|
||||
// child: RichText(text: TextSpan(text: '请确认需要撤销所有批阅痕迹?', style: TextStyle(color: Color.fromARGB(255, 58, 58, 58)))),
|
||||
// ),
|
||||
// actions: <Widget>[
|
||||
// CupertinoDialogAction(
|
||||
// child: Text("取消", style: TextStyle(color: Color.fromARGB(255, 58, 58, 58))),
|
||||
// onPressed: () => Navigator.of(context).pop(false),
|
||||
// ),
|
||||
// CupertinoDialogAction(
|
||||
// child: Text("确定"),
|
||||
// onPressed: () => Navigator.of(context).pop(true),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// if (resFlag == true) eventFire(model: BottomAnnotationSwitchCleanallOfMarking(cleanAll: true));
|
||||
// },
|
||||
// ),
|
||||
// padding: EdgeInsets.zero,
|
||||
// icon: Icon(Icons.reply_all_outlined, color: btnEnum == ReviewMarksBottomBtnsEnum.CLEAR_ALL ? actionColor : Colors.white, size: 34.r),
|
||||
// ),
|
||||
GestureDetector(
|
||||
onTap: () => easyThrottle(
|
||||
'REVIEW_MARKS_BOTTOM_BTNS',
|
||||
duration: const Duration(milliseconds: 100),
|
||||
() async {
|
||||
var resFlag = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: quickText('撤销批阅痕迹', size: 14.sp, color: Color.fromARGB(255, 53, 52, 52)),
|
||||
content: SingleChildScrollView(
|
||||
padding: EdgeInsets.only(top: 4.h),
|
||||
child: RichText(text: TextSpan(text: '请确认需要撤销所有批阅痕迹?', style: TextStyle(color: Color.fromARGB(255, 58, 58, 58)))),
|
||||
),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: Text("取消", style: TextStyle(color: Color.fromARGB(255, 58, 58, 58))),
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text("确定"),
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
if (resFlag == true) eventFire(model: BottomAnnotationSwitchCleanallOfMarking(cleanAll: true));
|
||||
},
|
||||
() async => widget.examStatusCall(1),
|
||||
),
|
||||
child: quickText(
|
||||
'优',
|
||||
size: 23.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: markingFlag == 1 ? Theme.of(context).primaryColor : Colors.white,
|
||||
),
|
||||
padding: EdgeInsets.zero,
|
||||
icon: Icon(Icons.reply_all_outlined, color: btnEnum == ReviewMarksBottomBtnsEnum.CLEAR_ALL ? actionColor : Colors.white, size: 34.r),
|
||||
),
|
||||
SizedBox(width: 5.w),
|
||||
GestureDetector(
|
||||
onTap: () => easyThrottle(
|
||||
'REVIEW_MARKS_BOTTOM_BTNS',
|
||||
duration: const Duration(milliseconds: 100),
|
||||
() async => widget.examStatusCall(2),
|
||||
),
|
||||
child: quickText(
|
||||
'错',
|
||||
size: 23.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: markingFlag == 2 ? Theme.of(context).primaryColor : Colors.white,
|
||||
),
|
||||
),
|
||||
// IconButton(
|
||||
// onPressed: () => easyThrottle(
|
||||
// 'REVIEW_MARKS_BOTTOM_BTNS',
|
||||
// duration: const Duration(milliseconds: 100),
|
||||
// () async {},
|
||||
// ),
|
||||
// padding: EdgeInsets.zero,
|
||||
// icon: Icon(Icons.reply_all_outlined, color: btnEnum == ReviewMarksBottomBtnsEnum.CLEAR_ALL ? actionColor : Colors.white, size: 34.r),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -31,9 +31,11 @@ import 'package:marking_app/common/model/enum/KeyboardType.dart';
|
|||
import 'package:marking_app/common/model/enum/marking_list_type.dart';
|
||||
import 'package:marking_app/common/model/enum/review_marks_bottom_btns_enum.dart';
|
||||
import 'package:marking_app/common/model/event_bus/bottom_annotation_switch_cleanall.dart';
|
||||
import 'package:marking_app/common/model/job/upload_file_interface_config_params.dart';
|
||||
import 'package:marking_app/common/model/marking/current_review_task.dart';
|
||||
import 'package:marking_app/common/model/marking/do_marking_keyboard_model.dart';
|
||||
import 'package:marking_app/common/model/marking/keyboard_assist_event.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_exam_status_flag.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_tag_single_params.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_text_question.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_text_question_params.dart';
|
||||
|
|
@ -312,6 +314,13 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> toMarkingFlag(int markingUserDetailId, int? markingFlag) async {
|
||||
// toMarkingFlag
|
||||
var _client = await getClient();
|
||||
var res = await _client.toMarkingFlag(MarkingExamStatusFlag(markingUserDetailId: markingUserDetailId, markingFlag: markingFlag));
|
||||
if (res.success) toUpState(setState, () => currentQuestion?.markingFlag = markingFlag, mounted);
|
||||
}
|
||||
|
||||
// 查看答案
|
||||
void viewAnswer() async {
|
||||
String? questionNum = currentQuestion?.questionNum;
|
||||
|
|
@ -1933,7 +1942,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
|
|||
},
|
||||
),
|
||||
),
|
||||
|
||||
$ExamStatusBox(data), // 试卷状态
|
||||
// 大题评分展示框
|
||||
if (!hasSubtopic)
|
||||
Positioned(
|
||||
|
|
@ -1953,10 +1962,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
|
|||
data.completeRating
|
||||
? getDoubleRemoveZero(data.score)
|
||||
: '请评分,满分${getDoubleRemoveZero(currentQuestion?.totalScore)}',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: const Color.fromRGBO(46, 91, 255, 1),
|
||||
),
|
||||
style: TextStyle(fontSize: 18.sp, color: const Color.fromRGBO(46, 91, 255, 1)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -2002,7 +2008,10 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
|
|||
),
|
||||
),
|
||||
// 底部批阅痕迹按钮
|
||||
DoPaperBottomReviewMarks(),
|
||||
DoPaperBottomReviewMarks(data, (e) async {
|
||||
// 试卷状态切换
|
||||
await toMarkingFlag(data.id, data.markingFlag == e ? null : e);
|
||||
}),
|
||||
// 下一题 按钮
|
||||
if (!_theOldAnnotationGraffiti && pressedNextTest != null && isNormal)
|
||||
Positioned(
|
||||
|
|
@ -2756,3 +2765,74 @@ Widget $arbitrationQuestionInfo({required bool show, required bool isBroadwise,
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 试卷状态 优秀卷 错误卷 默认卷
|
||||
@hwidget
|
||||
Widget $examStatusBox(MarkingTextQuestion? data) {
|
||||
ValueNotifier<int> markingFlag = useState(data?.markingFlag ?? 0);
|
||||
|
||||
useValueChanged<int?, void>(data?.markingFlag, (oldValue, oldResult) {
|
||||
markingFlag.value = data?.markingFlag ?? 0;
|
||||
});
|
||||
|
||||
if (data == null || data.markingFlag == null || markingFlag.value == 0) return Container();
|
||||
|
||||
var _strVal = markingFlag.value == 1 ? '优' : '错';
|
||||
return Positioned(
|
||||
top: 60.h,
|
||||
left: 4.w,
|
||||
child: CustomPaint(
|
||||
painter: CircleWithText(_strVal),
|
||||
size: Size(90.r, 90.r), // 设置你需要的尺寸
|
||||
),
|
||||
// Container(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 6.w, vertical: 10.h),
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(100.r),
|
||||
// border: Border.all(width: 10.r, color: Colors.red),
|
||||
// ),
|
||||
// child: quickText(markingFlag.value == 1 ? '优秀' : '错误'),
|
||||
// ),
|
||||
);
|
||||
}
|
||||
|
||||
class CircleWithText extends CustomPainter {
|
||||
final String textVal;
|
||||
const CircleWithText(this.textVal);
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final paint = Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 5.r
|
||||
..color = Colors.red.withOpacity(0.8);
|
||||
|
||||
// 绘制红色圆圈边框
|
||||
final radius = size.width / 2; // 假设宽高相等,取宽度的一半作为半径
|
||||
canvas.drawCircle(Offset(size.width / 2, size.height / 2), radius, paint);
|
||||
|
||||
// 绘制“优”字
|
||||
final textSpan = TextSpan(text: textVal, style: TextStyle(color: Colors.red.withOpacity(0.8), fontWeight: FontWeight.bold, fontSize: 44.sp));
|
||||
|
||||
final textPainter =
|
||||
TextPainter(text: TextSpan(children: [textSpan]), textDirection: TextDirection.ltr, textAlign: TextAlign.center, textScaleFactor: 1.0);
|
||||
|
||||
// 只设置maxWidth,因为TextPainter.layout不需要maxHeight
|
||||
textPainter.layout(maxWidth: size.width);
|
||||
|
||||
// 计算文本绘制的偏移量,使其居中
|
||||
final offset = Offset(
|
||||
(size.width - textPainter.width) / 2,
|
||||
(size.height - textPainter.height) / 2,
|
||||
);
|
||||
|
||||
// 注意:这里textPainter.height可能不准确,因为TextPainter默认不会自动换行
|
||||
// 如果需要精确控制文本在圆中的位置,可能需要手动调整偏移量
|
||||
|
||||
textPainter.paint(canvas, offset);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(CustomPainter oldDelegate) {
|
||||
return oldDelegate != this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import 'package:marking_app/common/model/job/review_again_list_params.dart';
|
|||
import 'package:marking_app/common/model/job/upload_file_interface_config.dart';
|
||||
import 'package:marking_app/common/model/job/upload_file_interface_config_params.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_abnormal_res.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_exam_status_flag.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_item.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_list_params.dart';
|
||||
import 'package:marking_app/common/model/marking/marking_statistics.dart';
|
||||
|
|
@ -194,6 +195,9 @@ abstract class RestClient {
|
|||
@the_retrofit.GET("/api/Upload")
|
||||
Future<BaseStructureResult<UploadFileInterfaceConfig>> getMarkingUploadFile(@the_retrofit.Queries() UploadFileInterfaceConfigParams params);
|
||||
|
||||
// 阅卷 => 上传图片请求参数
|
||||
@the_retrofit.PUT("/api/marking/flag")
|
||||
Future<BaseStructureResult> toMarkingFlag(@the_retrofit.Body() MarkingExamStatusFlag params);
|
||||
// ------------------------------------------ 作业 ------------------------------------------
|
||||
|
||||
// 作业 => 作业列表
|
||||
|
|
|
|||
Loading…
Reference in New Issue