no message
This commit is contained in:
parent
9421c6e90e
commit
19c59b0bde
|
|
@ -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': 2,
|
'subject': widget.logic.state.subject,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
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.allWrongRating()),
|
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.allPairs(context)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -165,7 +165,8 @@ 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.allPairs()),
|
onPressed: () =>
|
||||||
|
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),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -197,7 +198,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()),
|
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.submit(context)),
|
||||||
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)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ 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() ?? [],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -169,27 +170,35 @@ 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: [
|
||||||
Row(
|
Container(
|
||||||
|
color: Colors.yellow,
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// 对
|
// 对
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
|
padding: EdgeInsets.zero,
|
||||||
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
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(
|
child: Icon(
|
||||||
size: 22.sp,
|
size: 22.sp,
|
||||||
color: studentScore.value == 2 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
color: studentScore.value == 2 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
||||||
const IconData(0xe62b, fontFamily: "AlibabaIcon"),
|
const IconData(0xe62b, fontFamily: "AlibabaIcon"),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
||||||
studentScore.value = studentScore.value == 2 ? null : 2;
|
studentScore.value = studentScore.value == 2 ? null : 2;
|
||||||
}),
|
}),
|
||||||
|
|
@ -199,15 +208,19 @@ Widget $scoringQuestionsView(BuildContext context, StudentQuestions item, double
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
|
padding: EdgeInsets.zero,
|
||||||
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
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(
|
child: Icon(
|
||||||
size: 22.sp,
|
size: 22.sp,
|
||||||
color: studentScore.value == 1 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
color: studentScore.value == 1 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
||||||
const IconData(0xe62c, fontFamily: "AlibabaIcon"),
|
const IconData(0xe62c, fontFamily: "AlibabaIcon"),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
||||||
studentScore.value = studentScore.value == 1 ? null : 1;
|
studentScore.value = studentScore.value == 1 ? null : 1;
|
||||||
}),
|
}),
|
||||||
|
|
@ -217,15 +230,19 @@ Widget $scoringQuestionsView(BuildContext context, StudentQuestions item, double
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
|
padding: EdgeInsets.zero,
|
||||||
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
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(
|
child: Icon(
|
||||||
size: 22.sp,
|
size: 22.sp,
|
||||||
color: studentScore.value == 0 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
color: studentScore.value == 0 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
|
||||||
const IconData(0xe62a, fontFamily: "AlibabaIcon"),
|
const IconData(0xe62a, fontFamily: "AlibabaIcon"),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
onPressed: () => easyThrottle('scoring_homework_questions', () {
|
||||||
studentScore.value = studentScore.value == 0 ? null : 0;
|
studentScore.value = studentScore.value == 0 ? null : 0;
|
||||||
}),
|
}),
|
||||||
|
|
@ -233,6 +250,7 @@ Widget $scoringQuestionsView(BuildContext context, StudentQuestions item, double
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
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';
|
||||||
|
|
@ -8,6 +9,7 @@ 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 {
|
||||||
|
|
@ -111,8 +113,8 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
state.data.value?.studentQuestions = data;
|
state.data.value?.studentQuestions = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全对评分
|
// 全部统一打分
|
||||||
void allPairs([int score = 2]) async {
|
void allRating(int score) {
|
||||||
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 = [];
|
||||||
|
|
@ -123,27 +125,23 @@ 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([int score = 0]) async {
|
void allWrongRating(BuildContext context, [int score = 0]) async {
|
||||||
var studentQuestions = state.studentQuestions.value;
|
allRating(score);
|
||||||
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
|
await submit(context);
|
||||||
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() async {
|
Future<void> submit(BuildContext context) 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;
|
||||||
|
|
@ -154,7 +152,8 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO 请求提交加载框是否需要 如何防止重复提交
|
// TODO 请求提交加载框是否需要 如何防止重复提交
|
||||||
await getClient().reviewSubmission(ReviewSubmissionParams(
|
await getClient()
|
||||||
|
.reviewSubmission(ReviewSubmissionParams(
|
||||||
homeworkId: state.param.value.homeworkId,
|
homeworkId: state.param.value.homeworkId,
|
||||||
templateId: data.templateId,
|
templateId: data.templateId,
|
||||||
studentId: data.studentId,
|
studentId: data.studentId,
|
||||||
|
|
@ -165,6 +164,33 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
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