diff --git a/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart b/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart index 1b65bfd..5023e31 100644 --- a/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart +++ b/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart @@ -172,14 +172,14 @@ Widget $completedHomeworkView(BuildContext context, child: Row( children: [ Container( - width: 32.w, + width: isPad() ? 32.w : 36.w, height: 18.h, alignment: Alignment.center, - padding: EdgeInsets.only(left: 2.w), + padding: EdgeInsets.only(left: isPad() ? 2.w : 3.w), decoration: BoxDecoration( color: Color.fromRGBO(104, 136, 253, 1), borderRadius: BorderRadius.only( - topLeft: Radius.circular(18.r), + topLeft: Radius.circular(14.r), topRight: Radius.circular(3.r), bottomLeft: Radius.circular(4.r), bottomRight: Radius.circular(4.r), @@ -202,7 +202,7 @@ Widget $completedHomeworkView(BuildContext context, Padding( padding: EdgeInsets.symmetric(horizontal: 10.w), child: Row( - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, children: [ quickText( jobTaskItem.createTime.substring(0, 10), @@ -224,6 +224,13 @@ Widget $completedHomeworkView(BuildContext context, size: 12.sp, fontWeight: FontWeight.w600, ), + Expanded(child: SizedBox()), + FavoriteButton( + jobTaskItem.id, + jobTaskItem.title, + margin: EdgeInsets.zero, + isRow: false, + ), ], ), ), @@ -678,7 +685,8 @@ class FavoriteButton extends HookWidget with CommonMixin { final int jobId; final String jobName; EdgeInsets? margin; - FavoriteButton(this.jobId, this.jobName, {this.margin, super.key}); + final bool isRow; + FavoriteButton(this.jobId, this.jobName, {this.margin, this.isRow = true, super.key}); Future getInvolveClasses() async { try { @@ -715,27 +723,47 @@ class FavoriteButton extends HookWidget with CommonMixin { }, []); if (favoriteNumber.value <= 0) return Container(); margin ??= EdgeInsets.only(top: 15.h); - return Row( - children: [ - Container( - margin: margin, - child: Material( - color: Color.fromRGBO(244, 244, 244, 1), - borderRadius: BorderRadius.circular(20.r), - child: InkWell( - onTap: () => bookmarks(context), - borderRadius: BorderRadius.circular(8.r), - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w), - decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), - child: quickText('收藏夹(${favoriteNumber.value})', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)), + return isRow + ? Row( + children: [ + Container( + margin: margin, + child: Material( + color: Color.fromRGBO(244, 244, 244, 1), + borderRadius: BorderRadius.circular(20.r), + child: InkWell( + onTap: () => bookmarks(context), + borderRadius: BorderRadius.circular(8.r), + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), + child: quickText('收藏夹(${favoriteNumber.value})', + size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)), + ), + ), + ), + ), + Expanded(child: SizedBox()) + ], + ) + : Container( + margin: margin, + child: Material( + color: Color.fromRGBO(244, 244, 244, 1), + borderRadius: BorderRadius.circular(20.r), + child: InkWell( + onTap: () => bookmarks(context), + borderRadius: BorderRadius.circular(8.r), + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), + child: + quickText('收藏夹(${favoriteNumber.value})', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)), + ), ), ), - ), - ), - Expanded(child: SizedBox()) - ], - ); + ); } } diff --git a/marking_app/lib/pages/homework_correction/job_report.dart b/marking_app/lib/pages/homework_correction/job_report.dart index 0eed7ad..6a538d9 100644 --- a/marking_app/lib/pages/homework_correction/job_report.dart +++ b/marking_app/lib/pages/homework_correction/job_report.dart @@ -28,7 +28,7 @@ class JobReport extends StatefulWidget { final String? className; final String title; - const JobReport({required this.id, required this.title,this.schoolId,this.gradeId,this.className, super.key}); + const JobReport({required this.id, required this.title, this.schoolId, this.gradeId, this.className, super.key}); @override State createState() => _JobReportState(); @@ -51,16 +51,14 @@ class _JobReportState extends State with CommonMixin { Future getInvolveClasses() async { try { RestClient _client = await getClient(); - BaseStructureResult> result = - await _client.getJobReportJoinClasses(widget.id); + BaseStructureResult> result = await _client.getJobReportJoinClasses(widget.id); if (result.success) { toUpState(setState, () { - involveClasses = [ - JobReportJoinClass(-1, '全部', -1, '全部', '全部', '全部', -1, -1, '-1'), - ...(result.data ?? []) - ]; + involveClasses = [JobReportJoinClass(-1, '全部', -1, '全部', '全部', '全部', -1, -1, '-1'), ...(result.data ?? [])]; involveClasses?.forEach((element) { - if(element.className == widget.className && element.gradeId == widget.gradeId && element.schoolId == widget.schoolId){ + if (element.className == widget.className && + element.gradeId == widget.gradeId && + element.schoolId == widget.schoolId) { classData = element; } }); @@ -77,8 +75,7 @@ class _JobReportState extends State with CommonMixin { RestClient _client = await getClient(); Map param = classData?.toJson() ?? {}; param['jobid'] = widget.id; - BaseStructureResult data = - await _client.getJobReport(param); + BaseStructureResult data = await _client.getJobReport(param); if (!data.success) { throw Exception(data.message ?? '获取报告失败'); } @@ -96,8 +93,7 @@ class _JobReportState extends State with CommonMixin { RestClient _client = await getClient(); BaseStructureResult> datas = await _client.getDetailKnowledge(widget.id, knowledge.knowledgeId); - if (!datas.success) - return ToastUtils.showInfo(datas.message ?? '获取知识点失败'); + if (!datas.success) return ToastUtils.showInfo(datas.message ?? '获取知识点失败'); knowledge.details = datas.data; } @@ -119,9 +115,7 @@ class _JobReportState extends State with CommonMixin { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - quickText(knowledge.knowledgeName, - color: Theme.of(context1).primaryColor, - size: 16.sp), + quickText(knowledge.knowledgeName, color: Theme.of(context1).primaryColor, size: 16.sp), quickText( '的掌握情况', color: Color.fromRGBO(60, 60, 60, 1), @@ -131,157 +125,102 @@ class _JobReportState extends State with CommonMixin { ], )), Expanded( - child: ListView( - padding: EdgeInsets.symmetric(horizontal: 12.w), - children: [ - DataTable( - sortAscending: false, - columns: [ - DataColumn( - label: quickText('班级', - color: Color.fromRGBO(114, 114, 114, 1), - size: 14.sp, - fontWeight: FontWeight.bold), - ), - DataColumn( - label: quickText('掌握度', - color: Color.fromRGBO(114, 114, 114, 1), - size: 14.sp, - fontWeight: FontWeight.bold), - ), - DataColumn( - label: quickText('人数', - color: Color.fromRGBO(114, 114, 114, 1), - size: 14.sp, - fontWeight: FontWeight.bold), - ), - DataColumn( - label: quickText('操作', - color: Color.fromRGBO(114, 114, 114, 1), - size: 14.sp, - fontWeight: FontWeight.bold), - ), - ], - rows: [ - ...knowledge.details?.map((e) { - return DataRow(cells: [ - DataCell(quickText(e.className, - color: Color.fromRGBO(61, 61, 61, 1))), - DataCell(quickText( - e.rate > 0 - ? doubleToStringAsFixed(e.rate) + - '%' - : 0, - color: Color.fromRGBO(61, 61, 61, 1))), - DataCell(quickText(e.ratio, - color: Color.fromRGBO(61, 61, 61, 1))), - DataCell( - quickText('详情', - color: Color.fromRGBO( - 239, 135, 20, 1)), onTap: () { - showDialog( - context: context1, - builder: (BuildContext context2) { - return Container( - margin: EdgeInsets.symmetric( - vertical: 150.h, - horizontal: 24.w), - padding: EdgeInsets.symmetric( - vertical: 15.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.circular(18.sp), - ), - child: Column( - children: [ - Container( - child: quickText( - '${e.className}的掌握情况', - color: Color.fromRGBO( - 239, 135, 20, 1), - size: 16.sp, - maxLines: 2, - fontWeight: FontWeight.bold, - )), - SizedBox(height: 20.h), - Expanded( - child: ListView( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - children: [ - DataTable( - sortAscending: false, - columns: [ - DataColumn( - label: quickText( - '学生名字', - color: Color - .fromRGBO( - 114, - 114, - 114, - 1), - size: 14.sp, - fontWeight: - FontWeight - .bold), - ), - DataColumn( - label: quickText( - '掌握度', - color: Color - .fromRGBO( - 114, - 114, - 114, - 1), - size: 14.sp, - fontWeight: - FontWeight - .bold), - ), - ], - rows: [ - ...e.studentReports - .map((e) { - return DataRow( - cells: [ - DataCell( - quickText( - e.studentName)), - DataCell(e - .pass - ? Icon( - Icons - .check_outlined, - color: Colors - .green) - : Icon( - Icons - .close_outlined, - color: - Colors.red)), - ], - ); - }).toList() - ], - ), - ]), - ) - ], - ), - ); - }, - ); - }), - ]); - }).toList() ?? - [], - ], + child: ListView(padding: EdgeInsets.symmetric(horizontal: 12.w), children: [ + DataTable( + sortAscending: false, + columns: [ + DataColumn( + label: quickText('班级', + color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), ), - ]), + DataColumn( + label: quickText('掌握度', + color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + ), + DataColumn( + label: quickText('人数', + color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + ), + DataColumn( + label: quickText('操作', + color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + ), + ], + rows: [ + ...knowledge.details?.map((e) { + return DataRow(cells: [ + DataCell(quickText(e.className, color: Color.fromRGBO(61, 61, 61, 1))), + DataCell(quickText(e.rate > 0 ? doubleToStringAsFixed(e.rate) + '%' : 0, + color: Color.fromRGBO(61, 61, 61, 1))), + DataCell(quickText(e.ratio, color: Color.fromRGBO(61, 61, 61, 1))), + DataCell(quickText('详情', color: Color.fromRGBO(239, 135, 20, 1)), onTap: () { + showDialog( + context: context1, + builder: (BuildContext context2) { + return Container( + margin: EdgeInsets.symmetric(vertical: 150.h, horizontal: 24.w), + padding: EdgeInsets.symmetric(vertical: 15.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(18.sp), + ), + child: Column( + children: [ + Container( + child: quickText( + '${e.className}的掌握情况', + color: Color.fromRGBO(239, 135, 20, 1), + size: 16.sp, + maxLines: 2, + fontWeight: FontWeight.bold, + )), + SizedBox(height: 20.h), + Expanded( + child: + ListView(padding: EdgeInsets.symmetric(horizontal: 12.w), children: [ + DataTable( + sortAscending: false, + columns: [ + DataColumn( + label: quickText('学生名字', + color: Color.fromRGBO(114, 114, 114, 1), + size: 14.sp, + fontWeight: FontWeight.bold), + ), + DataColumn( + label: quickText('掌握度', + color: Color.fromRGBO(114, 114, 114, 1), + size: 14.sp, + fontWeight: FontWeight.bold), + ), + ], + rows: [ + ...e.studentReports.map((e) { + return DataRow( + cells: [ + DataCell(quickText(e.studentName)), + DataCell(e.pass + ? Icon(Icons.check_outlined, color: Colors.green) + : Icon(Icons.close_outlined, color: Colors.red)), + ], + ); + }).toList() + ], + ), + ]), + ) + ], + ), + ); + }, + ); + }), + ]); + }).toList() ?? + [], + ], + ), + ]), ) ], ), @@ -321,8 +260,7 @@ class _JobReportState extends State with CommonMixin { }), ],*/ ), - body: MyFutureBuilder.buildFutureBuilderOfSingleInstance( - context, _future, (data) { + body: MyFutureBuilder.buildFutureBuilderOfSingleInstance(context, _future, (data) { if (data == null) return Container( alignment: Alignment.center, @@ -345,8 +283,7 @@ class _JobReportState extends State with CommonMixin { ), child: Row( children: [ - $DropdownSelection(involveClasses, classData, - call: (JobReportJoinClass _classData) { + $DropdownSelection(involveClasses, classData, call: (JobReportJoinClass _classData) { classData = _classData; if (_classData.gradeId == -1) classData = null; _future = getReport(); @@ -358,7 +295,7 @@ class _JobReportState extends State with CommonMixin { ), //完成率、正确率 TopCount(data), - /* InkWell( + /* InkWell( onTap: (){ RouterManager.router.navigateTo( context, @@ -383,16 +320,26 @@ class _JobReportState extends State with CommonMixin { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text('客观题',style: TextStyle(fontSize: 14.sp,color: Color(0xFF5C5C5C),fontWeight: FontWeight.w600),), - SizedBox(width: 10.r,), - Text('${data.kgReport.correctRate}%',style: TextStyle(fontSize: 14.sp,color: Color(0xFF6888FD),fontWeight: FontWeight.w600),), + Text( + '客观题', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), + ), + SizedBox( + width: 10.r, + ), + Text( + '${data.kgReport.correctRate}%', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF6888FD), fontWeight: FontWeight.w600), + ), ], ), - SizedBox(height: 6.r,), SizedBox( - height: data.kgReport.details.length>10?300.r:data.kgReport.details.length * 50.r + 20.r, + height: 6.r, + ), + SizedBox( + height: data.kgReport.details.length > 10 ? 300.r : data.kgReport.details.length * 50.r + 20.r, child: ReportTable( - headList: ['题', '作答率','作答人数', '正确率', '标准答案', '优先批阅概况'], + headList: ['题', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'], bodyList: data.kgReport.details, fixedCols: 1, fixedRows: 1, @@ -415,27 +362,37 @@ class _JobReportState extends State with CommonMixin { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text('主观题',style: TextStyle(fontSize: 14.sp,color: Color(0xFF5C5C5C),fontWeight: FontWeight.w600),), - SizedBox(width: 6.r,), - Text('${data.zgReport.correctRate}%',style: TextStyle(fontSize: 14.sp,color: Color(0xFF6888FD),fontWeight: FontWeight.w600),), + Text( + '主观题', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), + ), + SizedBox( + width: 6.r, + ), + Text( + '${data.zgReport.correctRate}%', + style: TextStyle(fontSize: 14.sp, color: Color(0xFF6888FD), fontWeight: FontWeight.w600), + ), ], ), - SizedBox(height: 10.r,), SizedBox( - height: data.zgReport.details.length>10?300.r:data.zgReport.details.length * 50.r + 20.r, + height: 10.r, + ), + SizedBox( + height: data.zgReport.details.length > 10 ? 300.r : data.zgReport.details.length * 50.r + 20.r, child: ReportTable( - headList: ['题', '作答率','作答人数', '正确率', '查看原题', '优先批阅概况'], + headList: ['题', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'], bodyList: data.zgReport.details, fixedCols: 1, fixedRows: 1, - isKG:true, + isKG: true, ), ) ], ), ), - // 顶部图形数据 - /* $TopGraphic(data),*/ + // 顶部图形数据 + /* $TopGraphic(data),*/ // 掌握知识点的情况 Container( margin: EdgeInsets.symmetric(horizontal: 10.r), @@ -450,8 +407,7 @@ class _JobReportState extends State with CommonMixin { child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)), // 人员数据概况 Container( - margin: EdgeInsets.symmetric(horizontal: 10.r), - child: $PersonnelDataOverview(data.studentAnswerInfos)), + margin: EdgeInsets.symmetric(horizontal: 10.r), child: $PersonnelDataOverview(data.studentAnswerInfos)), ], ); }), @@ -461,11 +417,9 @@ class _JobReportState extends State with CommonMixin { /// 下拉选择框 @swidget -Widget $dropdownSelection( - List? involveClasses, JobReportJoinClass? classData, +Widget $dropdownSelection(List? involveClasses, JobReportJoinClass? classData, {required Function(JobReportJoinClass) call}) { - if (involveClasses == null) - return Container(child: quickText('点击重试')); // 点击重试 + if (involveClasses == null) return Container(child: quickText('点击重试')); // 点击重试 return Container( // width: 200.r, padding: EdgeInsets.symmetric(horizontal: 10.r), @@ -483,8 +437,7 @@ Widget $dropdownSelection( items: involveClasses.map((e) { return DropdownMenuItem( value: e.uniqueId!, - child: quickText(e.graduationYear + e.className, - size: 12.sp, color: Colors.black), + child: quickText(e.graduationYear + e.className, size: 12.sp, color: Colors.black), ); }).toList(), onChanged: (String? value) { @@ -536,58 +489,42 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { ), child: Column( children: [ - Container( - child: quickText('$title学生', - color: Color.fromRGBO(60, 60, 60, 1), size: 15.sp)), + Container(child: quickText('$title学生', color: Color.fromRGBO(60, 60, 60, 1), size: 15.sp)), Expanded( - child: ListView( - padding: EdgeInsets.symmetric(horizontal: 12.w), - children: [ - DataTable( - sortAscending: false, - columns: [ - DataColumn( - label: quickText('姓名', - color: Color.fromRGBO(114, 114, 114, 1), - size: 14.sp, - fontWeight: FontWeight.bold), - ), - DataColumn( - label: quickText('正确率', - color: Color.fromRGBO(114, 114, 114, 1), - size: 14.sp, - fontWeight: FontWeight.bold), - ), - DataColumn( - label: quickText('未答题数', - color: Color.fromRGBO(114, 114, 114, 1), - size: 14.sp, - fontWeight: FontWeight.bold), - ), - DataColumn( - label: quickText('用时(秒)', - color: Color.fromRGBO(114, 114, 114, 1), - size: 14.sp, - fontWeight: FontWeight.bold), - ), - ], - rows: [ - ...students.map((e) { - return DataRow(cells: [ - DataCell(quickText(e.studentName, - color: Color.fromRGBO(61, 61, 61, 1))), - DataCell(quickText( - doubleToStringAsFixed(e.correctRate) + '%', - color: Color.fromRGBO(61, 61, 61, 1))), - DataCell(quickText(e.noAnswerCount, - color: Color.fromRGBO(61, 61, 61, 1))), - DataCell(quickText(e.useTime, - color: Color.fromRGBO(61, 61, 61, 1))), - ]); - }).toList(), - ], + child: ListView(padding: EdgeInsets.symmetric(horizontal: 12.w), children: [ + DataTable( + sortAscending: false, + columns: [ + DataColumn( + label: quickText('姓名', + color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), ), - ]), + DataColumn( + label: quickText('正确率', + color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + ), + DataColumn( + label: quickText('未答题数', + color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + ), + DataColumn( + label: quickText('用时(秒)', + color: Color.fromRGBO(114, 114, 114, 1), size: 14.sp, fontWeight: FontWeight.bold), + ), + ], + rows: [ + ...students.map((e) { + return DataRow(cells: [ + DataCell(quickText(e.studentName, color: Color.fromRGBO(61, 61, 61, 1))), + DataCell(quickText(doubleToStringAsFixed(e.correctRate) + '%', + color: Color.fromRGBO(61, 61, 61, 1))), + DataCell(quickText(e.noAnswerCount, color: Color.fromRGBO(61, 61, 61, 1))), + DataCell(quickText(e.useTime, color: Color.fromRGBO(61, 61, 61, 1))), + ]); + }).toList(), + ], + ), + ]), ) ], ), @@ -599,8 +536,7 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { return Container( margin: EdgeInsets.only(top: 16.h, bottom: 10.h), padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 14.h), - decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(16.r)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(16.r)), child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -650,16 +586,12 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { ), ), alignment: Alignment.center, - child: quickText(data.scoreTitle, - color: Colors.white, - size: 32.sp, - fontWeight: FontWeight.bold), + child: quickText(data.scoreTitle, color: Colors.white, size: 32.sp, fontWeight: FontWeight.bold), ), ), ), ), - Image.asset("assets/images/job_report_scale.png", - width: 230.r, fit: BoxFit.fill), + Image.asset("assets/images/job_report_scale.png", width: 230.r, fit: BoxFit.fill), ], ), @@ -680,10 +612,8 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { children: [ Expanded( flex: 2, - child: quickText('${data.validCount}份', - color: Colors.white, - size: 10.sp, - fontWeight: FontWeight.bold), + child: + quickText('${data.validCount}份', color: Colors.white, size: 10.sp, fontWeight: FontWeight.bold), ), SizedBox(width: 1.2.w), Expanded( @@ -697,11 +627,8 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { children: [ Expanded( flex: 2, - child: quickText( - '${doubleToStringAsFixed(data.correctRate)}%', - color: Colors.white, - size: 10.sp, - fontWeight: FontWeight.bold)), + child: quickText('${doubleToStringAsFixed(data.correctRate)}%', + color: Colors.white, size: 10.sp, fontWeight: FontWeight.bold)), Expanded( flex: 5, child: Container( @@ -712,11 +639,8 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { shape: BoxShape.circle, // 设置为圆形 color: Color.fromRGBO(254, 151, 40, 1), ), - child: quickText( - '${doubleToStringAsFixed(data.finishRate)}%', - color: Colors.white, - size: 14.sp, - fontWeight: FontWeight.bold), + child: quickText('${doubleToStringAsFixed(data.finishRate)}%', + color: Colors.white, size: 14.sp, fontWeight: FontWeight.bold), ), ), ], @@ -744,13 +668,10 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { ), ), SizedBox(width: 5.w), - quickText('作业完成率', - color: Color.fromRGBO(114, 114, 114, 1), size: 12.sp), + quickText('作业完成率', color: Color.fromRGBO(114, 114, 114, 1), size: 12.sp), SizedBox(width: 4.w), quickText('${doubleToStringAsFixed(data.finishRate)}%', - color: Color.fromRGBO(72, 72, 72, 1), - size: 13.sp, - fontWeight: FontWeight.bold), + color: Color.fromRGBO(72, 72, 72, 1), size: 13.sp, fontWeight: FontWeight.bold), ], ), SizedBox(height: 14.h), @@ -766,13 +687,10 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { ), ), SizedBox(width: 5.w), - quickText('作业正确率', - color: Color.fromRGBO(114, 114, 114, 1), size: 12.sp), + quickText('作业正确率', color: Color.fromRGBO(114, 114, 114, 1), size: 12.sp), SizedBox(width: 4.w), quickText('${doubleToStringAsFixed(data.correctRate)}%', - color: Color.fromRGBO(72, 72, 72, 1), - size: 13.sp, - fontWeight: FontWeight.bold), + color: Color.fromRGBO(72, 72, 72, 1), size: 13.sp, fontWeight: FontWeight.bold), ], ), SizedBox(height: 14.h), @@ -788,13 +706,10 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { ), ), SizedBox(width: 5.w), - quickText('作业有效份数', - color: Color.fromRGBO(114, 114, 114, 1), size: 12.sp), + quickText('作业有效份数', color: Color.fromRGBO(114, 114, 114, 1), size: 12.sp), SizedBox(width: 4.w), quickText('${data.validCount}份', - color: Color.fromRGBO(72, 72, 72, 1), - size: 13.sp, - fontWeight: FontWeight.bold), + color: Color.fromRGBO(72, 72, 72, 1), size: 13.sp, fontWeight: FontWeight.bold), ], ), ], @@ -856,30 +771,21 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { Column( mainAxisSize: MainAxisSize.min, children: [ - quickText('人', - size: 18.sp, - color: - Color.fromRGBO(122, 122, 122, 1)), + quickText('人', size: 18.sp, color: Color.fromRGBO(122, 122, 122, 1)), SizedBox(height: 4.h) ], ) ], ), - quickText('全对', - color: Color.fromRGBO(164, 164, 164, 1), - size: 16.sp), + quickText('全对', color: Color.fromRGBO(164, 164, 164, 1), size: 16.sp), ], )), Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - quickText( - doubleToStringAsFixed( - data.allCorrect / data.studentCount * 100), - size: 34.sp, - color: Colors.white, - fontWeight: FontWeight.bold), + quickText(doubleToStringAsFixed(data.allCorrect / data.studentCount * 100), + size: 34.sp, color: Colors.white, fontWeight: FontWeight.bold), SizedBox(width: 1.5.w), quickText('%', size: 22.sp, color: Colors.white) ], @@ -895,18 +801,14 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { padding: EdgeInsets.symmetric(vertical: 4.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(77.r), - border: - Border.all(color: Color.fromRGBO(188, 188, 188, 1)), + border: Border.all(color: Color.fromRGBO(188, 188, 188, 1)), ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - quickText('查看', - size: 11.sp, - color: Color.fromRGBO(118, 118, 118, 1)), - Icon(Icons.arrow_forward_ios, - size: 11.sp, color: Color.fromRGBO(95, 95, 95, 1)) + quickText('查看', size: 11.sp, color: Color.fromRGBO(118, 118, 118, 1)), + Icon(Icons.arrow_forward_ios, size: 11.sp, color: Color.fromRGBO(95, 95, 95, 1)) ], ), ), @@ -962,30 +864,21 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { Column( mainAxisSize: MainAxisSize.min, children: [ - quickText('人', - size: 18.sp, - color: - Color.fromRGBO(122, 122, 122, 1)), + quickText('人', size: 18.sp, color: Color.fromRGBO(122, 122, 122, 1)), SizedBox(height: 4.h) ], ) ], ), - quickText('及格', - color: Color.fromRGBO(164, 164, 164, 1), - size: 16.sp), + quickText('及格', color: Color.fromRGBO(164, 164, 164, 1), size: 16.sp), ], )), Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - quickText( - doubleToStringAsFixed( - data.passCount / data.studentCount * 100), - size: 34.sp, - color: Colors.white, - fontWeight: FontWeight.bold), + quickText(doubleToStringAsFixed(data.passCount / data.studentCount * 100), + size: 34.sp, color: Colors.white, fontWeight: FontWeight.bold), SizedBox(width: 1.5.w), quickText('%', size: 22.sp, color: Colors.white) ], @@ -1001,18 +894,14 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { padding: EdgeInsets.symmetric(vertical: 4.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(77.r), - border: - Border.all(color: Color.fromRGBO(188, 188, 188, 1)), + border: Border.all(color: Color.fromRGBO(188, 188, 188, 1)), ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - quickText('查看', - size: 11.sp, - color: Color.fromRGBO(118, 118, 118, 1)), - Icon(Icons.arrow_forward_ios, - size: 11.sp, color: Color.fromRGBO(95, 95, 95, 1)) + quickText('查看', size: 11.sp, color: Color.fromRGBO(118, 118, 118, 1)), + Icon(Icons.arrow_forward_ios, size: 11.sp, color: Color.fromRGBO(95, 95, 95, 1)) ], ), ), @@ -1068,30 +957,21 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { Column( mainAxisSize: MainAxisSize.min, children: [ - quickText('人', - size: 18.sp, - color: - Color.fromRGBO(122, 122, 122, 1)), + quickText('人', size: 18.sp, color: Color.fromRGBO(122, 122, 122, 1)), SizedBox(height: 4.h) ], ) ], ), - quickText('不及格', - color: Color.fromRGBO(164, 164, 164, 1), - size: 16.sp), + quickText('不及格', color: Color.fromRGBO(164, 164, 164, 1), size: 16.sp), ], )), Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - quickText( - doubleToStringAsFixed( - data.failCount / data.studentCount * 100), - size: 34.sp, - color: Colors.white, - fontWeight: FontWeight.bold), + quickText(doubleToStringAsFixed(data.failCount / data.studentCount * 100), + size: 34.sp, color: Colors.white, fontWeight: FontWeight.bold), SizedBox(width: 1.5.w), quickText('%', size: 22.sp, color: Colors.white) ], @@ -1107,18 +987,14 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { padding: EdgeInsets.symmetric(vertical: 4.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(77.r), - border: - Border.all(color: Color.fromRGBO(188, 188, 188, 1)), + border: Border.all(color: Color.fromRGBO(188, 188, 188, 1)), ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - quickText('查看', - size: 11.sp, - color: Color.fromRGBO(118, 118, 118, 1)), - Icon(Icons.arrow_forward_ios, - size: 11.sp, color: Color.fromRGBO(95, 95, 95, 1)) + quickText('查看', size: 11.sp, color: Color.fromRGBO(118, 118, 118, 1)), + Icon(Icons.arrow_forward_ios, size: 11.sp, color: Color.fromRGBO(95, 95, 95, 1)) ], ), ), @@ -1174,18 +1050,13 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { Column( mainAxisSize: MainAxisSize.min, children: [ - quickText('人', - size: 18.sp, - color: - Color.fromRGBO(122, 122, 122, 1)), + quickText('人', size: 18.sp, color: Color.fromRGBO(122, 122, 122, 1)), SizedBox(height: 4.h) ], ) ], ), - quickText('未做', - color: Color.fromRGBO(164, 164, 164, 1), - size: 16.sp), + quickText('未做', color: Color.fromRGBO(164, 164, 164, 1), size: 16.sp), ], ), ), @@ -1193,12 +1064,8 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - quickText( - doubleToStringAsFixed( - data.noAnswerCount / data.studentCount * 100), - size: 34.sp, - color: Colors.white, - fontWeight: FontWeight.bold), + quickText(doubleToStringAsFixed(data.noAnswerCount / data.studentCount * 100), + size: 34.sp, color: Colors.white, fontWeight: FontWeight.bold), SizedBox(width: 1.5.w), quickText('%', size: 22.sp, color: Colors.white) ], @@ -1214,18 +1081,14 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { padding: EdgeInsets.symmetric(vertical: 4.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(77.r), - border: - Border.all(color: Color.fromRGBO(188, 188, 188, 1)), + border: Border.all(color: Color.fromRGBO(188, 188, 188, 1)), ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - quickText('查看', - size: 11.sp, - color: Color.fromRGBO(118, 118, 118, 1)), - Icon(Icons.arrow_forward_ios, - size: 11.sp, color: Color.fromRGBO(95, 95, 95, 1)) + quickText('查看', size: 11.sp, color: Color.fromRGBO(118, 118, 118, 1)), + Icon(Icons.arrow_forward_ios, size: 11.sp, color: Color.fromRGBO(95, 95, 95, 1)) ], ), ), @@ -1243,12 +1106,10 @@ Widget $topGraphic(BuildContext context, JobReportModel data) { /// 掌握知识点的情况 @swidget -Widget $masterKnowledgePoint( - BuildContext context, - List knowledgeInfos, +Widget $masterKnowledgePoint(BuildContext context, List knowledgeInfos, Future Function(KnowledgeInfos knowledge) detailCall) { Widget childItem(int serialNumber, KnowledgeInfos knowItem) => Container( - margin: EdgeInsets.only(bottom: 15.h,left: 15.r,right: 15.r), + margin: EdgeInsets.only(bottom: 15.h, left: 15.r, right: 15.r), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -1261,13 +1122,10 @@ Widget $masterKnowledgePoint( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - quickText( - '${(serialNumber + 1).toString() + '.' + knowItem.knowledgeName}', - size: 12.sp, - color: Color.fromRGBO(152, 152, 152, 1)), + quickText('${(serialNumber + 1).toString() + '.' + knowItem.knowledgeName}', + size: 12.sp, color: Color.fromRGBO(152, 152, 152, 1)), quickText('${doubleToStringAsFixed(knowItem.rate)}%', - size: 12.sp, - color: Color.fromRGBO(64, 64, 64, 1)), + size: 12.sp, color: Color.fromRGBO(64, 64, 64, 1)), ], ), ), @@ -1287,7 +1145,7 @@ Widget $masterKnowledgePoint( lineHeight: 10.h, animationDuration: 2500, percent: 0.1, - /* center: + /* center: Text( '${doubleToStringAsFixed(knowItem.rate)}%', style: TextStyle(color: Colors.white, fontSize: 10.sp), @@ -1302,10 +1160,8 @@ Widget $masterKnowledgePoint( child: Row( mainAxisSize: MainAxisSize.min, children: [ - quickText('查看', - size: 12.sp, color: Color.fromRGBO(239, 135, 20, 1)), - Icon(Icons.arrow_forward_ios, - size: 11.sp, color: Color.fromRGBO(239, 135, 20, 1)), + quickText('查看', size: 12.sp, color: Color.fromRGBO(239, 135, 20, 1)), + Icon(Icons.arrow_forward_ios, size: 11.sp, color: Color.fromRGBO(239, 135, 20, 1)), ], ), ), @@ -1318,25 +1174,16 @@ Widget $masterKnowledgePoint( margin: EdgeInsets.only(top: 10.h), padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w), constraints: BoxConstraints(maxHeight: 320.h), - decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(10.r)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)), child: Column( children: [ Container( - child: quickText('知识点掌握情况', - color: Color.fromRGBO(92, 92, 92, 1), - size: 14.sp, - fontWeight: FontWeight.bold), + child: quickText('知识点掌握情况', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), margin: EdgeInsets.only(bottom: 24.h), ), // ...knowledgeInfos.asMap().keys.map((e) => childItem(e, knowledgeInfos[e])).toList() Expanded( - child: ListView( - children: knowledgeInfos - .asMap() - .keys - .map((e) => childItem(e, knowledgeInfos[e])) - .toList()), + child: ListView(children: knowledgeInfos.asMap().keys.map((e) => childItem(e, knowledgeInfos[e])).toList()), ), ], )); @@ -1365,10 +1212,7 @@ Widget $overallPerformance(int totalNumber, List overallTitles) { children: [ Container( alignment: Alignment.center, - child: quickText('整体表现', - color: Color.fromRGBO(92, 92, 92, 1), - size: 14.sp, - fontWeight: FontWeight.bold), + child: quickText('整体表现', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), margin: EdgeInsets.only(bottom: 20.h), ), Expanded( @@ -1383,12 +1227,8 @@ Widget $overallPerformance(int totalNumber, List overallTitles) { color: colorMap[index], value: e.count / totalNumber * 100, radius: 110, - title: e.title + - (doubleToStringAsFixed(e.count / totalNumber * 100) + - '%'), - titleStyle: TextStyle( - fontSize: 12.sp, - color: Color(0xFF999999)), + title: e.title + (doubleToStringAsFixed(e.count / totalNumber * 100) + '%'), + titleStyle: TextStyle(fontSize: 12.sp, color: Color(0xFF999999)), ); }).toList(), ), @@ -1401,14 +1241,12 @@ Widget $overallPerformance(int totalNumber, List overallTitles) { /// 单位时间答题情况 @swidget -Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, - List questionAnswerInfos) { +Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, List questionAnswerInfos) { List questionNos = []; // 题号 List questionTypes = []; // 题型 List completionStatusWithinThirtySeconds = []; // 30s内完成情况 List completionStatusWithinThirtyOneSixtySeconds = []; // 31s-60s内完成情况 - List completionStatusWithinSixtyOneOneHundredAndTwenty = - []; // 61s-120s内完成情况 + List completionStatusWithinSixtyOneOneHundredAndTwenty = []; // 61s-120s内完成情况 List accuracys = []; // 正确率 List errorRate = []; // 错误率 List notDone = []; // 未做 @@ -1445,15 +1283,15 @@ Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, e.finishInfos.forEach((element) { if ('30s内完成情况' == element.title) { - completionStatusWithinThirtySeconds.add( - '${element.finishCount}人完成,正确率${doubleToStringAsFixed(element.correctRate)}%'); + completionStatusWithinThirtySeconds + .add('${element.finishCount}人完成,正确率${doubleToStringAsFixed(element.correctRate)}%'); } else if ('31-60s内完成情况' == element.title) { - completionStatusWithinThirtyOneSixtySeconds.add( - '${element.finishCount}人完成,正确率${doubleToStringAsFixed(element.correctRate)}%'); + completionStatusWithinThirtyOneSixtySeconds + .add('${element.finishCount}人完成,正确率${doubleToStringAsFixed(element.correctRate)}%'); } else { // 61-120s内完成情况 - completionStatusWithinSixtyOneOneHundredAndTwenty.add( - '${element.finishCount}人完成,正确率${doubleToStringAsFixed(element.correctRate)}%'); + completionStatusWithinSixtyOneOneHundredAndTwenty + .add('${element.finishCount}人完成,正确率${doubleToStringAsFixed(element.correctRate)}%'); } }); }); @@ -1474,171 +1312,148 @@ Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, return Container( width: double.infinity, - height: 520.h, + height: isPad() ? 520.h : 460.h, margin: EdgeInsets.only(top: 20.h), padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w), - decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(10.r)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)), child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( - child: quickText('整体表现', - color: Color.fromRGBO(92, 92, 92, 1), - size: 14.sp, - fontWeight: FontWeight.bold), + child: quickText('整体表现', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), margin: EdgeInsets.only(bottom: 20.h), ), Expanded( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...mapData.entries.map((entrie) { - bool isViewButton = - ['查看原题', '操作'].contains(entrie.key); // 查看按钮 - bool isRatio = ['正确率', '错误率', '未做'].contains(entrie.key); - bool isQuestionNo = entrie.key == '题号'; - return Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 94.r, - alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 1.h, right: 1.w), - padding: EdgeInsets.symmetric( - vertical: 10.h, horizontal: 8.w), - color: Color.fromRGBO(230, 230, 230, 1), - child: quickText(entrie.key, - color: Color.fromRGBO(24, 35, 77, 1), - size: 12.sp, - maxLines: 2), - ), - ...entrie.value.map((e) { - bool noHasChineseCharacter = - isQuestionNo && !containsChinese(e); - return Container( - width: 96.r, + child: Scrollbar( + thickness: 8.w, + thumbVisibility: true, + trackVisibility: true, + radius: Radius.circular(10.r), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...mapData.entries.map((entrie) { + bool isViewButton = ['查看原题', '操作'].contains(entrie.key); // 查看按钮 + bool isRatio = ['正确率', '错误率', '未做'].contains(entrie.key); + bool isQuestionNo = entrie.key == '题号'; + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 94.r, alignment: Alignment.center, margin: EdgeInsets.only(bottom: 1.h, right: 1.w), - padding: EdgeInsets.symmetric( - vertical: 10.h, horizontal: 8.w), - color: Color.fromRGBO(245, 245, 245, 1), - child: isViewButton - ? InkWell( - onTap: () { - // e - var _qpm = e as QuestionPictureModel; - // if (entrie.key == '操作') { - // showDialog( - // context: context, - // builder: (BuildContext context1) { - // return Container( - // margin: EdgeInsets.symmetric(vertical: 150.h, horizontal: 24.w), - // padding: EdgeInsets.symmetric(vertical: 15.h), - // decoration: BoxDecoration( - // color: Colors.white, - // borderRadius: BorderRadius.circular(18.sp), - // ), - // child: Column( - // children: [ - // Container( - // child: quickText('${_qpm.questionNo}题', - // color: Color.fromRGBO(60, 60, 60, 1), size: 15.sp)), - // Expanded( - // child: ListView( - // padding: EdgeInsets.symmetric(horizontal: 12.w), - // children: [ - // DataTable( - // sortAscending: false, - // columns: [ - // DataColumn( - // label: quickText('姓名', - // color: Color.fromRGBO(114, 114, 114, 1), - // size: 14.sp, - // fontWeight: FontWeight.bold), - // ), - // ], - // rows: [], - // ), - // ]), - // ) - // ], - // ), - // ); - // }, - // ); - // return; - // } - if (_qpm.questionPicture == null) - return ToastUtils.showInfo('当前试题没有原题'); - Navigator.push( - context, - MaterialPageRoute(builder: (_) { - return Scaffold( - appBar: AppBar(), - body: PhotoView( - imageProvider: NetworkImage( - _qpm.questionPicture!)), - ); - }), - ); - }, - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - quickText('查看', - color: - Color.fromRGBO(239, 135, 20, 1), - size: 12.sp), - Container( - padding: EdgeInsets.only(top: 1.h), - child: Icon( - Icons.arrow_forward_ios, - size: 10.sp, - color: - Color.fromRGBO(239, 135, 20, 1), - ), - ), - ], - ), - ) - : RegExp(r'^\d+$').hasMatch(e) || - (e.contains('%') && e.length < 4) - ? Row( + padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w), + color: Color.fromRGBO(230, 230, 230, 1), + child: quickText(entrie.key, color: Color.fromRGBO(24, 35, 77, 1), size: 12.sp, maxLines: 2), + ), + ...entrie.value.map((e) { + bool noHasChineseCharacter = isQuestionNo && !containsChinese(e); + return Container( + width: 96.r, + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 1.h, right: 1.w), + padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w), + color: Color.fromRGBO(245, 245, 245, 1), + child: isViewButton + ? InkWell( + onTap: () { + // e + var _qpm = e as QuestionPictureModel; + // if (entrie.key == '操作') { + // showDialog( + // context: context, + // builder: (BuildContext context1) { + // return Container( + // margin: EdgeInsets.symmetric(vertical: 150.h, horizontal: 24.w), + // padding: EdgeInsets.symmetric(vertical: 15.h), + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular(18.sp), + // ), + // child: Column( + // children: [ + // Container( + // child: quickText('${_qpm.questionNo}题', + // color: Color.fromRGBO(60, 60, 60, 1), size: 15.sp)), + // Expanded( + // child: ListView( + // padding: EdgeInsets.symmetric(horizontal: 12.w), + // children: [ + // DataTable( + // sortAscending: false, + // columns: [ + // DataColumn( + // label: quickText('姓名', + // color: Color.fromRGBO(114, 114, 114, 1), + // size: 14.sp, + // fontWeight: FontWeight.bold), + // ), + // ], + // rows: [], + // ), + // ]), + // ) + // ], + // ), + // ); + // }, + // ); + // return; + // } + if (_qpm.questionPicture == null) return ToastUtils.showInfo('当前试题没有原题'); + Navigator.push( + context, + MaterialPageRoute(builder: (_) { + return Scaffold( + appBar: AppBar(), + body: PhotoView(imageProvider: NetworkImage(_qpm.questionPicture!)), + ); + }), + ); + }, + child: Row( mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - quickText(e, - color: isRatio - ? Theme.of(context).primaryColor - : Color.fromRGBO(82, 82, 82, 1), - size: - isRatio || noHasChineseCharacter - ? 12.sp - : 12.sp, - maxLines: 2), - quickText('透', - color: Colors.transparent, - size: 12.sp), + quickText('查看', color: Color.fromRGBO(239, 135, 20, 1), size: 12.sp), + Container( + padding: EdgeInsets.only(top: 1.h), + child: Icon( + Icons.arrow_forward_ios, + size: 10.sp, + color: Color.fromRGBO(239, 135, 20, 1), + ), + ), ], - ) - : quickText(e, - color: isRatio - ? Theme.of(context).primaryColor - : Color.fromRGBO(82, 82, 82, 1), - size: isRatio || noHasChineseCharacter - ? 12.sp - : 12.sp, - maxLines: 2), - ); - }).toList(), - ], - ); - }).toList(), - ], + ), + ) + : RegExp(r'^\d+$').hasMatch(e) || (e.contains('%') && e.length < 4) + ? Row( + mainAxisSize: MainAxisSize.min, + children: [ + quickText(e, + color: isRatio + ? Theme.of(context).primaryColor + : Color.fromRGBO(82, 82, 82, 1), + size: isRatio || noHasChineseCharacter ? 12.sp : 12.sp, + maxLines: 2), + quickText('透', color: Colors.transparent, size: 12.sp), + ], + ) + : quickText(e, + color: isRatio ? Theme.of(context).primaryColor : Color.fromRGBO(82, 82, 82, 1), + size: isRatio || noHasChineseCharacter ? 12.sp : 12.sp, + maxLines: 2), + ); + }).toList(), + ], + ); + }).toList(), + ], + ), ), ), ), @@ -1649,8 +1464,7 @@ Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, /// 人员数据概况 @swidget -Widget $personnelDataOverview( - BuildContext context, List studentAnswerInfos) { +Widget $personnelDataOverview(BuildContext context, List studentAnswerInfos) { List names = []; List useTimes = []; List correctRates = []; @@ -1680,83 +1494,68 @@ Widget $personnelDataOverview( return Container( width: double.infinity, - height: 290.h, + height: isPad() ? 290 : 264.h, margin: EdgeInsets.only(top: 20.h), padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w), - decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(10.r)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)), child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( - child: quickText('人员数据概况', - color: Color.fromRGBO(92, 92, 92, 1), - size: 14.sp, - fontWeight: FontWeight.bold), + child: quickText('人员数据概况', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), margin: EdgeInsets.only(bottom: 20.h), ), Expanded( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...mapData.entries.map((entrie) { - bool isTransparentChinese = - ['答题时长', '正确率', '未答题数'].contains(entrie.key); // 透明中文 + child: Scrollbar( + thickness: 8.w, + thumbVisibility: true, + trackVisibility: true, + radius: Radius.circular(10.r), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...mapData.entries.map((entrie) { + bool isTransparentChinese = ['答题时长', '正确率', '未答题数'].contains(entrie.key); // 透明中文 - return Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 94.r, - alignment: Alignment.center, - color: Color.fromRGBO(230, 230, 230, 1), - margin: EdgeInsets.only(bottom: 1.h, right: 1.w), - padding: EdgeInsets.symmetric( - vertical: 10.h, horizontal: 8.w), - child: quickText(entrie.key, - color: Color.fromRGBO(24, 35, 77, 1), - size: 12.sp, - maxLines: 2), - ), - ...entrie.value.map((e) { - bool isTransparentChineseNew = - isTransparentChinese && (e?.length ?? 0) == 0; - return Container( - width: 100.r, + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 94.r, alignment: Alignment.center, + color: Color.fromRGBO(230, 230, 230, 1), margin: EdgeInsets.only(bottom: 1.h, right: 1.w), - padding: EdgeInsets.symmetric( - vertical: 10.h, horizontal: 8.w), - color: Color.fromRGBO(245, 245, 245, 1), - child: isTransparentChineseNew - ? quickText('透明', - color: Colors.transparent, size: 12.sp) - : RegExp(r'^\d+$').hasMatch(e) || e.contains('%') - ? Row( - mainAxisSize: MainAxisSize.min, - children: [ - quickText(e, - color: - Color.fromRGBO(82, 82, 82, 1), - size: 12.sp, - maxLines: 2), - quickText('透', - color: Colors.transparent, - size: 12.sp), - ], - ) - : quickText(e, - color: Color.fromRGBO(82, 82, 82, 1), - size: 12.sp, - maxLines: 2), - ); - }).toList(), - ], - ); - }).toList(), - ], + padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w), + child: quickText(entrie.key, color: Color.fromRGBO(24, 35, 77, 1), size: 12.sp, maxLines: 2), + ), + ...entrie.value.map((e) { + bool isTransparentChineseNew = isTransparentChinese && (e?.length ?? 0) == 0; + return Container( + width: 100.r, + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 1.h, right: 1.w), + padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w), + color: Color.fromRGBO(245, 245, 245, 1), + child: isTransparentChineseNew + ? quickText('透明', color: Colors.transparent, size: 12.sp) + : RegExp(r'^\d+$').hasMatch(e) || e.contains('%') + ? Row( + mainAxisSize: MainAxisSize.min, + children: [ + quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2), + quickText('透', color: Colors.transparent, size: 12.sp), + ], + ) + : quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2), + ); + }).toList(), + ], + ); + }).toList(), + ], + ), ), ), ), @@ -1790,9 +1589,5 @@ class QuestionPictureModel extends Object { int questionid; int jobid; - QuestionPictureModel( - {required this.jobid, - required this.questionid, - required this.questionNo, - this.questionPicture}); + QuestionPictureModel({required this.jobid, required this.questionid, required this.questionNo, this.questionPicture}); } diff --git a/marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.dart b/marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.dart index e3904bd..872d219 100644 --- a/marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.dart +++ b/marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.dart @@ -647,7 +647,7 @@ class TabletEndCompleted extends StatelessWidget { alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 4.h), decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), - child: quickText('未提交:${taskItem.totalCount - taskItem.commitStudentCount}', + child: quickText('未提交:${taskItem.studentCount - taskItem.commitStudentCount}', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), ), ), @@ -834,7 +834,7 @@ class MobileEndCompleted extends StatelessWidget { alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 5.h), decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), - child: quickText('未提交:${task.totalCount - task.commitStudentCount}', + child: quickText('未提交:${task.studentCount - task.commitStudentCount}', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)), ), ), @@ -1061,7 +1061,18 @@ Widget $itemDataViewOfPad( color: Color.fromRGBO(104, 136, 253, 1), borderRadius: BorderRadius.circular(16.r), child: InkWell( - onTap: () => easyThrottle('OneClickReview', () => oneClickReview(task.id)), + onTap: () => easyThrottle('OneClickReview', () { + if (!task.canMarking) { + return AchievementView( + elevation: 0.5, + duration: Duration(seconds: 1), + title: "提示", + subTitle: "此账号无法批阅该任务", + color: Theme.of(context).primaryColor, + ).show(context); + } + oneClickReview(task.id); + }), borderRadius: BorderRadius.circular(8.r), child: Container( alignment: Alignment.center, @@ -1322,7 +1333,18 @@ Widget $itemDataView( color: Color.fromRGBO(104, 136, 253, 1), borderRadius: BorderRadius.circular(16.r), child: InkWell( - onTap: () => easyThrottle('OneClickReview', () => oneClickReview(task.id)), + onTap: () => easyThrottle('OneClickReview', () { + if (!task.canMarking) { + return AchievementView( + elevation: 0.5, + duration: Duration(seconds: 1), + title: "提示", + subTitle: "此账号无法批阅该任务", + color: Theme.of(context).primaryColor, + ).show(context); + } + oneClickReview(task.id); + }), borderRadius: BorderRadius.circular(8.r), child: Container( alignment: Alignment.center,