From 85a80c364ad1597da655450e8d9a14fc2fa7a73d Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Thu, 28 Mar 2024 17:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BF=AB=E6=9F=A5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AE=A2=E8=A7=82=E9=A2=98=E5=92=8C=E4=B8=BB=E8=A7=82?= =?UTF-8?q?=E9=A2=98=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/common/model/job/job_data_report.dart | 10 ++- .../common/model/job/job_student_history.dart | 6 +- .../job_personal_detail.dart | 88 ++++++++++++++---- .../pages/homework_correction/job_report.dart | 4 +- .../homework_correction/quick_data_check.dart | 90 ++++++++++++++++++- 5 files changed, 175 insertions(+), 23 deletions(-) diff --git a/marking_app/lib/common/model/job/job_data_report.dart b/marking_app/lib/common/model/job/job_data_report.dart index aaa4e34..b5582ca 100644 --- a/marking_app/lib/common/model/job/job_data_report.dart +++ b/marking_app/lib/common/model/job/job_data_report.dart @@ -1,4 +1,5 @@ import 'package:json_annotation/json_annotation.dart'; +import 'package:marking_app/common/model/job/job_report_model.dart'; part 'job_data_report.g.dart'; @@ -41,8 +42,15 @@ class JobDataReport extends Object { @JsonKey(name: 'studentDetails') List studentDetails; + @JsonKey(name: 'kgReport') + KgReport kgReport; + + @JsonKey(name: 'zgReport') + ZgReport zgReport; + JobDataReport(this.jobId, this.jobName, this.gradeName, this.className, this.validCount, this.noAnswerCount, - this.kgValidRate, this.kgQuestionCount, this.zgValidRate, this.zgQuestionCount, this.studentDetails, + this.kgValidRate, this.kgQuestionCount, this.zgValidRate, this.zgQuestionCount, this.studentDetails, this.kgReport, + this.zgReport, [this.sortType = true,this.sortLevel = false,this.hasUnrated = false]) { this.studentDetails.sort((a, b) { diff --git a/marking_app/lib/common/model/job/job_student_history.dart b/marking_app/lib/common/model/job/job_student_history.dart index c9081be..15d50e9 100644 --- a/marking_app/lib/common/model/job/job_student_history.dart +++ b/marking_app/lib/common/model/job/job_student_history.dart @@ -99,7 +99,11 @@ class Items extends Object { @JsonKey(name: 'subjectiveDtls') List subjectiveDtls; - Items(this.id,this.name,this.subject,this.subjectName,this.publishTime,this.isPaper,this.studentJobId,this.correctRate,this.objectiveCorrectRate,this.objectiveDtls,this.subjectiveCorrectRate,this.subjectiveDtls,); + //全部未做 + @JsonKey(name: 'allNotDone') + bool allNotDone; + + Items(this.id,this.name,this.subject,this.subjectName,this.publishTime,this.isPaper,this.studentJobId,this.correctRate,this.objectiveCorrectRate,this.objectiveDtls,this.subjectiveCorrectRate,this.subjectiveDtls,[this.allNotDone = false,]); factory Items.fromJson(Map srcJson) => _$ItemsFromJson(srcJson); diff --git a/marking_app/lib/pages/homework_correction/job_personal_detail.dart b/marking_app/lib/pages/homework_correction/job_personal_detail.dart index 6a58867..4cde8f7 100644 --- a/marking_app/lib/pages/homework_correction/job_personal_detail.dart +++ b/marking_app/lib/pages/homework_correction/job_personal_detail.dart @@ -61,18 +61,39 @@ class _JobPersonalDetailState extends State BaseStructureResult res = await _client.getStudentJobHistory(widget.studentId, !isJob, startDataTime, endDataTime, page, pageSize); - setState(() { - studentData = res.data!; - if (page == 1) { - dataList = studentData!.pagedList.items; - } else { - dataList = [...dataList, ...studentData!.pagedList.items]; - } + if (res.success) { + res.data!.pagedList.items.forEach((element) { + int num = 0; + element.objectiveDtls.forEach((item) { + if (item.state == 0) { + num = num + 1; + } + }); + element.subjectiveDtls.forEach((subject) { + if (subject.state == 0) { + num = num + 1; + } + }); + if (num == + (element.objectiveDtls.length + element.subjectiveDtls.length)) { + element.allNotDone = true; + } + }); + + setState(() { + studentData = res.data!; + if (page == 1) { + dataList = studentData!.pagedList.items; + } else { + dataList = [...dataList, ...studentData!.pagedList.items]; + } + + totalPages = res.data!.pagedList.totalPages; + print('dataLists=${dataList.length}'); + print('totalpages=$totalPages'); + }); + } - totalPages = res.data!.pagedList.totalPages; - print('dataLists=${dataList.length}'); - print('totalpages=$totalPages'); - }); EasyLoading.dismiss(); } @@ -184,12 +205,16 @@ class _JobPersonalDetailState extends State jobType: isJob ? 1 : 2, customTimeStr: customTimeStr, customTime: tabController.index != 3 || - ((endDataTime == null || endDataTime == '') && (startDataTime == null || startDataTime == '')) + ((endDataTime == null || endDataTime == '') && + (startDataTime == null || startDataTime == '')) ? null : PickerDateRange( startDataTime == null || startDataTime == '' ? null - : DateTime.parse(startDataTime!),endDataTime == null || endDataTime == '' ? null : DateTime.parse(endDataTime!), + : DateTime.parse(startDataTime!), + endDataTime == null || endDataTime == '' + ? null + : DateTime.parse(endDataTime!), ), onTimeFilter: (String? startTime, String? endTime) { EasyLoading.show(status: 'loading...'); if (startTime == null && endTime == null) { @@ -263,7 +288,9 @@ class _JobPersonalDetailState extends State decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10.r)), - color: Colors.white), + color: item.allNotDone + ? Color(0xFFFFEDD3) + : Colors.white), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -361,8 +388,21 @@ class _JobPersonalDetailState extends State color: Colors.transparent, border: Border.all( width: 1.r, - color: Color( - 0xFF4CC793)), + color: subjective + .state == + 0 + ? Color( + 0xFFDDDDDD) + : subjective.state == + 3 + ? Color( + 0xFF666666) + : subjective.state == + 1 + ? Color( + 0xFFFF7474) + : Color( + 0xFF4CC793)), borderRadius: BorderRadius.all( Radius.circular( @@ -372,8 +412,20 @@ class _JobPersonalDetailState extends State subjective.questionNo, style: TextStyle( fontSize: 10.r, - color: - Color(0xFF4CC793)), + color: subjective + .state == + 0 + ? Color(0xFFDDDDDD) + : subjective.state == + 3 + ? Color( + 0xFF666666) + : subjective.state == + 1 + ? Color( + 0xFFFF7474) + : Color( + 0xFF4CC793)), )), ); }), diff --git a/marking_app/lib/pages/homework_correction/job_report.dart b/marking_app/lib/pages/homework_correction/job_report.dart index f505c33..0cabc85 100644 --- a/marking_app/lib/pages/homework_correction/job_report.dart +++ b/marking_app/lib/pages/homework_correction/job_report.dart @@ -339,7 +339,7 @@ class _JobReportState extends State with CommonMixin { height: 6.r, ), SizedBox( - height: data.kgReport.details.length > 10 ? 300.r : data.kgReport.details.length * 50.r + (isPadFlag == true ?40.r:65.r), + height: data.kgReport.details.length > 10 ? 300.r : data.kgReport.details.length * 40.r + (isPadFlag == true ?40.r:65.r), child: ReportTable( headList: ['题', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'], bodyList: data.kgReport.details, @@ -381,7 +381,7 @@ class _JobReportState extends State with CommonMixin { height: 10.r, ), SizedBox( - height: data.zgReport.details.length > 10 ? 300.r : data.zgReport.details.length * 50.r + 50.r, + height: data.zgReport.details.length > 10 ? 300.r : data.zgReport.details.length * 40.r +(isPad() == true ?40.r:65.r), child: ReportTable( headList: ['题', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'], bodyList: data.zgReport.details, diff --git a/marking_app/lib/pages/homework_correction/quick_data_check.dart b/marking_app/lib/pages/homework_correction/quick_data_check.dart index 356a5a6..88b9404 100644 --- a/marking_app/lib/pages/homework_correction/quick_data_check.dart +++ b/marking_app/lib/pages/homework_correction/quick_data_check.dart @@ -9,6 +9,7 @@ import 'package:marking_app/common/model/common/base_structure_result.dart'; import 'package:marking_app/common/model/job/job_data_report.dart'; import 'package:marking_app/pages/homework_correction/widget/quick_data_check_bottom.dart'; import 'package:marking_app/pages/homework_correction/widget/quick_student_data_table.dart'; +import 'package:marking_app/pages/homework_correction/widget/report_table.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/request/rest_client.dart'; @@ -366,6 +367,91 @@ class _QuickDataCheckPageState extends State ), ), QuickDataCheckBottom(jobData:jobData,jobId: widget.jobId,), + //客观题 + Container( + padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), + margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(6.r)), + ), + 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( + '${jobData!.kgReport.correctRate}%', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF6888FD), fontWeight: FontWeight.w600), + ), + ], + ), + SizedBox( + height: 6.r, + ), + SizedBox( + height: jobData!.kgReport.details.length > 10 ? 300.r : jobData!.kgReport.details.length * 40.r + (isPad() == true ?40.r:65.r), + child: ReportTable( + headList: ['题', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'], + bodyList: jobData!.kgReport.details, + fixedCols: 1, + fixedRows: 1, + ), + ) + ], + ), + ), + //主观题 + Container( + padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), + margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(6.r)), + ), + 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: 6.r, + ), + Text( + '${jobData!.zgReport.correctRate}%', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF6888FD), fontWeight: FontWeight.w600), + ), + ], + ), + SizedBox( + height: 10.r, + ), + SizedBox( + height: jobData!.zgReport.details.length > 10 ? 300.r : jobData!.zgReport.details.length * 40.r +(isPad() == true ?40.r:65.r), + child: ReportTable( + headList: ['题', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'], + bodyList: jobData!.zgReport.details, + fixedCols: 1, + fixedRows: 1, + isKG: true, + ), + ) + ], + ), + ), ], ), )) @@ -373,7 +459,9 @@ class _QuickDataCheckPageState extends State padding: EdgeInsets.only( top: MediaQuery.of(context).size.height / 2 - 200.r), child: MyEmptyWidget(), - ) + ), + + ], ), ),