mcy_new #1
|
|
@ -117,13 +117,36 @@ class Utils {
|
||||||
|
|
||||||
for (var stu in data.students) {
|
for (var stu in data.students) {
|
||||||
stu.kgtStu = kgt.where((w) => w.studentId == stu.studentId).toList();
|
stu.kgtStu = kgt.where((w) => w.studentId == stu.studentId).toList();
|
||||||
stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
|
// stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
|
||||||
|
// stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
|
||||||
|
stu.kgtStu!.sort((a, b) {
|
||||||
|
try {
|
||||||
|
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
|
||||||
|
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
|
||||||
|
} else {
|
||||||
|
throw Exception();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
|
||||||
|
}
|
||||||
|
});
|
||||||
stu.kgtOkCount = stu.kgtStu!.where((w) => w.state == 3).length;
|
stu.kgtOkCount = stu.kgtStu!.where((w) => w.state == 3).length;
|
||||||
stu.kgtErrorCount = stu.kgtStu!.where((w) => w.state == 2).length;
|
stu.kgtErrorCount = stu.kgtStu!.where((w) => w.state == 2).length;
|
||||||
stu.kgtAnswerCount = stu.kgtStu!.where((w) => w.state != 0).length;
|
stu.kgtAnswerCount = stu.kgtStu!.where((w) => w.state != 0).length;
|
||||||
|
|
||||||
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.zgtStu!.sort((a, b) {
|
||||||
|
try {
|
||||||
|
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
|
||||||
|
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
|
||||||
|
} else {
|
||||||
|
throw Exception();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
|
||||||
|
}
|
||||||
|
});
|
||||||
//正确
|
//正确
|
||||||
stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length;
|
stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length;
|
||||||
//错误
|
//错误
|
||||||
|
|
@ -181,7 +204,6 @@ class Utils {
|
||||||
var minSec = secList.isNotEmpty ? secList.first : 0;
|
var minSec = secList.isNotEmpty ? secList.first : 0;
|
||||||
var secTime = secList.isNotEmpty ? maxSec - minSec : 0;
|
var secTime = secList.isNotEmpty ? maxSec - minSec : 0;
|
||||||
stu.ttlSec = second2HMS(secTime);
|
stu.ttlSec = second2HMS(secTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data.students.sort((a, b) {
|
data.students.sort((a, b) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ class KnowledgePoint extends StatefulWidget {
|
||||||
final String className;
|
final String className;
|
||||||
final String homeworkId;
|
final String homeworkId;
|
||||||
final int subject;
|
final int subject;
|
||||||
KnowledgePoint({Key? key, required this.knowsList, required this.data, required this.className, required this.homeworkId,required this.subject}) : super(key: key);
|
const KnowledgePoint(
|
||||||
|
{super.key, required this.knowsList, required this.data, required this.className, required this.homeworkId, required this.subject});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<KnowledgePoint> createState() => _KnowledgePointState();
|
State<KnowledgePoint> createState() => _KnowledgePointState();
|
||||||
|
|
@ -208,7 +209,8 @@ class _KnowledgePointState extends State<KnowledgePoint> {
|
||||||
child: quickText('知识点掌握情况', color: const Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold),
|
child: quickText('知识点掌握情况', color: const Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: widget.knowsList.isNotEmpty? ListView(
|
child: widget.knowsList.isNotEmpty
|
||||||
|
? ListView(
|
||||||
children: widget.knowsList.value.map((item) {
|
children: widget.knowsList.value.map((item) {
|
||||||
return Container(
|
return 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),
|
||||||
|
|
@ -252,8 +254,9 @@ class _KnowledgePointState extends State<KnowledgePoint> {
|
||||||
SizedBox(width: 10.w),
|
SizedBox(width: 10.w),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
List<Questions> ques =
|
List<Questions> ques = widget.data.questions
|
||||||
widget.data.questions.where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1).toList();
|
.where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1)
|
||||||
|
.toList();
|
||||||
List<Students> array2 = [...widget.data.students];
|
List<Students> array2 = [...widget.data.students];
|
||||||
for (var stu in array2) {
|
for (var stu in array2) {
|
||||||
stu.queDtls = widget.data.dtls
|
stu.queDtls = widget.data.dtls
|
||||||
|
|
@ -290,7 +293,8 @@ class _KnowledgePointState extends State<KnowledgePoint> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList()): MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp),
|
}).toList())
|
||||||
|
: MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue