diff --git a/making_school_asignment_app/lib/common/job/homework_details.dart b/making_school_asignment_app/lib/common/job/homework_details.dart index 1b77ec3..c4a4d80 100644 --- a/making_school_asignment_app/lib/common/job/homework_details.dart +++ b/making_school_asignment_app/lib/common/job/homework_details.dart @@ -185,6 +185,9 @@ class Students extends Object { @JsonKey(name: 'okRate') double? okRate; + @JsonKey(name: 'answerRate') + double? answerRate; + @JsonKey(name: 'noAnswerCount') int? noAnswerCount; @@ -194,7 +197,7 @@ class Students extends Object { @JsonKey(name: 'ttlSec') String? ttlSec; - Students(this.studentId,this.studentName,this.state,this.priorityAnnotate,this.kgtStu,this.kgtOkCount,this.kgtAnswerCount,this.zgtStu,this.zgtAnswerCount,this.zgtOkCount,this.allOk,this.kgtErrorCount,this.zgtErrorCount,this.zgtUnrated,this.allNotDone,this.queDtls,this.okRate,this.noAnswerCount,this.useTime,this.isAllCorrect); + Students(this.studentId,this.studentName,this.state,this.priorityAnnotate,this.kgtStu,this.kgtOkCount,this.kgtAnswerCount,this.zgtStu,this.zgtAnswerCount,this.zgtOkCount,this.allOk,this.kgtErrorCount,this.zgtErrorCount,this.zgtUnrated,this.allNotDone,this.queDtls,this.okRate,this.noAnswerCount,this.useTime,this.isAllCorrect,this.answerRate); factory Students.fromJson(Map srcJson) => _$StudentsFromJson(srcJson); diff --git a/making_school_asignment_app/lib/common/job/marking_models/do_paper_details_result.dart b/making_school_asignment_app/lib/common/job/marking_models/do_paper_details_result.dart index 8960042..ed45bd8 100644 --- a/making_school_asignment_app/lib/common/job/marking_models/do_paper_details_result.dart +++ b/making_school_asignment_app/lib/common/job/marking_models/do_paper_details_result.dart @@ -191,6 +191,9 @@ class StudentQuestions extends Object { @JsonKey(name: 'height') double height; + @JsonKey(name: 'useTime') + int? useTime; + StudentQuestions({ required this.height, required this.questionNo, @@ -200,6 +203,7 @@ class StudentQuestions extends Object { this.scoreStep, this.studentScore, this.isCorrect, + this.useTime, }); factory StudentQuestions.fromJson(Map srcJson) => diff --git a/making_school_asignment_app/lib/common/utils/utils.dart b/making_school_asignment_app/lib/common/utils/utils.dart index 9cb4c3d..13c0e70 100644 --- a/making_school_asignment_app/lib/common/utils/utils.dart +++ b/making_school_asignment_app/lib/common/utils/utils.dart @@ -124,9 +124,13 @@ class Utils { stu.zgtStu = zgt.where((w) => w.studentId == stu.studentId).toList(); stu.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); + //正确 stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length; + //错误 stu.zgtErrorCount = stu.zgtStu!.where((w) => w.state == 2).length; + //待批阅 stu.zgtUnrated = stu.zgtStu!.where((w) => w.state == 1).length; + //未做 stu.zgtAnswerCount = stu.zgtStu!.where((w) => w.state != 0).length; stu.isAllCorrect = stu.kgtOkCount! + stu.zgtOkCount! == kgt.length + zgt.length ? true : false; stu.allOk = data.dtls.where((w) { @@ -157,6 +161,10 @@ class Utils { int ttlCount = stu.queDtls!.length; stu.okRate = Utils.calcRate(okCount, ttlCount); + //完成率 + int answerCount = stu.queDtls!.where((w) => w.state != 0).length; + stu.answerRate = Utils.calcRate(answerCount, ttlCount); + var stuDtls = data.dtls.where((w) => w.studentId == stu.studentId); var secList = []; for(var sec in stuDtls){ diff --git a/making_school_asignment_app/lib/page/home_page/children/homework_review/components/bottom_operation_bar.dart b/making_school_asignment_app/lib/page/home_page/children/homework_review/components/bottom_operation_bar.dart index 0c60ca7..6622669 100644 --- a/making_school_asignment_app/lib/page/home_page/children/homework_review/components/bottom_operation_bar.dart +++ b/making_school_asignment_app/lib/page/home_page/children/homework_review/components/bottom_operation_bar.dart @@ -71,6 +71,35 @@ class _BottomAnnotationSwitchJobState extends State with // padding: EdgeInsets.symmetric(vertical: 1.h), child: Row( children: [ + Expanded( + flex: 3, + child: Row( + children: [ + Expanded( + child: SizedBox( + width: double.infinity, + height: double.infinity, + child: TextButton( + onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.submit(context)), + child: quickText('提 交', size: 14.sp, color: Theme.of(context).primaryColor), + ), + ), + ), + Container(width: 0.3.w, height: double.infinity, color: Colors.white), + Expanded( + child: SizedBox( + width: double.infinity, + height: double.infinity, + child: TextButton( + onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.cancelAllRatings()), + child: quickText('取 消', size: 14.sp, color: Colors.white), + ), + ), + ), + ], + ), + ), + Container(width: 0.3.w, height: double.infinity, color: Colors.white), Expanded( flex: 7, child: Column( @@ -189,35 +218,6 @@ class _BottomAnnotationSwitchJobState extends State with ], ), ), - Container(width: 0.3.w, height: double.infinity, color: Colors.white), - Expanded( - flex: 3, - child: Row( - children: [ - Expanded( - child: SizedBox( - width: double.infinity, - height: double.infinity, - child: TextButton( - onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.cancelAllRatings()), - child: quickText('取 消', size: 14.sp, color: Colors.white), - ), - ), - ), - Container(width: 0.3.w, height: double.infinity, color: Colors.white), - Expanded( - child: SizedBox( - width: double.infinity, - height: double.infinity, - child: TextButton( - onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.submit(context)), - child: quickText('提 交', size: 14.sp, color: Theme.of(context).primaryColor), - ), - ), - ), - ], - ), - ), ], ), ); diff --git a/making_school_asignment_app/lib/page/home_page/children/homework_review/components/question_paper_view.dart b/making_school_asignment_app/lib/page/home_page/children/homework_review/components/question_paper_view.dart index 3a8959a..cddba44 100644 --- a/making_school_asignment_app/lib/page/home_page/children/homework_review/components/question_paper_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/homework_review/components/question_paper_view.dart @@ -302,7 +302,6 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewLogic logic, var imageVal = sateData.imageScale.value; if (imageVal == null) return const SizedBox(); var studentQuestions = sateData.studentQuestions.value; - var boxHeight = imageVal.boxHeight; var actualImgHeight = imageVal.actualImgHeight; // 实际图片高度 @@ -360,14 +359,13 @@ Widget $scoringQuestionsView( useEffect(() { return () {}; }, []); - var padinVal = item.correctRate > 0 ? EdgeInsets.only(top: 6.4.h) : EdgeInsets.symmetric(vertical: 2.h); return Container( height: item.height * scaleRatio, padding: EdgeInsets.zero, - child: Stack( + child: item.useTime == 0?Container():Stack( alignment: const FractionalOffset(0, 0), children: [ Row( diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart index 1dcc1cc..5864423 100644 --- a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_view.dart @@ -100,146 +100,160 @@ class _QuickDataCheckPageState extends State { padding: EdgeInsets.symmetric(vertical: 15.r, horizontal: 15.r), margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ - SizedBox( - height: 2.r, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, + + Expanded(child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 12.r, + height: 12.r, + decoration: BoxDecoration(color: const Color(0xFF4CC793), borderRadius: BorderRadius.all(Radius.circular(7.r))), + ), + SizedBox( + width: 6.r, + ), + Text( + '已提交', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF333333)), + ), + SizedBox( + width: 35.r, + ), + Container( + width: 12.r, + height: 12.r, + decoration: BoxDecoration(color: const Color(0xFF6888FD), borderRadius: BorderRadius.all(Radius.circular(7.r))), + ), + SizedBox( + width: 6.r, + ), + Text( + '未提交', + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF333333)), + ) + ], + ), + SizedBox( + height: 2.r, + ), + //环形图 + SizedBox( + height: MediaQuery.of(context).size.width * 0.3, + // width: MediaQuery.of(context).size.width * 0.08, + child: PieChart( + PieChartData( + borderData: FlBorderData(show: false), + sectionsSpace: 0, + centerSpaceRadius: MediaQuery.of(context).size.width * 0.04, + sections: [ + PieChartSectionData( + color: const Color(0xFF4CC793), + value: state.dataCount.studentSubmitCount! / state.dataCount.studentCount! * 100, + radius: MediaQuery.of(context).size.width * 0.06 + 5, + title: '${state.dataCount.studentSubmitCount}人', + titleStyle: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + PieChartSectionData( + color: const Color(0xFF6888FD), + value: + (state.dataCount.studentCount! - state.dataCount.studentSubmitCount!) / state.dataCount.studentCount! * 100, + radius: MediaQuery.of(context).size.width * 0.06, + title: '${state.dataCount.studentCount! - state.dataCount.studentSubmitCount!}人', + titleStyle: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ], + )), + SizedBox(width: 20.r,), + Expanded(child: Column( + children: [ - Container( - width: 12.r, - height: 12.r, - decoration: BoxDecoration(color: const Color(0xFF4CC793), borderRadius: BorderRadius.all(Radius.circular(7.r))), - ), - SizedBox( - width: 6.r, - ), - Text( - '已提交', - style: TextStyle(fontSize: 12.sp, color: Color(0xFF333333)), - ), - SizedBox( - width: 35.r, - ), - Container( - width: 12.r, - height: 12.r, - decoration: BoxDecoration(color: const Color(0xFF6888FD), borderRadius: BorderRadius.all(Radius.circular(7.r))), - ), - SizedBox( - width: 6.r, - ), - Text( - '未提交', - style: TextStyle(fontSize: 12.sp, color: const Color(0xFF333333)), - ) - ], - ), - SizedBox( - height: 2.r, - ), - //环形图 - SizedBox( - height: MediaQuery.of(context).size.width * 0.3, - child: PieChart( - PieChartData( - borderData: FlBorderData(show: false), - sectionsSpace: 0, - centerSpaceRadius: MediaQuery.of(context).size.width * 0.06, - sections: [ - PieChartSectionData( - color: const Color(0xFF4CC793), - value: state.dataCount.studentSubmitCount! / state.dataCount.studentCount! * 100, - radius: MediaQuery.of(context).size.width * 0.07 + 5, - title: '${state.dataCount.studentSubmitCount}人', - titleStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white, - ), - ), - PieChartSectionData( - color: const Color(0xFF6888FD), - value: - (state.dataCount.studentCount! - state.dataCount.studentSubmitCount!) / state.dataCount.studentCount! * 100, - radius: MediaQuery.of(context).size.width * 0.07, - title: '${state.dataCount.studentCount! - state.dataCount.studentSubmitCount!}人', - titleStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white, - ), - ), - ], - ), + // 客观进度条 + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '客观题答题进度', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)), + ), + Text( + '${state.dataCount.kgtAnswerRate!.toStringAsFixed(0)}%', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF333333)), + ), + ], ), - ), - // 客观进度条 - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '客观题答题进度', - style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)), - ), - Text( - '${state.dataCount.kgtAnswerRate!.toStringAsFixed(0)}%', - style: TextStyle(fontSize: 10.sp, color: const Color(0xFF333333)), - ), - ], - ), - SizedBox(height: 6.r), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 9.h, - animationDuration: 2500, - percent: state.dataCount.kgtAnswerRate! / 100, - progressColor: const Color(0xFFB2DA93), - backgroundColor: const Color(0xFFEAEAEA), - barRadius: Radius.circular(10.r), - )), - ], - ), - SizedBox(height: 20.r), - // 主观进度条 - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '主观题答题进度', - style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)), - ), - Text( - '${state.dataCount.zgtAnswerRate!.toStringAsFixed(0)}%', - style: TextStyle(fontSize: 10.sp, color: const Color(0xFF333333)), - ), - ], - ), - SizedBox(height: 6.r), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 9.h, - animationDuration: 2500, - percent: state.dataCount.zgtAnswerRate! / 100, - progressColor: const Color(0xFFB2DA93), - backgroundColor: const Color(0xFFEAEAEA), - barRadius: Radius.circular(10.r), - )), - ], - ), + SizedBox(height: 6.r), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 10, + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 9.h, + animationDuration: 2500, + percent: state.dataCount.kgtAnswerRate! / 100, + progressColor: const Color(0xFFB2DA93), + backgroundColor: const Color(0xFFEAEAEA), + barRadius: Radius.circular(10.r), + )), + ], + ), + SizedBox(height: 20.r), + // 主观进度条 + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '主观题答题进度', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)), + ), + Text( + '${state.dataCount.zgtAnswerRate!.toStringAsFixed(0)}%', + style: TextStyle(fontSize: 10.sp, color: const Color(0xFF333333)), + ), + ], + ), + SizedBox(height: 6.r), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 10, + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 9.h, + animationDuration: 2500, + percent: state.dataCount.zgtAnswerRate! / 100, + progressColor: const Color(0xFFB2DA93), + backgroundColor: const Color(0xFFEAEAEA), + barRadius: Radius.circular(10.r), + )), + ], + ), + + ],)) + ], ), ), diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart index 585979a..2506e98 100644 --- a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:making_school_asignment_app/common/job/homework_details.dart'; +import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart'; class QuickDataCheckBottom extends StatefulWidget { @@ -22,6 +24,7 @@ class _QuickDataCheckBottomState extends State { RxList followList = RxList(); RxBool sortType = true.obs; RxBool sortLevel = false.obs; + RxBool sortCompleteRate = false.obs; @override void initState() { @@ -63,6 +66,7 @@ class _QuickDataCheckBottomState extends State { sortType.value = !sortType.value; sortLevel.value = false; + sortCompleteRate.value = false; }, child: Obx(() { return Row( @@ -107,6 +111,7 @@ class _QuickDataCheckBottomState extends State { sortType.value = true; } + sortCompleteRate.value = false; sortLevel.value = !sortLevel.value; }, child: Obx(() { @@ -135,6 +140,56 @@ class _QuickDataCheckBottomState extends State { ); }), ), + SizedBox( + width: 20.r, + ), + InkWell( + onTap: () { + if (widget.jobData!.isEmpty) return; + showList.value = [...widget.jobData!]; + if (!sortCompleteRate.value) { + showList.sort((a, b) { + return b.answerRate!.toInt().compareTo(a.answerRate!.toInt()); + }); + + sortType.value = false; + } else { + showList.value = [...widget.jobData!]; + showList.sort((a, b) { + return b.state.compareTo(a.state); + }); + + sortType.value = true; + } + sortLevel.value = false; + sortCompleteRate.value = !sortCompleteRate.value; + }, + child: Obx(() { + return Row( + children: [ + if (!sortCompleteRate.value) + Image.asset( + 'assets/images/no_check_icon.png', + width: 16.r, + height: 16.r, + ), + if (sortCompleteRate.value) + Image.asset( + 'assets/images/check_icon.png', + width: 16.r, + height: 16.r, + ), + SizedBox( + width: 5.r, + ), + Text( + '完成率排序', + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF707070)), + ), + ], + ); + }), + ), ], ), SizedBox( @@ -230,22 +285,29 @@ class _QuickDataCheckBottomState extends State { height: 10.r, ), Obx(() { - return SizedBox( - height: showList.value.length > 5 ? 350.r : showList.value.length * 50.r + 40.r, - child: QuickStudentDataTable( - headList: ['学生姓名', '总用时','客观题', '主观题', '客观题状态', '主观题状态', '未批阅'], - bodyList: showList.value, - jobId: widget.jobId, - fixedRows: 1, - fixedCols: 0, - // hasUnrated: widget.jobData!.hasUnrated, - hasUnrated: false, - kgCount: widget.kgCount, - zgCount: widget.zgCount, - subject:widget.subject, - ), + return Column( + children: [ + SizedBox( + height: showList.value.length > 5 ? 350.r : showList.value.length * 50.r + 60.r, + child: QuickStudentDataTable( + headList: ['学生姓名', '总用时','客观题', '主观题', '客观题状态', '主观题状态', '未批阅'], + bodyList: showList.value, + jobId: widget.jobId, + fixedRows: 1, + fixedCols: 0, + // hasUnrated: widget.jobData!.hasUnrated, + hasUnrated: false, + kgCount: widget.kgCount, + zgCount: widget.zgCount, + subject:widget.subject, + ), + ), + if(showList.isEmpty) + MyEmptyWidget(imgWidth: 100.r,imgHeight: 100.r,font: 10.sp,), + ], ); - }) + }), + ], ), );