数据快查

This commit is contained in:
machuanyu 2024-10-28 09:23:33 +08:00
parent 5b202fd748
commit a43f803cca
7 changed files with 274 additions and 185 deletions

View File

@ -185,6 +185,9 @@ class Students extends Object {
@JsonKey(name: 'okRate') @JsonKey(name: 'okRate')
double? okRate; double? okRate;
@JsonKey(name: 'answerRate')
double? answerRate;
@JsonKey(name: 'noAnswerCount') @JsonKey(name: 'noAnswerCount')
int? noAnswerCount; int? noAnswerCount;
@ -194,7 +197,7 @@ class Students extends Object {
@JsonKey(name: 'ttlSec') @JsonKey(name: 'ttlSec')
String? 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<String, dynamic> srcJson) => _$StudentsFromJson(srcJson); factory Students.fromJson(Map<String, dynamic> srcJson) => _$StudentsFromJson(srcJson);

View File

@ -191,6 +191,9 @@ class StudentQuestions extends Object {
@JsonKey(name: 'height') @JsonKey(name: 'height')
double height; double height;
@JsonKey(name: 'useTime')
int? useTime;
StudentQuestions({ StudentQuestions({
required this.height, required this.height,
required this.questionNo, required this.questionNo,
@ -200,6 +203,7 @@ class StudentQuestions extends Object {
this.scoreStep, this.scoreStep,
this.studentScore, this.studentScore,
this.isCorrect, this.isCorrect,
this.useTime,
}); });
factory StudentQuestions.fromJson(Map<String, dynamic> srcJson) => factory StudentQuestions.fromJson(Map<String, dynamic> srcJson) =>

View File

@ -124,9 +124,13 @@ class Utils {
stu.zgtStu = zgt.where((w) => w.studentId == stu.studentId).toList(); 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.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
//
stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length; stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length;
//
stu.zgtErrorCount = stu.zgtStu!.where((w) => w.state == 2).length; stu.zgtErrorCount = stu.zgtStu!.where((w) => w.state == 2).length;
//
stu.zgtUnrated = stu.zgtStu!.where((w) => w.state == 1).length; stu.zgtUnrated = stu.zgtStu!.where((w) => w.state == 1).length;
//
stu.zgtAnswerCount = stu.zgtStu!.where((w) => w.state != 0).length; stu.zgtAnswerCount = stu.zgtStu!.where((w) => w.state != 0).length;
stu.isAllCorrect = stu.kgtOkCount! + stu.zgtOkCount! == kgt.length + zgt.length ? true : false; stu.isAllCorrect = stu.kgtOkCount! + stu.zgtOkCount! == kgt.length + zgt.length ? true : false;
stu.allOk = data.dtls.where((w) { stu.allOk = data.dtls.where((w) {
@ -157,6 +161,10 @@ class Utils {
int ttlCount = stu.queDtls!.length; int ttlCount = stu.queDtls!.length;
stu.okRate = Utils.calcRate(okCount, ttlCount); 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 stuDtls = data.dtls.where((w) => w.studentId == stu.studentId);
var secList = []; var secList = [];
for(var sec in stuDtls){ for(var sec in stuDtls){

View File

@ -71,6 +71,35 @@ class _BottomAnnotationSwitchJobState extends State<BottomAnnotationSwitch> with
// padding: EdgeInsets.symmetric(vertical: 1.h), // padding: EdgeInsets.symmetric(vertical: 1.h),
child: Row( child: Row(
children: [ 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( Expanded(
flex: 7, flex: 7,
child: Column( child: Column(
@ -189,35 +218,6 @@ class _BottomAnnotationSwitchJobState extends State<BottomAnnotationSwitch> 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),
),
),
),
],
),
),
], ],
), ),
); );

View File

@ -302,7 +302,6 @@ Widget $questionNumberView(BuildContext context, HomeworkReviewLogic logic,
var imageVal = sateData.imageScale.value; var imageVal = sateData.imageScale.value;
if (imageVal == null) return const SizedBox(); if (imageVal == null) return const SizedBox();
var studentQuestions = sateData.studentQuestions.value; var studentQuestions = sateData.studentQuestions.value;
var boxHeight = imageVal.boxHeight; var boxHeight = imageVal.boxHeight;
var actualImgHeight = imageVal.actualImgHeight; // var actualImgHeight = imageVal.actualImgHeight; //
@ -360,14 +359,13 @@ Widget $scoringQuestionsView(
useEffect(() { useEffect(() {
return () {}; return () {};
}, []); }, []);
var padinVal = item.correctRate > 0 var padinVal = item.correctRate > 0
? EdgeInsets.only(top: 6.4.h) ? EdgeInsets.only(top: 6.4.h)
: EdgeInsets.symmetric(vertical: 2.h); : EdgeInsets.symmetric(vertical: 2.h);
return Container( return Container(
height: item.height * scaleRatio, height: item.height * scaleRatio,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
child: Stack( child: item.useTime == 0?Container():Stack(
alignment: const FractionalOffset(0, 0), alignment: const FractionalOffset(0, 0),
children: [ children: [
Row( Row(

View File

@ -100,12 +100,16 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> {
padding: EdgeInsets.symmetric(vertical: 15.r, horizontal: 15.r), padding: EdgeInsets.symmetric(vertical: 15.r, horizontal: 15.r),
margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))),
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(
height: 2.r, Expanded(child: Column(
), // crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -144,16 +148,17 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> {
// //
SizedBox( SizedBox(
height: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3,
// width: MediaQuery.of(context).size.width * 0.08,
child: PieChart( child: PieChart(
PieChartData( PieChartData(
borderData: FlBorderData(show: false), borderData: FlBorderData(show: false),
sectionsSpace: 0, sectionsSpace: 0,
centerSpaceRadius: MediaQuery.of(context).size.width * 0.06, centerSpaceRadius: MediaQuery.of(context).size.width * 0.04,
sections: [ sections: [
PieChartSectionData( PieChartSectionData(
color: const Color(0xFF4CC793), color: const Color(0xFF4CC793),
value: state.dataCount.studentSubmitCount! / state.dataCount.studentCount! * 100, value: state.dataCount.studentSubmitCount! / state.dataCount.studentCount! * 100,
radius: MediaQuery.of(context).size.width * 0.07 + 5, radius: MediaQuery.of(context).size.width * 0.06 + 5,
title: '${state.dataCount.studentSubmitCount}', title: '${state.dataCount.studentSubmitCount}',
titleStyle: TextStyle( titleStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -164,7 +169,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> {
color: const Color(0xFF6888FD), color: const Color(0xFF6888FD),
value: value:
(state.dataCount.studentCount! - state.dataCount.studentSubmitCount!) / state.dataCount.studentCount! * 100, (state.dataCount.studentCount! - state.dataCount.studentSubmitCount!) / state.dataCount.studentCount! * 100,
radius: MediaQuery.of(context).size.width * 0.07, radius: MediaQuery.of(context).size.width * 0.06,
title: '${state.dataCount.studentCount! - state.dataCount.studentSubmitCount!}', title: '${state.dataCount.studentCount! - state.dataCount.studentSubmitCount!}',
titleStyle: TextStyle( titleStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -175,6 +180,12 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> {
), ),
), ),
), ),
],
)),
SizedBox(width: 20.r,),
Expanded(child: Column(
children: [
// //
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -240,6 +251,9 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> {
)), )),
], ],
), ),
],))
], ],
), ),
), ),

View File

@ -1,7 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/job/homework_details.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'; import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart';
class QuickDataCheckBottom extends StatefulWidget { class QuickDataCheckBottom extends StatefulWidget {
@ -22,6 +24,7 @@ class _QuickDataCheckBottomState extends State<QuickDataCheckBottom> {
RxList<Students> followList = RxList(); RxList<Students> followList = RxList();
RxBool sortType = true.obs; RxBool sortType = true.obs;
RxBool sortLevel = false.obs; RxBool sortLevel = false.obs;
RxBool sortCompleteRate = false.obs;
@override @override
void initState() { void initState() {
@ -63,6 +66,7 @@ class _QuickDataCheckBottomState extends State<QuickDataCheckBottom> {
sortType.value = !sortType.value; sortType.value = !sortType.value;
sortLevel.value = false; sortLevel.value = false;
sortCompleteRate.value = false;
}, },
child: Obx(() { child: Obx(() {
return Row( return Row(
@ -107,6 +111,7 @@ class _QuickDataCheckBottomState extends State<QuickDataCheckBottom> {
sortType.value = true; sortType.value = true;
} }
sortCompleteRate.value = false;
sortLevel.value = !sortLevel.value; sortLevel.value = !sortLevel.value;
}, },
child: Obx(() { child: Obx(() {
@ -135,6 +140,56 @@ class _QuickDataCheckBottomState extends State<QuickDataCheckBottom> {
); );
}), }),
), ),
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( SizedBox(
@ -230,8 +285,10 @@ class _QuickDataCheckBottomState extends State<QuickDataCheckBottom> {
height: 10.r, height: 10.r,
), ),
Obx(() { Obx(() {
return SizedBox( return Column(
height: showList.value.length > 5 ? 350.r : showList.value.length * 50.r + 40.r, children: [
SizedBox(
height: showList.value.length > 5 ? 350.r : showList.value.length * 50.r + 60.r,
child: QuickStudentDataTable( child: QuickStudentDataTable(
headList: ['学生姓名', '总用时','客观题', '主观题', '客观题状态', '主观题状态', '未批阅'], headList: ['学生姓名', '总用时','客观题', '主观题', '客观题状态', '主观题状态', '未批阅'],
bodyList: showList.value, bodyList: showList.value,
@ -244,8 +301,13 @@ class _QuickDataCheckBottomState extends State<QuickDataCheckBottom> {
zgCount: widget.zgCount, zgCount: widget.zgCount,
subject:widget.subject, subject:widget.subject,
), ),
),
if(showList.isEmpty)
MyEmptyWidget(imgWidth: 100.r,imgHeight: 100.r,font: 10.sp,),
],
); );
}) }),
], ],
), ),
); );