no message

This commit is contained in:
1147192855@qq.com 2024-05-06 08:59:21 +08:00
parent cf7870c05f
commit 84f9d7a4ea
2 changed files with 144 additions and 395 deletions

View File

@ -165,8 +165,7 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
crypto.Digest fileMd5 = crypto.md5.convert(await temFile!.readAsBytes()); crypto.Digest fileMd5 = crypto.md5.convert(await temFile!.readAsBytes());
RestClient _client = await getClient(); RestClient _client = await getClient();
BaseStructureResult<UploadFileInterfaceConfig> resUploadConfig = BaseStructureResult<UploadFileInterfaceConfig> resUploadConfig = await _client.getUploadFile(UploadFileInterfaceConfigParams(
await _client.getUploadFile(UploadFileInterfaceConfigParams(
fileName: '1.png', fileName: '1.png',
fileMd5: fileMd5.toString(), fileMd5: fileMd5.toString(),
contentLength: temFile!.lengthSync(), contentLength: temFile!.lengthSync(),
@ -179,8 +178,7 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
if (resUploadConfig.data!.uploadUri == null) { if (resUploadConfig.data!.uploadUri == null) {
return FileResult(myObject: '', success: true, url: resUploadConfig.data!.downloadUri); return FileResult(myObject: '', success: true, url: resUploadConfig.data!.downloadUri);
} }
FileResult? resFile = FileResult? resFile = await ref.read(uploadFileProvider.notifier).getUploadFileConfig(resUploadConfig.data!, temFile!);
await ref.read(uploadFileProvider.notifier).getUploadFileConfig(resUploadConfig.data!, temFile!);
// FileResult? resFile = await ref // FileResult? resFile = await ref
// .read(uploadFileProvider.notifier) // .read(uploadFileProvider.notifier)
// .uploadFile(temFile!.path, widget.imageItems[currentIndex], ref.read(userProvider).id.toString()); // .uploadFile(temFile!.path, widget.imageItems[currentIndex], ref.read(userProvider).id.toString());
@ -230,7 +228,6 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
DoMarkingKeyboardModel _model = ref.watch(markingKeyboardProvider);
return Container( return Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
@ -259,8 +256,7 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
}, },
imageBuilder: (context, imageProvider) { imageBuilder: (context, imageProvider) {
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth); Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
if (imagInfoModel == null || if (imagInfoModel == null || (imagInfoModel?.boxHeight != containerHeight || imagInfoModel?.boxWidth != containerWidth)) {
(imagInfoModel?.boxHeight != containerHeight || imagInfoModel?.boxWidth != containerWidth)) {
if (_imageStreamListener != null) _imageStream?.removeListener(_imageStreamListener!); if (_imageStreamListener != null) _imageStream?.removeListener(_imageStreamListener!);
_imageStreamListener = ImageStreamListener((ImageInfo info, bool _) { _imageStreamListener = ImageStreamListener((ImageInfo info, bool _) {
imagInfoModel = TestQuestionsImageInfo( imagInfoModel = TestQuestionsImageInfo(
@ -303,24 +299,25 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
// //
class ExamPaperDrawing extends StatefulHookConsumerWidget { class ExamPaperDrawing extends StatefulHookConsumerWidget {
String imgUrl; // String imgUrl;
bool homework; bool homework;
BoxDecoration? decoration; BoxDecoration? decoration;
AnnotationGraffitiSwitch graffitiSwitch; AnnotationGraffitiSwitch graffitiSwitch;
List<GestureRecording>? points; List<GestureRecording>? points;
List<dynamic>? pointsPureData; List<dynamic>? pointsPureData;
ValueNotifier<Map<String, ui.Image>> imageLoaded; ValueNotifier<Map<String, ui.Image>> imageLoaded;
Widget child;
GlobalKey globalKey; GlobalKey globalKey;
// Function(String) imageCall; // Function(String) imageCall;
ExamPaperDrawing({ ExamPaperDrawing({
required this.imgUrl, // required this.imgUrl,
required this.homework, required this.homework,
required this.points, required this.points,
required this.pointsPureData, required this.pointsPureData,
required this.graffitiSwitch, required this.graffitiSwitch,
required this.globalKey, required this.globalKey,
required this.imageLoaded, required this.imageLoaded,
required this.child,
this.decoration, this.decoration,
Key? key, Key? key,
}) : super(key: key); }) : super(key: key);
@ -329,54 +326,17 @@ class ExamPaperDrawing extends StatefulHookConsumerWidget {
_ExamPaperDrawingState createState() => _ExamPaperDrawingState(); _ExamPaperDrawingState createState() => _ExamPaperDrawingState();
} }
class _ExamPaperDrawingState extends ConsumerState<ExamPaperDrawing> class _ExamPaperDrawingState extends ConsumerState<ExamPaperDrawing> with EventBusMixin<BottomAnnotationSwitchCleanall> {
with EventBusMixin<BottomAnnotationSwitchCleanall> {
late Future<ui.Image?> _future; //
// //
late List<GestureRecording> points; late List<GestureRecording> points;
late List<dynamic> pointsPureData; late List<dynamic> pointsPureData;
// //
bool _isEraserPressed = false; // Offset? globalPosition; //
Offset? _eraserPosition; //
Offset? globalPosition = null; //
Future<ui.Image?> loadImage(String url) async {
try {
Map<String, ui.Image> map = widget.imageLoaded.value;
ui.Image? image = map[url];
if (image != null) {
return image;
}
final httpClient = HttpClient();
final request = await httpClient.getUrl(Uri.parse(url));
final response = await request.close();
final bytes = await consolidateHttpClientResponseBytes(response);
final codec = await ui.instantiateImageCodec(bytes);
final frame = await codec.getNextFrame();
ui.Image theImage = frame.image;
map[url] = theImage;
return theImage;
} catch (e) {
print('请求图片报错:${e.toString()}');
}
return null;
}
// void _onPointerDown(DragDownDetails details) {
// if (widget.graffitiSwitch.openEraser) {
// _eraserPosition = (context.findRenderObject() as RenderBox).globalToLocal(details.globalPosition);
// _isEraserPressed = true;
// toUpState(setState, ()=>{}, mounted);
// }
// }
@override @override
void initState() { void initState() {
points = widget.points ?? []; points = widget.points ?? [];
pointsPureData = widget.pointsPureData ?? []; pointsPureData = widget.pointsPureData ?? [];
print('图片地址:${widget.imgUrl}');
_future = loadImage(widget.imgUrl);
// 线 // 线
eventOn(callback: (BottomAnnotationSwitchCleanall item) { eventOn(callback: (BottomAnnotationSwitchCleanall item) {
if (item.previousStep) { if (item.previousStep) {
@ -434,190 +394,79 @@ class _ExamPaperDrawingState extends ConsumerState<ExamPaperDrawing>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MyFutureBuilder.buildFutureBuilderOfSingleInstance<ui.Image>( return Listener(
context,
_future,
(ui.Image? theImage) {
if (theImage == null) return const Center(child: Text('图片加载错误'));
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
final double containerWidth = constraints.maxWidth; //
final double containerHeight = constraints.maxHeight; //
final double imageWidth = theImage.width.toDouble(); //
final double imageHeight = theImage.height.toDouble(); //
final double widthRatio = containerWidth / imageWidth; //
final double heightRatio = containerHeight / imageHeight;
final double scale = widthRatio > heightRatio ? heightRatio : widthRatio;
final double destWidth = imageWidth * scale;
final double destHeight = imageHeight * scale;
final bool homework = widget.homework;
return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onPanUpdate: (DragUpdateDetails details) { onPointerMove: (PointerMoveEvent details) {
if (globalPosition != null) { if (globalPosition != null) {
// //
double dx = globalPosition!.dx; double dx = globalPosition!.dx;
double dy = globalPosition!.dy; double dy = globalPosition!.dy;
double dxNew = details.globalPosition.dx; double dxNew = details.localPosition.dx;
double dyNew = details.globalPosition.dy; double dyNew = details.localPosition.dy;
if ((dxNew - dx).abs() > 22 || (dyNew - dy).abs() > 22) { if ((dxNew - dx).abs() > 22 || (dyNew - dy).abs() > 22) {
return; return;
} }
} }
globalPosition = details.globalPosition; globalPosition = details.localPosition;
try { try {
if (widget.graffitiSwitch.openBrush || widget.graffitiSwitch.openEraser) { // if (widget.graffitiSwitch.openBrush || widget.graffitiSwitch.openEraser) {
RenderBox renderBox = context.findRenderObject() as RenderBox; RenderBox renderBox = context.findRenderObject() as RenderBox;
Offset localPosition = renderBox.globalToLocal(details.globalPosition); Offset localPosition = renderBox.globalToLocal(details.localPosition);
pointsPureData = List.from(pointsPureData)..add(localPosition); pointsPureData = List.from(pointsPureData)..add(localPosition);
points = List.from(points) points = List.from(points)..add(GestureRecording(eraser: widget.graffitiSwitch.openEraser, data: localPosition));
..add(GestureRecording(eraser: widget.graffitiSwitch.openEraser, data: localPosition));
_eraserPosition = localPosition;
_isEraserPressed = true;
setState(() {}); setState(() {});
} // }
} catch (e) { } catch (e) {
toPrint(val: '进入报错'); toPrint(val: '进入报错');
} }
}, },
onPanEnd: (DragEndDetails details) { onPointerUp: (PointerUpEvent details) {
print('离开.............'); print('离开.............');
globalPosition = null; globalPosition = null;
if (widget.graffitiSwitch.openBrush || widget.graffitiSwitch.openEraser) { if (widget.graffitiSwitch.openBrush || widget.graffitiSwitch.openEraser) {
pointsPureData.add(null); // 线 pointsPureData.add(null); // 线
points.add(GestureRecording(eraser: widget.graffitiSwitch.openEraser)); points.add(GestureRecording(eraser: widget.graffitiSwitch.openEraser));
_isEraserPressed = false;
_eraserPosition = null;
} }
}, },
child: RepaintBoundary( child: RepaintBoundary(
key: widget.globalKey, key: widget.globalKey,
child: CustomPaint( child: CustomPaint(
// isComplex: true, foregroundPainter: DrawingPainter(points: points),
// willChange: true, child: widget.child,
painter: DrawingPainter(
image: theImage,
points: points,
isErasing: widget.graffitiSwitch.openEraser,
destWidth: destWidth,
destHeight: destHeight,
imageWidth: imageWidth,
imageHeight: imageHeight,
homework: homework,
containerWidth: containerWidth,
containerHeight: containerHeight,
),
// size: Size(homework ? containerWidth : destWidth, homework ? containerHeight : destHeight),
size: Size(containerWidth, containerHeight),
), ),
), ),
); );
},
);
},
);
} }
} }
class DrawingPainter extends CustomPainter { class DrawingPainter extends CustomPainter {
final List<GestureRecording> points; final List<GestureRecording> points;
final bool isErasing; DrawingPainter({required this.points}) : super();
final ui.Image image;
final bool homework;
final double containerWidth;
final double containerHeight;
double destWidth;
double destHeight;
final double imageWidth;
final double imageHeight;
// final Rect destRect; final Paint paintBrush = Paint()
// final Rect srcRect;
final bool openErasing;
DrawingPainter({
required this.homework,
required this.points,
required this.isErasing,
required this.image,
required this.destWidth,
required this.destHeight,
required this.containerWidth,
required this.containerHeight,
required this.imageWidth,
required this.imageHeight,
}) :
// destRect = Rect.fromLTWH(0, 0,destWidth,destHeight),
// srcRect = Rect.fromLTWH(0, 0, imageWidth, imageHeight),
openErasing = points.isNotEmpty && isErasing,
super();
Paint paintBrush = Paint()
..color = Colors.red ..color = Colors.red
..strokeCap = StrokeCap.round ..strokeCap = StrokeCap.round
..strokeWidth = 1.5; ..strokeWidth = 1.5.r;
Paint eraser = Paint()
..blendMode = BlendMode.clear
..color = Colors.transparent
..style = PaintingStyle.stroke
..strokeCap = StrokeCap.round
..strokeWidth = 100;
final emptyPaint = Paint();
final emptyPaintWithWidth = Paint()..strokeWidth = 60.0;
@override @override
void paint(Canvas canvas, Size size) { void paint(Canvas canvas, Size size) {
double offsetX = (size.width - destWidth) / 2; print('数据.....................');
double offsetY = (size.height - destHeight) / 2; for (int i = 0; i < points.length; i++) {
if (destWidth < (size.width / 2)) {
destWidth = size.width / 2;
offsetX = (size.width - destWidth) / 2;
}
// final rect = Rect.fromCenter(center: center, width: destWidth, height: destHeight);
Rect srcRect = Rect.fromLTRB(0, 0, image.width.toDouble(), image.height.toDouble());
// Rect destRect = Rect.fromLTRB(offsetX, offsetY, containerWidth, containerHeight);
Rect destRect = Offset(offsetX, offsetY) & Size(destWidth, destHeight);
canvas.drawImageRect(image, srcRect, destRect, emptyPaint);
// canvas.drawImage(image, Offset.zero, emptyPaint);
if (points.isNotEmpty) {
// canvas.saveLayer(destRect, emptyPaintWithWidth); //
canvas.saveLayer(Rect.largest, emptyPaintWithWidth); //
canvas.drawColor(Colors.transparent, BlendMode.clear);
}
for (int i = 0; i < points.length - 1; i++) {
GestureRecording item = points[i]; GestureRecording item = points[i];
GestureRecording nextItem = points[i + 1]; GestureRecording nextItem = points[i + 1];
Offset? offsetData = item.data; Offset? offsetData = item.data;
Offset? nextOffsetData = nextItem.data; Offset? nextOffsetData = nextItem.data;
if (offsetData != null && nextOffsetData != null) { if (offsetData != null && nextOffsetData != null) {
canvas.drawLine(offsetData, nextOffsetData, !item.eraser ? paintBrush : eraser); canvas.drawLine(offsetData, nextOffsetData, paintBrush);
} }
} }
// .
if (points.isNotEmpty) canvas.restore();
} }
// @override
// bool shouldRepaint(DrawingPainter oldDelegate) {
// List<GestureRecording> thePoints = oldDelegate.points;
// // var flag = oldDelegate.points != points || oldDelegate.isErasing != isErasing;
// return thePoints != points;
// }
@override @override
bool shouldRepaint(DrawingPainter oldDelegate) => true; bool shouldRepaint(DrawingPainter oldDelegate) {
return oldDelegate.points.length != points.length || oldDelegate.points != points;
}
} }
/** /**
@ -802,9 +651,7 @@ Widget $localAndNetworkSwitch(
useValueChanged<bool, String>(drawFlag, (oldValue, oldResult) { useValueChanged<bool, String>(drawFlag, (oldValue, oldResult) {
if (!drawFlag) { if (!drawFlag) {
// //
_useSwitch _useSwitch.createTempFile(context, theglobalKey: theglobalKey, examGlobalKey: examGlobalKey).then((File? theFile) {
.createTempFile(context, theglobalKey: theglobalKey, examGlobalKey: examGlobalKey)
.then((File? theFile) {
if (theFile == null) { if (theFile == null) {
// TODO // TODO
// _useSwich.showZoomImg.value true还是展示的原来的绘图组件ExamPaperDrawing // _useSwich.showZoomImg.value true还是展示的原来的绘图组件ExamPaperDrawing
@ -832,40 +679,7 @@ Widget $localAndNetworkSwitch(
}, []); }, []);
print('是否更新视图.... ${_useZoomHistory.initPosition.value}'); print('是否更新视图.... ${_useZoomHistory.initPosition.value}');
return _useSwitch.showZoomImg.value return ExamPaperDrawing(
?
/**
Scrollbar(
// thumbVisibility: true,
thumbVisibility: true,
controller: _useScrollController,
child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical, //
child: Transform.scale(
scale: 0.4,
alignment: Alignment.topCenter,
child: $MyCachedNetworkImage(
imageUrl: imageUrl,
tempFile: _useSwitch.temFile.value,
width: containerWidth,
height: containerHeight,
),
),
),
)*/
/** */
$MyCachedNetworkImage(
imageUrl: imageUrl,
tempFile: _useSwitch.temFile.value,
width: containerWidth,
height: containerHeight,
imageBuilder: imageBuilder,
)
: ExamPaperDrawing(
imgUrl: imageUrl,
graffitiSwitch: graffitiSwitch, graffitiSwitch: graffitiSwitch,
points: _useSwitch.points.value, points: _useSwitch.points.value,
pointsPureData: _useSwitch.pointsPureData.value, pointsPureData: _useSwitch.pointsPureData.value,
@ -874,7 +688,13 @@ Widget $localAndNetworkSwitch(
key: examGlobalKey, key: examGlobalKey,
imageLoaded: _useSwitch.imageLoaded, imageLoaded: _useSwitch.imageLoaded,
homework: homework, homework: homework,
// imageCall: (String str) => widget.imageCall(str, currentIndex), child: $MyCachedNetworkImage(
imageUrl: imageUrl,
tempFile: _useSwitch.temFile.value,
width: containerWidth,
height: containerHeight,
imageBuilder: imageBuilder,
),
); );
} }

View File

@ -44,6 +44,7 @@ import 'package:marking_app/common/model/marking/submit_exam_small_params.dart';
import 'package:marking_app/common/model/marking/switch_keyboard_to_reload_images.dart'; import 'package:marking_app/common/model/marking/switch_keyboard_to_reload_images.dart';
import 'package:marking_app/components/PictureOverview.dart'; import 'package:marking_app/components/PictureOverview.dart';
import 'package:marking_app/components/marking/bottom_annotation_switch.dart';
import 'package:marking_app/components/marking/marking_keyboard_switch.dart'; import 'package:marking_app/components/marking/marking_keyboard_switch.dart';
import 'package:marking_app/components/marking/marking_question_type_drawer.dart'; import 'package:marking_app/components/marking/marking_question_type_drawer.dart';
import 'package:marking_app/components/marking/marking_seting.dart'; import 'package:marking_app/components/marking/marking_seting.dart';
@ -174,9 +175,8 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
screenDirectionSwitch(state.screenDirection); screenDirectionSwitch(state.screenDirection);
} else { } else {
ScreenDirection nowScreenDirection = state.screenDirection; // ScreenDirection nowScreenDirection = state.screenDirection; //
ScreenDirection theOrientation = MediaQuery.of(context).orientation == Orientation.landscape ScreenDirection theOrientation =
? ScreenDirection.HORIZONTAL_SCREEN MediaQuery.of(context).orientation == Orientation.landscape ? ScreenDirection.HORIZONTAL_SCREEN : ScreenDirection.VERTICAL_SCREEN;
: ScreenDirection.VERTICAL_SCREEN;
if (theOrientation != nowScreenDirection) { if (theOrientation != nowScreenDirection) {
screenDirectionSwitch(nowScreenDirection); screenDirectionSwitch(nowScreenDirection);
} }
@ -243,8 +243,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
bool isHorizontal = direction == ScreenDirection.HORIZONTAL_SCREEN; bool isHorizontal = direction == ScreenDirection.HORIZONTAL_SCREEN;
Future.delayed(Duration.zero, () { Future.delayed(Duration.zero, () {
SystemChrome.setPreferredOrientations( SystemChrome.setPreferredOrientations([isHorizontal ? DeviceOrientation.landscapeLeft : DeviceOrientation.portraitUp]);
[isHorizontal ? DeviceOrientation.landscapeLeft : DeviceOrientation.portraitUp]);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
setTimeOut(1000, () => toUpState(setState, () => annotationsFlag = true, mounted)); setTimeOut(1000, () => toUpState(setState, () => annotationsFlag = true, mounted));
}); });
@ -260,8 +259,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
return null; return null;
} }
currentQuestion!.papersUrlStr = paperUrls; currentQuestion!.papersUrlStr = paperUrls;
currentQuestion!.papersUrl = currentQuestion!.papersUrl = paperUrls.asMap().keys.map((e) => GalleryExampleItemModel(id: e.toString(), resource: paperUrls[e])).toList();
paperUrls.asMap().keys.map((e) => GalleryExampleItemModel(id: e.toString(), resource: paperUrls[e])).toList();
return currentQuestion!.papersUrl; return currentQuestion!.papersUrl;
} }
@ -426,8 +424,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
Future<void> submitTestQuestions(BuildContext theContext, MarkingTextQuestion data) async { Future<void> submitTestQuestions(BuildContext theContext, MarkingTextQuestion data) async {
Timer timer = Timer(const Duration(milliseconds: 300), () => ToastUtils.showLoading()); Timer timer = Timer(const Duration(milliseconds: 300), () => ToastUtils.showLoading());
try { try {
if (widget.markingtype == MarkingListType.NORMAL && currentQuestion!.isException) if (widget.markingtype == MarkingListType.NORMAL && currentQuestion!.isException) return ToastUtils.showError('异常题,不允许再评分');
return ToastUtils.showError('异常题,不允许再评分');
if (currentQuestion == null) { if (currentQuestion == null) {
return ToastUtils.showError('提交失败,请退出重试。'); return ToastUtils.showError('提交失败,请退出重试。');
@ -762,8 +759,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
bool isReview = widget.isReview; bool isReview = widget.isReview;
if (theId != null && _currentTab != null && theQuestionNum != _currentTab!.questionNum) { if (theId != null && _currentTab != null && theQuestionNum != _currentTab!.questionNum) {
MarkingTextQuestionTab? _foundCrrentTab = MarkingTextQuestionTab? _foundCrrentTab = _currentTabs.firstWhereOrNull((element) => element.questionNum == theQuestionNum);
_currentTabs.firstWhereOrNull((element) => element.questionNum == theQuestionNum);
if (_foundCrrentTab != null) { if (_foundCrrentTab != null) {
_currentTab = _foundCrrentTab; _currentTab = _foundCrrentTab;
} }
@ -791,11 +787,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
// score: continueScoring hasSubtopic; cleanScore: // score: continueScoring hasSubtopic; cleanScore:
Future<void> synchroScore( Future<void> synchroScore(
{required double score, {required double score, required bool continueScoring, required bool hasSubtopic, bool allWrong = false, bool cleanScore = false}) async {
required bool continueScoring,
required bool hasSubtopic,
bool allWrong = false,
bool cleanScore = false}) async {
if (currentQuestion == null) return; if (currentQuestion == null) return;
if (cleanScore) { if (cleanScore) {
@ -879,8 +871,8 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
res.data = res.data!.where((element) => !(element.isFinished && element.finishCount == 0)).toList(); res.data = res.data!.where((element) => !(element.isFinished && element.finishCount == 0)).toList();
// 便tags key是题号 // 便tags key是题号
Map<String, MarkingTextQuestionTab> _currentTabsMap = Map<String, MarkingTextQuestionTab>.fromIterable(_currentTabs, Map<String, MarkingTextQuestionTab> _currentTabsMap =
key: (item) => item.questionNum, value: (item) => item); Map<String, MarkingTextQuestionTab>.fromIterable(_currentTabs, key: (item) => item.questionNum, value: (item) => item);
MarkingTextQuestionTab? theCurrentTab; MarkingTextQuestionTab? theCurrentTab;
String currentTagQueNum = _currentTab!.questionNum; String currentTagQueNum = _currentTab!.questionNum;
res.data!.forEach((e) { res.data!.forEach((e) {
@ -918,31 +910,25 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
if (!widget.exceptional && _currentTabs.length <= 0 && _currentTab == null) { if (!widget.exceptional && _currentTabs.length <= 0 && _currentTab == null) {
// tag为空tag数据并且为对应的tag赋值上分值步长 // tag为空tag数据并且为对应的tag赋值上分值步长
RestClient client = await getClient(); RestClient client = await getClient();
List<BaseStructureResult> res = await Future.wait([ List<BaseStructureResult> res =
client.getTestQuestionsOfTab(widget.markingUserId), await Future.wait([client.getTestQuestionsOfTab(widget.markingUserId), client.getTestQuestionsOfTabStepSize(widget.examSubjectId)]);
client.getTestQuestionsOfTabStepSize(widget.examSubjectId) BaseStructureResult<List<MarkingTextQuestionTab>> resultTab = res[0] as BaseStructureResult<List<MarkingTextQuestionTab>>;
]); BaseStructureResult<List<MarkingTextQuestionTabStepSize>> resultTabStep = res[1] as BaseStructureResult<List<MarkingTextQuestionTabStepSize>>;
BaseStructureResult<List<MarkingTextQuestionTab>> resultTab =
res[0] as BaseStructureResult<List<MarkingTextQuestionTab>>;
BaseStructureResult<List<MarkingTextQuestionTabStepSize>> resultTabStep =
res[1] as BaseStructureResult<List<MarkingTextQuestionTabStepSize>>;
if ((!resultTab.success || (resultTab.data?.isEmpty ?? true)) || if ((!resultTab.success || (resultTab.data?.isEmpty ?? true)) ||
(!resultTabStep.success || (resultTabStep.data?.isEmpty ?? true)) || (!resultTabStep.success || (resultTabStep.data?.isEmpty ?? true)) ||
(resultTabStep.data!.length < resultTab.data!.length)) { (resultTabStep.data!.length < resultTab.data!.length)) {
throw Error(); throw Error();
} }
Map<String, double> tabStepMap = Map<String, double>.fromIterable(resultTabStep.data!, Map<String, double> tabStepMap =
key: (item) => item.questionNum, value: (item) => item.scoreInterval); Map<String, double>.fromIterable(resultTabStep.data!, key: (item) => item.questionNum, value: (item) => item.scoreInterval);
resultTab.data = resultTab.data!.where((element) => !(element.isFinished && element.finishCount == 0)).toList(); resultTab.data = resultTab.data!.where((element) => !(element.isFinished && element.finishCount == 0)).toList();
resultTab.data!.forEach((element) => element.setStepSize(tabStepMap[element.questionNum] ?? 1.0)); resultTab.data!.forEach((element) => element.setStepSize(tabStepMap[element.questionNum] ?? 1.0));
_currentTabs = resultTab.data!; _currentTabs = resultTab.data!;
// tabs批次下第一个没有完成数据 // tabs批次下第一个没有完成数据
currentTab = resultTab.data!.firstWhere( currentTab = resultTab.data!.firstWhere(tabQuestionNum == null ? firstWhereCall : (e) => e.questionNum == tabQuestionNum,
tabQuestionNum == null ? firstWhereCall : (e) => e.questionNum == tabQuestionNum, orElse: () => MarkingTextQuestionTab(isFinished: false, questionNum: '0.0', total: 0, finishCount: 0, isExcess: false));
orElse: () =>
MarkingTextQuestionTab(isFinished: false, questionNum: '0.0', total: 0, finishCount: 0, isExcess: false));
if (currentTab.questionNum == '0.0') { if (currentTab.questionNum == '0.0') {
// tab设置为第一个 // tab设置为第一个
@ -1025,8 +1011,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
if (hasNext) { if (hasNext) {
// tab // tab
return _currentTabs.firstWhere(firstWhereCall, return _currentTabs.firstWhere(firstWhereCall,
orElse: () => MarkingTextQuestionTab( orElse: () => MarkingTextQuestionTab(questionNum: '0.0', total: 0, finishCount: 0, isExcess: false, isFinished: false));
questionNum: '0.0', total: 0, finishCount: 0, isExcess: false, isFinished: false));
} }
if (tabQuestionNum != null) { if (tabQuestionNum != null) {
@ -1036,8 +1021,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
if (resetting) { if (resetting) {
// //
MarkingTextQuestionTab theMarking = _currentTabs.firstWhere(firstWhereCall, MarkingTextQuestionTab theMarking = _currentTabs.firstWhere(firstWhereCall,
orElse: () => MarkingTextQuestionTab( orElse: () => MarkingTextQuestionTab(questionNum: '0.0', total: 0, finishCount: 0, isExcess: false, isFinished: false));
questionNum: '0.0', total: 0, finishCount: 0, isExcess: false, isFinished: false));
if (theMarking.questionNum != '0.0') { if (theMarking.questionNum != '0.0') {
currentTab = theMarking; currentTab = theMarking;
} }
@ -1143,8 +1127,8 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
currentQuestion = result.data; currentQuestion = result.data;
if (temTab != null) { if (temTab != null) {
result.data!.scoreInterval = temTab.scoreInterval ?? 1; result.data!.scoreInterval = temTab.scoreInterval ?? 1;
MarkingZoom? markingZoom = await UseZoomImageHistoryUtils.getZoomImageInfo( MarkingZoom? markingZoom =
widget.markingUserId.toString() + '-' + (currentQuestion?.questionNum.toString() ?? '')); await UseZoomImageHistoryUtils.getZoomImageInfo(widget.markingUserId.toString() + '-' + (currentQuestion?.questionNum.toString() ?? ''));
if (markingZoom != null) { if (markingZoom != null) {
imageScale = double.parse(markingZoom.scale.toStringAsFixed(2)); imageScale = double.parse(markingZoom.scale.toStringAsFixed(2));
imagePosition = Offset( imagePosition = Offset(
@ -1232,8 +1216,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
if (firstComeIn) setTimeOut(2000, () => firstComeIn = false); if (firstComeIn) setTimeOut(2000, () => firstComeIn = false);
if (ref.read(markingSubtopicSwitchingProvider.notifier).state != activeQuestIndex) { if (ref.read(markingSubtopicSwitchingProvider.notifier).state != activeQuestIndex) {
// //
Future.delayed( Future.delayed(Duration.zero, () => ref.read(markingSubtopicSwitchingProvider.notifier).setVal(activeQuestIndex));
Duration.zero, () => ref.read(markingSubtopicSwitchingProvider.notifier).setVal(activeQuestIndex));
} }
if (currentQuestion != null && widget.markingtype == MarkingListType.EXCEPTIONAL) { if (currentQuestion != null && widget.markingtype == MarkingListType.EXCEPTIONAL) {
BaseStructureResult<ExceptionInfo> res = await client.getMarkingQuestionsErrorInfo(currentQuestion!.id); BaseStructureResult<ExceptionInfo> res = await client.getMarkingQuestionsErrorInfo(currentQuestion!.id);
@ -1435,8 +1418,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
bool isNormal = !widget.exceptional; // bool isNormal = !widget.exceptional; //
bool notNextTest = data.nextId == 0; // bool notNextTest = data.nextId == 0; //
// //
var pressedNextTest = var pressedNextTest = notNextTest ? null : () => easyThrottle('TestQuestionSwitch', () => refresh(isNext: true));
notNextTest ? null : () => easyThrottle('TestQuestionSwitch', () => refresh(isNext: true));
bool notHasPreviousTest = data.prevId == 0; bool notHasPreviousTest = data.prevId == 0;
/** /**
@ -1501,8 +1483,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
color: const Color.fromRGBO(148, 163, 182, 1), color: const Color.fromRGBO(148, 163, 182, 1),
), ),
), ),
if (_currentTab!.isExcess && if (_currentTab!.isExcess && _currentTab!.finishCount > _currentTab!.total)
_currentTab!.finishCount > _currentTab!.total)
Container( Container(
margin: EdgeInsets.only(left: 4.w), margin: EdgeInsets.only(left: 4.w),
child: Row( child: Row(
@ -1513,8 +1494,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
color: const Color.fromRGBO(148, 163, 182, 1), color: const Color.fromRGBO(148, 163, 182, 1),
), ),
quickText( quickText(
(_currentTab!.finishCount - _currentTab!.total) (_currentTab!.finishCount - _currentTab!.total).toString(),
.toString(),
size: isBroadwise ? 18.sp : 14.sp, size: isBroadwise ? 18.sp : 14.sp,
color: Color.fromRGBO(251, 144, 84, 1), color: Color.fromRGBO(251, 144, 84, 1),
), ),
@ -1540,19 +1520,16 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
), ),
), ),
SizedBox(width: 8.w), SizedBox(width: 8.w),
if (model.hideQuestionId && if (model.hideQuestionId && model.screenDirection == ScreenDirection.HORIZONTAL_SCREEN)
model.screenDirection == ScreenDirection.HORIZONTAL_SCREEN)
InkWell( InkWell(
onTap: () { onTap: () {
Clipboard.setData(ClipboardData(text: data.paperNum ?? '')) Clipboard.setData(ClipboardData(text: data.paperNum ?? '')).then((value) {
.then((value) {
ToastUtils.showSuccess('试卷编号已复制'); ToastUtils.showSuccess('试卷编号已复制');
}); });
}, },
child: Row( child: Row(
children: [ children: [
quickText('试卷编号: ', quickText('试卷编号: ', size: 16.sp, color: const Color.fromRGBO(148, 163, 182, 1)),
size: 16.sp, color: const Color.fromRGBO(148, 163, 182, 1)),
quickText( quickText(
data.paperNum ?? '', data.paperNum ?? '',
size: 16.sp, size: 16.sp,
@ -1585,8 +1562,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
color: const Color.fromRGBO(4, 201, 208, 1), color: const Color.fromRGBO(4, 201, 208, 1),
), ),
), ),
if (isBroadwise && widget.markingtype == MarkingListType.EXCEPTIONAL || if (isBroadwise && widget.markingtype == MarkingListType.EXCEPTIONAL || data.isException)
data.isException)
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 2.w, vertical: 2.h), padding: EdgeInsets.symmetric(horizontal: 2.w, vertical: 2.h),
color: const Color.fromRGBO(245, 108, 108, 0.236), color: const Color.fromRGBO(245, 108, 108, 0.236),
@ -1630,18 +1606,14 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
size: isBroadwise ? 15.sp : 12.sp, size: isBroadwise ? 15.sp : 12.sp,
), ),
SizedBox(width: 1.w), SizedBox(width: 1.w),
quickText('继续阅卷', quickText('继续阅卷', color: const Color.fromRGBO(80, 87, 103, 1), size: isBroadwise ? 15.sp : 12.sp),
color: const Color.fromRGBO(80, 87, 103, 1),
size: isBroadwise ? 15.sp : 12.sp),
], ],
), ),
), ),
SizedBox(width: 10.w), SizedBox(width: 10.w),
InkWell( InkWell(
onTap: () { onTap: () {
ref ref.read(ratingProgressProvider.notifier).setState(EndDrawerViewEnum.REVIEW_RECORD);
.read(ratingProgressProvider.notifier)
.setState(EndDrawerViewEnum.REVIEW_RECORD);
scaffoldKey.currentState?.openEndDrawer(); scaffoldKey.currentState?.openEndDrawer();
}, },
child: Row( child: Row(
@ -1652,9 +1624,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
size: isBroadwise ? 15.sp : 12.sp, size: isBroadwise ? 15.sp : 12.sp,
), ),
SizedBox(width: 1.w), SizedBox(width: 1.w),
quickText('阅卷记录', quickText('阅卷记录', color: const Color.fromRGBO(80, 87, 103, 1), size: isBroadwise ? 15.sp : 12.sp),
color: const Color.fromRGBO(80, 87, 103, 1),
size: isBroadwise ? 15.sp : 12.sp),
], ],
), ),
), ),
@ -1666,9 +1636,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
), ),
InkWell( InkWell(
onTap: () { onTap: () {
ref ref.read(ratingProgressProvider.notifier).setState(EndDrawerViewEnum.RATING_PROGRESS);
.read(ratingProgressProvider.notifier)
.setState(EndDrawerViewEnum.RATING_PROGRESS);
scaffoldKey.currentState?.openEndDrawer(); scaffoldKey.currentState?.openEndDrawer();
}, },
child: Row( child: Row(
@ -1679,9 +1647,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
size: isBroadwise ? 15.sp : 12.sp, size: isBroadwise ? 15.sp : 12.sp,
), ),
SizedBox(width: 1.w), SizedBox(width: 1.w),
quickText('评分进度', quickText('评分进度', color: const Color.fromRGBO(80, 87, 103, 1), size: isBroadwise ? 15.sp : 12.sp),
color: const Color.fromRGBO(80, 87, 103, 1),
size: isBroadwise ? 15.sp : 12.sp),
], ],
), ),
), ),
@ -1690,8 +1656,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
InkWell( InkWell(
onTap: () { onTap: () {
if (data.isException) { if (data.isException) {
return ToastUtils.getFluttertoast( return ToastUtils.getFluttertoast(context: context, msg: '当前试题已为异常题,无需重复提交');
context: context, msg: '当前试题已为异常题,无需重复提交');
} }
toUpState(setState, () => showAbnormal = true, mounted); toUpState(setState, () => showAbnormal = true, mounted);
}, },
@ -1817,17 +1782,14 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
return InkWell( return InkWell(
onTap: () { onTap: () {
double? getScore = quest.subQuestionGotScore; double? getScore = quest.subQuestionGotScore;
ref ref.read(markingSubtopicSwitchingProvider.notifier).setVal(index);
.read(markingSubtopicSwitchingProvider.notifier)
.setVal(index);
toUpState(setState, () { toUpState(setState, () {
activeQuestIndex = index; activeQuestIndex = index;
// TODO // TODO
// pictureOverviewKey.currentState?.jumpToPage(activeQuestIndex); // pictureOverviewKey.currentState?.jumpToPage(activeQuestIndex);
questScore = getScore?.toString() ?? ''; questScore = getScore?.toString() ?? '';
hasZeroPointFive = hasZeroPointFive = questScore != '' && getScore! >= quest.subQuestionScore;
questScore != '' && getScore! >= quest.subQuestionScore;
}, mounted); }, mounted);
}, },
child: Container( child: Container(
@ -1848,8 +1810,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
alignment: const FractionalOffset(0.5, 1.78), alignment: const FractionalOffset(0.5, 1.78),
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 8.h),
horizontal: 4.w, vertical: 8.h),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !activeIndex color: !activeIndex
@ -1871,9 +1832,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: activeIndex color: activeIndex ? Colors.white : const Color.fromRGBO(80, 87, 103, 1),
? Colors.white
: const Color.fromRGBO(80, 87, 103, 1),
fontSize: 13.sp, fontSize: 13.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
@ -1884,22 +1843,18 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
child: quickText( child: quickText(
'(${getDoubleRemoveZero(data.subQuestionDetailList[index].subQuestionScore)})', '(${getDoubleRemoveZero(data.subQuestionDetailList[index].subQuestionScore)})',
size: 11.sp, size: 11.sp,
color: activeIndex color:
? Colors.white activeIndex ? Colors.white : const Color.fromRGBO(80, 87, 103, 1)),
: const Color.fromRGBO(
80, 87, 103, 1)),
) )
], ],
)), )),
if (activeIndex) if (activeIndex)
Icon(Icons.arrow_drop_down_outlined, Icon(Icons.arrow_drop_down_outlined,
color: const Color.fromRGBO(46, 91, 255, 1), color: const Color.fromRGBO(46, 91, 255, 1), size: 20.sp)
size: 20.sp)
], ],
), ),
Container( Container(
padding: padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 8.h),
EdgeInsets.symmetric(horizontal: 4.w, vertical: 8.h),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
getDoubleRemoveZero(quest.subQuestionGotScore, '请评分'), getDoubleRemoveZero(quest.subQuestionGotScore, '请评分'),
@ -1945,8 +1900,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
), ),
child: Text( child: Text(
'>>', '>>',
style: style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 12.sp),
TextStyle(color: Theme.of(context).primaryColor, fontSize: 12.sp),
), ),
)), )),
onHorizontalDragEnd: (detail) { onHorizontalDragEnd: (detail) {
@ -1976,7 +1930,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
imageItems: data.getImageData(), imageItems: data.getImageData(),
), ),
), ),
// // TODO
// if (!showSetingFlag && // if (!showSetingFlag &&
// !widget.exceptional && // !widget.exceptional &&
// currentQuestion != null && // currentQuestion != null &&
@ -1986,7 +1940,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
// Positioned( // Positioned(
// left: 0, // left: 0,
// bottom: 0, // bottom: 0,
// child: BottomAnnotationSwitch(maxWidth: maxWidth - 1.5.w), // child: BottomAnnotationSwitch(maxWidth: ScreenUtil().screenWidth - 1.5.w),
// ), // ),
// //
if (!hasSubtopic) if (!hasSubtopic)
@ -2000,10 +1954,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
color: data.isException ? Colors.red : const Color.fromRGBO(46, 91, 255, 1), color: data.isException ? Colors.red : const Color.fromRGBO(46, 91, 255, 1),
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: (data.score == null || horizontal: (data.score == null || (getDoubleRemoveZero(data.score ?? 0)).length >= 2) ? 4.w : 12.w,
(getDoubleRemoveZero(data.score ?? 0)).length >= 2)
? 4.w
: 12.w,
vertical: 6.h), vertical: 6.h),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
@ -2029,15 +1980,11 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
color: data.isException ? Colors.red : const Color.fromRGBO(46, 91, 255, 1), color: data.isException ? Colors.red : const Color.fromRGBO(46, 91, 255, 1),
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: (data.score == null || horizontal: (data.score == null || (getDoubleRemoveZero(data.score ?? 0)).length >= 2) ? 4.w : 12.w,
(getDoubleRemoveZero(data.score ?? 0)).length >= 2)
? 4.w
: 12.w,
vertical: 6.h), vertical: 6.h),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
getDoubleRemoveZero(data.score, getDoubleRemoveZero(data.score, '请评分,满分${getDoubleRemoveZero(currentQuestion?.totalScore)}'),
'请评分,满分${getDoubleRemoveZero(currentQuestion?.totalScore)}'),
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
color: const Color.fromRGBO(46, 91, 255, 1), color: const Color.fromRGBO(46, 91, 255, 1),
@ -2047,22 +1994,17 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
), ),
), ),
// //
if (widget.markingtype != MarkingListType.EXCEPTIONAL && if (widget.markingtype != MarkingListType.EXCEPTIONAL && !_theOldAnnotationGraffiti && !notHasPreviousTest)
!_theOldAnnotationGraffiti &&
!notHasPreviousTest)
Positioned( Positioned(
left: 3.w, left: 3.w,
top: ScreenUtil().setHeight(MediaQuery.of(context).size.height) / 2 * 0.87, top: ScreenUtil().setHeight(MediaQuery.of(context).size.height) / 2 * 0.87,
child: FloatingActionButton( child: FloatingActionButton(
tooltip: '前往上一题', tooltip: '前往上一题',
backgroundColor: notHasPreviousTest backgroundColor:
? const Color.fromRGBO(24, 32, 32, 0.04) notHasPreviousTest ? const Color.fromRGBO(24, 32, 32, 0.04) : const Color.fromRGBO(24, 32, 32, 0.1),
: const Color.fromRGBO(24, 32, 32, 0.1),
focusColor: Theme.of(context).primaryColor, focusColor: Theme.of(context).primaryColor,
elevation: 0, elevation: 0,
onPressed: notHasPreviousTest onPressed: notHasPreviousTest ? null : () => easyThrottle('TestQuestionSwitch', () => refresh()),
? null
: () => easyThrottle('TestQuestionSwitch', () => refresh()),
child: const Icon(Icons.arrow_back_ios, color: Colors.white), child: const Icon(Icons.arrow_back_ios, color: Colors.white),
heroTag: 'other', heroTag: 'other',
), ),
@ -2075,9 +2017,8 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
child: FloatingActionButton( child: FloatingActionButton(
elevation: 0, elevation: 0,
tooltip: '点击前往下一题', tooltip: '点击前往下一题',
backgroundColor: notNextTest backgroundColor:
? const Color.fromRGBO(24, 32, 32, 0.04) notNextTest ? const Color.fromRGBO(24, 32, 32, 0.04) : const Color.fromRGBO(24, 32, 32, 0.1),
: const Color.fromRGBO(24, 32, 32, 0.1),
foregroundColor: Colors.white, foregroundColor: Colors.white,
onPressed: pressedNextTest, onPressed: pressedNextTest,
child: const Icon(Icons.arrow_forward_ios, color: Colors.white), child: const Icon(Icons.arrow_forward_ios, color: Colors.white),
@ -2169,8 +2110,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
// //
$AbnormalBox( $AbnormalBox(
businessHandle: (bool flag, String? reasonKey, String? otherReasons) => businessHandle: (bool flag, String? reasonKey, String? otherReasons) => initiateException(flag, reasonKey, otherReasons),
initiateException(flag, reasonKey, otherReasons),
isBroadwise: isBroadwise, isBroadwise: isBroadwise,
showAbnormal: !showAbnormal, showAbnormal: !showAbnormal,
), ),
@ -2202,8 +2142,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
eventFireSub(model: SwitchKeyboardToReloadImages(true)); eventFireSub(model: SwitchKeyboardToReloadImages(true));
}); });
ref.read(annotationGraffitiSwitchProvider.notifier).setSwitch(false); ref.read(annotationGraffitiSwitchProvider.notifier).setSwitch(false);
ToastUtils.showSuccess(newOpenAuxiliary ? '开启双栏打分' : '关闭双栏打分', ToastUtils.showSuccess(newOpenAuxiliary ? '开启双栏打分' : '关闭双栏打分', duration: const Duration(milliseconds: 300));
duration: const Duration(milliseconds: 300));
}); });
}, },
// 线 // 线
@ -2212,8 +2151,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
width: isBroadwise ? 18.w : 42.w, width: isBroadwise ? 18.w : 42.w,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.only(topLeft: Radius.circular(8.w), bottomLeft: Radius.circular(8.w)),
BorderRadius.only(topLeft: Radius.circular(8.w), bottomLeft: Radius.circular(8.w)),
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
), ),
child: Row( child: Row(
@ -2247,8 +2185,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
tabName: _currentTab?.questionNum ?? '', tabName: _currentTab?.questionNum ?? '',
tabs: _currentTabs, tabs: _currentTabs,
direction: keyboardModel?.screenDirection ?? ScreenDirection.HORIZONTAL_SCREEN, direction: keyboardModel?.screenDirection ?? ScreenDirection.HORIZONTAL_SCREEN,
call: (int detailId, String selectedQuesiontNum) => call: (int detailId, String selectedQuesiontNum) => refresh(theId: detailId, theQuestionNum: selectedQuesiontNum),
refresh(theId: detailId, theQuestionNum: selectedQuesiontNum),
markingUserId: widget.markingUserId, markingUserId: widget.markingUserId,
questionNum: _currentTab?.questionNum, questionNum: _currentTab?.questionNum,
), ),
@ -2429,10 +2366,8 @@ Widget $abnormalBox(
child: TextField( child: TextField(
controller: controller, controller: controller,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
onEditingComplete: () => easyThrottle( onEditingComplete: () => easyThrottle('Abnormal_submission_confirmation_button',
'Abnormal_submission_confirmation_button', () => _useAbnormal.submit(context, controller, (reasonType, reason) => businessHandle(true, reasonType, reason))),
() => _useAbnormal.submit(context, controller,
(reasonType, reason) => businessHandle(true, reasonType, reason))),
maxLines: 15, maxLines: 15,
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
decoration: InputDecoration( decoration: InputDecoration(
@ -2452,8 +2387,7 @@ Widget $abnormalBox(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
InkWell( InkWell(
onTap: () => easyThrottle( onTap: () => easyThrottle('Abnormal_submission_confirmation_button', () => businessHandle(false, null, null)),
'Abnormal_submission_confirmation_button', () => businessHandle(false, null, null)),
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h), padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
margin: EdgeInsets.only(right: 16.w), margin: EdgeInsets.only(right: 16.w),
@ -2483,8 +2417,7 @@ Widget $abnormalBox(
InkWell( InkWell(
onTap: () => easyThrottle( onTap: () => easyThrottle(
'Abnormal_submission_confirmation_button', 'Abnormal_submission_confirmation_button',
() => _useAbnormal.submit( () => _useAbnormal.submit(context, controller, (reasonType, reason) => businessHandle(true, reasonType, reason)),
context, controller, (reasonType, reason) => businessHandle(true, reasonType, reason)),
), ),
// () { // () {
@ -2582,8 +2515,7 @@ class StandardAnswerRegion extends StatelessWidget {
/// ///
@hwidget @hwidget
Widget $abnormalQuestionInfo( Widget $abnormalQuestionInfo({required bool hasSubtopic, required bool isBroadwise, required bool show, double? score, ExceptionInfo? info}) {
{required bool hasSubtopic, required bool isBroadwise, required bool show, double? score, ExceptionInfo? info}) {
final _useFlagAnimation = useState(true); final _useFlagAnimation = useState(true);
AnimationController _useAnimationHorizontal = useAnimationController( AnimationController _useAnimationHorizontal = useAnimationController(
initialValue: 300, initialValue: 300,
@ -2675,14 +2607,12 @@ Widget $abnormalQuestionInfo(
Row( Row(
children: [ children: [
if ((info?.studentName.length ?? 0) > 0) if ((info?.studentName.length ?? 0) > 0)
quickText('考生:${info!.studentName}', quickText('考生:${info!.studentName}', color: const Color.fromRGBO(104, 104, 113, 1), size: 14.sp
color: const Color.fromRGBO(104, 104, 113, 1), size: 14.sp
// overflow: TextOverflow.clip, // overflow: TextOverflow.clip,
), ),
SizedBox(width: 3.w), SizedBox(width: 3.w),
if ((info?.studentExamNum.length ?? 0) > 0) if ((info?.studentExamNum.length ?? 0) > 0)
quickText('考号:${info!.studentExamNum}', quickText('考号:${info!.studentExamNum}', color: const Color.fromRGBO(104, 104, 113, 1), size: 14.sp
color: const Color.fromRGBO(104, 104, 113, 1), size: 14.sp
// overflow: TextOverflow.clip, // overflow: TextOverflow.clip,
), ),
], ],
@ -2716,8 +2646,7 @@ Widget $abnormalQuestionInfo(
/// ///
@hwidget @hwidget
Widget $arbitrationQuestionInfo( Widget $arbitrationQuestionInfo({required bool show, required bool isBroadwise, required bool hasSubtopic, required List<HistoricalScoring> data}) {
{required bool show, required bool isBroadwise, required bool hasSubtopic, required List<HistoricalScoring> data}) {
final _useFlagAnimation = useState(true); final _useFlagAnimation = useState(true);
AnimationController _useAnimationHorizontal = useAnimationController( AnimationController _useAnimationHorizontal = useAnimationController(
initialValue: 300, initialValue: 300,