no message

This commit is contained in:
1147192855@qq.com 2024-05-14 18:17:15 +08:00
parent 6dca9d8f0e
commit f13bdbcf5f
3 changed files with 77 additions and 56 deletions

View File

@ -71,6 +71,7 @@ class PictureOverview extends StatefulHookConsumerWidget {
final String testQuestionNumber; final String testQuestionNumber;
final Map<String, String> commentImageMap; final Map<String, String> commentImageMap;
final MarkingTextQuestion data; final MarkingTextQuestion data;
final Function callAnnotationTips;
const PictureOverview({ const PictureOverview({
required this.imageItems, required this.imageItems,
@ -80,6 +81,7 @@ class PictureOverview extends StatefulHookConsumerWidget {
required this.questionNum, required this.questionNum,
required this.markingUserId, required this.markingUserId,
required this.data, required this.data,
required this.callAnnotationTips,
this.homework = false, this.homework = false,
this.imageScale = 1, this.imageScale = 1,
this.imagePosition, this.imagePosition,
@ -139,6 +141,7 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
// 线 // 线
eventOn(callback: (BottomAnnotationSwitchCleanallOfMarking item) async { eventOn(callback: (BottomAnnotationSwitchCleanallOfMarking item) async {
widget.callAnnotationTips(); //
if (ref.read(drawMarkingProvider).data.isEmpty) { if (ref.read(drawMarkingProvider).data.isEmpty) {
if (widget.data.commentImageUrl.isNotEmpty) { if (widget.data.commentImageUrl.isNotEmpty) {
bool? res = await showDialog<bool>( bool? res = await showDialog<bool>(
@ -146,7 +149,7 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (context1) { builder: (context1) {
return AlertDialog(content: quickText("是否撤销上次批注痕迹"), actions: <Widget>[ return AlertDialog(content: quickText("是否撤销上次批阅批注痕迹"), actions: <Widget>[
TextButton(child: quickText("取消"), onPressed: () => Navigator.pop(context1, false)), TextButton(child: quickText("取消"), onPressed: () => Navigator.pop(context1, false)),
TextButton(child: quickText("确定", color: Theme.of(context).primaryColor), onPressed: () => Navigator.pop(context1, true)) TextButton(child: quickText("确定", color: Theme.of(context).primaryColor), onPressed: () => Navigator.pop(context1, true))
]); ]);
@ -424,6 +427,7 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser, data: localPosition)); var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser, data: localPosition));
var newVal1 = ref.read(drawMarkingProvider).offsets..add(localPosition); var newVal1 = ref.read(drawMarkingProvider).offsets..add(localPosition);
ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal(newVal, newVal1)); ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal(newVal, newVal1));
widget.callAnnotationTips();
}, },
// onPointerDown: (PointerDownEvent event) { // onPointerDown: (PointerDownEvent event) {
// }, // },

View File

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -5,6 +6,7 @@ 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/event_bus/bottom_annotation_switch_cleanall.dart';
import 'package:marking_app/pages/common/event_bus_mixin.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/anti_shake_throttling.dart';
import 'package:marking_app/utils/my_text.dart';
import '../provider/do_paper_bottom_review_marks_provider.dart'; import '../provider/do_paper_bottom_review_marks_provider.dart';
@ -84,7 +86,31 @@ class _DoPaperBottomReviewMarksState extends ConsumerState<DoPaperBottomReviewMa
onPressed: () => easyThrottle( onPressed: () => easyThrottle(
'REVIEW_MARKS_BOTTOM_BTNS', 'REVIEW_MARKS_BOTTOM_BTNS',
duration: const Duration(milliseconds: 100), duration: const Duration(milliseconds: 100),
() => eventFire(model: BottomAnnotationSwitchCleanallOfMarking(cleanAll: true)), () 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, padding: EdgeInsets.zero,
icon: Icon(Icons.reply_all_outlined, color: btnEnum == ReviewMarksBottomBtnsEnum.CLEAR_ALL ? actionColor : Colors.white, size: 34.r), icon: Icon(Icons.reply_all_outlined, color: btnEnum == ReviewMarksBottomBtnsEnum.CLEAR_ALL ? actionColor : Colors.white, size: 34.r),

View File

@ -14,6 +14,7 @@ import 'package:achievement_view/achievement_view.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:dotted_border/dotted_border.dart'; import 'package:dotted_border/dotted_border.dart';
import 'package:dropdown_search/dropdown_search.dart'; import 'package:dropdown_search/dropdown_search.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
@ -29,6 +30,7 @@ import 'package:marking_app/common/model/common/upload_img_secret_key.dart';
import 'package:marking_app/common/model/enum/KeyboardType.dart'; 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/marking_list_type.dart';
import 'package:marking_app/common/model/enum/review_marks_bottom_btns_enum.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/current_review_task.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/do_marking_keyboard_model.dart';
import 'package:marking_app/common/model/marking/keyboard_assist_event.dart'; import 'package:marking_app/common/model/marking/keyboard_assist_event.dart';
@ -142,6 +144,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
bool _completionPromptTab = false; // tab下试题完成并提示 bool _completionPromptTab = false; // tab下试题完成并提示
bool _reviewCompletedPrompted = false; // bool _reviewCompletedPrompted = false; //
bool annotationTips = false; //
// bool _switchQueTypePrompt = false; // // bool _switchQueTypePrompt = false; //
@ -195,6 +198,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
setTimeOut(300, () { setTimeOut(300, () {
eventFireSub(model: SwitchKeyboardToReloadImages(true)); eventFireSub(model: SwitchKeyboardToReloadImages(true));
}); });
eventOn(callback: (BottomAnnotationSwitchCleanallOfMarking item) async {});
}); });
params = MarkingTextQuestionParams( params = MarkingTextQuestionParams(
@ -506,6 +510,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
e.isFinish = true; e.isFinish = true;
} }
} }
annotationTips = false;
// ScaffoldMessenger.of(context).showSnackBar( // ScaffoldMessenger.of(context).showSnackBar(
// SnackBar( // SnackBar(
@ -757,6 +762,39 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
return ToastUtils.getFluttertoast(context: context, msg: '请先评分后提交再进入下一题'); return ToastUtils.getFluttertoast(context: context, msg: '请先评分后提交再进入下一题');
} }
print(annotationTips);
if (annotationTips && currentQuestion != null) {
//
var resFlag = await showDialog<bool>(
context: context,
barrierDismissible: false,
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!) {
//
return submitTestQuestions(context, currentQuestion!);
}
}
int detailId = theId ?? (isNext ? currentQuestion!.nextId : currentQuestion!.prevId); int detailId = theId ?? (isNext ? currentQuestion!.nextId : currentQuestion!.prevId);
bool isReview = widget.isReview; bool isReview = widget.isReview;
@ -1094,6 +1132,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
// bool flagInputKeyboardGuidePage = await FastData.getInstance().getInputKeyboardGuidePage(); // // bool flagInputKeyboardGuidePage = await FastData.getInstance().getInputKeyboardGuidePage(); //
try { try {
theRequesting = true; theRequesting = true;
RestClient client = await getClient(); RestClient client = await getClient();
MarkingTextQuestionTab? temTab; MarkingTextQuestionTab? temTab;
bool isNormal = !widget.exceptional; bool isNormal = !widget.exceptional;
@ -1102,8 +1141,6 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
MarkingTextQuestionTab? oldCurrentTab = _currentTab; MarkingTextQuestionTab? oldCurrentTab = _currentTab;
temTab = await getTabsData(tabQuestionNum: tabQuestionNum, resetting: resetting); // tag tag temTab = await getTabsData(tabQuestionNum: tabQuestionNum, resetting: resetting); // tag tag
print('当前选中类型:${temTab.questionNum}');
MarkingTextQuestionTabParams theParam = tabParams.setQuestionNum( MarkingTextQuestionTabParams theParam = tabParams.setQuestionNum(
tab: temTab, tab: temTab,
locaQuestionNum: oldCurrentTab?.questionNum, locaQuestionNum: oldCurrentTab?.questionNum,
@ -1130,6 +1167,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
ref.read(doPaperBottomReviewMarksProvider.notifier).setState(ReviewMarksBottomBtnsEnum.DRAG); ref.read(doPaperBottomReviewMarksProvider.notifier).setState(ReviewMarksBottomBtnsEnum.DRAG);
// //
ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal([], [])); ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal([], []));
currentQuestion = result.data; currentQuestion = result.data;
if (temTab != null) { if (temTab != null) {
result.data!.scoreInterval = temTab.scoreInterval ?? 1; result.data!.scoreInterval = temTab.scoreInterval ?? 1;
@ -1146,60 +1184,8 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
imageScale = 1; imageScale = 1;
imagePosition = Offset(0, 0); imagePosition = Offset(0, 0);
} }
/** */
// int? thetypeNum = tabParams.type;
// // || _currentTab?.total == 0 total没有更新造成了total是0
// if (tabQuestionNum != null || _currentTab?.total == 0)
// await getTabsData(updateCurrentTag: true); // tag更新当前Tag数据
// currentQuestion?.scoreInterval = temTab.scoreInterval!;
// if (oldCurrentQuestion == null ||
// (oldCurrentQuestion.markingUserDetailId != currentQuestion!.markingUserDetailId)) {
// if (theExamIndex == 0 || tabQuestionNum != null) {
// // !tabParams.excessContinue
// theExamIndex = (temTab.finishCount >= temTab.total && temTab.excessCount <= 0) ||
// (!tabParams.excessContinue && currentQuestion!.isFinish)
// ? temTab.finishCount
// : temTab.finishCount + 1; //
// } else if (thetypeNum != null) {
// thetypeNum == 0 ? ++theExamIndex : --theExamIndex;
// }
// }
// theExamIndex = currentQuestion?.currentIndex ?? 0;
/**后端返回当前试题位置不需要前端再去计算位置了 不需要判断超量题和平均量了 */
// currentQuestion!.setTotalCountAndCurrentIndex(
// temTab.isExcess
// ? (temTab.total > temTab.excessAvgCount ? temTab.total : temTab.excessAvgCount)
// : temTab.total,
// temTab.finishCount); //
// currentQuestion?.totalCount = temTab.total;
} }
/**
toUpState(setState, () {
bool hasSub = currentQuestion!.subQuestionDetailList.isNotEmpty;
activeQuestIndex = 0; //
double fullScore;
double getScore;
if (hasSub) {
SubQuestions questions = currentQuestion!.subQuestionDetailList[activeQuestIndex];
bool isFinish = questions.isFinish;
fullScore = questions.subQuestionScore;
getScore = isFinish ? questions.subQuestionGotScore! : 0;
} else {
fullScore = currentQuestion!.totalScore;
bool isFinish = currentQuestion!.isFinish; //
getScore = isFinish ? currentQuestion!.score! : 0;
}
questScore = getScore == 0 ? '' : getScore.toString(); //
hasZeroPointFive = getScore >= fullScore || questScore.length > 1; // /
// inputKeyboardGuidePage = flagInputKeyboardGuidePage; //
}, mounted);*/
bool hasSub = currentQuestion!.subQuestionDetailList.isNotEmpty; bool hasSub = currentQuestion!.subQuestionDetailList.isNotEmpty;
activeQuestIndex = 0; // activeQuestIndex = 0; //
double fullScore; double fullScore;
@ -1239,6 +1225,7 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
} }
} }
Future.delayed(Duration.zero, () => annotationTips = false);
// getMarkingQuestionsErrorInfo // getMarkingQuestionsErrorInfo
return currentQuestion; return currentQuestion;
} catch (e) { } catch (e) {
@ -1935,6 +1922,10 @@ class _MarkingPapersState extends ConsumerState<DoPapers>
commentImageMap: data.commentImageUrlMap, commentImageMap: data.commentImageUrlMap,
testQuestionNumber: widget.markingUserId.toString() + '-' + data.questionNum, testQuestionNumber: widget.markingUserId.toString() + '-' + data.questionNum,
imageItems: data.studentAnswerList, imageItems: data.studentAnswerList,
callAnnotationTips: () {
//
annotationTips = true;
},
), ),
), ),