主观题客观题增加作答正确率
This commit is contained in:
parent
bf219ecf1f
commit
297bebe523
|
|
@ -66,6 +66,9 @@ class Questions extends Object {
|
||||||
@JsonKey(name: 'okRate')
|
@JsonKey(name: 'okRate')
|
||||||
double? okRate;
|
double? okRate;
|
||||||
|
|
||||||
|
@JsonKey(name: 'correctRate')
|
||||||
|
double? correctRate;
|
||||||
|
|
||||||
@JsonKey(name: 'priorityInfo')
|
@JsonKey(name: 'priorityInfo')
|
||||||
List<Dtls>? priorityInfo;
|
List<Dtls>? priorityInfo;
|
||||||
|
|
||||||
|
|
@ -83,7 +86,7 @@ class Questions extends Object {
|
||||||
|
|
||||||
|
|
||||||
Questions(this.id,this.templateId,this.questionNo,this.questionType,this.answer,this.score,this.questionPicture,this.subjectivePicture,this.knows,this.answerCount,
|
Questions(this.id,this.templateId,this.questionNo,this.questionType,this.answer,this.score,this.questionPicture,this.subjectivePicture,this.knows,this.answerCount,
|
||||||
this.answerRate,this.okRate,this.priorityInfo,this.noAnswerStudents,this.answerOkStudents,this.answerNgStudents,
|
this.answerRate,this.okRate,this.priorityInfo,this.noAnswerStudents,this.answerOkStudents,this.answerNgStudents,this.correctRate,
|
||||||
this.overallTitles);
|
this.overallTitles);
|
||||||
|
|
||||||
factory Questions.fromJson(Map<String, dynamic> srcJson) => _$QuestionsFromJson(srcJson);
|
factory Questions.fromJson(Map<String, dynamic> srcJson) => _$QuestionsFromJson(srcJson);
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,8 @@ class Utils {
|
||||||
dataCount.kgtDtlCount = kgt.length;
|
dataCount.kgtDtlCount = kgt.length;
|
||||||
dataCount.kgtAnswerRate = Utils.calcRate(dataCount.kgtAnswerCount!, dataCount.kgtDtlCount!);
|
dataCount.kgtAnswerRate = Utils.calcRate(dataCount.kgtAnswerCount!, dataCount.kgtDtlCount!);
|
||||||
dataCount.kgtOkRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtDtlCount!);
|
dataCount.kgtOkRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtDtlCount!);
|
||||||
|
|
||||||
|
dataCount.kgtCorrectRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtAnswerCount!);
|
||||||
dataCount.kgtCount = data.questions.where((w) => w.questionType == 1).length;
|
dataCount.kgtCount = data.questions.where((w) => w.questionType == 1).length;
|
||||||
|
|
||||||
List<Dtls> zgt = data.dtls.where((w) => w.questionType == 2).toList();
|
List<Dtls> zgt = data.dtls.where((w) => w.questionType == 2).toList();
|
||||||
|
|
@ -100,6 +102,8 @@ class Utils {
|
||||||
dataCount.zgtDtlCount = zgt.length;
|
dataCount.zgtDtlCount = zgt.length;
|
||||||
dataCount.zgtAnswerRate = Utils.calcRate(dataCount.zgtAnswerCount!, dataCount.zgtDtlCount!);
|
dataCount.zgtAnswerRate = Utils.calcRate(dataCount.zgtAnswerCount!, dataCount.zgtDtlCount!);
|
||||||
dataCount.zgtOkRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtDtlCount!);
|
dataCount.zgtOkRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtDtlCount!);
|
||||||
|
|
||||||
|
dataCount.zgtCorrectRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtAnswerCount!);
|
||||||
dataCount.zgtCount = data.questions.where((w) => w.questionType == 2).length;
|
dataCount.zgtCount = data.questions.where((w) => w.questionType == 2).length;
|
||||||
dataCount.studentCount = data.students.length;
|
dataCount.studentCount = data.students.length;
|
||||||
dataCount.priorityStudents = data.students.where((w) => w.priorityAnnotate!).toList();
|
dataCount.priorityStudents = data.students.where((w) => w.priorityAnnotate!).toList();
|
||||||
|
|
@ -210,7 +214,7 @@ class Utils {
|
||||||
-1 &&
|
-1 &&
|
||||||
w.state != 3;
|
w.state != 3;
|
||||||
}).toList();
|
}).toList();
|
||||||
|
que.correctRate = Utils.calcRate(okCount, que.answerCount!);
|
||||||
que.answerNgStudents = ques.where((w) {
|
que.answerNgStudents = ques.where((w) {
|
||||||
w.studentName = data.students.firstWhere((s) => s.studentId == w.studentId).studentName;
|
w.studentName = data.students.firstWhere((s) => s.studentId == w.studentId).studentName;
|
||||||
return w.state == 2;
|
return w.state == 2;
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,9 @@ class _JobReportPageState extends State<JobReportPage> {
|
||||||
kgReport: state.kgReport,
|
kgReport: state.kgReport,
|
||||||
zgReport: state.zgReport,
|
zgReport: state.zgReport,
|
||||||
kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0),
|
kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0),
|
||||||
zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0)),
|
zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0),
|
||||||
|
kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0),
|
||||||
|
zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0)),
|
||||||
// 掌握知识点的情况
|
// 掌握知识点的情况
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.symmetric(horizontal: 10.r),
|
margin: EdgeInsets.symmetric(horizontal: 10.r),
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,14 @@ class CountData extends Object {
|
||||||
int? kgtDtlCount = 0;
|
int? kgtDtlCount = 0;
|
||||||
double? kgtAnswerRate = 0;
|
double? kgtAnswerRate = 0;
|
||||||
double? kgtOkRate = 0;
|
double? kgtOkRate = 0;
|
||||||
|
double? kgtCorrectRate = 0;
|
||||||
int? kgtAnswerCount = 0;
|
int? kgtAnswerCount = 0;
|
||||||
int? kgtCount = 0;
|
int? kgtCount = 0;
|
||||||
int? zgtDtlCount = 0;
|
int? zgtDtlCount = 0;
|
||||||
int? zgtOkCount = 0;
|
int? zgtOkCount = 0;
|
||||||
int? zgtAnswerCount = 0;
|
int? zgtAnswerCount = 0;
|
||||||
double? zgtAnswerRate = 0;
|
double? zgtAnswerRate = 0;
|
||||||
|
double? zgtCorrectRate = 0;
|
||||||
double? zgtOkRate = 0;
|
double? zgtOkRate = 0;
|
||||||
int? zgtCount = 0;
|
int? zgtCount = 0;
|
||||||
int? studentCount = 0;
|
int? studentCount = 0;
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,9 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> {
|
||||||
kgReport: state.kgReport,
|
kgReport: state.kgReport,
|
||||||
zgReport: state.zgReport,
|
zgReport: state.zgReport,
|
||||||
kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0),
|
kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0),
|
||||||
zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0)),
|
kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0),
|
||||||
|
zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0),
|
||||||
|
zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import 'package:making_school_asignment_app/common/job/homework_details.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
||||||
import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.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/report_table.dart';
|
import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/widget/report_table.dart';
|
||||||
|
import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart';
|
||||||
|
|
||||||
class KgtZgtTable extends StatefulWidget {
|
class KgtZgtTable extends StatefulWidget {
|
||||||
final int studentCount;
|
final int studentCount;
|
||||||
|
|
@ -13,6 +14,8 @@ class KgtZgtTable extends StatefulWidget {
|
||||||
final List<Questions> zgReport;
|
final List<Questions> zgReport;
|
||||||
final String kgtOkRate;
|
final String kgtOkRate;
|
||||||
final String zgtOkRate;
|
final String zgtOkRate;
|
||||||
|
final String kgtCorrectRate;
|
||||||
|
final String zgtCorrectRate;
|
||||||
|
|
||||||
const KgtZgtTable(
|
const KgtZgtTable(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
|
|
@ -21,7 +24,9 @@ class KgtZgtTable extends StatefulWidget {
|
||||||
required this.kgReport,
|
required this.kgReport,
|
||||||
required this.zgReport,
|
required this.zgReport,
|
||||||
required this.kgtOkRate,
|
required this.kgtOkRate,
|
||||||
required this.zgtOkRate})
|
required this.kgtCorrectRate,
|
||||||
|
required this.zgtOkRate,
|
||||||
|
required this.zgtCorrectRate,})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -47,31 +52,39 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'客观题',
|
'客观题',
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600),
|
style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10.r,
|
height: 20.r,
|
||||||
),
|
),
|
||||||
Text(
|
ProgressBar(
|
||||||
'${widget.kgtOkRate}%',
|
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF4CC793), fontWeight: FontWeight.w600),
|
percent: double.parse(widget.kgtCorrectRate) / 100,
|
||||||
|
title: '作答正确率:',
|
||||||
|
padingEdg: EdgeInsets.only(left: 5.w, right: 10.w),
|
||||||
|
fontSize: 10.sp,
|
||||||
|
lineHeight: 10.h,
|
||||||
|
marginEdg: EdgeInsets.only(top: 5.h),
|
||||||
),
|
),
|
||||||
],
|
ProgressBar(
|
||||||
|
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||||
|
percent: double.parse(widget.kgtOkRate) / 100,
|
||||||
|
title: '全班正确率:',
|
||||||
|
padingEdg: EdgeInsets.only(left: 5.w, right: 10.w),
|
||||||
|
fontSize: 10.sp,
|
||||||
|
lineHeight: 10.h,
|
||||||
|
marginEdg: EdgeInsets.only(top: 5.h),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 6.r,
|
height: 10.r,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: widget.kgReport.length > 10 ? 300.r : widget.kgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r),
|
height: widget.kgReport.length > 10 ? 300.r : widget.kgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r),
|
||||||
child: ReportTable(
|
child: ReportTable(
|
||||||
headList: const ['题', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'],
|
headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率','标准答案', '优先批阅概况'],
|
||||||
bodyList: widget.kgReport,
|
bodyList: widget.kgReport,
|
||||||
fixedCols: 1,
|
fixedCols: 1,
|
||||||
fixedRows: 1,
|
fixedRows: 1,
|
||||||
|
|
@ -92,31 +105,39 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'主观题',
|
'主观题',
|
||||||
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600),
|
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 6.r,
|
height: 20.r,
|
||||||
),
|
),
|
||||||
Text(
|
ProgressBar(
|
||||||
'${widget.zgtOkRate}%',
|
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||||
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF4CC793), fontWeight: FontWeight.w600),
|
percent: double.parse(widget.zgtCorrectRate) / 100,
|
||||||
|
title: '作答正确率:',
|
||||||
|
padingEdg: EdgeInsets.only(left: 5.w, right: 10.w),
|
||||||
|
fontSize: 10.sp,
|
||||||
|
lineHeight: 10.h,
|
||||||
|
marginEdg: EdgeInsets.only(top: 5.h),
|
||||||
),
|
),
|
||||||
],
|
ProgressBar(
|
||||||
|
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||||
|
percent: double.parse(widget.zgtOkRate) / 100,
|
||||||
|
title: '全班正确率:',
|
||||||
|
padingEdg: EdgeInsets.only(left: 5.w, right: 10.w),
|
||||||
|
fontSize: 10.sp,
|
||||||
|
lineHeight: 10.h,
|
||||||
|
marginEdg: EdgeInsets.only(top: 5.h),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.r,
|
height:10.r,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: widget.zgReport.length > 10 ? 300.r : widget.zgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r),
|
height: widget.zgReport.length > 10 ? 300.r : widget.zgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r),
|
||||||
child: ReportTable(
|
child: ReportTable(
|
||||||
headList: const ['题', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况','作答效率'],
|
headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率', '查看原题', '优先批阅概况','作答效率'],
|
||||||
bodyList: widget.zgReport,
|
bodyList: widget.zgReport,
|
||||||
fixedCols: 1,
|
fixedCols: 1,
|
||||||
fixedRows: 1,
|
fixedRows: 1,
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,7 @@ class _ReportTableState extends State<ReportTable> {
|
||||||
var item = widget.bodyList[index];
|
var item = widget.bodyList[index];
|
||||||
return DataRow2.byIndex(
|
return DataRow2.byIndex(
|
||||||
index: index,
|
index: index,
|
||||||
color: color != null ? MaterialStateProperty.all(color) : null,
|
color: color != null ? WidgetStateProperty.all(color) : null,
|
||||||
cells: [
|
cells: [
|
||||||
DataCell(Center(
|
DataCell(Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|
@ -467,6 +467,14 @@ class _ReportTableState extends State<ReportTable> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
|
||||||
|
DataCell(Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
|
child: Text('${item.correctRate.toStringAsFixed(0)}%',
|
||||||
|
style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
|
||||||
|
),
|
||||||
|
)),
|
||||||
DataCell(Center(
|
DataCell(Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
|
|
@ -590,7 +598,36 @@ class _ReportTableState extends State<ReportTable> {
|
||||||
columns: List.generate(widget.headList.length, (index) {
|
columns: List.generate(widget.headList.length, (index) {
|
||||||
var item = widget.headList[index];
|
var item = widget.headList[index];
|
||||||
return DataColumn2(
|
return DataColumn2(
|
||||||
label: Center(
|
label: index == 3 ?
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(item,
|
||||||
|
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
|
||||||
|
SizedBox(width: 2.r,),
|
||||||
|
const Tooltip(
|
||||||
|
message: '答对人数/作答人数',
|
||||||
|
triggerMode: TooltipTriggerMode.tap,
|
||||||
|
preferBelow:false,
|
||||||
|
child: Icon(Icons.info_outline_rounded,color: Colors.grey,)),
|
||||||
|
],
|
||||||
|
):
|
||||||
|
index == 4 ?Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(item,
|
||||||
|
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
|
||||||
|
SizedBox(width: 2.r,),
|
||||||
|
const Tooltip(
|
||||||
|
message: '答对人数/总人数',
|
||||||
|
triggerMode: TooltipTriggerMode.tap,
|
||||||
|
preferBelow:false,
|
||||||
|
child: Icon(Icons.info_outline_rounded,color: Colors.grey,)),
|
||||||
|
],
|
||||||
|
):
|
||||||
|
Center(
|
||||||
child: Text(item,
|
child: Text(item,
|
||||||
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
|
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue