数据快查增加客观题和主观题表格

This commit is contained in:
machuanyu 2024-03-28 17:09:39 +08:00
parent ffc9fdd9c1
commit 85a80c364a
5 changed files with 175 additions and 23 deletions

View File

@ -1,4 +1,5 @@
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
import 'package:marking_app/common/model/job/job_report_model.dart';
part 'job_data_report.g.dart'; part 'job_data_report.g.dart';
@ -41,8 +42,15 @@ class JobDataReport extends Object {
@JsonKey(name: 'studentDetails') @JsonKey(name: 'studentDetails')
List<StudentDetails> studentDetails; List<StudentDetails> studentDetails;
@JsonKey(name: 'kgReport')
KgReport kgReport;
@JsonKey(name: 'zgReport')
ZgReport zgReport;
JobDataReport(this.jobId, this.jobName, this.gradeName, this.className, this.validCount, this.noAnswerCount, 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.sortType = true,this.sortLevel = false,this.hasUnrated = false]) {
this.studentDetails.sort((a, b) { this.studentDetails.sort((a, b) {

View File

@ -99,7 +99,11 @@ class Items extends Object {
@JsonKey(name: 'subjectiveDtls') @JsonKey(name: 'subjectiveDtls')
List<SubjectiveDtls> subjectiveDtls; List<SubjectiveDtls> 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<String, dynamic> srcJson) => _$ItemsFromJson(srcJson); factory Items.fromJson(Map<String, dynamic> srcJson) => _$ItemsFromJson(srcJson);

View File

@ -61,18 +61,39 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
BaseStructureResult<JobStudentHistory> res = BaseStructureResult<JobStudentHistory> res =
await _client.getStudentJobHistory(widget.studentId, !isJob, await _client.getStudentJobHistory(widget.studentId, !isJob,
startDataTime, endDataTime, page, pageSize); startDataTime, endDataTime, page, pageSize);
setState(() { if (res.success) {
studentData = res.data!; res.data!.pagedList.items.forEach((element) {
if (page == 1) { int num = 0;
dataList = studentData!.pagedList.items; element.objectiveDtls.forEach((item) {
} else { if (item.state == 0) {
dataList = [...dataList, ...studentData!.pagedList.items]; 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(); EasyLoading.dismiss();
} }
@ -184,12 +205,16 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
jobType: isJob ? 1 : 2, jobType: isJob ? 1 : 2,
customTimeStr: customTimeStr, customTimeStr: customTimeStr,
customTime: tabController.index != 3 || customTime: tabController.index != 3 ||
((endDataTime == null || endDataTime == '') && (startDataTime == null || startDataTime == '')) ((endDataTime == null || endDataTime == '') &&
(startDataTime == null || startDataTime == ''))
? null ? null
: PickerDateRange( : PickerDateRange(
startDataTime == null || startDataTime == '' startDataTime == null || startDataTime == ''
? null ? 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) { ), onTimeFilter: (String? startTime, String? endTime) {
EasyLoading.show(status: 'loading...'); EasyLoading.show(status: 'loading...');
if (startTime == null && endTime == null) { if (startTime == null && endTime == null) {
@ -263,7 +288,9 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(10.r)), BorderRadius.all(Radius.circular(10.r)),
color: Colors.white), color: item.allNotDone
? Color(0xFFFFEDD3)
: Colors.white),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -361,8 +388,21 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
color: Colors.transparent, color: Colors.transparent,
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
color: Color( color: subjective
0xFF4CC793)), .state ==
0
? Color(
0xFFDDDDDD)
: subjective.state ==
3
? Color(
0xFF666666)
: subjective.state ==
1
? Color(
0xFFFF7474)
: Color(
0xFF4CC793)),
borderRadius: borderRadius:
BorderRadius.all( BorderRadius.all(
Radius.circular( Radius.circular(
@ -372,8 +412,20 @@ class _JobPersonalDetailState extends State<JobPersonalDetail>
subjective.questionNo, subjective.questionNo,
style: TextStyle( style: TextStyle(
fontSize: 10.r, fontSize: 10.r,
color: color: subjective
Color(0xFF4CC793)), .state ==
0
? Color(0xFFDDDDDD)
: subjective.state ==
3
? Color(
0xFF666666)
: subjective.state ==
1
? Color(
0xFFFF7474)
: Color(
0xFF4CC793)),
)), )),
); );
}), }),

View File

@ -339,7 +339,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
height: 6.r, height: 6.r,
), ),
SizedBox( 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( child: ReportTable(
headList: ['', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'], headList: ['', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'],
bodyList: data.kgReport.details, bodyList: data.kgReport.details,
@ -381,7 +381,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
height: 10.r, height: 10.r,
), ),
SizedBox( 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( child: ReportTable(
headList: ['', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'], headList: ['', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'],
bodyList: data.zgReport.details, bodyList: data.zgReport.details,

View File

@ -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/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_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/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/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/request/rest_client.dart'; import 'package:marking_app/utils/request/rest_client.dart';
@ -366,6 +367,91 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
), ),
), ),
QuickDataCheckBottom(jobData:jobData,jobId: widget.jobId,), 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<QuickDataCheckPage>
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height / 2 - 200.r), top: MediaQuery.of(context).size.height / 2 - 200.r),
child: MyEmptyWidget(), child: MyEmptyWidget(),
) ),
], ],
), ),
), ),