Compare commits
No commits in common. "a4dd67ddfa3d8a03a0b80729dd193a19e0f7b808" and "9421c6e90e950ca4e58bd523e2c4e8c771b9c906" have entirely different histories.
a4dd67ddfa
...
9421c6e90e
|
|
@ -299,7 +299,7 @@ class _AnnotateItemState extends State<AnnotateItem> {
|
||||||
'homeworkId': widget.homeworkId,
|
'homeworkId': widget.homeworkId,
|
||||||
'homeworkName': widget.name,
|
'homeworkName': widget.name,
|
||||||
'classId': itemData.classId,
|
'classId': itemData.classId,
|
||||||
'subject': widget.logic.state.subject,
|
'subject': 2,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ class _BottomAnnotationSwitchJobState extends State<BottomAnnotationSwitch> with
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
child: quickText('全 对', color: Colors.white, size: 12.sp),
|
child: quickText('全 对', color: Colors.white, size: 12.sp),
|
||||||
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.allPairs(context)),
|
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.allWrongRating()),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -165,8 +165,7 @@ class _BottomAnnotationSwitchJobState extends State<BottomAnnotationSwitch> with
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () =>
|
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.allPairs()),
|
||||||
easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.allWrongRating(context)),
|
|
||||||
child: quickText('全 错', color: Colors.white, size: 12.sp),
|
child: quickText('全 错', color: Colors.white, size: 12.sp),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -198,7 +197,7 @@ class _BottomAnnotationSwitchJobState extends State<BottomAnnotationSwitch> with
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.submit(context)),
|
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.submit()),
|
||||||
child: quickText('提 交', size: 12.sp, color: const Color.fromRGBO(76, 199, 147, 1)),
|
child: quickText('提 交', size: 12.sp, color: const Color.fromRGBO(76, 199, 147, 1)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
|
||||||
heroTag: '点击前往上一题',
|
heroTag: '点击前往上一题',
|
||||||
tooltip: '点击前往上一题',
|
tooltip: '点击前往上一题',
|
||||||
focusColor: Theme.of(context).primaryColor,
|
focusColor: Theme.of(context).primaryColor,
|
||||||
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.05),
|
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.1),
|
||||||
elevation: 10.r,
|
elevation: 6.r,
|
||||||
onPressed: () => easyThrottle('TestQuestionSwitch', () {
|
onPressed: () => easyThrottle('TestQuestionSwitch', () {
|
||||||
var param = sateData.param.value;
|
var param = sateData.param.value;
|
||||||
param.studentId = lastPageVal.studentId;
|
param.studentId = lastPageVal.studentId;
|
||||||
|
|
@ -82,8 +82,8 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
|
||||||
return FloatingActionButton(
|
return FloatingActionButton(
|
||||||
heroTag: '点击前往下一题',
|
heroTag: '点击前往下一题',
|
||||||
tooltip: '点击前往下一题',
|
tooltip: '点击前往下一题',
|
||||||
elevation: 10.r,
|
elevation: 6.r,
|
||||||
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.05),
|
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.1),
|
||||||
onPressed: () => easyThrottle('TestQuestionSwitch', () {
|
onPressed: () => easyThrottle('TestQuestionSwitch', () {
|
||||||
var param = sateData.param.value;
|
var param = sateData.param.value;
|
||||||
param.studentId = nextPageVal.studentId;
|
param.studentId = nextPageVal.studentId;
|
||||||
|
|
@ -145,7 +145,6 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewState sateData) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(top: imageVal.remainingHeight > 0 ? imageVal.remainingHeight / 2 : 0),
|
padding: EdgeInsets.only(top: imageVal.remainingHeight > 0 ? imageVal.remainingHeight / 2 : 0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: studentQuestions?.asMap().keys.map((e) => $ScoringQuestionsView(studentQuestions[e], imageVal.scaleRatio)).toList() ?? [],
|
children: studentQuestions?.asMap().keys.map((e) => $ScoringQuestionsView(studentQuestions[e], imageVal.scaleRatio)).toList() ?? [],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -170,86 +169,69 @@ Widget $scoringQuestionsView(BuildContext context, StudentQuestions item, double
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
return () {};
|
return () {};
|
||||||
}, []);
|
}, []);
|
||||||
var padinVal = item.correctRate > 0 ? EdgeInsets.only(top: 6.4.h) : EdgeInsets.symmetric(vertical: 2.h);
|
|
||||||
return Container(
|
return Container(
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
height: item.height * scaleRatio,
|
height: item.height * scaleRatio,
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: const FractionalOffset(0, 0),
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Row(
|
||||||
color: Colors.yellow,
|
children: [
|
||||||
child: Row(
|
// 对
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
Expanded(
|
||||||
children: [
|
child: ElevatedButton(
|
||||||
// 对
|
style: ElevatedButton.styleFrom(
|
||||||
Expanded(
|
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
|
||||||
child: ElevatedButton(
|
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), // 设置背景色
|
||||||
style: ElevatedButton.styleFrom(
|
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), // 去除圆角
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
||||||
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), // 设置背景色
|
|
||||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), // 去除圆角
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: padinVal,
|
|
||||||
child: Icon(
|
|
||||||
size: 22.sp,
|
|
||||||
color: studentScore.value == 2 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
|
||||||
const IconData(0xe62b, fontFamily: "AlibabaIcon"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
|
||||||
studentScore.value = studentScore.value == 2 ? null : 2;
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
),
|
child: Icon(
|
||||||
// 半
|
size: 22.sp,
|
||||||
Expanded(
|
color: studentScore.value == 2 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
||||||
child: ElevatedButton(
|
const IconData(0xe62b, fontFamily: "AlibabaIcon"),
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
||||||
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), // 设置背景色
|
|
||||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), // 去除圆角
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: padinVal,
|
|
||||||
child: Icon(
|
|
||||||
size: 22.sp,
|
|
||||||
color: studentScore.value == 1 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
|
||||||
const IconData(0xe62c, fontFamily: "AlibabaIcon"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
|
||||||
studentScore.value = studentScore.value == 1 ? null : 1;
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
|
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
||||||
|
studentScore.value = studentScore.value == 2 ? null : 2;
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
// 错
|
),
|
||||||
Expanded(
|
// 半
|
||||||
child: ElevatedButton(
|
Expanded(
|
||||||
style: ElevatedButton.styleFrom(
|
child: ElevatedButton(
|
||||||
padding: EdgeInsets.zero,
|
style: ElevatedButton.styleFrom(
|
||||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
|
||||||
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), // 设置背景色
|
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), // 设置背景色
|
||||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), // 去除圆角
|
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), // 去除圆角
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: padinVal,
|
|
||||||
child: Icon(
|
|
||||||
size: 22.sp,
|
|
||||||
color: studentScore.value == 0 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
|
||||||
const IconData(0xe62a, fontFamily: "AlibabaIcon"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
|
||||||
studentScore.value = studentScore.value == 0 ? null : 0;
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
|
child: Icon(
|
||||||
|
size: 22.sp,
|
||||||
|
color: studentScore.value == 1 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
||||||
|
const IconData(0xe62c, fontFamily: "AlibabaIcon"),
|
||||||
|
),
|
||||||
|
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
||||||
|
studentScore.value = studentScore.value == 1 ? null : 1;
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
// 错
|
||||||
|
Expanded(
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
|
||||||
|
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), // 设置背景色
|
||||||
|
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), // 去除圆角
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
size: 22.sp,
|
||||||
|
color: studentScore.value == 0 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
||||||
|
const IconData(0xe62a, fontFamily: "AlibabaIcon"),
|
||||||
|
),
|
||||||
|
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
||||||
|
studentScore.value = studentScore.value == 0 ? null : 0;
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
|
@ -279,9 +261,9 @@ Widget $scoringQuestionsView(BuildContext context, StudentQuestions item, double
|
||||||
@hwidget
|
@hwidget
|
||||||
Widget $questionImageView(double maxWidth, double maxHeight, HomeworkReviewState sateData) {
|
Widget $questionImageView(double maxWidth, double maxHeight, HomeworkReviewState sateData) {
|
||||||
final scrollControllerQuestion = useScrollController(); // 试题图片区域
|
final scrollControllerQuestion = useScrollController(); // 试题图片区域
|
||||||
var vnHandWritings = useValueNotifier<List<dynamic>>([]);
|
|
||||||
ImageStream? imageStream;
|
ImageStream? imageStream;
|
||||||
var imageStreamListener = useState<ImageStreamListener>(ImageStreamListener((ImageInfo info, bool _) {
|
|
||||||
|
ImageStreamListener imageStreamListener = ImageStreamListener((ImageInfo info, bool _) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
sateData.imageScale.value = TestQuestionsImageInfo(
|
sateData.imageScale.value = TestQuestionsImageInfo(
|
||||||
boxWidth: maxWidth,
|
boxWidth: maxWidth,
|
||||||
|
|
@ -291,7 +273,7 @@ Widget $questionImageView(double maxWidth, double maxHeight, HomeworkReviewState
|
||||||
url: sateData.data.value!.zgtAnswer,
|
url: sateData.data.value!.zgtAnswer,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}));
|
});
|
||||||
|
|
||||||
// 可选:添加滚动监听
|
// 可选:添加滚动监听
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
|
|
@ -301,11 +283,10 @@ Widget $questionImageView(double maxWidth, double maxHeight, HomeworkReviewState
|
||||||
});
|
});
|
||||||
// 返回一个清理函数,在组件销毁时移除监听
|
// 返回一个清理函数,在组件销毁时移除监听
|
||||||
return () {
|
return () {
|
||||||
imageStream?.removeListener(imageStreamListener.value);
|
imageStream?.removeListener(imageStreamListener);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
print('这里是加载了..............');
|
|
||||||
return Container(
|
return Container(
|
||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
// padding: EdgeInsets.only(bottom: 2.h, top: 2.h),
|
// padding: EdgeInsets.only(bottom: 2.h, top: 2.h),
|
||||||
|
|
@ -317,69 +298,25 @@ Widget $questionImageView(double maxWidth, double maxHeight, HomeworkReviewState
|
||||||
scrollDirection: Axis.vertical, // 设置垂直滚动
|
scrollDirection: Axis.vertical, // 设置垂直滚动
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
var imageUrl = sateData.data.value?.zgtAnswer;
|
var imageUrl = sateData.data.value?.zgtAnswer;
|
||||||
|
print(imageUrl);
|
||||||
if (imageUrl == null) return const SizedBox();
|
if (imageUrl == null) return const SizedBox();
|
||||||
|
|
||||||
return Container(
|
// return Container(
|
||||||
decoration: BoxDecoration(boxShadow: [
|
// color: Colors.green,
|
||||||
BoxShadow(
|
// height: 394.45145018915514,
|
||||||
color: Colors.grey.withOpacity(0.2),
|
// );
|
||||||
offset: Offset(-6.r, 1.r), //阴影x轴偏移量
|
return $TheCachedNetworkImage(
|
||||||
blurRadius: 10.r, //阴影模糊程度
|
(context, imageProvider) {
|
||||||
spreadRadius: 8.r //阴影扩散程度
|
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
|
||||||
)
|
imageStream?.removeListener(imageStreamListener);
|
||||||
]),
|
imageStream = imageWidget.image.resolve(const ImageConfiguration())..addListener(imageStreamListener);
|
||||||
child: Listener(
|
|
||||||
behavior: HitTestBehavior.opaque,
|
|
||||||
onPointerUp: (PointerUpEvent details) {},
|
|
||||||
onPointerMove: (PointerMoveEvent details) {},
|
|
||||||
child: RepaintBoundary(
|
|
||||||
child: CustomPaint(
|
|
||||||
foregroundPainter: DrawingPainter(ctrl: vnHandWritings),
|
|
||||||
child: RepaintBoundary(
|
|
||||||
child: $TheCachedNetworkImage(
|
|
||||||
(context, imageProvider) {
|
|
||||||
print('图片加载了..............');
|
|
||||||
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
|
|
||||||
imageStream?.removeListener(imageStreamListener.value);
|
|
||||||
imageStream = imageWidget.image.resolve(const ImageConfiguration())..addListener(imageStreamListener.value);
|
|
||||||
|
|
||||||
return imageWidget;
|
return imageWidget;
|
||||||
},
|
},
|
||||||
imageUrl: RequestConfig.imgUrl + imageUrl,
|
imageUrl: RequestConfig.imgUrl + imageUrl,
|
||||||
),
|
// imageUrl: 'https://cdn3-banquan.ituchong.com/weili/image/l/2000260200787476490.jpeg',
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批注框
|
|
||||||
class DrawingPainter extends CustomPainter {
|
|
||||||
final ValueNotifier<List<dynamic>> ctrl;
|
|
||||||
final Paint paintBrush = Paint()
|
|
||||||
..color = Colors.red
|
|
||||||
..strokeCap = StrokeCap.round
|
|
||||||
..strokeWidth = 1.5.r;
|
|
||||||
DrawingPainter({required this.ctrl}) : super(repaint: ctrl);
|
|
||||||
|
|
||||||
@override
|
|
||||||
void paint(Canvas canvas, Size size) {
|
|
||||||
var points = ctrl.value;
|
|
||||||
var pointsLength = points.length;
|
|
||||||
// for (int i = 0; i < pointsLength; i++) {
|
|
||||||
// GestureRecording item = points[i];
|
|
||||||
// Offset? offsetData = item.data;
|
|
||||||
// Offset? nextOffsetData = pointsLength - 1 == i ? null : points[i + 1].data;
|
|
||||||
// if (offsetData != null && nextOffsetData != null) {
|
|
||||||
// canvas.drawLine(offsetData, nextOffsetData, paintBrush);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
|
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
|
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
|
||||||
|
|
@ -9,7 +8,6 @@ import 'package:making_school_asignment_app/common/job/marking_models/do_test_qu
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/review_submission_params.dart';
|
import 'package:making_school_asignment_app/common/job/marking_models/review_submission_params.dart';
|
||||||
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
||||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
|
||||||
|
|
||||||
// 数据
|
// 数据
|
||||||
class HomeworkReviewState {
|
class HomeworkReviewState {
|
||||||
|
|
@ -113,8 +111,8 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
state.data.value?.studentQuestions = data;
|
state.data.value?.studentQuestions = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全部统一打分
|
// 全对评分
|
||||||
void allRating(int score) {
|
void allPairs([int score = 2]) async {
|
||||||
var studentQuestions = state.studentQuestions.value;
|
var studentQuestions = state.studentQuestions.value;
|
||||||
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
|
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
|
||||||
List<StudentQuestions> data = [];
|
List<StudentQuestions> data = [];
|
||||||
|
|
@ -125,23 +123,27 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
}
|
}
|
||||||
state.studentQuestions.value = data;
|
state.studentQuestions.value = data;
|
||||||
state.data.value?.studentQuestions = data;
|
state.data.value?.studentQuestions = data;
|
||||||
}
|
await submit();
|
||||||
|
|
||||||
// 全对评分
|
|
||||||
void allPairs(BuildContext context, [int score = 2]) async {
|
|
||||||
allRating(score);
|
|
||||||
await submit(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全错评分
|
// 全错评分
|
||||||
void allWrongRating(BuildContext context, [int score = 0]) async {
|
void allWrongRating([int score = 0]) async {
|
||||||
allRating(score);
|
var studentQuestions = state.studentQuestions.value;
|
||||||
await submit(context);
|
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
|
||||||
|
List<StudentQuestions> data = [];
|
||||||
|
for (var e in studentQuestions!) {
|
||||||
|
var newe = StudentQuestions.fromJson(e.toJson());
|
||||||
|
newe.studentScore = score;
|
||||||
|
data.add(newe);
|
||||||
|
}
|
||||||
|
state.studentQuestions.value = data;
|
||||||
|
state.data.value?.studentQuestions = data;
|
||||||
|
await submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交打分
|
// 提交打分
|
||||||
/// allPairs
|
/// allPairs
|
||||||
Future<void> submit(BuildContext context) async {
|
Future<void> submit() async {
|
||||||
var data = state.data.value;
|
var data = state.data.value;
|
||||||
if (data == null) return;
|
if (data == null) return;
|
||||||
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
|
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
|
||||||
|
|
@ -152,45 +154,17 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO 请求提交加载框是否需要 如何防止重复提交
|
// TODO 请求提交加载框是否需要 如何防止重复提交
|
||||||
await getClient()
|
await getClient().reviewSubmission(ReviewSubmissionParams(
|
||||||
.reviewSubmission(ReviewSubmissionParams(
|
homeworkId: state.param.value.homeworkId,
|
||||||
homeworkId: state.param.value.homeworkId,
|
templateId: data.templateId,
|
||||||
templateId: data.templateId,
|
studentId: data.studentId,
|
||||||
studentId: data.studentId,
|
studentScores: studentQuestions.map((e) {
|
||||||
studentScores: studentQuestions.map((e) {
|
var studentScore = e.studentScore!;
|
||||||
var studentScore = e.studentScore!;
|
return StudentScores(
|
||||||
return StudentScores(
|
isCorrect: studentScore == 2,
|
||||||
isCorrect: studentScore == 2,
|
questionNo: e.questionNo,
|
||||||
questionNo: e.questionNo,
|
studentScore: studentScore,
|
||||||
studentScore: studentScore,
|
);
|
||||||
);
|
}).toList()));
|
||||||
}).toList()))
|
|
||||||
.then((e) async {
|
|
||||||
var annotatedCount = data.annotatedCount + 1; // 批阅数量
|
|
||||||
var submitCount = data.submitCount; // 学生提交数量
|
|
||||||
if (annotatedCount == submitCount) {
|
|
||||||
// 批阅完成
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context1) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: quickText('完成批阅提示'),
|
|
||||||
content: const Text('暂无更多待批阅项,是否返回主页?'),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(child: const Text('否'), onPressed: () => Navigator.of(context1).pop()),
|
|
||||||
TextButton(
|
|
||||||
child: const Text('是'),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context1).pop();
|
|
||||||
Get.back();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
state.param.value = DoPaperDetailsParam.fromJson(state.param.value.toJson());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue