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 0810109..17fef7b 100644 --- a/marking_app/lib/pages/homework_correction/quick_data_check.dart +++ b/marking_app/lib/pages/homework_correction/quick_data_check.dart @@ -73,250 +73,255 @@ class _QuickDataCheckState extends State with CommonMixin { 0.09, 0.3 ])), - child: SingleChildScrollView( - child: Column( - children: [ - Row( - children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios, color: Colors.white), - onPressed: () => Navigator.of(context).pop(), - ), - Expanded( - child: Center( - child: Text( - '数据快查', - style: TextStyle(fontSize: 16.sp, color: Colors.white), - ))), - ], - ), - Padding( - padding: EdgeInsets.only(left: 14.r, top: 10.r), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/job_report_class_icon.png', - width: 22.r, - height: 22.r, - ), - SizedBox( - width: 6.r, - ), - Text( - widget.className, - style: TextStyle(fontSize: 14.r, color: Colors.white), - ) - ], + child: Column( + children: [ + Row( + children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.white), + onPressed: () => Navigator.of(context).pop(), ), - ), - Container( - padding: EdgeInsets.symmetric(vertical: 10.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, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, + Expanded( + child: Center( + child: Text( + '数据快查', + style: TextStyle(fontSize: 16.sp, color: Colors.white), + ))), + ], + ), + SizedBox(height:10.r), + Expanded(child: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 14.r, top: 2.r), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( - width: 14.r, - height: 14.r, - decoration: BoxDecoration( - color: Color(0xFF4CC793), - borderRadius: - BorderRadius.all(Radius.circular(7.r))), + Image.asset( + 'assets/images/job_report_class_icon.png', + width: 22.r, + height: 22.r, ), SizedBox( width: 6.r, ), Text( - '已提交', - style: TextStyle( - fontSize: 12.sp, color: Color(0xFF333333)), - ), - SizedBox( - width: 35.r, - ), - Container( - width: 14.r, - height: 14.r, - decoration: BoxDecoration( - color: Color(0xFF6888FD), - borderRadius: - BorderRadius.all(Radius.circular(7.r))), - ), - SizedBox( - width: 6.r, - ), - Text( - '未提交', - style: TextStyle( - fontSize: 12.sp, color: Color(0xFF333333)), + widget.className, + style: TextStyle(fontSize: 14.r, color: Colors.white), ) ], ), - //环形图 - SizedBox( - height: MediaQuery.of(context).size.width * 0.5, - child: PieChart( - PieChartData( - borderData: FlBorderData(show: false), - sectionsSpace: 0, - centerSpaceRadius: MediaQuery.of(context).size.width * 0.1, - sections: [ - PieChartSectionData( - color: Color(0xFF4CC793), - value: jobData!.validCount/(jobData!.validCount+jobData!.noAnswerCount) * 100, - radius: MediaQuery.of(context).size.width * 0.1 + 5, - title: '${jobData!.validCount}人', - titleStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white, - ), + ), + Container( + padding: EdgeInsets.symmetric(vertical: 10.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, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 14.r, + height: 14.r, + decoration: BoxDecoration( + color: Color(0xFF4CC793), + borderRadius: + BorderRadius.all(Radius.circular(7.r))), ), - PieChartSectionData( - color: Color(0xFF6888FD), - value: jobData!.noAnswerCount/(jobData!.validCount+jobData!.noAnswerCount) * 100, - radius: MediaQuery.of(context).size.width * 0.1, - title: '${jobData!.noAnswerCount}人', - titleStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white, - ), + SizedBox( + width: 6.r, + ), + Text( + '已提交', + style: TextStyle( + fontSize: 12.sp, color: Color(0xFF333333)), + ), + SizedBox( + width: 35.r, + ), + Container( + width: 14.r, + height: 14.r, + decoration: BoxDecoration( + color: Color(0xFF6888FD), + borderRadius: + BorderRadius.all(Radius.circular(7.r))), + ), + SizedBox( + width: 6.r, + ), + Text( + '未提交', + style: TextStyle( + fontSize: 12.sp, color: Color(0xFF333333)), + ) + ], + ), + //环形图 + SizedBox( + height: MediaQuery.of(context).size.width * 0.5, + child: PieChart( + PieChartData( + borderData: FlBorderData(show: false), + sectionsSpace: 0, + centerSpaceRadius: MediaQuery.of(context).size.width * 0.1, + sections: [ + PieChartSectionData( + color: Color(0xFF4CC793), + value: jobData!.validCount/(jobData!.validCount+jobData!.noAnswerCount) * 100, + radius: MediaQuery.of(context).size.width * 0.1 + 5, + title: '${jobData!.validCount}人', + titleStyle: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + PieChartSectionData( + color: Color(0xFF6888FD), + value: jobData!.noAnswerCount/(jobData!.validCount+jobData!.noAnswerCount) * 100, + radius: MediaQuery.of(context).size.width * 0.1, + title: '${jobData!.noAnswerCount}人', + titleStyle: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + ], + ), + ), + ), + // 客观进度条 + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '客观题答题进度', + style: TextStyle( + fontSize: 10.sp, color: Color(0xFF8B8B8B)), + ), + Text('${doubleToStringAsFixed(jobData!.kgValidRate)}%', + style: TextStyle( + fontSize: 10.sp, color: Color(0xFF333333)), ), ], ), - ), - ), - // 客观进度条 - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '客观题答题进度', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF8B8B8B)), + 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: jobData!.kgValidRate/100, + progressColor: Color(0xFFFF7F22), + backgroundColor: Color(0xFFEAEAEA), + barRadius: Radius.circular(10.r), + )), + ], ), - Text('${doubleToStringAsFixed(jobData!.kgValidRate)}%', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF333333)), + SizedBox(height: 20.r), + // 主观进度条 + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '主观题答题进度', + style: TextStyle( + fontSize: 10.sp, color: Color(0xFF8B8B8B)), + ), + Text( + '${doubleToStringAsFixed(jobData!.zgValidRate)}%', + style: TextStyle( + fontSize: 10.sp, color: 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: jobData!.zgValidRate/100, + progressColor: Color(0xFFFF7F22), + backgroundColor: Color(0xFFEAEAEA), + barRadius: Radius.circular(10.r), + )), + ], ), ], ), - SizedBox(height: 6.r), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + ), + 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: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 9.h, - animationDuration: 2500, - percent: jobData!.kgValidRate/100, - progressColor: Color(0xFFFF7F22), - backgroundColor: Color(0xFFEAEAEA), - barRadius: Radius.circular(10.r), - )), - ], - ), - SizedBox(height: 20.r), - // 主观进度条 - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '主观题答题进度', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF8B8B8B)), - ), - Text( - '${doubleToStringAsFixed(jobData!.zgValidRate)}%', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF333333)), + InkWell( + onTap: (){ + jobData!.studentDetails.sort((a, b) { + int num1 = a.kgValidRate + a.zgValidRate; + int num2 = b.kgValidRate + b.zgValidRate; + return num2.compareTo(num1); + }); + setState(() { + jobData!.studentDetails; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + '未提交排序', + style: TextStyle( + fontSize: 12.sp, color: Color(0xFF6888FD)), + ), + SizedBox( + width: 10.r, + ), + Image.asset( + 'assets/images/sort_icon.png', + width: 14.r, + height: 14.r, + ), + ], + ), ), + SizedBox(height: 10.r,), + SizedBox( + height: jobData!.studentDetails.length>5?350.r:jobData!.studentDetails.length * 50.r + 40.r, + child: QuickStudentDataTable( + headList: ['学生姓名','客观题','主观题','客观题错题','主观题错题'], + bodyList: jobData!.studentDetails, + jobId: widget.jobId, + fixedRows: 1, + fixedCols: 0, + ), + ) ], ), - 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: jobData!.zgValidRate/100, - progressColor: Color(0xFFFF7F22), - backgroundColor: Color(0xFFEAEAEA), - barRadius: Radius.circular(10.r), - )), - ], - ), - ], - ), + ), + ], ), - 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: [ - InkWell( - onTap: (){ - jobData!.studentDetails.sort((a, b) { - int num1 = a.kgValidRate + a.zgValidRate; - int num2 = b.kgValidRate + b.zgValidRate; - return num2.compareTo(num1); - }); - setState(() { - jobData!.studentDetails; - }); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - '未提交排序', - style: TextStyle( - fontSize: 12.sp, color: Color(0xFF6888FD)), - ), - SizedBox( - width: 10.r, - ), - Image.asset( - 'assets/images/sort_icon.png', - width: 14.r, - height: 14.r, - ), - ], - ), - ), - SizedBox(height: 10.r,), - SizedBox( - height: jobData!.studentDetails.length>5?300.r:jobData!.studentDetails.length * 50.r + 40.r, - child: QuickStudentDataTable( - headList: ['学生姓名','客观题','主观题','客观题错题','主观题错题'], - bodyList: jobData!.studentDetails, - jobId: widget.jobId, - fixedRows: 1, - fixedCols: 0, - ), - ) - ], - ), - ), - ], - ), + )) + ], ), ), );