From 297bebe523404b3ddfb1a1dfde8bebd50fc6c05e Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Wed, 18 Sep 2024 15:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E8=A7=82=E9=A2=98=E5=AE=A2=E8=A7=82?= =?UTF-8?q?=E9=A2=98=E5=A2=9E=E5=8A=A0=E4=BD=9C=E7=AD=94=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/common/job/homework_details.dart | 5 +- .../lib/common/utils/utils.dart | 6 +- .../children/job_report/job_report_view.dart | 4 +- .../quick_data_check_state.dart | 2 + .../quick_data_check_view.dart | 4 +- .../widget/kgt_zgt_table.dart | 95 +++++++++++-------- .../quick_data_check/widget/report_table.dart | 41 +++++++- 7 files changed, 114 insertions(+), 43 deletions(-) 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 c295124..8cb6846 100644 --- a/making_school_asignment_app/lib/common/job/homework_details.dart +++ b/making_school_asignment_app/lib/common/job/homework_details.dart @@ -66,6 +66,9 @@ class Questions extends Object { @JsonKey(name: 'okRate') double? okRate; + @JsonKey(name: 'correctRate') + double? correctRate; + @JsonKey(name: 'priorityInfo') List? priorityInfo; @@ -83,7 +86,7 @@ class Questions extends Object { Questions(this.id,this.templateId,this.questionNo,this.questionType,this.answer,this.score,this.questionPicture,this.subjectivePicture,this.knows,this.answerCount, - this.answerRate,this.okRate,this.priorityInfo,this.noAnswerStudents,this.answerOkStudents,this.answerNgStudents, + this.answerRate,this.okRate,this.priorityInfo,this.noAnswerStudents,this.answerOkStudents,this.answerNgStudents,this.correctRate, this.overallTitles); factory Questions.fromJson(Map srcJson) => _$QuestionsFromJson(srcJson); diff --git a/making_school_asignment_app/lib/common/utils/utils.dart b/making_school_asignment_app/lib/common/utils/utils.dart index e938f50..9cb4c3d 100644 --- a/making_school_asignment_app/lib/common/utils/utils.dart +++ b/making_school_asignment_app/lib/common/utils/utils.dart @@ -92,6 +92,8 @@ class Utils { dataCount.kgtDtlCount = kgt.length; dataCount.kgtAnswerRate = Utils.calcRate(dataCount.kgtAnswerCount!, dataCount.kgtDtlCount!); dataCount.kgtOkRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtDtlCount!); + + dataCount.kgtCorrectRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtAnswerCount!); dataCount.kgtCount = data.questions.where((w) => w.questionType == 1).length; List zgt = data.dtls.where((w) => w.questionType == 2).toList(); @@ -100,6 +102,8 @@ class Utils { dataCount.zgtDtlCount = zgt.length; dataCount.zgtAnswerRate = Utils.calcRate(dataCount.zgtAnswerCount!, dataCount.zgtDtlCount!); dataCount.zgtOkRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtDtlCount!); + + dataCount.zgtCorrectRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtAnswerCount!); dataCount.zgtCount = data.questions.where((w) => w.questionType == 2).length; dataCount.studentCount = data.students.length; dataCount.priorityStudents = data.students.where((w) => w.priorityAnnotate!).toList(); @@ -210,7 +214,7 @@ class Utils { -1 && w.state != 3; }).toList(); - + que.correctRate = Utils.calcRate(okCount, que.answerCount!); que.answerNgStudents = ques.where((w) { w.studentName = data.students.firstWhere((s) => s.studentId == w.studentId).studentName; return w.state == 2; diff --git a/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart index 537277a..233b364 100644 --- a/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart @@ -85,7 +85,9 @@ class _JobReportPageState extends State { kgReport: state.kgReport, zgReport: state.zgReport, kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0), - zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0)), + zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0), + kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0), + zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0)), // 掌握知识点的情况 Container( margin: EdgeInsets.symmetric(horizontal: 10.r), diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart index 6c3ff43..ed8f0bb 100644 --- a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/quick_data_check_state.dart @@ -23,12 +23,14 @@ class CountData extends Object { int? kgtDtlCount = 0; double? kgtAnswerRate = 0; double? kgtOkRate = 0; + double? kgtCorrectRate = 0; int? kgtAnswerCount = 0; int? kgtCount = 0; int? zgtDtlCount = 0; int? zgtOkCount = 0; int? zgtAnswerCount = 0; double? zgtAnswerRate = 0; + double? zgtCorrectRate = 0; double? zgtOkRate = 0; int? zgtCount = 0; int? studentCount = 0; 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 21b87cf..dc0eb9b 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 @@ -256,7 +256,9 @@ class _QuickDataCheckPageState extends State { kgReport: state.kgReport, zgReport: state.zgReport, kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0), - zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0)), + kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0), + zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0), + zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0)), ], ), )); diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart index 76d560a..d688c0b 100644 --- a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/kgt_zgt_table.dart @@ -5,6 +5,7 @@ import 'package:making_school_asignment_app/common/job/homework_details.dart'; import 'package:making_school_asignment_app/common/utils/utils.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/report_table.dart'; +import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart'; class KgtZgtTable extends StatefulWidget { final int studentCount; @@ -13,6 +14,8 @@ class KgtZgtTable extends StatefulWidget { final List zgReport; final String kgtOkRate; final String zgtOkRate; + final String kgtCorrectRate; + final String zgtCorrectRate; const KgtZgtTable( {Key? key, @@ -21,7 +24,9 @@ class KgtZgtTable extends StatefulWidget { required this.kgReport, required this.zgReport, required this.kgtOkRate, - required this.zgtOkRate}) + required this.kgtCorrectRate, + required this.zgtOkRate, + required this.zgtCorrectRate,}) : super(key: key); @override @@ -48,30 +53,38 @@ class _KgtZgtTableState extends State { ), child: Column( children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - '客观题', - style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), - ), - SizedBox( - width: 10.r, - ), - Text( - '${widget.kgtOkRate}%', - style: TextStyle(fontSize: 14.sp, color: Color(0xFF4CC793), fontWeight: FontWeight.w600), - ), - ], + Text( + '客观题', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), ), SizedBox( - height: 6.r, + height: 20.r, + ), + ProgressBar( + color: const Color.fromRGBO(76, 199, 147, 1), + percent: double.parse(widget.kgtCorrectRate) / 100, + title: '作答正确率:', + padingEdg: EdgeInsets.only(left: 5.w, right: 10.w), + fontSize: 10.sp, + lineHeight: 10.h, + marginEdg: EdgeInsets.only(top: 5.h), + ), + ProgressBar( + color: const Color.fromRGBO(76, 199, 147, 1), + percent: double.parse(widget.kgtOkRate) / 100, + title: '全班正确率:', + padingEdg: EdgeInsets.only(left: 5.w, right: 10.w), + fontSize: 10.sp, + lineHeight: 10.h, + marginEdg: EdgeInsets.only(top: 5.h), + ), + SizedBox( + height: 10.r, ), SizedBox( height: widget.kgReport.length > 10 ? 300.r : widget.kgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r), child: ReportTable( - headList: const ['题', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'], + headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率','标准答案', '优先批阅概况'], bodyList: widget.kgReport, fixedCols: 1, fixedRows: 1, @@ -93,30 +106,38 @@ class _KgtZgtTableState extends State { ), child: Column( children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - '主观题', - style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600), - ), - SizedBox( - width: 6.r, - ), - Text( - '${widget.zgtOkRate}%', - style: TextStyle(fontSize: 14.sp, color: const Color(0xFF4CC793), fontWeight: FontWeight.w600), - ), - ], + Text( + '主观题', + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600), ), SizedBox( - height: 10.r, + height: 20.r, + ), + ProgressBar( + color: const Color.fromRGBO(76, 199, 147, 1), + percent: double.parse(widget.zgtCorrectRate) / 100, + title: '作答正确率:', + padingEdg: EdgeInsets.only(left: 5.w, right: 10.w), + fontSize: 10.sp, + lineHeight: 10.h, + marginEdg: EdgeInsets.only(top: 5.h), + ), + ProgressBar( + color: const Color.fromRGBO(76, 199, 147, 1), + percent: double.parse(widget.zgtOkRate) / 100, + title: '全班正确率:', + padingEdg: EdgeInsets.only(left: 5.w, right: 10.w), + fontSize: 10.sp, + lineHeight: 10.h, + marginEdg: EdgeInsets.only(top: 5.h), + ), + SizedBox( + height:10.r, ), SizedBox( height: widget.zgReport.length > 10 ? 300.r : widget.zgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r), child: ReportTable( - headList: const ['题', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况','作答效率'], + headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率', '查看原题', '优先批阅概况','作答效率'], bodyList: widget.zgReport, fixedCols: 1, fixedRows: 1, diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart index df768bd..ce64a7a 100644 --- a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart @@ -420,7 +420,7 @@ class _ReportTableState extends State { var item = widget.bodyList[index]; return DataRow2.byIndex( index: index, - color: color != null ? MaterialStateProperty.all(color) : null, + color: color != null ? WidgetStateProperty.all(color) : null, cells: [ DataCell(Center( child: Padding( @@ -467,6 +467,14 @@ class _ReportTableState extends State { ), ), )), + + DataCell(Center( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 5.r), + child: Text('${item.correctRate.toStringAsFixed(0)}%', + style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), + ), + )), DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), @@ -590,7 +598,36 @@ class _ReportTableState extends State { columns: List.generate(widget.headList.length, (index) { var item = widget.headList[index]; return DataColumn2( - label: Center( + label: index == 3 ? + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(item, + style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), + SizedBox(width: 2.r,), + const Tooltip( + message: '答对人数/作答人数', + triggerMode: TooltipTriggerMode.tap, + preferBelow:false, + child: Icon(Icons.info_outline_rounded,color: Colors.grey,)), + ], + ): + index == 4 ?Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(item, + style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), + SizedBox(width: 2.r,), + const Tooltip( + message: '答对人数/总人数', + triggerMode: TooltipTriggerMode.tap, + preferBelow:false, + child: Icon(Icons.info_outline_rounded,color: Colors.grey,)), + ], + ): + Center( child: Text(item, style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), ),