班级排名修改
This commit is contained in:
parent
f79baf3a5e
commit
c2dd9171b9
|
|
@ -20,7 +20,7 @@ class RequestConfig {
|
|||
|
||||
static const connectTimeout = 8 * 1000; // 连接超时
|
||||
static const receiveTimeout = 8 * 1000; // 接收超时
|
||||
static const bool requestDataPrinting = false; // 打印返回数据
|
||||
static const bool requestDataPrinting = true; // 打印返回数据
|
||||
static const bool printSwitch = true; // 打印返回数据
|
||||
static const successCode = [204, 200]; // 返回成功code
|
||||
static final BasePage basePage = BasePage(1, 10); // 分页参数
|
||||
|
|
|
|||
|
|
@ -199,7 +199,10 @@ class Students extends Object {
|
|||
@JsonKey(name: 'ttlSec')
|
||||
String? ttlSec;
|
||||
|
||||
Students(this.studentId,this.studentName,this.state,this.priorityAnnotate,this.kgtStu,this.kgtOkCount,this.kgtAnswerCount,this.zgtStu,this.zgtAnswerCount,this.zgtOkCount,this.allOk,this.kgtErrorCount,this.zgtErrorCount,this.zgtUnrated,this.allNotDone,this.queDtls,this.okRate,this.noAnswerCount,this.useTime,this.isAllCorrect,this.answerRate);
|
||||
@JsonKey(name: 'allTime')
|
||||
int? allTime;
|
||||
|
||||
Students(this.studentId,this.studentName,this.state,this.priorityAnnotate,this.kgtStu,this.kgtOkCount,this.kgtAnswerCount,this.zgtStu,this.zgtAnswerCount,this.zgtOkCount,this.allOk,this.kgtErrorCount,this.zgtErrorCount,this.zgtUnrated,this.allNotDone,this.queDtls,this.okRate,this.noAnswerCount,this.useTime,this.isAllCorrect,this.answerRate,this.allTime);
|
||||
|
||||
factory Students.fromJson(Map<String, dynamic> srcJson) => _$StudentsFromJson(srcJson);
|
||||
|
||||
|
|
|
|||
|
|
@ -239,11 +239,18 @@ class Utils {
|
|||
}
|
||||
}
|
||||
secList.sort();
|
||||
/* var maxSec = secList.isNotEmpty ? secList.last : 0;
|
||||
/* var maxSec = secList.isNotEmpty ? secList.last : 0;
|
||||
var minSec = secList.isNotEmpty ? secList.first : 0;*/
|
||||
var maxSec = secList.isNotEmpty ? secList.reduce((value, element) => value > element ? value : element):0;
|
||||
var minSec = secList.isNotEmpty ? secList.reduce((value, element) => value < element ? value : element):0;
|
||||
var maxSec = secList.isNotEmpty
|
||||
? secList
|
||||
.reduce((value, element) => value > element ? value : element)
|
||||
: 0;
|
||||
var minSec = secList.isNotEmpty
|
||||
? secList
|
||||
.reduce((value, element) => value < element ? value : element)
|
||||
: 0;
|
||||
var secTime = secList.isNotEmpty ? maxSec - minSec : 0;
|
||||
stu.allTime = secTime;
|
||||
stu.ttlSec = second2HMS(secTime);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,14 @@ class JobReportLogic extends GetxController with RequestToolMixin {
|
|||
}
|
||||
|
||||
void getClass() async {
|
||||
List<AnnotatedClass> data = await getClient().getAnnotatedClassList(state.homeworkId.value);
|
||||
List<AnnotatedClass> data =
|
||||
await getClient().getAnnotatedClassList(state.homeworkId.value);
|
||||
state.involveClasses.value = data;
|
||||
|
||||
state.involveClasses.value = [state.classData.value, ...(data ?? [])];
|
||||
for (var element in state.involveClasses) {
|
||||
if (element.className == state.className.value && element.grade == state.grade) {
|
||||
if (element.className == state.className.value &&
|
||||
element.grade == state.grade) {
|
||||
state.classData.value = element;
|
||||
}
|
||||
}
|
||||
|
|
@ -36,13 +38,18 @@ class JobReportLogic extends GetxController with RequestToolMixin {
|
|||
}
|
||||
|
||||
void getWorkData() async {
|
||||
HomeworkDetails data =
|
||||
await getClient().getHomeworkDetails(state.homeworkId.value, state.classData.value.classId != '-1' ? state.classData.value.classId : '');
|
||||
HomeworkDetails data = await getClient().getHomeworkDetails(
|
||||
state.homeworkId.value,
|
||||
state.classData.value.classId != '-1'
|
||||
? state.classData.value.classId
|
||||
: '');
|
||||
state.dataCount = Utils.getHomeworkData(data);
|
||||
state.subject = data.subject!;
|
||||
state.homeData = data;
|
||||
state.kgReport.value = data.questions.where((w) => w.questionType == 1).toList();
|
||||
state.zgReport.value = data.questions.where((w) => w.questionType == 2).toList();
|
||||
state.kgReport.value =
|
||||
data.questions.where((w) => w.questionType == 1).toList();
|
||||
state.zgReport.value =
|
||||
data.questions.where((w) => w.questionType == 2).toList();
|
||||
state.studentList.value = [...data.students];
|
||||
state.knowsList.value = data.knows;
|
||||
state.hasData.value = true;
|
||||
|
|
@ -51,6 +58,9 @@ class JobReportLogic extends GetxController with RequestToolMixin {
|
|||
state.studentList.sort((a, b) {
|
||||
int num1 = a.kgtOkCount! + a.zgtOkCount!;
|
||||
int num2 = b.kgtOkCount! + b.zgtOkCount!;
|
||||
if (num1 == num2) {
|
||||
return a.allTime! > b.allTime! ? num1 : num2;
|
||||
}
|
||||
return num2.compareTo(num1);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
|
|||
),
|
||||
SizedBox(height: 10.r),
|
||||
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.h : widget.kgReport.length * 40.h + (Utils.isPad() == true ? 40.h : 65.h),
|
||||
child: ReportTable(
|
||||
headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率', '标准答案', '优先批阅概况'],
|
||||
bodyList: widget.kgReport,
|
||||
|
|
@ -134,7 +134,7 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
|
|||
height: 10.r,
|
||||
),
|
||||
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.h : widget.zgReport.length * 40.h + (Utils.isPad() == true ? 40.h : 65.h),
|
||||
child: ReportTable(
|
||||
headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率', '查看原题', '优先批阅概况', '作答效率'],
|
||||
bodyList: widget.zgReport,
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class _ReportTableState extends State<ReportTable> {
|
|||
radius: 110,
|
||||
// borderSide:BorderSide(color: const Color(0xFF273366),width: 0.5.r),
|
||||
// title: e.title + (Utils.doubleToStringAsFixed(e.count / widget.studentCount * 100) + '%'),
|
||||
title: e.title + e.count.toString(),
|
||||
title: e.count.toString(),
|
||||
titleStyle: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: const Color(0xFFFFFFFF)),
|
||||
|
|
@ -942,8 +942,9 @@ class _ReportTableState extends State<ReportTable> {
|
|||
scrollController: _controller,
|
||||
columnSpacing: 0,
|
||||
horizontalMargin: 0,
|
||||
dataRowHeight: 40.r,
|
||||
dataRowHeight: 40.h,
|
||||
bottomMargin: 0,
|
||||
headingRowHeight: 40.h,
|
||||
border: const TableBorder(
|
||||
horizontalInside: BorderSide(
|
||||
width: 1, color: Colors.white, style: BorderStyle.solid),
|
||||
|
|
|
|||
Loading…
Reference in New Issue