修复全部BUG
This commit is contained in:
parent
b6af1f57a4
commit
b7478fd785
|
|
@ -1,14 +1,6 @@
|
||||||
import 'package:dio/dio.dart' hide Headers;
|
import 'package:dio/dio.dart' hide Headers;
|
||||||
import 'package:making_school_asignment_app/common/job/app_version.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/favor_param.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/original_manuscript_handwriting_params.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/review_submission_params.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/user_register_params.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/homework_review/components/job_handwriting.dart';
|
|
||||||
import 'package:retrofit/retrofit.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/annotated_class.dart';
|
import 'package:making_school_asignment_app/common/job/annotated_class.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/app_version.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/class_item.dart';
|
import 'package:making_school_asignment_app/common/job/class_item.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/common/app_version_model.dart';
|
import 'package:making_school_asignment_app/common/job/common/app_version_model.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/common/base_app_version.dart';
|
import 'package:making_school_asignment_app/common/job/common/base_app_version.dart';
|
||||||
|
|
@ -17,13 +9,21 @@ import 'package:making_school_asignment_app/common/job/enum_subject.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/homework_details.dart';
|
import 'package:making_school_asignment_app/common/job/homework_details.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart';
|
import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/knowledge_report_detail.dart';
|
import 'package:making_school_asignment_app/common/job/knowledge_report_detail.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/marking_models/favor_param.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/marking_models/original_manuscript_handwriting_params.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/marking_models/review_submission_params.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/student_history.dart';
|
import 'package:making_school_asignment_app/common/job/student_history.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/student_history_params.dart';
|
import 'package:making_school_asignment_app/common/job/student_history_params.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/student_item.dart';
|
import 'package:making_school_asignment_app/common/job/student_item.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/student_personal_info.dart';
|
import 'package:making_school_asignment_app/common/job/student_personal_info.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/user_info_detail.dart';
|
import 'package:making_school_asignment_app/common/job/user_info_detail.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/user_register_params.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/work_student.dart';
|
import 'package:making_school_asignment_app/common/job/work_student.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/work_student_params.dart';
|
import 'package:making_school_asignment_app/common/job/work_student_params.dart';
|
||||||
|
import 'package:making_school_asignment_app/page/home_page/children/homework_review/components/job_handwriting.dart';
|
||||||
|
import 'package:retrofit/retrofit.dart';
|
||||||
|
|
||||||
part 'retrofit_client.g.dart';
|
part 'retrofit_client.g.dart';
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ abstract class RetrofitClient {
|
||||||
|
|
||||||
//获取优先批阅状态学生列表
|
//获取优先批阅状态学生列表
|
||||||
@GET("/api/rbac/Student/GetPriorityAnnotateStudents")
|
@GET("/api/rbac/Student/GetPriorityAnnotateStudents")
|
||||||
Future<List<StudentItem>> getStudentList(@Query('ClassId') String classId, @Query('Subject') int subject);
|
Future<List<StudentItem>> getStudentList(@Query('ClassId') String classId, @Query('Subject') int? subject);
|
||||||
|
|
||||||
//待批阅列表
|
//待批阅列表
|
||||||
@GET("/api/hms/Annotate/GetUnAnnotateList")
|
@GET("/api/hms/Annotate/GetUnAnnotateList")
|
||||||
|
|
@ -88,16 +88,22 @@ abstract class RetrofitClient {
|
||||||
|
|
||||||
//修改学生优先批阅状态
|
//修改学生优先批阅状态
|
||||||
@POST("/api/rbac/Student/PriorityAnnotateStudent")
|
@POST("/api/rbac/Student/PriorityAnnotateStudent")
|
||||||
Future getAnnotateStudent(@Field() String classId, @Field() int studentId, @Field() bool priorityAnnotate, @Field() int subject);
|
Future getAnnotateStudent(
|
||||||
|
@Field() String classId, @Field() int studentId, @Field() bool priorityAnnotate, @Field() int? subject);
|
||||||
|
|
||||||
//学生作业信息
|
//学生作业信息
|
||||||
@GET("/api/hms/HmsReport/GetStudentHomework")
|
@GET("/api/hms/HmsReport/GetStudentHomework")
|
||||||
Future<StudentPersonalInfo> getStudentHomework(@Query('HomeworkId') String homeworkId, @Query('StudentId') int studentId);
|
Future<StudentPersonalInfo> getStudentHomework(
|
||||||
|
@Query('HomeworkId') String homeworkId, @Query('StudentId') int studentId);
|
||||||
|
|
||||||
//知识点掌握
|
//知识点掌握
|
||||||
@GET("/api/hms/HmsReport/GetKnowledgeReport")
|
@GET("/api/hms/HmsReport/GetKnowledgeReport")
|
||||||
Future<List<KnowledgePointsGrasp>> getKnowledgeReport(
|
Future<List<KnowledgePointsGrasp>> getKnowledgeReport(
|
||||||
@Query('DateStart') String dateStart, @Query('DateEnd') String dateEnd, @Query('KnowledgeName') String knowledgeName,@Query('ClassId') String classId,@Query('Subject') int subject);
|
@Query('DateStart') String dateStart,
|
||||||
|
@Query('DateEnd') String dateEnd,
|
||||||
|
@Query('KnowledgeName') String knowledgeName,
|
||||||
|
@Query('ClassId') String classId,
|
||||||
|
@Query('Subject') int? subject);
|
||||||
|
|
||||||
//知识点掌握详情
|
//知识点掌握详情
|
||||||
@GET("/api/hms/HmsReport/GetKnowledgeReportDetail")
|
@GET("/api/hms/HmsReport/GetKnowledgeReportDetail")
|
||||||
|
|
@ -106,8 +112,8 @@ abstract class RetrofitClient {
|
||||||
|
|
||||||
//学生
|
//学生
|
||||||
@GET("/api/hms/HmsReport/GetQuestionStudentState")
|
@GET("/api/hms/HmsReport/GetQuestionStudentState")
|
||||||
Future<List<Students>> getQuestionStudentState(
|
Future<List<Students>> getQuestionStudentState(@Query('HomeworkId') String homeworkId,
|
||||||
@Query('HomeworkId') String homeworkId, @Query('TemplateId') int templateId, @Query('QuestionNo') String questionNo);
|
@Query('TemplateId') int templateId, @Query('QuestionNo') String questionNo);
|
||||||
|
|
||||||
//收集订正
|
//收集订正
|
||||||
@POST("/api/hms/Homework/Collect")
|
@POST("/api/hms/Homework/Collect")
|
||||||
|
|
@ -124,7 +130,8 @@ abstract class RetrofitClient {
|
||||||
|
|
||||||
//收藏夹列表
|
//收藏夹列表
|
||||||
@GET("/api/hms/FavStudent/GetList")
|
@GET("/api/hms/FavStudent/GetList")
|
||||||
Future<BasePageData<HomeworkFavs>> getFavList(@Query('HomeworkName') String homeworkName, @Query('ClassId') String classId);
|
Future<BasePageData<HomeworkFavs>> getFavList(
|
||||||
|
@Query('HomeworkName') String homeworkName, @Query('ClassId') String classId);
|
||||||
|
|
||||||
//一键批阅 (默认未批阅的题目全部正确)
|
//一键批阅 (默认未批阅的题目全部正确)
|
||||||
@POST("/api/hms/Annotate/AllCorrect")
|
@POST("/api/hms/Annotate/AllCorrect")
|
||||||
|
|
@ -148,5 +155,6 @@ abstract class RetrofitClient {
|
||||||
|
|
||||||
// 获取APP 版本
|
// 获取APP 版本
|
||||||
@GET("/api/infra/AppVersion/Get")
|
@GET("/api/infra/AppVersion/Get")
|
||||||
Future<AppVersion?> getLastAppVersion(@Query('appName') String appName, @Query('ftuType') int ftuType); // ftuType 1安卓 2IOS 3windows
|
Future<AppVersion?> getLastAppVersion(
|
||||||
|
@Query('appName') String appName, @Query('ftuType') int ftuType); // ftuType 1安卓 2IOS 3windows
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,52 +1,61 @@
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:making_school_asignment_app/common/config/request_config.dart';
|
import 'package:making_school_asignment_app/common/config/request_config.dart';
|
||||||
|
|
||||||
part 'do_paper_details_result.g.dart';
|
part 'do_paper_details_result.g.dart';
|
||||||
|
|
||||||
|
/// 试卷详情结果数据模型
|
||||||
@JsonSerializable(checked: true, includeIfNull: false)
|
@JsonSerializable(checked: true, includeIfNull: false)
|
||||||
class DoPaperDetailsResult extends Object {
|
class DoPaperDetailsResult {
|
||||||
@JsonKey(name: 'templateIds')
|
@JsonKey(name: 'templateIds')
|
||||||
Map<String, bool> templateIds;
|
final Map<String, bool> templateIds;
|
||||||
|
|
||||||
// 自定义字段
|
/// 模板ID键列表
|
||||||
@JsonKey(name: 'templateIdKeys')
|
@JsonKey(name: 'templateIdKeys')
|
||||||
List<int>? templateIdKeys;
|
List<int>? templateIdKeys;
|
||||||
|
|
||||||
// 自定义字段
|
/// 模板ID键映射表
|
||||||
@JsonKey(name: 'templateIdKeyMap')
|
@JsonKey(name: 'templateIdKeyMap')
|
||||||
Map<int, int>? templateIdKeyMap;
|
Map<int, int>? templateIdKeyMap;
|
||||||
|
|
||||||
@JsonKey(name: 'submitStudents', toJson: _paperStudentsToJson) // 当前页 总提交学生集合
|
/// 当前页总提交学生集合
|
||||||
List<PaperStudents> students;
|
@JsonKey(name: 'submitStudents', toJson: _paperStudentsToJson)
|
||||||
|
final List<PaperStudents> students;
|
||||||
|
|
||||||
|
/// 模板ID
|
||||||
@JsonKey(name: 'templateId')
|
@JsonKey(name: 'templateId')
|
||||||
int templateId;
|
final int templateId;
|
||||||
|
|
||||||
|
/// 学生ID
|
||||||
@JsonKey(name: 'studentId')
|
@JsonKey(name: 'studentId')
|
||||||
int studentId;
|
final int studentId;
|
||||||
|
|
||||||
// 自定义字段
|
/// 是否为优先批阅
|
||||||
@JsonKey(name: 'priority', defaultValue: false)
|
@JsonKey(name: 'priority', defaultValue: false)
|
||||||
bool priority;
|
bool priority;
|
||||||
|
|
||||||
@JsonKey(name: 'annotatedCount') // 当前试题批阅数量
|
/// 当前试题批阅数量
|
||||||
int annotatedCount;
|
@JsonKey(name: 'annotatedCount')
|
||||||
|
final int annotatedCount;
|
||||||
|
|
||||||
@JsonKey(name: 'submitCount') // 当前试题提交数量
|
/// 当前试题提交数量
|
||||||
int submitCount;
|
@JsonKey(name: 'submitCount')
|
||||||
|
final int submitCount;
|
||||||
|
|
||||||
@JsonKey(name: 'zgtAnswer') // 主观题作答图片
|
/// 主观题作答图片
|
||||||
|
@JsonKey(name: 'zgtAnswer')
|
||||||
String zgtAnswer;
|
String zgtAnswer;
|
||||||
|
|
||||||
@JsonKey(name: 'showZgtAnnotate') // 主观题老师批注图片
|
/// 主观题老师批注图片(显示用)
|
||||||
|
@JsonKey(name: 'showZgtAnnotate')
|
||||||
String? showZgtAnnotate;
|
String? showZgtAnnotate;
|
||||||
|
|
||||||
@JsonKey(name: 'zgtAnnotate') // 主观题老师批注图片
|
/// 主观题老师批注图片
|
||||||
|
@JsonKey(name: 'zgtAnnotate')
|
||||||
String? zgtAnnotate;
|
String? zgtAnnotate;
|
||||||
|
|
||||||
@JsonKey(name: 'lastAnswerTime') // 学生提交作答试题时间
|
/// 学生提交作答试题时间
|
||||||
String lastAnswerTime;
|
@JsonKey(name: 'lastAnswerTime')
|
||||||
|
final String lastAnswerTime;
|
||||||
|
|
||||||
// 批注时间
|
// 批注时间
|
||||||
@JsonKey(name: 'annotateTime')
|
@JsonKey(name: 'annotateTime')
|
||||||
|
|
@ -67,7 +76,6 @@ class DoPaperDetailsResult extends Object {
|
||||||
|
|
||||||
@JsonKey(name: 'continuePage', toJson: _continuePageToJson)
|
@JsonKey(name: 'continuePage', toJson: _continuePageToJson)
|
||||||
ContinuePage? continuePage;
|
ContinuePage? continuePage;
|
||||||
|
|
||||||
|
|
||||||
@JsonKey(name: 'nextPage', toJson: _nextPageToJson)
|
@JsonKey(name: 'nextPage', toJson: _nextPageToJson)
|
||||||
NextPage? nextPage;
|
NextPage? nextPage;
|
||||||
|
|
@ -102,35 +110,42 @@ class DoPaperDetailsResult extends Object {
|
||||||
this.annotateTime,
|
this.annotateTime,
|
||||||
this.showZgtAnnotate,
|
this.showZgtAnnotate,
|
||||||
{this.needAnnotate = false}) {
|
{this.needAnnotate = false}) {
|
||||||
if (templateIds.keys.isNotEmpty) {
|
// 初始化模板ID键列表和映射表
|
||||||
templateIdKeys = templateIds.keys.map((e) => int.parse(e)).toList();
|
if (templateIds.isNotEmpty) {
|
||||||
|
templateIdKeys = templateIds.keys.map(int.parse).toList();
|
||||||
templateIdKeyMap = <int, int>{};
|
templateIdKeyMap = <int, int>{};
|
||||||
for (var i = 1; i <= templateIdKeys!.length; i++) {
|
for (int i = 0; i < templateIdKeys!.length; i++) {
|
||||||
var theVal = templateIdKeys![i - 1];
|
final templateId = templateIdKeys![i];
|
||||||
templateIdKeyMap![i] = theVal;
|
templateIdKeyMap![i + 1] = templateId;
|
||||||
templateIdKeyMap![theVal] = i;
|
templateIdKeyMap![templateId] = i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 找到当前学生是否是优先批阅
|
// 查找当前学生是否为优先批阅
|
||||||
if (students.isNotEmpty) {
|
if (students.isNotEmpty) {
|
||||||
var currentStudent = students.firstWhereOrNull((e) => e.id == studentId);
|
try {
|
||||||
if (currentStudent != null) priority = currentStudent.isPriority;
|
final currentStudent = students.firstWhere((e) => e.id == studentId);
|
||||||
|
priority = currentStudent.isPriority;
|
||||||
|
} catch (e) {
|
||||||
|
// 未找到对应的学生,保持默认值
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理主观题作答图片URL
|
||||||
if (!zgtAnswer.contains(RequestConfig.imgUrl)) {
|
if (!zgtAnswer.contains(RequestConfig.imgUrl)) {
|
||||||
zgtAnswer = '${RequestConfig.imgUrl}$zgtAnswer?$lastAnswerTime';
|
zgtAnswer = '${RequestConfig.imgUrl}$zgtAnswer?$lastAnswerTime';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zgtAnnotate?.isNotEmpty ?? false) {
|
// 处理主观题批注图片URL
|
||||||
showZgtAnnotate = RequestConfig.imgUrl + zgtAnnotate!; // 批注图片地址赋值
|
if (zgtAnnotate?.isNotEmpty == true) {
|
||||||
if (annotateTime != null) showZgtAnnotate = '${showZgtAnnotate!}?$annotateTime';
|
showZgtAnnotate = RequestConfig.imgUrl + zgtAnnotate!;
|
||||||
|
if (annotateTime != null) {
|
||||||
|
showZgtAnnotate = '${showZgtAnnotate!}?$annotateTime';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断当前试题是否需要批阅
|
// 判断当前试题是否需要批阅
|
||||||
if (annotateTime == null || studentQuestions.indexWhere((e) => e.studentScore == null) != -1) {
|
needAnnotate = annotateTime == null || studentQuestions.any((e) => e.studentScore == null);
|
||||||
needAnnotate = true;
|
|
||||||
}
|
|
||||||
// print('学生作答图片:${annotatedCount}');
|
// print('学生作答图片:${annotatedCount}');
|
||||||
// print('老师批注图片提交数量:${submitCount}');
|
// print('老师批注图片提交数量:${submitCount}');
|
||||||
}
|
}
|
||||||
|
|
@ -139,14 +154,15 @@ class DoPaperDetailsResult extends Object {
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => _$DoPaperDetailsResultToJson(this);
|
Map<String, dynamic> toJson() => _$DoPaperDetailsResultToJson(this);
|
||||||
|
|
||||||
static List<Map<String, dynamic>> _paperStudentsToJson(List<PaperStudents> examples) => examples.map((e) => e.toJson()).toList();
|
static List<Map<String, dynamic>> _paperStudentsToJson(List<PaperStudents> examples) =>
|
||||||
|
examples.map((e) => e.toJson()).toList();
|
||||||
|
|
||||||
static List<Map<String, dynamic>> _studentQuestionsToJson(List<StudentQuestions> examples) => examples.map((e) => e.toJson()).toList();
|
static List<Map<String, dynamic>> _studentQuestionsToJson(List<StudentQuestions> examples) =>
|
||||||
|
examples.map((e) => e.toJson()).toList();
|
||||||
|
|
||||||
static Map<String, dynamic>? _nextPageToJson(NextPage? example) => example?.toJson();
|
static Map<String, dynamic>? _nextPageToJson(NextPage? example) => example?.toJson();
|
||||||
static Map<String, dynamic>? _lastPageToJson(LastPage? example) => example?.toJson();
|
static Map<String, dynamic>? _lastPageToJson(LastPage? example) => example?.toJson();
|
||||||
static Map<String, dynamic>? _continuePageToJson(ContinuePage? example) => example?.toJson();
|
static Map<String, dynamic>? _continuePageToJson(ContinuePage? example) => example?.toJson();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
@ -260,22 +276,20 @@ class NextPage extends Object {
|
||||||
Map<String, dynamic> toJson() => _$NextPageToJson(this);
|
Map<String, dynamic> toJson() => _$NextPageToJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class ContinuePage extends Object {
|
class ContinuePage extends Object {
|
||||||
|
|
||||||
@JsonKey(name: 'templateId')
|
@JsonKey(name: 'templateId')
|
||||||
int templateId;
|
int templateId;
|
||||||
|
|
||||||
@JsonKey(name: 'studentId')
|
@JsonKey(name: 'studentId')
|
||||||
int studentId;
|
int studentId;
|
||||||
|
|
||||||
ContinuePage(this.templateId,this.studentId,);
|
ContinuePage(
|
||||||
|
this.templateId,
|
||||||
|
this.studentId,
|
||||||
|
);
|
||||||
|
|
||||||
factory ContinuePage.fromJson(Map<String, dynamic> srcJson) => _$ContinuePageFromJson(srcJson);
|
factory ContinuePage.fromJson(Map<String, dynamic> srcJson) => _$ContinuePageFromJson(srcJson);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => _$ContinuePageToJson(this);
|
Map<String, dynamic> toJson() => _$ContinuePageToJson(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,26 @@ import 'package:making_school_asignment_app/common/store/user_store.dart';
|
||||||
|
|
||||||
class EnumUtils {
|
class EnumUtils {
|
||||||
static String formatSubject(int id) {
|
static String formatSubject(int id) {
|
||||||
if (UserStore.to.subjectList.isEmpty || id == null) {
|
if (UserStore.to.subjectList.isEmpty) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
EnumSubject item = UserStore.to.subjectList.firstWhere((element) => element.id == id);
|
||||||
|
return item.name;
|
||||||
|
} catch (e) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
EnumSubject item = UserStore.to.subjectList.firstWhere((element) => element.id == id);
|
|
||||||
return item.name ?? '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static String formatGrade(int id) {
|
static String formatGrade(int id) {
|
||||||
if (UserStore.to.gradeList.isEmpty || id == null) {
|
if (UserStore.to.gradeList.isEmpty) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
EnumSubject item = UserStore.to.gradeList.firstWhere((element) => element.id == id);
|
||||||
|
return item.name;
|
||||||
|
} catch (e) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
EnumSubject item = UserStore.to.gradeList.firstWhere((element) => element.id == id);
|
|
||||||
return item.name ?? '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -291,6 +291,8 @@ class ShapeRecognizer {
|
||||||
/// 从原始点集中尝试识别一个“斜线”手势,并返回线段的起点和终点。
|
/// 从原始点集中尝试识别一个“斜线”手势,并返回线段的起点和终点。
|
||||||
/// 斜线被定义为一条通过 RDP 简化后只剩下两个点的笔画,且其斜率在指定范围内。
|
/// 斜线被定义为一条通过 RDP 简化后只剩下两个点的笔画,且其斜率在指定范围内。
|
||||||
bool _getSlashDetails(List<Offset> points) {
|
bool _getSlashDetails(List<Offset> points) {
|
||||||
|
if (points.isEmpty) return false;
|
||||||
|
|
||||||
final simplified = RamerDouglasPeucker.simplify(points, rdpEpsilon);
|
final simplified = RamerDouglasPeucker.simplify(points, rdpEpsilon);
|
||||||
|
|
||||||
// 1. 如果简化后是2个点,那么它是一条标准的直线斜线。
|
// 1. 如果简化后是2个点,那么它是一条标准的直线斜线。
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/src/widgets/framework.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/homework_details.dart';
|
import 'package:making_school_asignment_app/common/job/homework_details.dart';
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_state.dart';
|
import 'package:making_school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_state.dart';
|
||||||
import 'dart:math';
|
|
||||||
|
|
||||||
import '../config/request_config.dart';
|
import '../config/request_config.dart';
|
||||||
|
|
||||||
|
|
@ -23,17 +21,13 @@ class Utils {
|
||||||
|
|
||||||
/// 关闭键盘
|
/// 关闭键盘
|
||||||
static void hideKeyboard() {
|
static void hideKeyboard() {
|
||||||
FocusScopeNode? currentFocus = Get.focusScope?.nearestScope;
|
final currentFocus = Get.focusScope?.nearestScope;
|
||||||
if (currentFocus == null) {
|
if (currentFocus != null && !currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
|
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTimeOut(int seconds, call) =>
|
void setTimeOut(int seconds, VoidCallback call) => Future.delayed(Duration(seconds: seconds), call);
|
||||||
Future.delayed(Duration(seconds: seconds), call);
|
|
||||||
|
|
||||||
// 是否是平板
|
// 是否是平板
|
||||||
static bool isPad([double mobilePhoneScale = 1.2]) {
|
static bool isPad([double mobilePhoneScale = 1.2]) {
|
||||||
|
|
@ -43,9 +37,9 @@ class Utils {
|
||||||
static String getDoubleRemoveZero(double? val, [String? defaultVal]) {
|
static String getDoubleRemoveZero(double? val, [String? defaultVal]) {
|
||||||
try {
|
try {
|
||||||
if (val == null) throw Exception('数据为空');
|
if (val == null) throw Exception('数据为空');
|
||||||
List<String> _valArr = val.toString().split('.');
|
List<String> valArr = val.toString().split('.');
|
||||||
if (_valArr.length >= 2) {
|
if (valArr.length >= 2) {
|
||||||
if (int.parse(_valArr[1]) == 0) {
|
if (int.parse(valArr[1]) == 0) {
|
||||||
return val.toInt().toString();
|
return val.toInt().toString();
|
||||||
}
|
}
|
||||||
return val.toString();
|
return val.toString();
|
||||||
|
|
@ -97,43 +91,30 @@ class Utils {
|
||||||
dataCount.kgtAnswerCount = kgt.where((w) => w.state != 0).length;
|
dataCount.kgtAnswerCount = kgt.where((w) => w.state != 0).length;
|
||||||
dataCount.kgtOkCount = kgt.where((w) => w.state == 3).length;
|
dataCount.kgtOkCount = kgt.where((w) => w.state == 3).length;
|
||||||
dataCount.kgtDtlCount = kgt.length;
|
dataCount.kgtDtlCount = kgt.length;
|
||||||
dataCount.kgtAnswerRate =
|
dataCount.kgtAnswerRate = Utils.calcRate(dataCount.kgtAnswerCount!, dataCount.kgtDtlCount!);
|
||||||
Utils.calcRate(dataCount.kgtAnswerCount!, dataCount.kgtDtlCount!);
|
dataCount.kgtOkRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtDtlCount!);
|
||||||
dataCount.kgtOkRate =
|
|
||||||
Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtDtlCount!);
|
|
||||||
|
|
||||||
dataCount.kgtCorrectRate =
|
dataCount.kgtCorrectRate = Utils.calcRate(dataCount.kgtOkCount!, dataCount.kgtAnswerCount!);
|
||||||
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();
|
||||||
dataCount.zgtAnswerCount = zgt.where((w) => w.state != 0).length;
|
dataCount.zgtAnswerCount = zgt.where((w) => w.state != 0).length;
|
||||||
dataCount.zgtOkCount = zgt.where((w) => w.state == 3).length;
|
dataCount.zgtOkCount = zgt.where((w) => w.state == 3).length;
|
||||||
dataCount.zgtDtlCount = zgt.length;
|
dataCount.zgtDtlCount = zgt.length;
|
||||||
dataCount.zgtAnswerRate =
|
dataCount.zgtAnswerRate = Utils.calcRate(dataCount.zgtAnswerCount!, dataCount.zgtDtlCount!);
|
||||||
Utils.calcRate(dataCount.zgtAnswerCount!, dataCount.zgtDtlCount!);
|
dataCount.zgtOkRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtDtlCount!);
|
||||||
dataCount.zgtOkRate =
|
|
||||||
Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtDtlCount!);
|
|
||||||
|
|
||||||
dataCount.zgtCorrectRate =
|
dataCount.zgtCorrectRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtAnswerCount!);
|
||||||
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 =
|
dataCount.priorityStudents = data.students.where((w) => w.priorityAnnotate!).toList();
|
||||||
data.students.where((w) => w.priorityAnnotate!).toList();
|
|
||||||
|
|
||||||
//已提交学生数
|
//已提交学生数
|
||||||
dataCount.studentSubmitCount =
|
dataCount.studentSubmitCount = data.students.where((s) => s.state != 0).length;
|
||||||
data.students.where((s) => s.state != 0).length;
|
dataCount.studentSubmitStudents = data.students.where((s) => s.state != 0).toList();
|
||||||
dataCount.studentSubmitStudents =
|
|
||||||
data.students.where((s) => s.state != 0).toList();
|
|
||||||
//未提交学生数
|
//未提交学生数
|
||||||
dataCount.noAnswerCount =
|
dataCount.noAnswerCount = data.students.length - dataCount.studentSubmitCount!;
|
||||||
data.students.length - dataCount.studentSubmitCount!;
|
dataCount.noAnswerStudents = data.students.where((s) => s.state == 0).toList();
|
||||||
dataCount.noAnswerStudents =
|
|
||||||
data.students.where((s) => s.state == 0).toList();
|
|
||||||
|
|
||||||
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();
|
||||||
|
|
@ -141,16 +122,13 @@ class Utils {
|
||||||
// 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) {
|
stu.kgtStu!.sort((a, b) {
|
||||||
try {
|
try {
|
||||||
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) &&
|
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
|
||||||
RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
|
|
||||||
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
|
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
|
||||||
} else {
|
} else {
|
||||||
throw Exception();
|
throw Exception();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return a.questionNo
|
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
|
||||||
.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;
|
||||||
|
|
@ -161,16 +139,13 @@ class Utils {
|
||||||
// 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) {
|
stu.zgtStu!.sort((a, b) {
|
||||||
try {
|
try {
|
||||||
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) &&
|
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
|
||||||
RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
|
|
||||||
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
|
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
|
||||||
} else {
|
} else {
|
||||||
throw Exception();
|
throw Exception();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return a.questionNo
|
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
|
||||||
.toLowerCase()
|
|
||||||
.compareTo(b.questionNo.toLowerCase());
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//正确
|
//正确
|
||||||
|
|
@ -181,43 +156,32 @@ class Utils {
|
||||||
stu.zgtUnrated = stu.zgtStu!.where((w) => w.state == 1).length;
|
stu.zgtUnrated = stu.zgtStu!.where((w) => w.state == 1).length;
|
||||||
//未做
|
//未做
|
||||||
stu.zgtAnswerCount = stu.zgtStu!.where((w) => w.state != 0).length;
|
stu.zgtAnswerCount = stu.zgtStu!.where((w) => w.state != 0).length;
|
||||||
stu.isAllCorrect =
|
stu.isAllCorrect = stu.kgtOkCount! + stu.zgtOkCount! == kgt.length + zgt.length ? true : false;
|
||||||
stu.kgtOkCount! + stu.zgtOkCount! == kgt.length + zgt.length
|
|
||||||
? true
|
|
||||||
: false;
|
|
||||||
stu.allOk = data.dtls.where((w) {
|
stu.allOk = data.dtls.where((w) {
|
||||||
if (stu.studentId == w.studentId) {
|
if (stu.studentId == w.studentId) {
|
||||||
stu.useTime = w.useTime;
|
stu.useTime = w.useTime;
|
||||||
}
|
}
|
||||||
for (var que in data.questions) {
|
for (var que in data.questions) {
|
||||||
if (w.templateId == que.templateId &&
|
if (w.templateId == que.templateId && w.questionNo == que.questionNo) {
|
||||||
w.questionNo == que.questionNo) {
|
w.answer = que.answer;
|
||||||
w.answer = que.answer;
|
w.questionPicture = que.questionPicture;
|
||||||
w.questionPicture = que.questionPicture;
|
}
|
||||||
}
|
}
|
||||||
}
|
return w.studentId == stu.studentId && w.state != 3;
|
||||||
return w.studentId == stu.studentId && w.state != 3;
|
}).length;
|
||||||
}).length ??
|
if ((stu.kgtStu!.length - stu.kgtAnswerCount!) + (stu.zgtStu!.length - stu.zgtAnswerCount!) ==
|
||||||
0;
|
|
||||||
if ((stu.kgtStu!.length - stu.kgtAnswerCount!) +
|
|
||||||
(stu.zgtStu!.length - stu.zgtAnswerCount!) ==
|
|
||||||
(stu.kgtStu!.length + stu.zgtStu!.length)) {
|
(stu.kgtStu!.length + stu.zgtStu!.length)) {
|
||||||
stu.allNotDone = true;
|
stu.allNotDone = true;
|
||||||
} else {
|
} else {
|
||||||
stu.allNotDone = false;
|
stu.allNotDone = false;
|
||||||
}
|
}
|
||||||
stu.noAnswerCount = data.dtls
|
stu.noAnswerCount = data.dtls.where((w) => w.state == 0 && stu.studentId == w.studentId).length;
|
||||||
.where((w) => w.state == 0 && stu.studentId == w.studentId)
|
|
||||||
.length;
|
|
||||||
|
|
||||||
List<Questions> ques = data.questions;
|
List<Questions> ques = data.questions;
|
||||||
stu.queDtls = data.dtls
|
stu.queDtls = data.dtls
|
||||||
.where((w) =>
|
.where((w) =>
|
||||||
w.studentId == stu.studentId &&
|
w.studentId == stu.studentId &&
|
||||||
ques.indexWhere((q) =>
|
ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1)
|
||||||
w.templateId == q.templateId &&
|
|
||||||
w.questionNo == q.questionNo) >
|
|
||||||
-1)
|
|
||||||
.toList();
|
.toList();
|
||||||
int okCount = stu.queDtls!.where((w) => w.state == 3).length;
|
int okCount = stu.queDtls!.where((w) => w.state == 3).length;
|
||||||
int ttlCount = stu.queDtls!.length;
|
int ttlCount = stu.queDtls!.length;
|
||||||
|
|
@ -241,15 +205,7 @@ class Utils {
|
||||||
secList.sort();
|
secList.sort();
|
||||||
/* var maxSec = secList.isNotEmpty ? secList.last : 0;
|
/* var maxSec = secList.isNotEmpty ? secList.last : 0;
|
||||||
var minSec = secList.isNotEmpty ? secList.first : 0;*/
|
var minSec = secList.isNotEmpty ? secList.first : 0;*/
|
||||||
var maxSec = secList.isNotEmpty
|
final secTime = secList.isNotEmpty ? secList.last - secList.first : 0;
|
||||||
? 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.allTime = secTime;
|
||||||
stu.ttlSec = second2HMS(secTime);
|
stu.ttlSec = second2HMS(secTime);
|
||||||
}
|
}
|
||||||
|
|
@ -259,43 +215,32 @@ class Utils {
|
||||||
int num2 = b.state;
|
int num2 = b.state;
|
||||||
return num2.compareTo(num1);
|
return num2.compareTo(num1);
|
||||||
});
|
});
|
||||||
//全对
|
// 按成绩等级分类学生
|
||||||
dataCount.allCorrect =
|
final allCorrectStudents = data.students.where((w) => w.isAllCorrect == true).toList();
|
||||||
data.students.where((w) => w.isAllCorrect == true).length;
|
dataCount.allCorrect = allCorrectStudents.length;
|
||||||
dataCount.allCorrectStudents =
|
dataCount.allCorrectStudents = allCorrectStudents;
|
||||||
data.students.where((w) => w.isAllCorrect == true).toList();
|
|
||||||
//优
|
|
||||||
dataCount.levelOneCount =
|
|
||||||
data.students.where((s) => s.okRate! >= 85).length;
|
|
||||||
dataCount.levelOneStudents =
|
|
||||||
data.students.where((s) => s.okRate! >= 85).toList();
|
|
||||||
|
|
||||||
//良
|
final levelOneStudents = data.students.where((s) => s.okRate! >= 85).toList();
|
||||||
dataCount.levelTwoCount =
|
dataCount.levelOneCount = levelOneStudents.length;
|
||||||
data.students.where((s) => s.okRate! < 85 && s.okRate! >= 55).length;
|
dataCount.levelOneStudents = levelOneStudents;
|
||||||
dataCount.levelTwoStudents =
|
|
||||||
data.students.where((s) => s.okRate! < 85 && s.okRate! >= 55).toList();
|
|
||||||
|
|
||||||
//中
|
final levelTwoStudents = data.students.where((s) => s.okRate! < 85 && s.okRate! >= 55).toList();
|
||||||
dataCount.levelThreeCount =
|
dataCount.levelTwoCount = levelTwoStudents.length;
|
||||||
data.students.where((s) => s.okRate! < 55 && s.okRate! >= 25).length;
|
dataCount.levelTwoStudents = levelTwoStudents;
|
||||||
dataCount.levelThreeStudents =
|
|
||||||
data.students.where((s) => s.okRate! < 55 && s.okRate! >= 25).toList();
|
|
||||||
|
|
||||||
//差
|
final levelThreeStudents = data.students.where((s) => s.okRate! < 55 && s.okRate! >= 25).toList();
|
||||||
dataCount.levelFourCount =
|
dataCount.levelThreeCount = levelThreeStudents.length;
|
||||||
data.students.where((s) => s.okRate! < 25).length;
|
dataCount.levelThreeStudents = levelThreeStudents;
|
||||||
dataCount.levelFourStudents =
|
|
||||||
data.students.where((s) => s.okRate! < 25).toList();
|
final levelFourStudents = data.students.where((s) => s.okRate! < 25).toList();
|
||||||
|
dataCount.levelFourCount = levelFourStudents.length;
|
||||||
|
dataCount.levelFourStudents = levelFourStudents;
|
||||||
|
|
||||||
for (var que in data.questions) {
|
for (var que in data.questions) {
|
||||||
List<Dtls> ques = data.dtls
|
List<Dtls> ques =
|
||||||
.where((w) =>
|
data.dtls.where((w) => w.templateId == que.templateId && w.questionNo == que.questionNo).toList();
|
||||||
w.templateId == que.templateId && w.questionNo == que.questionNo)
|
|
||||||
.toList();
|
|
||||||
que.answerCount = ques.where((w) => w.state != 0).length;
|
que.answerCount = ques.where((w) => w.state != 0).length;
|
||||||
que.answerRate =
|
que.answerRate = Utils.calcRate(que.answerCount!, dataCount.studentCount!);
|
||||||
Utils.calcRate(que.answerCount!, dataCount.studentCount!);
|
|
||||||
int okCount = ques.where((w) => w.state == 3).length;
|
int okCount = ques.where((w) => w.state == 3).length;
|
||||||
que.okRate = Utils.calcRate(okCount, dataCount.studentCount!);
|
que.okRate = Utils.calcRate(okCount, dataCount.studentCount!);
|
||||||
que.priorityInfo = ques.where((w) {
|
que.priorityInfo = ques.where((w) {
|
||||||
|
|
@ -308,9 +253,12 @@ class Utils {
|
||||||
}).toList();
|
}).toList();
|
||||||
que.correctRate = Utils.calcRate(okCount, que.answerCount!);
|
que.correctRate = Utils.calcRate(okCount, que.answerCount!);
|
||||||
que.answerNgStudents = ques.where((w) {
|
que.answerNgStudents = ques.where((w) {
|
||||||
w.studentName = data.students
|
try {
|
||||||
.firstWhere((s) => s.studentId == w.studentId)
|
var student = data.students.firstWhere((s) => s.studentId == w.studentId);
|
||||||
.studentName;
|
w.studentName = student.studentName;
|
||||||
|
} catch (e) {
|
||||||
|
w.studentName = '';
|
||||||
|
}
|
||||||
return w.state == 2;
|
return w.state == 2;
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|
@ -325,21 +273,16 @@ class Utils {
|
||||||
int middleTime = 0;
|
int middleTime = 0;
|
||||||
if (ques.length % 2 == 0) {
|
if (ques.length % 2 == 0) {
|
||||||
int index = (ques.length / 2).ceil();
|
int index = (ques.length / 2).ceil();
|
||||||
middleTime =
|
middleTime = ((ques[index].useTime + ques[index - 1].useTime) / 2).ceil();
|
||||||
((ques[index].useTime + ques[index - 1].useTime) / 2).ceil();
|
|
||||||
} else {
|
} else {
|
||||||
int index = ((ques.length + 1) / 2).ceil();
|
int index = ((ques.length + 1) / 2).ceil();
|
||||||
middleTime = ques[index - 1].useTime;
|
middleTime = ques[index - 1].useTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
var excellent =
|
var excellent = ques.where((w) => w.state == 3 && w.useTime <= middleTime).length;
|
||||||
ques.where((w) => w.state == 3 && w.useTime <= middleTime).length;
|
var good = ques.where((w) => w.state == 3 && w.useTime > middleTime).length;
|
||||||
var good =
|
var middle = ques.where((w) => w.state != 3 && w.useTime <= middleTime).length;
|
||||||
ques.where((w) => w.state == 3 && w.useTime > middleTime).length;
|
var differ = ques.where((w) => w.state != 3 && w.useTime > middleTime).length;
|
||||||
var middle =
|
|
||||||
ques.where((w) => w.state != 3 && w.useTime <= middleTime).length;
|
|
||||||
var differ =
|
|
||||||
ques.where((w) => w.state != 3 && w.useTime > middleTime).length;
|
|
||||||
|
|
||||||
que.overallTitles = [
|
que.overallTitles = [
|
||||||
OverallTitles('优秀', excellent),
|
OverallTitles('优秀', excellent),
|
||||||
|
|
@ -349,8 +292,7 @@ class Utils {
|
||||||
];
|
];
|
||||||
|
|
||||||
Map<String, int> optInfos = {};
|
Map<String, int> optInfos = {};
|
||||||
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!;
|
||||||
if (optInfos[key] != null) {
|
if (optInfos[key] != null) {
|
||||||
optInfos[key] = optInfos[key]! + 1;
|
optInfos[key] = optInfos[key]! + 1;
|
||||||
|
|
@ -362,21 +304,14 @@ class Utils {
|
||||||
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
|
List<Students> currentOptionStudents = data.students
|
||||||
.where((s) => ques
|
.where((s) => ques.where((w) => w.studentAnswer == key && w.studentId == s.studentId).isNotEmpty)
|
||||||
.where(
|
|
||||||
(w) => w.studentAnswer == key && w.studentId == s.studentId)
|
|
||||||
.isNotEmpty)
|
|
||||||
.toList();
|
.toList();
|
||||||
//字母排序
|
//字母排序
|
||||||
String upStr = key.toUpperCase();
|
String upStr = key.toUpperCase();
|
||||||
List<String> chars = upStr.split('')..sort();
|
List<String> chars = upStr.split('')..sort();
|
||||||
String sortedStr = chars.join();
|
String sortedStr = chars.join();
|
||||||
|
|
||||||
student.add(SelectionRate(
|
student.add(SelectionRate(sortedStr, Utils.calcRate(value, ques.length).round(), false, currentOptionStudents));
|
||||||
sortedStr,
|
|
||||||
Utils.calcRate(value, ques.length).round(),
|
|
||||||
false,
|
|
||||||
currentOptionStudents));
|
|
||||||
});
|
});
|
||||||
/* print('optitems=$optInfos');
|
/* print('optitems=$optInfos');
|
||||||
var ARate = Utils.calcRate(
|
var ARate = Utils.calcRate(
|
||||||
|
|
@ -385,16 +320,10 @@ class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var know in data.knows) {
|
for (var know in data.knows) {
|
||||||
List<Questions> ques = data.questions
|
List<Questions> ques =
|
||||||
.where((w) =>
|
data.questions.where((w) => w.knows.indexWhere((k) => k.knowledgeId == know.knowledgeId) > -1).toList();
|
||||||
w.knows.indexWhere((k) => k.knowledgeId == know.knowledgeId) > -1)
|
|
||||||
.toList();
|
|
||||||
List<Dtls> queDtls = data.dtls
|
List<Dtls> queDtls = data.dtls
|
||||||
.where((w) =>
|
.where((w) => ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1)
|
||||||
ques.indexWhere((q) =>
|
|
||||||
w.templateId == q.templateId &&
|
|
||||||
w.questionNo == q.questionNo) >
|
|
||||||
-1)
|
|
||||||
.toList();
|
.toList();
|
||||||
know.okCount = queDtls.where((w) => w.state == 3).length;
|
know.okCount = queDtls.where((w) => w.state == 3).length;
|
||||||
know.ttlCount = queDtls.length;
|
know.ttlCount = queDtls.length;
|
||||||
|
|
@ -433,8 +362,7 @@ bool isPad([double mobilePhoneScale = 1.2]) {
|
||||||
return ScreenUtil().scaleWidth > mobilePhoneScale;
|
return ScreenUtil().scaleWidth > mobilePhoneScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
void toUpState(
|
void toUpState(Function(void Function()) setState, VoidCallback fn, bool mounted) {
|
||||||
Function(void Function()) setState, VoidCallback fn, bool mounted) {
|
|
||||||
if (mounted) setState(fn);
|
if (mounted) setState(fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get_storage/get_storage.dart';
|
|
||||||
import 'package:making_school_asignment_app/common/job/student_item.dart';
|
import 'package:making_school_asignment_app/common/job/student_item.dart';
|
||||||
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
||||||
|
|
||||||
|
|
@ -16,7 +15,8 @@ class ClassStudentLogic extends GetxController with RequestToolMixin {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
state.title.value = Get.arguments['title'] ?? '';
|
state.title.value = Get.arguments['title'] ?? '';
|
||||||
state.classId = Get.arguments['classId'] ?? '';
|
state.classId = Get.arguments['classId'] ?? '';
|
||||||
state.subject = Get.arguments['subject'] ?? -1;
|
final subject = Get.arguments['subject'];
|
||||||
|
state.subject = subject == 0 ? null : subject;
|
||||||
state.page = Get.arguments['page'] ?? '';
|
state.page = Get.arguments['page'] ?? '';
|
||||||
EasyLoading.show(status: 'loading...');
|
EasyLoading.show(status: 'loading...');
|
||||||
refreshController = EasyRefreshController();
|
refreshController = EasyRefreshController();
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ class ClassStudentState {
|
||||||
|
|
||||||
late RxString title = ''.obs;
|
late RxString title = ''.obs;
|
||||||
late final String classId;
|
late final String classId;
|
||||||
late final int subject;
|
late final int? subject;
|
||||||
late RxList<StudentItem> studentList = RxList();
|
late RxList<StudentItem> studentList = RxList();
|
||||||
late String page = '';
|
late String page = '';
|
||||||
late bool isClicking = true;
|
late bool isClicking = true;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import 'package:making_school_asignment_app/page/home_page/children/job_report/w
|
||||||
import 'fav_student_logic.dart';
|
import 'fav_student_logic.dart';
|
||||||
|
|
||||||
class FavStudentPage extends StatefulWidget {
|
class FavStudentPage extends StatefulWidget {
|
||||||
const FavStudentPage({Key? key}) : super(key: key);
|
const FavStudentPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FavStudentPage> createState() => _FavStudentPageState();
|
State<FavStudentPage> createState() => _FavStudentPageState();
|
||||||
|
|
@ -20,9 +20,7 @@ class FavStudentPage extends StatefulWidget {
|
||||||
|
|
||||||
class _FavStudentPageState extends State<FavStudentPage> {
|
class _FavStudentPageState extends State<FavStudentPage> {
|
||||||
final logic = Get.find<FavStudentLogic>();
|
final logic = Get.find<FavStudentLogic>();
|
||||||
final state = Get
|
final state = Get.find<FavStudentLogic>().state;
|
||||||
.find<FavStudentLogic>()
|
|
||||||
.state;
|
|
||||||
|
|
||||||
void showStudentDialog(BuildContext context, HomeworkFavs item, List groups) {
|
void showStudentDialog(BuildContext context, HomeworkFavs item, List groups) {
|
||||||
showDialog(
|
showDialog(
|
||||||
|
|
@ -31,16 +29,13 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
insetPadding: EdgeInsets.all(25.r),
|
insetPadding: EdgeInsets.all(25.r),
|
||||||
content: FavoriteStudentDialog(
|
content: FavoriteStudentDialog(
|
||||||
item: item,
|
item: item, group: groups, deleteFav: logic.getDelete, confirmDialog: confirmDialog),
|
||||||
group: groups,
|
|
||||||
deleteFav: logic.getDelete,
|
|
||||||
confirmDialog: confirmDialog),
|
|
||||||
contentPadding: const EdgeInsets.all(0),
|
contentPadding: const EdgeInsets.all(0),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))));
|
||||||
borderRadius: BorderRadius.all(Radius.circular(15.r))));
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> confirmDialog() async {
|
Future<bool> confirmDialog() async {
|
||||||
return await showDialog(
|
return await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -62,9 +57,9 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
||||||
),
|
),
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'确定',
|
'确定',
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
))),
|
))),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// 执行操作
|
// 执行操作
|
||||||
// Navigator.of(context).pop(true);
|
// Navigator.of(context).pop(true);
|
||||||
|
|
@ -85,300 +80,245 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
||||||
),
|
),
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'取消',
|
'取消',
|
||||||
style: TextStyle(color: Color(0xFF666666)),
|
style: TextStyle(color: Color(0xFF666666)),
|
||||||
))),
|
))),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
|
backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
// titleSpacing: 0,
|
// titleSpacing: 0,
|
||||||
elevation: 0.0,
|
elevation: 0.0,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: const Icon(Icons.arrow_back_ios),
|
icon: const Icon(Icons.arrow_back_ios),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
}),
|
}),
|
||||||
iconTheme: const IconThemeData(color: Colors.black),
|
iconTheme: const IconThemeData(color: Colors.black),
|
||||||
title: quickText('收藏夹'),
|
title: quickText('收藏夹'),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
actions: const [
|
actions: const [
|
||||||
ReturnToHomepage(),
|
ReturnToHomepage(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body:OrientationBuilder(
|
body: OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
|
||||||
builder: (BuildContext context, Orientation orientation){
|
return Column(
|
||||||
return Column(
|
children: [
|
||||||
children: [
|
Padding(
|
||||||
Padding(
|
padding: EdgeInsets.symmetric(vertical: 0.r, horizontal: 14.r),
|
||||||
padding: EdgeInsets.symmetric(vertical: 0.r, horizontal: 14.r),
|
child: Row(
|
||||||
child: Row(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
children: [
|
||||||
children: [
|
Expanded(
|
||||||
Expanded(
|
child: Obx(() {
|
||||||
child: Obx(() {
|
return Text(
|
||||||
return Text(
|
state.homeworkName.value,
|
||||||
state.homeworkName.value,
|
style: TextStyle(
|
||||||
style:
|
fontSize: 14.sp,
|
||||||
TextStyle(fontSize: 14.sp, color: const Color(0xFF3C3C3C),),
|
color: const Color(0xFF3C3C3C),
|
||||||
overflow: TextOverflow.ellipsis,
|
),
|
||||||
);
|
overflow: TextOverflow.ellipsis,
|
||||||
}),
|
);
|
||||||
),
|
|
||||||
// 下拉框
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
vertical: 10.h, horizontal: 10.w),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Obx(() {
|
|
||||||
return DropdownSelection(
|
|
||||||
bgColor: Colors.white,
|
|
||||||
involveClasses: state.involveClasses.value,
|
|
||||||
classData: state.classData.value,
|
|
||||||
call: (AnnotatedClass item) {
|
|
||||||
state.classData.value = item;
|
|
||||||
if (item.grade == -1) state.classData.value = state.defaultClass;
|
|
||||||
logic.getList();
|
|
||||||
});
|
|
||||||
}),
|
}),
|
||||||
],
|
),
|
||||||
),
|
// 下拉框
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Obx(() {
|
||||||
|
return DropdownSelection(
|
||||||
|
bgColor: Colors.white,
|
||||||
|
involveClasses: state.involveClasses.value,
|
||||||
|
classData: state.classData.value,
|
||||||
|
onClassSelected: (AnnotatedClass item) {
|
||||||
|
state.classData.value = item;
|
||||||
|
if (item.grade == -1) state.classData.value = state.defaultClass;
|
||||||
|
logic.getList();
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
Container(
|
||||||
),
|
width: MediaQuery.of(context).size.width,
|
||||||
Container(
|
height: 1.r,
|
||||||
width: MediaQuery
|
decoration: const BoxDecoration(
|
||||||
.of(context)
|
color: Color(0xFFEEEEEE),
|
||||||
.size
|
),
|
||||||
.width,
|
),
|
||||||
height: 1.r,
|
Obx(() {
|
||||||
decoration: const BoxDecoration(
|
return state.favList.isNotEmpty
|
||||||
color: Color(0xFFEEEEEE),
|
? Expanded(
|
||||||
),
|
child: Utils.isPad()
|
||||||
),
|
? Padding(
|
||||||
Obx((){
|
padding: EdgeInsets.only(top: 10.r, bottom: 8.r, left: 14.r, right: 14.r),
|
||||||
return state.favList.isNotEmpty
|
child: Column(
|
||||||
? Expanded(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Utils.isPad()
|
children: List.generate(state.favList.length, (index) {
|
||||||
? Padding(
|
var item = state.favList[index];
|
||||||
padding: EdgeInsets.only(
|
return Padding(
|
||||||
top: 10.r,
|
padding: EdgeInsets.only(bottom: 8.r),
|
||||||
bottom: 8.r,
|
child: Column(
|
||||||
left: 14.r,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
right: 14.r),
|
children: [
|
||||||
child: Column(
|
Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: EdgeInsets.only(bottom: 5.r),
|
||||||
children:
|
child: Text(
|
||||||
List.generate(state.favList.length, (index) {
|
'第${item['questionPage']}页',
|
||||||
var item = state.favList[index];
|
style:
|
||||||
return Padding(
|
TextStyle(fontSize: 12.sp, color: Theme.of(context).primaryColor),
|
||||||
padding: EdgeInsets.only(bottom: 8.r),
|
),
|
||||||
child: Column(
|
),
|
||||||
crossAxisAlignment:
|
GridView(
|
||||||
CrossAxisAlignment.start,
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
children: [
|
crossAxisCount: 2,
|
||||||
Padding(
|
mainAxisSpacing: 8.r,
|
||||||
padding:
|
crossAxisSpacing: 10.r,
|
||||||
EdgeInsets.only(bottom: 5.r),
|
childAspectRatio: 556 / 112,
|
||||||
child: Text(
|
),
|
||||||
'第${item['questionPage']}页',
|
shrinkWrap: true,
|
||||||
style: TextStyle(
|
children: List.generate(item['list'].length, (i) {
|
||||||
fontSize: 12.sp,
|
HomeworkFavs student = item['list'][i];
|
||||||
color:Theme.of(context).primaryColor),
|
return Container(
|
||||||
),
|
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 10.r),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
GridView(
|
color: Colors.white,
|
||||||
gridDelegate:
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
SliverGridDelegateWithFixedCrossAxisCount(
|
),
|
||||||
crossAxisCount: 2,
|
child: InkWell(
|
||||||
mainAxisSpacing: 8.r,
|
onTap: () {
|
||||||
crossAxisSpacing: 10.r,
|
showStudentDialog(context, student, state.favList);
|
||||||
childAspectRatio: 556 / 112,
|
},
|
||||||
),
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
quickText(student.studentName,
|
||||||
|
color: const Color(0xFF333333), size: 12.sp),
|
||||||
|
Expanded(child: Container()),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(right: 8.r),
|
||||||
|
child: Text(
|
||||||
|
student.className!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp, color: const Color(0xFF666666)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
var confim = await confirmDialog();
|
||||||
|
if (confim) {
|
||||||
|
logic.getDelete(student);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/favorite_delete_icon.png',
|
||||||
|
width: 24.r,
|
||||||
|
height: 24.r,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
children: List.generate(
|
itemBuilder: (context, index) {
|
||||||
item['list'].length, (i) {
|
var item = state.favList[index];
|
||||||
HomeworkFavs student = item['list'][i];
|
return Padding(
|
||||||
return Container(
|
padding: EdgeInsets.only(top: 10.r, bottom: 8.r, left: 14.r, right: 14.r),
|
||||||
padding: EdgeInsets.symmetric(
|
child: Column(
|
||||||
vertical: 5.r,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
horizontal: 10.r),
|
children: [
|
||||||
decoration: BoxDecoration(
|
Padding(
|
||||||
color: Colors.white,
|
padding: EdgeInsets.only(bottom: 5.r),
|
||||||
borderRadius:
|
child: Text(
|
||||||
BorderRadius.all(
|
'第${item['questionPage']}页',
|
||||||
Radius.circular(
|
style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor),
|
||||||
6.r)),
|
|
||||||
),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
showStudentDialog(context,
|
|
||||||
student, state.favList);
|
|
||||||
},
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment
|
|
||||||
.spaceBetween,
|
|
||||||
children: [
|
|
||||||
quickText(
|
|
||||||
student.studentName,
|
|
||||||
color: const Color(
|
|
||||||
0xFF333333),
|
|
||||||
size: 12.sp),
|
|
||||||
Expanded(
|
|
||||||
child: Container()),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
EdgeInsets.only(
|
|
||||||
right: 8.r),
|
|
||||||
child: Text(
|
|
||||||
student.className!,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12.sp,
|
|
||||||
color: const Color(
|
|
||||||
0xFF666666)),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
InkWell(
|
),
|
||||||
onTap: () async {
|
ListView.builder(
|
||||||
var confim =
|
itemBuilder: (context, i) {
|
||||||
await confirmDialog();
|
HomeworkFavs student = item['list'][i];
|
||||||
if (confim) {
|
return InkWell(
|
||||||
logic.getDelete(
|
onTap: () {
|
||||||
student);
|
showStudentDialog(context, student, state.favList);
|
||||||
}
|
},
|
||||||
},
|
child: Container(
|
||||||
child: Image.asset(
|
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 10.r),
|
||||||
'assets/images/favorite_delete_icon.png',
|
margin: EdgeInsets.only(top: 5.r),
|
||||||
width: 24.r,
|
decoration: BoxDecoration(
|
||||||
height: 24.r,
|
color: Colors.white,
|
||||||
),
|
borderRadius: BorderRadius.all(Radius.circular(6.r)),
|
||||||
),
|
),
|
||||||
],
|
child: Row(
|
||||||
),
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
quickText(student.studentName,
|
||||||
|
color: const Color(0xFF333333), size: 14.sp),
|
||||||
|
Expanded(child: Container()),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(right: 8.r),
|
||||||
|
child: Text(
|
||||||
|
student.className!,
|
||||||
|
style:
|
||||||
|
TextStyle(fontSize: 14.sp, color: const Color(0xFF666666)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
var confim = await confirmDialog();
|
||||||
|
if (confim) {
|
||||||
|
logic.getDelete(student);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/favorite_delete_icon.png',
|
||||||
|
width: 32.r,
|
||||||
|
height: 32.r,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: item['list'].length,
|
||||||
|
shrinkWrap: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
})),
|
},
|
||||||
],
|
itemCount: state.favList.length,
|
||||||
),
|
|
||||||
);
|
|
||||||
})),
|
|
||||||
)
|
|
||||||
: ListView.builder(
|
|
||||||
shrinkWrap: true,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
var item = state.favList[index];
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: 10.r,
|
|
||||||
bottom: 8.r,
|
|
||||||
left: 14.r,
|
|
||||||
right: 14.r),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 5.r),
|
|
||||||
child: Text(
|
|
||||||
'第${item['questionPage']}页',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.sp,
|
|
||||||
color:Theme.of(context).primaryColor),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListView.builder(
|
|
||||||
itemBuilder: (context, i) {
|
|
||||||
HomeworkFavs student = item['list'][i];
|
|
||||||
return InkWell(
|
|
||||||
onTap: () {
|
|
||||||
showStudentDialog(
|
|
||||||
context, student, state.favList);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
vertical: 5.r,
|
|
||||||
horizontal: 10.r),
|
|
||||||
margin: EdgeInsets.only(top: 5.r),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.r)),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment
|
|
||||||
.spaceBetween,
|
|
||||||
children: [
|
|
||||||
quickText(student.studentName,
|
|
||||||
color: const Color(0xFF333333),
|
|
||||||
size: 14.sp),
|
|
||||||
Expanded(child: Container()),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
right: 8.r),
|
|
||||||
child: Text(
|
|
||||||
student.className!,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.sp,
|
|
||||||
color: const Color(
|
|
||||||
0xFF666666)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
var confim =
|
|
||||||
await confirmDialog();
|
|
||||||
if (confim) {
|
|
||||||
logic.getDelete(student);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/images/favorite_delete_icon.png',
|
|
||||||
width: 32.r,
|
|
||||||
height: 32.r,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
)
|
||||||
},
|
: Padding(
|
||||||
itemCount: item['list'].length,
|
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r),
|
||||||
shrinkWrap: true,
|
child: const MyEmptyWidget(),
|
||||||
),
|
);
|
||||||
],
|
}),
|
||||||
),
|
],
|
||||||
);
|
);
|
||||||
},
|
}));
|
||||||
itemCount: state.favList.length,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: MediaQuery
|
|
||||||
.of(context)
|
|
||||||
.size
|
|
||||||
.height / 2 - 200.r),
|
|
||||||
child: const MyEmptyWidget(),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -387,4 +327,4 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
logic.controller.getList();
|
logic.controller.getList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
|
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
|
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
|
||||||
|
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
|
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
||||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||||
|
|
@ -77,9 +78,14 @@ class DropdownSwitchStudentsType extends StatelessWidget {
|
||||||
final students = sateData.value?.students ?? [];
|
final students = sateData.value?.students ?? [];
|
||||||
|
|
||||||
// 获取当前学生姓名
|
// 获取当前学生姓名
|
||||||
final currentStudent = currentStudentId != null
|
PaperStudents? currentStudent;
|
||||||
? students.firstWhereOrNull((e) => e.id == currentStudentId)
|
if (currentStudentId != null) {
|
||||||
: null;
|
try {
|
||||||
|
currentStudent = students.firstWhere((e) => e.id == currentStudentId);
|
||||||
|
} catch (e) {
|
||||||
|
currentStudent = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final studentName = currentStudent?.name ?? '当前学生';
|
final studentName = currentStudent?.name ?? '当前学生';
|
||||||
final questionNumber = templateIdKeyMap?[value] ?? '当前选择页';
|
final questionNumber = templateIdKeyMap?[value] ?? '当前选择页';
|
||||||
|
|
@ -301,8 +307,12 @@ Widget $historyHomework(BuildContext context) {
|
||||||
int? studentId = sateData.value?.studentId;
|
int? studentId = sateData.value?.studentId;
|
||||||
if (kDebugMode) print(studentId);
|
if (kDebugMode) print(studentId);
|
||||||
if (studentId == null || (sateData.value?.students.isEmpty ?? true)) return;
|
if (studentId == null || (sateData.value?.students.isEmpty ?? true)) return;
|
||||||
var currentStudent = sateData.value!.students.firstWhereOrNull((e) => e.id == studentId);
|
PaperStudents? currentStudent;
|
||||||
if (currentStudent == null) return;
|
try {
|
||||||
|
currentStudent = sateData.value!.students.firstWhere((e) => e.id == studentId);
|
||||||
|
} catch (e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var theState = Get.find<HomeworkReviewLogic>().state;
|
var theState = Get.find<HomeworkReviewLogic>().state;
|
||||||
Get.toNamed(Routes.studentWorkDetailPage, arguments: {
|
Get.toNamed(Routes.studentWorkDetailPage, arguments: {
|
||||||
'studentId': studentId,
|
'studentId': studentId,
|
||||||
|
|
|
||||||
|
|
@ -184,8 +184,12 @@ Widget $scoringQuestionsView(
|
||||||
studentScoreListener() {
|
studentScoreListener() {
|
||||||
print(item.toJson());
|
print(item.toJson());
|
||||||
item.studentScore = studentScore.value;
|
item.studentScore = studentScore.value;
|
||||||
var theVal = sateData.studentQuestions.value?.firstWhereOrNull((e) => e.questionNo == item.questionNo);
|
try {
|
||||||
if (theVal != null) theVal.studentScore = studentScore.value;
|
var theVal = sateData.studentQuestions.value?.firstWhere((e) => e.questionNo == item.questionNo);
|
||||||
|
theVal?.studentScore = studentScore.value;
|
||||||
|
} catch (e) {
|
||||||
|
// 未找到对应的题目
|
||||||
|
}
|
||||||
|
|
||||||
var studentQuestions = sateData.studentQuestions.value;
|
var studentQuestions = sateData.studentQuestions.value;
|
||||||
if (item.studentScore == null) return;
|
if (item.studentScore == null) return;
|
||||||
|
|
@ -193,17 +197,25 @@ Widget $scoringQuestionsView(
|
||||||
// 校验是否自动提交 对于已经批阅过的试题 不重复自动提交
|
// 校验是否自动提交 对于已经批阅过的试题 不重复自动提交
|
||||||
var annotateTime = logic.state.data.value?.annotateTime;
|
var annotateTime = logic.state.data.value?.annotateTime;
|
||||||
if (annotateTime == null) {
|
if (annotateTime == null) {
|
||||||
var noRatingGiven = studentQuestions!.firstWhereOrNull((e) => e.useTime != 0 && e.studentScore == null);
|
try {
|
||||||
if (noRatingGiven == null) logic.submit(context);
|
studentQuestions!.firstWhere((e) => e.useTime != 0 && e.studentScore == null);
|
||||||
|
} catch (e) {
|
||||||
|
// 所有题目都已评分,可以提交
|
||||||
|
logic.submit(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
studentScore.addListener(studentScoreListener);
|
studentScore.addListener(studentScoreListener);
|
||||||
|
|
||||||
var studentQuestionsStream = sateData.studentQuestions.listen((e) {
|
var studentQuestionsStream = sateData.studentQuestions.listen((e) {
|
||||||
var itemVal = (e ?? []).firstWhereOrNull((e1) => e1.questionNo == item.questionNo);
|
try {
|
||||||
if (itemVal != null && studentScore.value != itemVal.studentScore) {
|
var itemVal = (e ?? []).firstWhere((e1) => e1.questionNo == item.questionNo);
|
||||||
studentScore.value = itemVal.studentScore;
|
if (studentScore.value != itemVal.studentScore) {
|
||||||
|
studentScore.value = itemVal.studentScore;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 未找到对应的题目
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
||||||
timer = Timer(const Duration(milliseconds: timeoutDuration), () {
|
timer = Timer(const Duration(milliseconds: timeoutDuration), () {
|
||||||
if (_activePointers > 2) {
|
if (_activePointers > 2) {
|
||||||
_activePointers = 0;
|
_activePointers = 0;
|
||||||
if (vnHandWritings.value.last != null) {
|
if (vnHandWritings.value.isNotEmpty && vnHandWritings.value.last != null) {
|
||||||
vnHandWritings.value.add(null); // 增加空点以分隔不同的线段
|
vnHandWritings.value.add(null); // 增加空点以分隔不同的线段
|
||||||
sateData.handwritings = vnHandWritings.value; // 添加笔迹数据
|
sateData.handwritings = vnHandWritings.value; // 添加笔迹数据
|
||||||
}
|
}
|
||||||
|
|
@ -415,10 +415,12 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
||||||
sateData.data.update((_) {
|
sateData.data.update((_) {
|
||||||
var theStudentQuestions = sateData.studentQuestions.value;
|
var theStudentQuestions = sateData.studentQuestions.value;
|
||||||
if (theStudentQuestions?.isNotEmpty ?? false) {
|
if (theStudentQuestions?.isNotEmpty ?? false) {
|
||||||
var noMarking = theStudentQuestions?.firstWhereOrNull((e) => e.studentScore == null);
|
try {
|
||||||
if (noMarking != null) {
|
var noMarking = theStudentQuestions?.firstWhere((e) => e.studentScore == null);
|
||||||
ToastUtils.showInfo("未提交!请为第${noMarking.questionNo}题打分,再手动提交");
|
ToastUtils.showInfo("未提交!请为第${noMarking?.questionNo}题打分,再手动提交");
|
||||||
return;
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
// 所有题目都已评分
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logic.submit(Get.context ?? context);
|
logic.submit(Get.context ?? context);
|
||||||
|
|
|
||||||
|
|
@ -288,10 +288,12 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin, EventBus
|
||||||
|
|
||||||
var studentQuestions = state.studentQuestions.value!.where((e) => e.useTime != null && e.useTime! > 0).toList();
|
var studentQuestions = state.studentQuestions.value!.where((e) => e.useTime != null && e.useTime! > 0).toList();
|
||||||
// 跳过学生未作答的题
|
// 跳过学生未作答的题
|
||||||
var noRatingElement = studentQuestions.firstWhereOrNull((e) => e.studentScore == null);
|
try {
|
||||||
if (noRatingElement != null) {
|
var noRatingElement = studentQuestions.firstWhere((e) => e.studentScore == null);
|
||||||
ToastUtils.showInfo('第${noRatingElement.questionNo}题请评分');
|
ToastUtils.showInfo('第${noRatingElement.questionNo}题请评分');
|
||||||
return;
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
// 所有题目都已评分
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片上传
|
// 图片上传
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import 'package:get/get.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/annotated_class.dart';
|
import 'package:making_school_asignment_app/common/job/annotated_class.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/global_widget/ReturnToHomepage.dart';
|
import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart';
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/dropdown_selection.dart';
|
|
||||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||||
|
import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/dropdown_selection.dart';
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/knowledge_point.dart';
|
import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/knowledge_point.dart';
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/personnel_data_overview.dart';
|
import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/personnel_data_overview.dart';
|
||||||
import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/top_count.dart';
|
import 'package:making_school_asignment_app/page/home_page/children/job_report/widget/top_count.dart';
|
||||||
|
|
@ -64,7 +64,7 @@ class _JobReportPageState extends State<JobReportPage> {
|
||||||
return DropdownSelection(
|
return DropdownSelection(
|
||||||
involveClasses: state.involveClasses.value,
|
involveClasses: state.involveClasses.value,
|
||||||
classData: state.classData.value,
|
classData: state.classData.value,
|
||||||
call: (AnnotatedClass item) {
|
onClassSelected: (AnnotatedClass item) {
|
||||||
state.classData.value = item;
|
state.classData.value = item;
|
||||||
if (item.grade == -1) state.classData.value = state.defaultClass;
|
if (item.grade == -1) state.classData.value = state.defaultClass;
|
||||||
logic.getWorkData();
|
logic.getWorkData();
|
||||||
|
|
@ -75,18 +75,19 @@ class _JobReportPageState extends State<JobReportPage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
//完成率、正确率
|
//完成率、正确率
|
||||||
TopCount(state.dataCount, state.classData == null ? '' : state.classData.value.className, state.homeworkId.value, state.subject),
|
TopCount(
|
||||||
|
state.dataCount, state.classData.value.className ?? '', state.homeworkId.value, state.subject),
|
||||||
//客观题、主观题
|
//客观题、主观题
|
||||||
KgtZgtTable(
|
KgtZgtTable(
|
||||||
studentCount: state.dataCount.studentCount!,
|
studentCount: state.dataCount.studentCount!,
|
||||||
homeworkId: state.homeworkId.value,
|
homeworkId: state.homeworkId.value,
|
||||||
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),
|
kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0),
|
||||||
zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0),
|
zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0),
|
||||||
subject: state.subject,
|
subject: state.subject,
|
||||||
),
|
),
|
||||||
// 掌握知识点的情况
|
// 掌握知识点的情况
|
||||||
Container(
|
Container(
|
||||||
|
|
@ -94,7 +95,7 @@ class _JobReportPageState extends State<JobReportPage> {
|
||||||
child: KnowledgePoint(
|
child: KnowledgePoint(
|
||||||
knowsList: state.knowsList,
|
knowsList: state.knowsList,
|
||||||
data: state.homeData,
|
data: state.homeData,
|
||||||
className: state.classData.value.className,
|
className: state.classData.value.className ?? '',
|
||||||
homeworkId: state.homeworkId.value,
|
homeworkId: state.homeworkId.value,
|
||||||
subject: state.subject,
|
subject: state.subject,
|
||||||
)),
|
)),
|
||||||
|
|
@ -107,7 +108,9 @@ class _JobReportPageState extends State<JobReportPage> {
|
||||||
margin: EdgeInsets.symmetric(horizontal: 10.r),
|
margin: EdgeInsets.symmetric(horizontal: 10.r),
|
||||||
child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)),*/
|
child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)),*/
|
||||||
// 人员数据概况
|
// 人员数据概况
|
||||||
Container(margin: EdgeInsets.symmetric(horizontal: 10.r), child: PersonnelDataOverview(studentList: state.studentList.value)),
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 10.r),
|
||||||
|
child: PersonnelDataOverview(studentList: state.studentList.value)),
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30.r,
|
height: 30.r,
|
||||||
|
|
@ -116,7 +119,9 @@ class _JobReportPageState extends State<JobReportPage> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget());
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r),
|
||||||
|
child: const MyEmptyWidget());
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,11 @@ import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||||
class DropdownSelection extends StatefulWidget {
|
class DropdownSelection extends StatefulWidget {
|
||||||
final List<AnnotatedClass>? involveClasses;
|
final List<AnnotatedClass>? involveClasses;
|
||||||
final AnnotatedClass? classData;
|
final AnnotatedClass? classData;
|
||||||
final Function(AnnotatedClass) call;
|
final void Function(AnnotatedClass) onClassSelected;
|
||||||
final Color? bgColor;
|
final Color? bgColor;
|
||||||
const DropdownSelection({Key? key, required this.involveClasses, required this.classData, required this.call,this.bgColor}) : super(key: key);
|
|
||||||
|
const DropdownSelection(
|
||||||
|
{super.key, required this.involveClasses, required this.classData, required this.onClassSelected, this.bgColor});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<DropdownSelection> createState() => _DropdownSelectionState();
|
State<DropdownSelection> createState() => _DropdownSelectionState();
|
||||||
|
|
@ -29,18 +31,27 @@ class _DropdownSelectionState extends State<DropdownSelection> {
|
||||||
)),
|
)),
|
||||||
child: DropdownButton(
|
child: DropdownButton(
|
||||||
value: widget.classData?.classId ?? '-1',
|
value: widget.classData?.classId ?? '-1',
|
||||||
style: TextStyle(color: Color.fromRGBO(89, 89, 89, 1), fontSize: 12.sp),
|
style: TextStyle(color: const Color.fromRGBO(89, 89, 89, 1), fontSize: 12.sp),
|
||||||
underline: Container(),
|
underline: Container(),
|
||||||
// isExpanded:true,
|
// isExpanded:true,
|
||||||
items: widget.involveClasses?.map((e) {
|
items: widget.involveClasses?.map((classItem) {
|
||||||
return DropdownMenuItem(
|
return DropdownMenuItem<String>(
|
||||||
value: e.classId!,
|
value: classItem.classId,
|
||||||
child: quickText(e.classId == '-1' ? '全部' : ' ${EnumUtils.formatGrade(e.grade)}${e.className}', size: 12.sp, color: Colors.black),
|
child: quickText(
|
||||||
|
classItem.classId == '-1' ? '全部' : ' ${EnumUtils.formatGrade(classItem.grade)}${classItem.className}',
|
||||||
|
size: 12.sp,
|
||||||
|
color: Colors.black),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
onChanged: (value) {
|
onChanged: (String? value) {
|
||||||
if (value == null) return;
|
if (value == null || widget.involveClasses == null) return;
|
||||||
widget.call(widget.involveClasses!.firstWhere((element) => element.classId == value));
|
|
||||||
|
try {
|
||||||
|
final selectedClass = widget.involveClasses!.firstWhere((element) => element.classId == value);
|
||||||
|
widget.onClassSelected(selectedClass);
|
||||||
|
} catch (e) {
|
||||||
|
// 如果没有找到匹配的班级,不执行任何操作
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import 'package:get/get.dart';
|
||||||
import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart';
|
import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart';
|
||||||
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
||||||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
|
||||||
|
|
||||||
import 'knowledge_points_grasp_state.dart';
|
import 'knowledge_points_grasp_state.dart';
|
||||||
|
|
||||||
|
|
@ -19,7 +18,9 @@ class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin, Ge
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
state.subject = Get.arguments['subject'] ?? -1;
|
final subject = Get.arguments['subject'];
|
||||||
|
state.subject = subject == 0 ? null : subject;
|
||||||
|
|
||||||
state.classId = Get.arguments['classId'] ?? '';
|
state.classId = Get.arguments['classId'] ?? '';
|
||||||
textController = TextEditingController();
|
textController = TextEditingController();
|
||||||
refreshController = EasyRefreshController();
|
refreshController = EasyRefreshController();
|
||||||
|
|
@ -31,8 +32,9 @@ class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin, Ge
|
||||||
void getList() async {
|
void getList() async {
|
||||||
try {
|
try {
|
||||||
ToastUtils.showLoading();
|
ToastUtils.showLoading();
|
||||||
List<KnowledgePointsGrasp> data =
|
List<KnowledgePointsGrasp> data = await getClient()
|
||||||
await getClient().getKnowledgeReport(state.dateStart, state.dateEnd, textController.text, state.classId, state.subject);
|
.getKnowledgeReport(state.dateStart, state.dateEnd, textController.text, state.classId, state.subject);
|
||||||
|
print('data: ${data.length}');
|
||||||
state.dataList.value = data;
|
state.dataList.value = data;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ class KnowledgePointsGraspState {
|
||||||
late String dateStart = Utils.getWeekStartDate().toString().substring(0, 10);
|
late String dateStart = Utils.getWeekStartDate().toString().substring(0, 10);
|
||||||
late String dateEnd = Utils.getWeekEndDate().toString().substring(0, 10);
|
late String dateEnd = Utils.getWeekEndDate().toString().substring(0, 10);
|
||||||
late RxString customTimeStr = '自定义'.obs;
|
late RxString customTimeStr = '自定义'.obs;
|
||||||
late final int subject;
|
late final int? subject;
|
||||||
late final String classId;
|
late final String classId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:easy_debounce/easy_throttle.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||||
|
|
@ -87,7 +86,8 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 50.r,
|
width: 50.r,
|
||||||
height: 30.r,
|
height: 30.r,
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(4.r), color: Theme.of(context).primaryColor),
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(4.r), color: Theme.of(context).primaryColor),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'查询',
|
'查询',
|
||||||
|
|
@ -104,12 +104,11 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
|
||||||
jobType: 1,
|
jobType: 1,
|
||||||
controller: logic.tabController,
|
controller: logic.tabController,
|
||||||
customTimeStr: state.customTimeStr.value,
|
customTimeStr: state.customTimeStr.value,
|
||||||
customTime: logic.tabController.index != 2 ||
|
customTime: logic.tabController.index != 2 || ((state.dateEnd == '') && (state.dateStart == ''))
|
||||||
((state.dateEnd == null || state.dateEnd == '') && (state.dateStart == null || state.dateStart == ''))
|
|
||||||
? null
|
? null
|
||||||
: PickerDateRange(
|
: PickerDateRange(
|
||||||
state.dateStart == null || state.dateStart == '' ? null : DateTime.parse(state.dateStart!),
|
state.dateStart == '' ? null : DateTime.parse(state.dateStart),
|
||||||
state.dateEnd == null || state.dateEnd == '' ? null : DateTime.parse(state.dateEnd!),
|
state.dateEnd == '' ? null : DateTime.parse(state.dateEnd),
|
||||||
),
|
),
|
||||||
onTimeFilter: (String? startTime, String? endTime) {
|
onTimeFilter: (String? startTime, String? endTime) {
|
||||||
EasyLoading.show(status: 'loading...');
|
EasyLoading.show(status: 'loading...');
|
||||||
|
|
@ -133,9 +132,11 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
|
||||||
state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? '';
|
state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? '';
|
||||||
if (value.endDate != null) {
|
if (value.endDate != null) {
|
||||||
if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) {
|
if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) {
|
||||||
state.customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
|
state.customTimeStr.value =
|
||||||
|
'${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
|
||||||
} else {
|
} else {
|
||||||
state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
|
state.customTimeStr.value =
|
||||||
|
'${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +181,8 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r),
|
margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r),
|
||||||
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r),
|
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.r)), color: Colors.white),
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.r)), color: Colors.white),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|
@ -207,12 +209,14 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${item.count}次',
|
'${item.count}次',
|
||||||
style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor),
|
style:
|
||||||
|
TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor),
|
||||||
),
|
),
|
||||||
SizedBox(width: 1.w),
|
SizedBox(width: 1.w),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 2.h),
|
padding: EdgeInsets.only(top: 2.h),
|
||||||
child: Icon(Icons.chevron_right, size: 12.r, color: Theme.of(context).primaryColor),
|
child: Icon(Icons.chevron_right,
|
||||||
|
size: 12.r, color: Theme.of(context).primaryColor),
|
||||||
),
|
),
|
||||||
// Image.asset(
|
// Image.asset(
|
||||||
// 'assets/images/job_data_right_icon.png',
|
// 'assets/images/job_data_right_icon.png',
|
||||||
|
|
|
||||||
|
|
@ -88,48 +88,18 @@ class HomePage extends GetxKeepAliveWidget<HomeLogic> {
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
// 刷新按钮
|
// 刷新按钮
|
||||||
Obx(() => IconButton(
|
IconButton(
|
||||||
onPressed: state.totalCount.value > 0 ? () => controller.getList() : null,
|
onPressed: () => controller.refreshController.callRefresh(),
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.refresh,
|
Icons.refresh,
|
||||||
size: 20.sp,
|
size: 20.sp,
|
||||||
color: const Color(0xFF4F4F4F),
|
color: const Color(0xFF4F4F4F),
|
||||||
),
|
),
|
||||||
tooltip: '刷新数据',
|
tooltip: '刷新数据',
|
||||||
)),
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 20.r),
|
|
||||||
// 统计信息卡片
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.all(16.r),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: const Color(0xFFF8F9FA),
|
|
||||||
borderRadius: BorderRadius.circular(12.r),
|
|
||||||
border: Border.all(color: const Color(0xFFE9ECEF), width: 1),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: _buildStatCard(
|
|
||||||
'待批阅',
|
|
||||||
state.totalCount.value.toString(),
|
|
||||||
const Color(0xFFFF6969),
|
|
||||||
Icons.assignment_turned_in,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 16.r),
|
|
||||||
Expanded(
|
|
||||||
child: _buildStatCard(
|
|
||||||
'已批阅',
|
|
||||||
'0', // 这里可以添加已批阅数量
|
|
||||||
const Color(0xFF28A745),
|
|
||||||
Icons.check_circle_outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 24.r),
|
SizedBox(height: 24.r),
|
||||||
// 功能菜单网格
|
// 功能菜单网格
|
||||||
_buildMenuGrid(context, state),
|
_buildMenuGrid(context, state),
|
||||||
|
|
@ -191,7 +161,7 @@ class HomePage extends GetxKeepAliveWidget<HomeLogic> {
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Obx(() => $menuItem(
|
child: Obx(() => $MenuItem(
|
||||||
bgImg: 'assets/images/home_bg_01.png',
|
bgImg: 'assets/images/home_bg_01.png',
|
||||||
name: '作业批阅',
|
name: '作业批阅',
|
||||||
value: state.totalCount.value > 0 ? state.totalCount.value.toString() : null,
|
value: state.totalCount.value > 0 ? state.totalCount.value.toString() : null,
|
||||||
|
|
@ -200,8 +170,8 @@ class HomePage extends GetxKeepAliveWidget<HomeLogic> {
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
SizedBox(width: 16.r),
|
SizedBox(width: 16.r),
|
||||||
Expanded(
|
const Expanded(
|
||||||
child: $menuItem(
|
child: $MenuItem(
|
||||||
bgImg: 'assets/images/home_bg_02.png',
|
bgImg: 'assets/images/home_bg_02.png',
|
||||||
name: '知识点掌握',
|
name: '知识点掌握',
|
||||||
url: Routes.studentHistoryWorkPage,
|
url: Routes.studentHistoryWorkPage,
|
||||||
|
|
@ -214,8 +184,8 @@ class HomePage extends GetxKeepAliveWidget<HomeLogic> {
|
||||||
// 第二行
|
// 第二行
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
const Expanded(
|
||||||
child: $menuItem(
|
child: $MenuItem(
|
||||||
bgImg: 'assets/images/home_bg_03.png',
|
bgImg: 'assets/images/home_bg_03.png',
|
||||||
name: '学生历史作业',
|
name: '学生历史作业',
|
||||||
url: Routes.studentHistoryWorkPage,
|
url: Routes.studentHistoryWorkPage,
|
||||||
|
|
@ -223,8 +193,8 @@ class HomePage extends GetxKeepAliveWidget<HomeLogic> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 16.r),
|
SizedBox(width: 16.r),
|
||||||
Expanded(
|
const Expanded(
|
||||||
child: $menuItem(bgImg: 'assets/images/home_bg_04.png', name: '答题轨迹', url: Routes.answerTrajectoryPage),
|
child: $MenuItem(bgImg: 'assets/images/home_bg_04.png', name: '答题轨迹', url: Routes.answerTrajectoryPage),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -232,8 +202,8 @@ class HomePage extends GetxKeepAliveWidget<HomeLogic> {
|
||||||
// 第三行
|
// 第三行
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
const Expanded(
|
||||||
child: $menuItem(
|
child: $MenuItem(
|
||||||
bgImg: 'assets/images/home_bg_05.png',
|
bgImg: 'assets/images/home_bg_05.png',
|
||||||
name: '优先批阅设定',
|
name: '优先批阅设定',
|
||||||
url: Routes.studentHistoryWorkPage,
|
url: Routes.studentHistoryWorkPage,
|
||||||
|
|
@ -299,7 +269,7 @@ Widget $menuItem({
|
||||||
image: AssetImage(bgImg),
|
image: AssetImage(bgImg),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
Colors.white.withOpacity(0.9),
|
Colors.white.withOpacity(0.8),
|
||||||
BlendMode.srcATop,
|
BlendMode.srcATop,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ class StudentGroupList extends StatelessWidget {
|
||||||
final Function goNextPage;
|
final Function goNextPage;
|
||||||
final Widget? rightBtn;
|
final Widget? rightBtn;
|
||||||
|
|
||||||
const StudentGroupList(this.studentGroups, this.goNextPage, {Key? key, this.rightBtn}) : super(key: key);
|
const StudentGroupList(this.studentGroups, this.goNextPage, {super.key, this.rightBtn});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
return studentGroups != null && studentGroups.isNotEmpty
|
return studentGroups.isNotEmpty
|
||||||
? Utils.isPad()
|
? Utils.isPad()
|
||||||
? GridView(
|
? GridView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
|
@ -45,12 +45,12 @@ class StudentGroupList extends StatelessWidget {
|
||||||
padding: EdgeInsets.only(right: 8.r),
|
padding: EdgeInsets.only(right: 8.r),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${EnumUtils.formatGrade(item.grade)}${item.className}',
|
'${EnumUtils.formatGrade(item.grade)}${item.className}',
|
||||||
style: TextStyle(fontSize: 10.sp, color:Theme.of(context).primaryColor),
|
style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
EnumUtils.formatSubject(item.subject!),
|
EnumUtils.formatSubject(item.subject!),
|
||||||
style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)),
|
style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
/*Expanded(
|
/*Expanded(
|
||||||
|
|
@ -114,7 +114,7 @@ class StudentGroupList extends StatelessWidget {
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
EnumUtils.formatSubject(item.subject!),
|
EnumUtils.formatSubject(item.subject!),
|
||||||
style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)),
|
style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
/* Expanded(
|
/* Expanded(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue