批阅页面修改

This commit is contained in:
DESKTOP-I3JPKHK\wy 2025-04-23 15:27:27 +08:00
parent a8d0e80555
commit 9d2f15c80c
3 changed files with 57 additions and 26 deletions

View File

@ -148,6 +148,10 @@ Widget $scoringQuestionsView(BuildContext context, List<StudentQuestions>? stude
studentScore.value = item.studentScore; studentScore.value = item.studentScore;
}); });
// useValueChanged<StudentQuestions, void>(item, (_, __) {
// studentScore.value = item.studentScore;
// });
useEffect(() { useEffect(() {
/// ///
studentScoreListener() { studentScoreListener() {

View File

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:math'; import 'dart:math';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -278,6 +279,10 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
int _activePointers = 0; int _activePointers = 0;
Timer? timer;
//
static const int timeoutDuration = 300;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theMaxHeight = useState<double>(maxHeight); final theMaxHeight = useState<double>(maxHeight);
@ -424,21 +429,38 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
// //
// //
_activePointers++; _activePointers = _activePointers + 1;
print("+++进入onPointerDown $_activePointers");
timer?.cancel();
timer = Timer(const Duration(milliseconds: timeoutDuration), () {
if (_activePointers > 0) {
_activePointers = 0;
if (vnHandWritings.value.last != null) {
vnHandWritings.value.add(null); // 线
sateData.handwritings = vnHandWritings.value; //
}
}
});
sateData.panQuestView = true; sateData.panQuestView = true;
}, },
onPointerUp: (PointerUpEvent details) { onPointerUp: (PointerUpEvent details) {
// //
// activePointers--; // activePointers--;
// globalPosition = null; // globalPosition = null;
_activePointers--; if (_activePointers > 0) {
_activePointers = _activePointers - 1;
}
print("---进入onPointerUp $_activePointers");
timer?.cancel();
if (!annotationState.pen.value) return; if (!annotationState.pen.value) return;
vnHandWritings.value.add(null); // 线 vnHandWritings.value.add(null); // 线
sateData.handwritings = vnHandWritings.value; // sateData.handwritings = vnHandWritings.value; //
}, },
onPointerMove: (PointerMoveEvent event) { onPointerMove: (PointerMoveEvent event) {
print("进入onPointerMove $_activePointers");
if (_activePointers != 1) return; if (_activePointers != 1) return;
timer?.cancel();
if (!annotationState.pen.value) return; if (!annotationState.pen.value) return;
Offset localPosition = event.localPosition; // Offset localPosition = event.localPosition; //
@ -486,6 +508,7 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
var isPen = annotationState.pen.value; var isPen = annotationState.pen.value;
var showZgtAnnotate = sateData.data.value?.showZgtAnnotate; var showZgtAnnotate = sateData.data.value?.showZgtAnnotate;
print(sateData.data.value!.zgtAnswer);
return Container( return Container(
height: double.infinity, height: double.infinity,
width: double.infinity, width: double.infinity,

View File

@ -311,9 +311,10 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
var totalUnAnnotateCount = data.totalUnAnnotateCount; var totalUnAnnotateCount = data.totalUnAnnotateCount;
if (data.needAnnotate) totalUnAnnotateCount -= 1; // if (data.needAnnotate) totalUnAnnotateCount -= 1; //
if (totalUnAnnotateCount <= 0 && !state.lastQuestionPrompt) { if (totalUnAnnotateCount <= 0) {
// //
showDialog( if (!state.lastQuestionPrompt) {
await showDialog(
context: context, context: context,
builder: (BuildContext context1) { builder: (BuildContext context1) {
return AlertDialog( return AlertDialog(
@ -337,6 +338,9 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
); );
}, },
); );
}else{
ToastUtils.showSuccess("已经提交",duration:const Duration(milliseconds: 800));
}
return; return;
} }
var newParams = DoPaperDetailsParam.fromJson(state.param.value.toJson()); var newParams = DoPaperDetailsParam.fromJson(state.param.value.toJson());