This commit is contained in:
machuanyu 2025-04-23 14:49:07 +08:00
parent bd8ef8bb57
commit a8d0e80555
2 changed files with 11 additions and 7 deletions

View File

@ -340,7 +340,6 @@ class Utils {
]; ];
Map<String, int> optInfos = {}; Map<String, int> optInfos = {};
print('opt====${que.questionNo}');
for (var d in ques for (var d in ques
.where((w) => w.questionType == 1 && w.studentAnswer != null)) { .where((w) => w.questionType == 1 && w.studentAnswer != null)) {
final key = d.studentAnswer!; final key = d.studentAnswer!;
@ -353,7 +352,8 @@ class Utils {
List<SelectionRate> student = []; List<SelectionRate> student = [];
optInfos.forEach((key, value) { optInfos.forEach((key, value) {
// optInfos[key] = Utils.calcRate(value, ques.length).round(); // optInfos[key] = Utils.calcRate(value, ques.length).round();
List<Students> currentOptionStudents = data.students.where((s) => ques List<Students> currentOptionStudents = data.students
.where((s) => ques
.where( .where(
(w) => w.studentAnswer == key && w.studentId == s.studentId) (w) => w.studentAnswer == key && w.studentId == s.studentId)
.isNotEmpty) .isNotEmpty)
@ -363,12 +363,15 @@ class Utils {
List<String> chars = upStr.split('')..sort(); List<String> chars = upStr.split('')..sort();
String sortedStr = chars.join(); String sortedStr = chars.join();
student.add(SelectionRate(sortedStr, Utils.calcRate(value, ques.length).round(),false, currentOptionStudents)); student.add(SelectionRate(
sortedStr,
Utils.calcRate(value, ques.length).round(),
false,
currentOptionStudents));
}); });
print('optitems=$optInfos'); /* print('optitems=$optInfos');
/* var ARate = Utils.calcRate( var ARate = Utils.calcRate(
ques.where((w) => w.studentAnswer == "A").length, ques.length);*/ ques.where((w) => w.studentAnswer == "A").length, ques.length);*/
que.options = student; que.options = student;
} }

View File

@ -897,7 +897,8 @@ class _ReportTableState extends State<ReportTable> {
.r, .r,
horizontal: horizontal:
8.r), 8.r),
color:const Color(0xFFF0ECFF), color: const Color(
0xFFF0ECFF),
child: quickText( child: quickText(
e e
.studentName, .studentName,