Compare commits

..

No commits in common. "d1fd1fb1bcba82cc4e37d603a9ae619d3fc162dc" and "1a6721cbb02e61c810d6ac22bb16f536163a2520" have entirely different histories.

33 changed files with 1054 additions and 1448 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -29,7 +29,7 @@
type="application/octet-stream" />
</item> -->
<item>
<title>Version 1.0.3+4</title>
<title>Version 1.0.1+2</title>
#发行说明-读取html方式(2选1)
<!-- <sparkle:releaseNotesLink>
https://your_domain/your_path/release_notes.html
@ -38,18 +38,18 @@
<description>
<![CDATA[
<ul>
<li>1、修复已知BUG</li>
<li>2、优化操作布局</li>
<li>1、优化批阅提示</li>
<li>2、优化启动图和展示页面</li>
</ul>
]]>
</description>
<pubDate>Fri, 14 Mar 2025 12:00:00 +0800</pubDate>
<pubDate>Sun, 16 Feb 2024 12:00:00 +0800</pubDate>
#你更新程序的地址
<enclosure url="https://dpc-job-oss.23544.com/infra-app/making_school_asignment_app/1.0.3/3/making_school_asignment_app-1.0.3+4-windows-setup.exe"
sparkle:dsaSignature="MEYCIQCuU0BodcdWrF+WoJrWRpY8P1pfK+dKkvrl3ZJ5KxnDdAIhAIWqp7VBNO9IaKFj2ypQ+s7DWurBUSaf6MTvexMmuvX+"
length="0"
sparkle:version="1.0.3+4"
<enclosure url="https://dpc-job-oss.23544.com/infra-app/making_school_asignment_app/1.0.1/3/making_school_asignment_app-1.0.1+2-windows-setup.exe"
sparkle:dsaSignature="MEUCIG2O7ZNPeIs/fi2GF/UCRvooqIZMFjLPyfGsIqTnmfHkAiEAuFusRpYjkf05fqBv3nQqfyy8Y8u6ub5X+QWZU7NJ5qU="
sparkle:version="1.0.1+2"
sparkle:os="windows"
length="0"
type="application/octet-stream" />
</item>
</channel>

View File

@ -495,7 +495,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = Z778GC45N8;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@ -503,7 +503,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3;
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = "com.yuanxuan.makingS--buneng--choolAsignmentApp";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -689,7 +689,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = Z778GC45N8;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@ -697,7 +697,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3;
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -719,7 +719,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = Z778GC45N8;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@ -727,7 +727,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3;
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = com.yuanxuan.makingSchoolAsignmentApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -44,13 +44,10 @@ class AppVersion extends Object {
this.appFileUrl,
this.description,
) {
if (appFileUrl != null && ftuType != 2) {
appFileUrl = RequestConfig.imgUrl + appFileUrl!;
}
if (appFileUrl != null) appFileUrl = RequestConfig.imgUrl + appFileUrl!;
}
factory AppVersion.fromJson(Map<String, dynamic> srcJson) =>
_$AppVersionFromJson(srcJson);
factory AppVersion.fromJson(Map<String, dynamic> srcJson) => _$AppVersionFromJson(srcJson);
Map<String, dynamic> toJson() => _$AppVersionToJson(this);
}

View File

@ -154,7 +154,7 @@ class TheError extends Interceptor {
message = '请求发送超时';
break;
case DioExceptionType.receiveTimeout:
message = '接收超时';
message = '接收超时时发生';
break;
case DioExceptionType.badResponse:
if (error.response == null) {

View File

@ -21,8 +21,7 @@ import 'upgradeLogic.dart';
class DownloadApk {
///
static Future<File?> _downloadAndroid(
context, UpdateAppEvent event, UpgradeLogic logic) async {
static Future<File?> _downloadAndroid(context, UpdateAppEvent event, UpgradeLogic logic) async {
///
Directory? storageDir = await getExternalStorageDirectory();
final storagePath = storageDir?.path ?? '/';
@ -48,12 +47,10 @@ class DownloadApk {
print(e);
// toPrint(val: e);
}
return null;
}
// apk
static Future<bool> installApk(
context, UpdateAppEvent event, UpgradeLogic logic) async {
static Future<bool> installApk(context, UpdateAppEvent event, UpgradeLogic logic) async {
try {
logic.loadingApk.value = true;
File? _apkFile = await _downloadAndroid(context, event, logic);
@ -76,9 +73,7 @@ class DownloadApk {
actions: [
MaterialButton(
color: Theme.of(context).primaryColor,
child: const Text("我已知晓",
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold)),
child: const Text("我已知晓", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
onPressed: () => Navigator.of(context).pop(),
),
],
@ -92,15 +87,12 @@ class DownloadApk {
//
// await SystemNavigator.pop(); // 退APP
var options = ['应用市场更新APP', '浏览器下载并安装APP'];
var uri =
Uri.parse('market://details?id=${event.packageName}'); // URI
if (!await canLaunchUrl(uri))
options.removeAt(0); //
String? option = await UpgradePermission.showCustomModalBottomSheet(
context, options);
var uri = Uri.parse('market://details?id=com.example.marking_app'); // URI
if (!await canLaunchUrl(uri)) options.removeAt(0); //
String? option = await UpgradePermission.showCustomModalBottomSheet(context, options);
if (option == '应用市场更新APP') await launchUrl(uri);
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(event.link));
} catch (_) {}
} catch (e) {}
});
print('安装执行完成了..............0.0');
@ -115,8 +107,7 @@ class DownloadApk {
}
///
static void showDownloadProgress(
context, num received, num total, UpgradeLogic logic) {
static void showDownloadProgress(context, num received, num total, UpgradeLogic logic) {
if (total != -1) {
double progress = double.parse((received / total).toStringAsFixed(2));
// debugPrint('下载进度$progress');
@ -131,8 +122,7 @@ class RestartWidget extends StatefulWidget {
const RestartWidget({super.key, required this.child});
static restartApp(BuildContext context) {
final _RestartWidgetState? state =
context.findAncestorStateOfType<_RestartWidgetState>();
final _RestartWidgetState? state = context.findAncestorStateOfType<_RestartWidgetState>();
state?.restartApp();
}

View File

@ -14,6 +14,7 @@
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-01-12 15:08:43
*/
import 'package:auto_updater/auto_updater.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/utils/app_upgrade/DownloadApk.dart';
@ -33,8 +34,7 @@ class UpdateDialog extends Dialog {
final UpdateAppEvent updateAppEvent;
final String deviceInfo;
const UpdateDialog(
{super.key, required this.updateAppEvent, required this.deviceInfo});
const UpdateDialog({super.key, required this.updateAppEvent, required this.deviceInfo});
@override
Widget build(BuildContext context) {
@ -72,17 +72,11 @@ class UpdateDialog extends Dialog {
HtmlWidget(
updateAppEvent.description,
customStylesBuilder: (element) {
return {
'color': '#666666',
'font-weight': 'normal',
'text-decoration': 'none'
};
return {'color': '#666666', 'font-weight': 'normal', 'text-decoration': 'none'};
},
onLoadingBuilder: (context, element, loadingProgress) =>
const CircularProgressIndicator(),
onLoadingBuilder: (context, element, loadingProgress) => const CircularProgressIndicator(),
renderMode: RenderMode.column,
textStyle:
TextStyle(fontSize: 14.sp, color: Colors.black87),
textStyle: TextStyle(fontSize: 14.sp, color: Colors.black87),
)
],
),
@ -103,9 +97,7 @@ class UpdateDialog extends Dialog {
builder: (BuildContext context) {
return WillPopScope(
onWillPop: () async => false,
child: UpdateDialog(
updateAppEvent: updateAppEvent,
deviceInfo: updateAppEvent.deviceInfo),
child: UpdateDialog(updateAppEvent: updateAppEvent, deviceInfo: updateAppEvent.deviceInfo),
);
},
);
@ -144,10 +136,7 @@ class DownloadProgress extends StatelessWidget {
Container(
height: 6.h,
),
quickText('更新中...',
size: 12.sp,
fontWeight: FontWeight.w500,
color: const Color.fromRGBO(90, 90, 90, 1))
quickText('更新中...', size: 12.sp, fontWeight: FontWeight.w500, color: const Color.fromRGBO(90, 90, 90, 1))
],
);
});
@ -163,7 +152,7 @@ class DownloadButton extends StatelessWidget {
//
Future<bool> toLaunch(UpdateAppEvent data) async {
var uri = Uri.parse('market://details?id=${updateAppEvent.packageName}');
var uri = Uri.parse('market://details?id=com.yuanxuan.making_school_asignment_app');
if (await canLaunchUrl(uri)) {
//
return await launchUrl(uri);
@ -192,20 +181,15 @@ class DownloadButton extends StatelessWidget {
width: 245.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(42.h)),
gradient: LinearGradient(
colors: [primaryColor, primaryColor.withOpacity(0.7)]),
gradient: LinearGradient(colors: [primaryColor, primaryColor.withOpacity(0.7)]),
),
child: MaterialButton(
onPressed: () => easyThrottle('DownloadButton_App_Upgrade',
duration: const Duration(milliseconds: 1000), () async {
if (deviceInfo == "android" &&
updateAppEvent.equipment == Equipment.android) {
onPressed: () => easyThrottle('DownloadButton_App_Upgrade', duration: const Duration(milliseconds: 1000), () async {
if (deviceInfo == "android" && updateAppEvent.equipment == Equipment.android) {
//
bool flag = await UpgradePermission(updateAppEvent.deviceInfo)
.checkPermission(context, updateAppEvent);
bool flag = await UpgradePermission(updateAppEvent.deviceInfo).checkPermission(context, updateAppEvent);
if (flag) {
flag = await DownloadApk.installApk(
context, updateAppEvent, logic);
flag = await DownloadApk.installApk(context, updateAppEvent, logic);
if (!flag) {
print('执行到了重置更新按钮的地方....');
logic.downloadRatio.value = 0.0; //
@ -217,10 +201,8 @@ class DownloadButton extends StatelessWidget {
}
// await FlutterClipboard.copy(updateAppEvent.link);
// setTimeOut(1000, () => ToastUtils.showInfo('下载链接已经复制到设备,可前往浏览器下载安装'));
} else if (deviceInfo == "ios" &&
updateAppEvent.equipment == Equipment.ios) {
} else if (deviceInfo == "ios" && updateAppEvent.equipment == Equipment.ios) {
try {
print(updateAppEvent.link);
await launchUrlString(updateAppEvent.link);
} catch (e) {
print('进来更新报错$e');
@ -232,8 +214,7 @@ class DownloadButton extends StatelessWidget {
// await autoUpdater.setScheduledCheckInterval(0);
// }
}),
child: quickText(!logic.loadingApk.value ? '立即体验' : '正在下载...',
size: 16.sp, color: Colors.white, fontWeight: FontWeight.w500),
child: quickText(!logic.loadingApk.value ? '立即体验' : '正在下载...', size: 16.sp, color: Colors.white, fontWeight: FontWeight.w500),
),
);
});

View File

@ -77,15 +77,14 @@ class UpgradePermission {
//
// await SystemNavigator.pop(); // 退APP
var options = ['应用市场更新APP', '浏览器下载并安装APP'];
var uri = Uri.parse('market://details?id=${updateAppEvent.packageName}'); // URI
var uri = Uri.parse('market://details?id=com.example.marking_app'); // URI
// if (!await canLaunchUrl(uri)) options.removeAt(0); //
String? option = await showCustomModalBottomSheet(context, options);
if (option == '应用市场更新APP') {
if (await canLaunchUrl(uri)) {
if (await canLaunchUrl(uri))
await launchUrl(uri);
} else {
await AppInstaller.goStore(updateAppEvent.packageName, 'iOSAppId');
}
else
await AppInstaller.goStore('com.example.marking_app', 'iOSAppId');
}
if (option == '浏览器下载并安装APP') await launchUrl(Uri.parse(updateAppEvent.link));
} else

View File

@ -44,8 +44,7 @@ class UpgradeLogic extends GetxController with RequestToolMixin {
return;
}
AppVersion? result = await getClient()
.getLastAppVersion('making_school_asignment_app', deviceType);
AppVersion? result = await getClient().getLastAppVersion('making_school_asignment_app', deviceType);
if (result != null) {
//
PackageInfo packageInfo = await PackageInfo.fromPlatform();
@ -61,11 +60,8 @@ class UpgradeLogic extends GetxController with RequestToolMixin {
'systemType': deviceType,
'description': result.description ?? 'APP新版本更新'
};
UpdateAppEvent updateAppEvent = UpdateAppEvent.fromJson(
json, localVersion, deviceInfo, appName, packageName,
typeName: 'systemType');
UpdateAppEvent updateAppEvent = UpdateAppEvent.fromJson(json, localVersion, deviceInfo, appName, packageName, typeName: 'systemType');
if (updateAppEvent.upgrade) {
if (Platform.isAndroid) {
DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
Permission storagePermission;
@ -74,18 +70,13 @@ class UpgradeLogic extends GetxController with RequestToolMixin {
} else {
storagePermission = Permission.storage;
}
await PermissionDescribeUtil.instance.toLaunchPermissionRequest(
Get.context ?? context,
PermissionDescribeUtil.instance.toLaunchPermissionRequest(
context,
title: '储存权限请求',
describe: "为了提供更好的服务需要获取到存储权限用于保存APP升级文件APK进行升级",
permissions: [storagePermission],
);
}
await UpdateDialog.showUpdateDialog(
Get.context ?? context,
updateAppEvent,
);
await UpdateDialog.showUpdateDialog(context, updateAppEvent);
}
}
} finally {

View File

@ -12,18 +12,13 @@ class PermissionDescribePage extends StatefulWidget {
final String describe;
final List<Permission> permissions;
const PermissionDescribePage(
{required this.title,
required this.describe,
required this.permissions,
super.key});
const PermissionDescribePage({required this.title, required this.describe, required this.permissions, super.key});
@override
State<PermissionDescribePage> createState() => _PermissionDescribePageState();
}
class _PermissionDescribePageState extends State<PermissionDescribePage>
with WidgetsBindingObserver {
class _PermissionDescribePageState extends State<PermissionDescribePage> with WidgetsBindingObserver {
Timer? _timerPermission;
bool theOpenAppSettings = false;
int theExecutionFrequency = 0;
@ -137,9 +132,7 @@ class _PermissionDescribePageState extends State<PermissionDescribePage>
///
/// @param List<Permission> permissions
Future<List<Permission>> getStoragePermission(
BuildContext context, List<Permission> permissions,
[int executionFrequency = 0]) async {
Future<List<Permission>> getStoragePermission(BuildContext context, List<Permission> permissions, [int executionFrequency = 0]) async {
Map<Permission, PermissionStatus> statusRes = await permissions.request();
List<Permission> permanentRefusal = []; //
@ -180,8 +173,7 @@ class _PermissionDescribePageState extends State<PermissionDescribePage>
executionFrequency++;
}
if (executionFrequency <= 1) {
var res =
await getStoragePermission(context, [key], executionFrequency);
var res = await getStoragePermission(context, [key], executionFrequency);
permanentRefusal.addAll(res);
} else {
permanentRefusal.add(key);
@ -239,10 +231,12 @@ class PermissionDescribeUtil {
PermissionDescribeUtil._internal();
static get instance => _instance ??= PermissionDescribeUtil._internal();
static get instance {
return _instance ??= PermissionDescribeUtil._internal();
}
///
Future<void> toLaunchPermissionRequest(
void toLaunchPermissionRequest(
BuildContext context, {
required String title,
required String describe,

View File

@ -121,36 +121,13 @@ class Utils {
for (var stu in data.students) {
stu.kgtStu = kgt.where((w) => w.studentId == stu.studentId).toList();
// stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
// stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
stu.kgtStu!.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
stu.kgtOkCount = stu.kgtStu!.where((w) => w.state == 3).length;
stu.kgtErrorCount = stu.kgtStu!.where((w) => w.state == 2).length;
stu.kgtAnswerCount = stu.kgtStu!.where((w) => w.state != 0).length;
stu.zgtStu = zgt.where((w) => w.studentId == stu.studentId).toList();
// stu.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
stu.zgtStu!.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
stu.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo)));
//
stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length;
//

View File

@ -44,9 +44,10 @@ class _ClassStudentPageState extends State<ClassStudentPage> {
actions: const [
ReturnToHomepage(),
],
elevation: 0,
),
body: Obx(() {
body: Padding(
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
child: Obx(() {
return EasyRefresh(
firstRefresh: false,
taskIndependence: true,
@ -62,9 +63,9 @@ class _ClassStudentPageState extends State<ClassStudentPage> {
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 0.r,
crossAxisSpacing: 0.r,
childAspectRatio: 556 / 90,
mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112,
),
children:
List.generate(state.studentList.length, (index) {
@ -84,10 +85,8 @@ class _ClassStudentPageState extends State<ClassStudentPage> {
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(0.r)),
color: Colors.transparent,
border: Border(left: BorderSide(width:
(index + 1)%2 == 0? 1.r:0,color: const Color(0xFFA5A5A5)),bottom: BorderSide(width: 1.r,color: const Color(0xFFA5A5A5)))
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
@ -242,9 +241,7 @@ class _ClassStudentPageState extends State<ClassStudentPage> {
);
}),
)
: Padding(
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
child: ListView.builder(
: ListView.builder(
itemBuilder: (context, index) {
StudentItem item = state.studentList[index];
return InkWell(
@ -419,11 +416,11 @@ class _ClassStudentPageState extends State<ClassStudentPage> {
);
},
itemCount: state.studentList.length,
),
)
: const MyEmptyWidget(),
);
}),
),
);
}
);

View File

@ -14,7 +14,7 @@ import 'package:making_school_asignment_app/page/home_page/children/quick_data_c
import 'job_report_logic.dart';
class JobReportPage extends StatefulWidget {
const JobReportPage({super.key});
const JobReportPage({Key? key}) : super(key: key);
@override
State<JobReportPage> createState() => _JobReportPageState();
@ -26,7 +26,8 @@ class _JobReportPageState extends State<JobReportPage> {
@override
Widget build(BuildContext context) {
return OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
return OrientationBuilder(
builder: (BuildContext context, Orientation orientation){
return Scaffold(
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
@ -75,7 +76,8 @@ 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 == null ? '' : state.classData.value.className, state.homeworkId.value,state.subject),
//
KgtZgtTable(
studentCount: state.dataCount.studentCount!,
@ -95,8 +97,7 @@ class _JobReportPageState extends State<JobReportPage> {
data: state.homeData,
className: state.classData.value.className,
homeworkId: state.homeworkId.value,
subject: state.subject,
)),
subject:state.subject,)),
//
/* Container(
margin: EdgeInsets.symmetric(horizontal: 10.r),
@ -119,7 +120,8 @@ class _JobReportPageState extends State<JobReportPage> {
}
}),
);
});
}
);
}
@override

View File

@ -14,8 +14,7 @@ class KnowledgePoint extends StatefulWidget {
final String className;
final String homeworkId;
final int subject;
const KnowledgePoint(
{super.key, required this.knowsList, required this.data, required this.className, required this.homeworkId, required this.subject});
KnowledgePoint({Key? key, required this.knowsList, required this.data, required this.className, required this.homeworkId,required this.subject}) : super(key: key);
@override
State<KnowledgePoint> createState() => _KnowledgePointState();
@ -209,8 +208,7 @@ class _KnowledgePointState extends State<KnowledgePoint> {
child: quickText('知识点掌握情况', color: const Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold),
),
Expanded(
child: widget.knowsList.isNotEmpty
? ListView(
child: widget.knowsList.isNotEmpty? ListView(
children: widget.knowsList.value.map((item) {
return Container(
margin: EdgeInsets.only(bottom: 15.h, left: 15.r, right: 15.r),
@ -254,9 +252,8 @@ class _KnowledgePointState extends State<KnowledgePoint> {
SizedBox(width: 10.w),
InkWell(
onTap: () {
List<Questions> ques = widget.data.questions
.where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1)
.toList();
List<Questions> ques =
widget.data.questions.where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1).toList();
List<Students> array2 = [...widget.data.students];
for (var stu in array2) {
stu.queDtls = widget.data.dtls
@ -268,15 +265,9 @@ class _KnowledgePointState extends State<KnowledgePoint> {
int ttlCount = stu.queDtls!.length;
stu.okRate = Utils.calcRate(okCount, ttlCount);
stu.queDtls!.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
num num1 = num.parse(a.questionNo);
num num2 = num.parse(b.questionNo);
return num1.compareTo(num2);
});
}
@ -299,8 +290,7 @@ class _KnowledgePointState extends State<KnowledgePoint> {
],
),
);
}).toList())
: MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp),
}).toList()): MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp),
),
],
));

View File

@ -4,8 +4,6 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.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/utils/toast_utils.dart';
import 'package:making_school_asignment_app/common/utils/utils.dart';
import 'knowledge_points_grasp_state.dart';
@ -29,15 +27,9 @@ class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin, Ge
}
void getList() async {
try {
ToastUtils.showLoading();
List<KnowledgePointsGrasp> data =
await getClient().getKnowledgeReport(state.dateStart, state.dateEnd, textController.text, state.classId, state.subject);
List<KnowledgePointsGrasp> data = await getClient().getKnowledgeReport(state.dateStart, state.dateEnd, textController.text,state.classId,state.subject);
state.dataList.value = data;
} catch (_) {
} finally {
ToastUtils.dismiss();
}
EasyLoading.dismiss();
}
@override

View File

@ -1,11 +1,9 @@
import 'package:easy_debounce/easy_throttle.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart';
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
import 'package:making_school_asignment_app/common/utils/utils.dart';
import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart';
import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart';
@ -17,7 +15,7 @@ import 'package:syncfusion_flutter_datepicker/datepicker.dart';
import 'knowledge_points_grasp_logic.dart';
class KnowledgePointsGraspPage extends StatefulWidget {
const KnowledgePointsGraspPage({super.key});
const KnowledgePointsGraspPage({Key? key}) : super(key: key);
@override
State<KnowledgePointsGraspPage> createState() => _KnowledgePointsGraspPageState();
@ -29,15 +27,16 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
@override
Widget build(BuildContext context) {
return OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
return OrientationBuilder(
builder: (BuildContext context, Orientation orientation){
return Scaffold(
backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
backgroundColor: Colors.white,
title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333))),
title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))),
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Get.back(),
),
actions: const [
@ -57,7 +56,7 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
padding: EdgeInsets.only(left: 10.r, right: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
border: Border.all(width: 1.r, color: const Color(0xFFDDDDDD)),
border: Border.all(width: 1.r, color: Color(0xFFDDDDDD)),
color: Colors.white,
),
child: TextField(
@ -80,14 +79,17 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
width: 10.r,
),
InkWell(
onTap: () => easyThrottle('zshi_shi_dian_cx', () {
Utils.hideKeyboard();
logic.refreshController.callRefresh();
}),
onTap: () {
state.page = 1;
logic.getList();
},
child: Container(
width: 50.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: Text(
'查询',
@ -192,7 +194,7 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
Expanded(
child: Text(
item.knowledgeName,
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505050)),
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)),
)),
Container(
width: 49.r,
@ -209,16 +211,11 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
'${item.count}',
style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor),
),
SizedBox(width: 1.w),
Padding(
padding: EdgeInsets.only(top: 2.h),
child: Icon(Icons.chevron_right, size: 12.r, color: Theme.of(context).primaryColor),
Image.asset(
'assets/images/job_data_right_icon.png',
width: 10.r,
height: 10.r,
),
// Image.asset(
// 'assets/images/job_data_right_icon.png',
// width: 10.r,
// height: 10.r,
// ),
],
),
),
@ -229,7 +226,7 @@ class _KnowledgePointsGraspPageState extends State<KnowledgePointsGraspPage> {
),
ProgressBar(
title: '正确率:',
color: const Color(0xFFB2DA93),
color: Color(0xFFB2DA93),
percent: item.correctRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)),

View File

@ -15,7 +15,7 @@ import 'package:making_school_asignment_app/page/global_widget/show_student_list
import 'knowledge_points_grasp_detail_logic.dart';
class KnowledgePointsGraspDetailPage extends StatefulWidget {
const KnowledgePointsGraspDetailPage({super.key});
const KnowledgePointsGraspDetailPage({Key? key}) : super(key: key);
@override
State<KnowledgePointsGraspDetailPage> createState() => _KnowledgePointsGraspDetailPageState();
@ -70,17 +70,18 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
EasyLoading.dismiss();
}
return OrientationBuilder(builder: (BuildContext context, Orientation orientation) {
return OrientationBuilder(
builder: (BuildContext context, Orientation orientation){
return Scaffold(
backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
backgroundColor: Colors.white,
title: Obx(() {
return Text(state.knowledgeName.value, style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333)));
return Text(state.knowledgeName.value, style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)));
}),
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Get.back(),
),
actions: const [
@ -131,7 +132,7 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
children: [
Text(
item.publishTime.substring(0, 10),
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505050)),
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)),
),
SizedBox(
width: 10.r,
@ -139,7 +140,7 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
Expanded(
child: Text(
item.homeworkName,
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505050)),
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)),
)),
InkWell(
onTap: () {
@ -147,16 +148,16 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
showImg(item.questionPicture, context);
},
child: Container(
width: 49.r,
height: 22.r,
padding: EdgeInsets.symmetric(horizontal: 4.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)),
border: Border.all(width: 1.r, color: const Color(0xFF8B8B8B)),
border: Border.all(width: 1.r, color: Color(0xFF8B8B8B)),
),
child: Center(
child: Text(
'${item.questionNo}',
style: TextStyle(fontSize: 10.sp, color: const Color(0xFF8B8B8B)),
style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)),
),
),
),
@ -183,13 +184,13 @@ class _KnowledgePointsGraspDetailPageState extends State<KnowledgePointsGraspDet
width: 56.r,
height: 20.r,
decoration: BoxDecoration(
color: const Color(0xFFE9FFD9),
color: Color(0xFFE9FFD9),
borderRadius: BorderRadius.circular(20.r),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
quickText('正确率', color: const Color(0xFF313131), size: 10.sp),
quickText('正确率', color: Color(0xFF313131), size: 10.sp),
Image.asset(
'assets/images/job_data_right_icon.png',
width: 8.r,

View File

@ -57,9 +57,11 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
children: [
Text(
'客观题',
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600),
style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600),
),
SizedBox(
height: 20.r,
),
SizedBox(height: 20.r),
ProgressBar(
color: const Color.fromRGBO(76, 199, 147, 1),
percent: double.parse(widget.kgtCorrectRate) / 100,
@ -78,7 +80,9 @@ class _KgtZgtTableState extends State<KgtZgtTable> {
lineHeight: 10.h,
marginEdg: EdgeInsets.only(top: 5.h),
),
SizedBox(height: 10.r),
SizedBox(
height: 10.r,
),
SizedBox(
height: widget.kgReport.length > 10 ? 300.r : widget.kgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r),
child: ReportTable(

View File

@ -56,7 +56,8 @@ class _ReportTableState extends State<ReportTable> {
builder: (BuildContext context) {
return AlertDialog(
contentPadding: EdgeInsets.all(20.r),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: SizedBox(
width: MediaQuery.of(context).size.width * 0.5,
height: MediaQuery.of(context).size.height * 0.4,
@ -64,7 +65,10 @@ class _ReportTableState extends State<ReportTable> {
children: [
Text(
'作答效率',
style: TextStyle(fontSize: 15.sp, color: const Color(0xFF3C3C3C), fontWeight: FontWeight.w500),
style: TextStyle(
fontSize: 15.sp,
color: const Color(0xFF3C3C3C),
fontWeight: FontWeight.w500),
),
Padding(
padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 10.r),
@ -72,33 +76,27 @@ class _ReportTableState extends State<ReportTable> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
mapIcon(const Color(0xFFB8A1FF)),
SizedBox(
width: 5.r,
),
SizedBox(width: 5.r,),
mapTxt(''),
const Spacer(),
mapIcon(const Color(0xFF4CC793)),
SizedBox(
width: 5.r,
),
SizedBox(width: 5.r,),
mapTxt(''),
const Spacer(),
mapIcon(const Color(0xFF90E0BE)),
SizedBox(
width: 5.r,
),
SizedBox(width: 5.r,),
mapTxt(''),
const Spacer(),
mapIcon(const Color(0xFFFF6B6B)),
SizedBox(
width: 5.r,
),
SizedBox(width: 5.r,),
mapTxt(''),
],
),
),
Expanded(
child: PieChart(
child:
PieChart(
PieChartData(
borderData: FlBorderData(show: true),
sectionsSpace: 0,
@ -153,14 +151,20 @@ class _ReportTableState extends State<ReportTable> {
});
}
void showPeopleListDialog({required BuildContext context, required String title, required String questionNo, required List arr, List? dcList}) {
void showPeopleListDialog(
{required BuildContext context,
required String title,
required String questionNo,
required List arr,
List? dcList}) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
// insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r),
contentPadding: EdgeInsets.all(20.r),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: SizedBox(
width: MediaQuery.of(context).size.width * 0.7,
height: MediaQuery.of(context).size.height * 0.7,
@ -170,7 +174,10 @@ class _ReportTableState extends State<ReportTable> {
Center(
child: Text(
title,
style: TextStyle(fontSize: 15.sp, color: const Color(0xFF3C3C3C), fontWeight: FontWeight.w500),
style: TextStyle(
fontSize: 15.sp,
color: const Color(0xFF3C3C3C),
fontWeight: FontWeight.w500),
),
),
SizedBox(
@ -180,15 +187,18 @@ class _ReportTableState extends State<ReportTable> {
children: [
Text(
widget.isZG == true ? '主观题' : '客观题',
style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor),
style: TextStyle(
fontSize: 14.sp, color: Theme.of(context).primaryColor),
),
Text(
'',
style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor),
style: TextStyle(
fontSize: 14.sp, color: Theme.of(context).primaryColor),
),
Text(
'$questionNo题',
style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor),
style: TextStyle(
fontSize: 14.sp, color: Theme.of(context).primaryColor),
),
],
),
@ -203,21 +213,27 @@ class _ReportTableState extends State<ReportTable> {
child: Center(
child: Text(
'未作答人',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
Expanded(
flex: 1,
child: Center(
child: Text(
'答对人数',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
Expanded(
flex: 1,
child: Center(
child: Text(
'答错人',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
],
)
@ -225,7 +241,8 @@ class _ReportTableState extends State<ReportTable> {
padding: EdgeInsets.only(left: 15.r),
child: Text(
title,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)),
style: TextStyle(
fontSize: 12.sp, color: Color(0xFF6A6A6A)),
),
),
SizedBox(
@ -239,41 +256,60 @@ class _ReportTableState extends State<ReportTable> {
var item = arr[index];
return Container(
padding: EdgeInsets.symmetric(vertical: 5.r),
color: index.isOdd ? Colors.white : Color(0xFFF0F0F0),
color:
index.isOdd ? Colors.white : Color(0xFFF0F0F0),
child: Row(
children: [
Expanded(
flex: 1,
child: InkWell(
onTap: () {
goQuickCheckPersonalPath(item['noAnswerStudents'].studentId);
goQuickCheckPersonalPath(
item['noAnswerStudents']
.studentId);
},
child: Center(
child: Text(
item['noAnswerStudents']?.studentName ?? '--',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
item['noAnswerStudents']
?.studentName ??
'--',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
goQuickCheckPersonalPath(item['answerOkStudents'].studentId);
goQuickCheckPersonalPath(
item['answerOkStudents']
.studentId);
},
child: Center(
child: Text(
item['answerOkStudents']?.studentName ?? '--',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
item['answerOkStudents']
?.studentName ??
'--',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
goQuickCheckPersonalPath(item['answerNgStudents'].studentId);
goQuickCheckPersonalPath(
item['answerNgStudents']
.studentId);
},
child: Center(
child: Text(
item['answerNgStudents']?.studentName ?? '--',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
item['answerNgStudents']
?.studentName ??
'--',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))),
],
),
@ -294,11 +330,16 @@ class _ReportTableState extends State<ReportTable> {
goQuickCheckPersonalPath(item.studentId);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r),
color: index.isOdd ? Colors.white : Color(0xFFF0F0F0),
padding: EdgeInsets.symmetric(
vertical: 5.r, horizontal: 15.r),
color: index.isOdd
? Colors.white
: Color(0xFFF0F0F0),
child: Text(
item.studentName! ?? '--',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
),
),
);
@ -316,56 +357,65 @@ class _ReportTableState extends State<ReportTable> {
void goQuickCheckPersonalPath(id) {
if (id != null) {
Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': id, 'homeworkId': widget.jobId, 'subject': widget.subject});
Get.toNamed(Routes.studentPersonalPage,
arguments: {'studentId': id, 'homeworkId': widget.jobId,'subject':widget.subject});
}
}
void zdHandle(BuildContext context, String title, String questionNo, List noAnswerStudents, List answerNgStudents, List answerOkStudents) {
void zdHandle(BuildContext context, String title, String questionNo,
List noAnswerStudents, List answerNgStudents, List answerOkStudents) {
List list = [];
// Questions student = Questions('','',-1,-1,'',-1,'','',[],-1,-1,[] as double?);
if (noAnswerStudents.length > answerNgStudents.length && noAnswerStudents.length > answerOkStudents.length) {
if (noAnswerStudents.length > answerNgStudents.length &&
noAnswerStudents.length > answerOkStudents.length) {
for (int i = 0; i < noAnswerStudents.length; i++) {
var obj = {
'noAnswerStudents': noAnswerStudents[i],
'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null,
'answerOkStudents': answerOkStudents.length > i ? answerOkStudents[i] : null
'answerNgStudents':
answerNgStudents.length > i ? answerNgStudents[i] : null,
'answerOkStudents':
answerOkStudents.length > i ? answerOkStudents[i] : null
};
list.add(obj);
}
} else if (answerNgStudents.length > noAnswerStudents.length && answerNgStudents.length > answerOkStudents.length) {
} else if (answerNgStudents.length > noAnswerStudents.length &&
answerNgStudents.length > answerOkStudents.length) {
for (int i = 0; i < answerNgStudents.length; i++) {
var obj = {
'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null,
'noAnswerStudents':
noAnswerStudents.length > i ? noAnswerStudents[i] : null,
'answerNgStudents': answerNgStudents[i],
'answerOkStudents': answerOkStudents.length > i ? answerOkStudents[i] : null
'answerOkStudents':
answerOkStudents.length > i ? answerOkStudents[i] : null
};
list.add(obj);
}
} else if (answerOkStudents.length > noAnswerStudents.length && answerOkStudents.length > answerNgStudents.length) {
} else if (answerOkStudents.length > noAnswerStudents.length &&
answerOkStudents.length > answerNgStudents.length) {
for (int i = 0; i < answerOkStudents.length; i++) {
var obj = {
'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null,
'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null,
'answerOkStudents': answerOkStudents[i]
};
list.add(obj);
}
} else {
for (int i = 0; i < answerOkStudents.length; i++) {
var obj = {
'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null,
'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null,
'noAnswerStudents':
noAnswerStudents.length > i ? noAnswerStudents[i] : null,
'answerNgStudents':
answerNgStudents.length > i ? answerNgStudents[i] : null,
'answerOkStudents': answerOkStudents[i]
};
list.add(obj);
}
}
showPeopleListDialog(context: context, title: title, questionNo: questionNo, arr: list, dcList: []);
showPeopleListDialog(
context: context,
title: title,
questionNo: questionNo,
arr: list,
dcList: []);
}
void dcHandle(BuildContext context, String title, String questionNo, List arr) {
showPeopleListDialog(context: context, title: title, questionNo: questionNo, arr: arr);
void dcHandle(
BuildContext context, String title, String questionNo, List arr) {
showPeopleListDialog(
context: context, title: title, questionNo: questionNo, arr: arr);
}
DataRow _getRow(int index, [Color? color]) {
@ -378,18 +428,28 @@ class _ReportTableState extends State<ReportTable> {
DataCell(Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text(item.questionNo.toString(), style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))),
child: Text(item.questionNo.toString(),
style:
TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))),
),
)),
DataCell(Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text('${item.answerRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))),
child: Text('${item.answerRate.toStringAsFixed(0)}%',
style:
TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))),
),
)),
DataCell(InkWell(
onTap: () {
zdHandle(context, '作答人数', item.questionNo.toString(), item.noAnswerStudents, item.answerNgStudents, item.answerOkStudents);
zdHandle(
context,
'作答人数',
item.questionNo.toString(),
item.noAnswerStudents,
item.answerNgStudents,
item.answerOkStudents);
},
child: Center(
child: Padding(
@ -397,7 +457,9 @@ class _ReportTableState extends State<ReportTable> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('${item.answerCount}/${widget.studentCount}', style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor)),
Text('${item.answerCount}/${widget.studentCount}',
style: TextStyle(
fontSize: 10.sp, color: Theme.of(context).primaryColor)),
Image.asset(
'assets/images/green_right_icon.png',
width: 12.r,
@ -408,16 +470,19 @@ class _ReportTableState extends State<ReportTable> {
),
),
)),
DataCell(Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text('${item.correctRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
child: Text('${item.correctRate.toStringAsFixed(0)}%',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
),
)),
DataCell(Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text('${item.okRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
child: Text('${item.okRate.toStringAsFixed(0)}%',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))),
),
)),
DataCell(Center(
@ -429,20 +494,30 @@ class _ReportTableState extends State<ReportTable> {
if (item.questionPicture == null) {
ToastUtils.showInfo('当前试题没有原题');
} else {
ImageDialog.showImgDialog(context, item.questionPicture);
ImageDialog.showImgDialog(
context, item.questionPicture);
}
},
child: Text('原题',
style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)),
style: TextStyle(
fontSize: 10.sp,
color: widget.isZG == true
? const Color(0xFFFF8A00)
: Theme.of(context).primaryColor)),
)
: Text(item.answer,
style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)),
style: TextStyle(
fontSize: 10.sp,
color: widget.isZG == true
? const Color(0xFFFF8A00)
: Theme.of(context).primaryColor)),
),
)),
DataCell(InkWell(
onTap: () {
// List<String> parts = item.priorityGeneral.split('');
dcHandle(context, '优先批阅答错人', item.questionNo.toString(), item.priorityInfo);
dcHandle(context, '优先批阅答错人', item.questionNo.toString(),
item.priorityInfo);
},
child: Center(
child: Padding(
@ -450,7 +525,9 @@ class _ReportTableState extends State<ReportTable> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('${item.priorityInfo.length}人答错', style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor)),
Text('${item.priorityInfo.length}人答错',
style: TextStyle(
fontSize: 10.sp, color: Theme.of(context).primaryColor)),
Image.asset(
'assets/images/green_right_icon.png',
width: 12.r,
@ -471,10 +548,18 @@ class _ReportTableState extends State<ReportTable> {
showAnswerEfficiency(item.overallTitles);
},
child: Text('查看',
style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)),
style: TextStyle(
fontSize: 10.sp,
color: widget.isZG == true
? const Color(0xFFFF8A00)
: Theme.of(context).primaryColor)),
)
: Text(item.answer,
style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)),
style: TextStyle(
fontSize: 10.sp,
color: widget.isZG == true
? const Color(0xFFFF8A00)
: Theme.of(context).primaryColor)),
),
)),
],
@ -492,12 +577,16 @@ class _ReportTableState extends State<ReportTable> {
dataRowHeight: 40.r,
bottomMargin: 0,
border: const TableBorder(
horizontalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid),
bottom: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid),
verticalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid)),
headingRowColor: MaterialStateProperty.resolveWith((states) => widget.fixedCols! > 0 ? Colors.white : Colors.transparent),
headingRowDecoration: const BoxDecoration(color: Color(0xFFE6E6E6)),
fixedColumnsColor: const Color(0xFFE6E6E6),
horizontalInside: BorderSide(
width: 1, color: Colors.white, style: BorderStyle.solid),
bottom: BorderSide(
width: 1, color: Colors.white, style: BorderStyle.solid),
verticalInside: BorderSide(
width: 1, color: Colors.white, style: BorderStyle.solid)),
headingRowColor: MaterialStateProperty.resolveWith((states) =>
widget.fixedCols! > 0 ? Colors.white : Colors.transparent),
headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)),
fixedColumnsColor: Color(0xFFE6E6E6),
fixedCornerColor: Colors.grey[400],
minWidth: widget.headList.length > 6
? 80.r * widget.headList.length
@ -512,46 +601,38 @@ class _ReportTableState extends State<ReportTable> {
columns: List.generate(widget.headList.length, (index) {
var item = widget.headList[index];
return DataColumn2(
label: index == 3
? Row(
label: index == 3 ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))),
SizedBox(
width: 2.r,
),
Text(item,
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
SizedBox(width: 2.r,),
const Tooltip(
message: '答对人数/作答人数',
triggerMode: TooltipTriggerMode.tap,
preferBelow:false,
child: Icon(
Icons.info_outline_rounded,
color: Colors.grey,
)),
child: Icon(Icons.info_outline_rounded,color: Colors.grey,)),
],
)
: index == 4
? Row(
):
index == 4 ?Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))),
SizedBox(
width: 2.r,
),
Text(item,
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
SizedBox(width: 2.r,),
const Tooltip(
message: '答对人数/总人数',
triggerMode: TooltipTriggerMode.tap,
preferBelow:false,
child: Icon(
Icons.info_outline_rounded,
color: Colors.grey,
)),
child: Icon(Icons.info_outline_rounded,color: Colors.grey,)),
],
)
: Center(
child: Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))),
):
Center(
child: Text(item,
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
),
// size: ColumnSize.S,
fixedWidth: index == 0
@ -559,11 +640,13 @@ class _ReportTableState extends State<ReportTable> {
: widget.headList.length > 6
? 80.r
: isPadFlag
? (MediaQuery.of(context).size.width - 8.r) / widget.headList.length
? (MediaQuery.of(context).size.width - 8.r) /
widget.headList.length
: 85.r,
);
}),
rows: List<DataRow>.generate(widget.bodyList.length, (index) => _getRow(index, const Color(0xFFF5F5F5))));
rows: List<DataRow>.generate(widget.bodyList.length,
(index) => _getRow(index, Color(0xFFF5F5F5))));
}
}
@ -577,10 +660,6 @@ Widget mapIcon(Color bgColor) {
),
);
}
Widget mapTxt(String title){
return Text(
title,
style: TextStyle(fontSize: 12.sp, color: const Color(0xFF525252), fontWeight: FontWeight.w400),
);
return Text(title,style: TextStyle(fontSize: 12.sp,color: Color(0xFF525252),fontWeight: FontWeight.w400),);
}

View File

@ -22,38 +22,26 @@ part 'annotate_list.g.dart';
class AnnotateList extends StatefulWidget {
final int tabIndex;
final int assessType;
const AnnotateList(
{Key? key, required this.tabIndex, required this.assessType})
: super(key: key);
const AnnotateList({super.key, required this.tabIndex, required this.assessType});
@override
State<AnnotateList> createState() => _AnnotateListState();
}
class _AnnotateListState extends State<AnnotateList>
with RequestToolMixin, SingleTickerProviderStateMixin {
class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, SingleTickerProviderStateMixin {
late RxString customTimeStr = '自定义'.obs;
int active = 1;
late RxList<Items> unAnnotateList = RxList();
late RxList<Items> annotateList = RxList();
late int page = 1;
late TabController tabController2;
/* 待阅卷 */
late final EasyRefreshController refreshController1;
late final EasyRefreshController refreshController2;
WorkStudentParams params = WorkStudentParams(
assessType: 0,
pageSize: 10,
);
WorkStudentParams params2 = WorkStudentParams(
assessType: 0,
pageSize: 10,
startDate: Utils.getWeekStartDate().toString().substring(0, 10),
endDate: Utils.getWeekEndDate().toString().substring(0, 10),
);
WorkStudentParams params = WorkStudentParams(assessType: 0, pageSize: 10);
WorkStudentParams params2 = WorkStudentParams(assessType: 0, pageSize: 10);
@override
void initState() {
@ -67,7 +55,6 @@ class _AnnotateListState extends State<AnnotateList>
EasyLoading.show(status: 'loading...');
getUnAnnotateList();
getAnnotateList();
}
//
@ -81,6 +68,7 @@ class _AnnotateListState extends State<AnnotateList>
EasyLoading.dismiss();
print('state.unAnnotateList.length=${unAnnotateList.length}');
}
//
void getAnnotateList() async {
WorkStudent data = WorkStudent([], 0);
@ -93,6 +81,7 @@ class _AnnotateListState extends State<AnnotateList>
EasyLoading.dismiss();
print('state.annotateList.length=${annotateList.length}');
}
///
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
/* params.page = RequestConfig.basePage.page;
@ -127,42 +116,29 @@ class _AnnotateListState extends State<AnnotateList>
}*/
}
@override
Widget build(BuildContext context) {
return Column(
children: [
if (widget.tabIndex == 1)
Obx(() {
return JobConditionFilter(
JobConditionFilter(
customTimeStr: customTimeStr.value,
controller: tabController2,
hasAll: true,
jobType: 1,
customTime: tabController2.index != 2 ||
(params2.startDate == null && params2.endDate == null)
customTime: tabController2.index != 3 || (params2.startDate == null && params2.endDate == null)
? null
: PickerDateRange(
params2.startDate == null ? null : DateTime.parse(
params2.startDate!),
params2.endDate == null ? null : DateTime.parse(
params2.endDate!),
params2.startDate == null ? null : DateTime.parse(params2.startDate!),
params2.endDate == null ? null : DateTime.parse(params2.endDate!),
),
onTimeFilter: (String? startTime, String? endTime) {
if (startTime == null && endTime == null &&
tabController2.index == 2) {
if (startTime == null && endTime == null && tabController2.index == 3) {
tabController2.animateTo(0);
params2.endDate =
Utils.getWeekEndDate().toString().substring(0, 10);
params2.startDate =
Utils.getWeekStartDate().toString().substring(0, 10);
customTimeStr.value = '自定义';
} else {
}
params2.endDate = endTime;
params2.startDate = startTime;
}
page = 1;
EasyLoading.show(status: 'loading...');
if (widget.tabIndex == 0) {
getUnAnnotateList();
} else {
@ -172,25 +148,19 @@ class _AnnotateListState extends State<AnnotateList>
},
refreshTime: (value) {
if (value != null && value.startDate != null) {
customTimeStr.value =
value.startDate?.toString().substring(0, 10) ?? '';
customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? '';
if (value.endDate != null) {
if (!Utils.isPad() &&
value.startDate!.year == value.endDate!.year) {
customTimeStr.value =
'${value.startDate.toString().substring(5, 10)}~${value
.endDate.toString().substring(5, 10)}';
if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) {
customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
} else {
customTimeStr.value =
'${customTimeStr.value}~${value.endDate?.toString()
.substring(0, 10)}';
customTimeStr.value = '${customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
}
}
}
});
}),
Expanded(child: IndexedStack(
Expanded(
child: IndexedStack(
index: widget.tabIndex,
children: <Widget>[
$EasyRefresh(
@ -222,10 +192,8 @@ class _AnnotateListState extends State<AnnotateList>
@swidget
Widget $easyRefresh({
required EasyRefreshController controller,
required Future<
void> Function(EasyRefreshController controller, int tab) onRefresh,
required Future<
void> Function(EasyRefreshController controller, int tab) onLoad,
required Future<void> Function(EasyRefreshController controller, int tab) onRefresh,
required Future<void> Function(EasyRefreshController controller, int tab) onLoad,
required List<Items> data,
required int tab,
required int type,
@ -245,8 +213,7 @@ Widget $easyRefresh({
footer: TaurusFooter(),
child: completed && isPadFlag
? GridView(
padding: EdgeInsets.only(
top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, //widget
mainAxisSpacing: 10.h,
@ -256,25 +223,14 @@ Widget $easyRefresh({
children: List.generate(data.length, (index) {
Items item = data[index];
String subjectName = EnumUtils.formatSubject(item.subject);
return $reviewedItem(jobTaskItem: item,
type: type,
subjectName: subjectName,
collectFun: collectFun,
tabIndex: tab - 1);
return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName, collectFun: collectFun, tabIndex: tab - 1);
}),
)
: ListView.builder(
padding: EdgeInsets.only(
top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
itemBuilder: (context, index) {
Items item = data[index];
return TaskListItem(
completed: completed,
jobTaskItem: item,
type: type,
collectFun: collectFun,
tabIndex: tab - 1
);
return TaskListItem(completed: completed, jobTaskItem: item, type: type, collectFun: collectFun, tabIndex: tab - 1);
},
itemCount: data.length,
),
@ -296,8 +252,7 @@ Widget $reviewedItem({
return InkWell(
onTap: () {
Get.toNamed(Routes.annotateClassPage,
arguments: {
Get.toNamed(Routes.annotateClassPage, arguments: {
'id': jobTaskItem.id,
'name': jobTaskItem.name,
'grade': jobTaskItem.grade,
@ -307,7 +262,7 @@ Widget $reviewedItem({
});
},
child: Container(
padding: EdgeInsets.only(top: 10.h),
padding: EdgeInsets.only(right: 5.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: Colors.white,
@ -324,11 +279,8 @@ Widget $reviewedItem({
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Padding(
padding: padEdg,
child: Row(
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 32.w,
@ -336,36 +288,30 @@ Widget $reviewedItem({
alignment: Alignment.center,
padding: EdgeInsets.only(left: 2.w),
decoration: BoxDecoration(
color: type == 1 ? const Color(0xFF4CC793) : const Color
.fromRGBO(255, 175, 56, 1),
color: type == 1 ? const Color(0xFFB2DA93) : const Color(0xFFEF8714),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r),
topRight: Radius.circular(3.r),
bottomLeft: Radius.circular(4.r),
bottomRight: Radius.circular(4.r),
topLeft: Radius.circular(6.r),
topRight: Radius.circular(0.r),
bottomLeft: Radius.circular(0.r),
bottomRight: Radius.circular(12.r),
),
),
margin: EdgeInsets.only(top: 3.h, right: 4.w),
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white,
size: 10.sp),
margin: EdgeInsets.only(top: 0.h, right: 4.w),
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(jobTaskItem.name, size: 14.sp,
color: const Color.fromRGBO(70, 70, 70, 1),
maxLines: 2),
child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2),
),
if (jobTaskItem.isFixed!)
Padding(
padding: EdgeInsets.only(top: 3.r),
child: Text(
'已订正',
style: TextStyle(
fontSize: 10.sp, color: const Color(0xFFF16262)),
style: TextStyle(fontSize: 10.sp, color: const Color(0xFFF16262)),
),
),
],
),
),
Padding(
padding: padEdg,
@ -373,31 +319,26 @@ Widget $reviewedItem({
crossAxisAlignment: CrossAxisAlignment.end,
children: [
quickText(
DateTime.parse(jobTaskItem.publishTime).toString().substring(
0, 10),
DateTime.parse(jobTaskItem.publishTime).toString().substring(0, 10),
color: const Color.fromRGBO(97, 97, 97, 1),
size: 10.sp,
fontWeight: FontWeight.w500,
),
quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1),
size: 10.sp,
fontWeight: FontWeight.w500),
quickText(' / ', color: const Color(0xFF8C68FF), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'参与班级:',
color: const Color.fromRGBO(76, 199, 147, 1),
color: const Color(0xFF8C68FF),
size: 9.sp,
),
quickText(
'${jobTaskItem.classCount}',
color: const Color.fromRGBO(76, 199, 147, 1),
color: const Color(0xFF8C68FF),
size: 10.sp,
),
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1),
size: 10.sp,
fontWeight: FontWeight.w500),
quickText(' / ', color: const Color(0xFF8C68FF), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'科目:$subjectName',
color: const Color.fromRGBO(116, 145, 253, 1),
color: const Color(0xFF8C68FF),
size: 9.sp,
),
],
@ -414,8 +355,7 @@ Widget $reviewedItem({
Container(
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r),
bottomRight: Radius.circular(6.r)),
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
color: Colors.white,
boxShadow: const [
BoxShadow(
@ -427,7 +367,7 @@ Widget $reviewedItem({
],
),
child: Row(children: [
if (!jobTaskItem.isFixed!)
/*if (!jobTaskItem.isFixed!)
Expanded(
flex: 1,
child: GestureDetector(
@ -441,31 +381,23 @@ Widget $reviewedItem({
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border(right: BorderSide(
width: 1.r, color: const Color(0xFFDCDCDC))),
),
child: quickText(
'收集订正', color: const Color(0xFF4CC793), size: 11.sp),
border: Border(right: BorderSide(width: 1.r, color: const Color(0xFFDCDCDC))),
),
child: quickText('收集订正', color: const Color(0xFF8C68FF), size: 11.sp),
),
),
),*/
Expanded(
flex: 1,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Get.toNamed(Routes.jobReportPage,
arguments: {
'title': jobTaskItem.name,
'homeworkId': jobTaskItem.id,
'grade': jobTaskItem.grade
});
arguments: {'title': jobTaskItem.name, 'homeworkId': jobTaskItem.id, 'grade': jobTaskItem.grade});
},
child: Container(
alignment: Alignment.center,
child: quickText(
'查看报告', color: const Color.fromRGBO(118, 118, 118, 1),
size: 11.sp),
child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 11.sp),
),
),
),

View File

@ -18,28 +18,6 @@ class StudentPersonalLogic extends GetxController with RequestToolMixin {
void getInfo() async {
StudentPersonalInfo data = await getClient().getStudentHomework(state.homeworkId, state.studentId);
data.kgtList.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
data.zgtList.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
state.studentInfo.value = data;
}
}

View File

@ -11,7 +11,7 @@ import 'package:making_school_asignment_app/routes/app_pages.dart';
import 'student_personal_logic.dart';
class StudentPersonalPage extends StatefulWidget {
const StudentPersonalPage({super.key});
const StudentPersonalPage({Key? key}) : super(key: key);
@override
State<StudentPersonalPage> createState() => _StudentPersonalPageState();
@ -54,11 +54,8 @@ class _StudentPersonalPageState extends State<StudentPersonalPage> {
onTap: () {
// RouterManager.router.navigateTo(context,
// '${RouterManager.jobPersonalDetailPath}?studentId=${widget.studentId}&studentName=${Uri.encodeComponent(state.studentInfo.studentName!)}');
Get.toNamed(Routes.studentWorkDetailPage, arguments: {
'studentId': state.studentInfo.value.studentId,
'studentName': state.studentInfo.value.studentName,
'subject': state.subject
});
Get.toNamed(Routes.studentWorkDetailPage,
arguments: {'studentId': state.studentInfo.value.studentId, 'studentName': state.studentInfo.value.studentName,'subject':state.subject});
},
child: Container(
width: 93.r,

View File

@ -36,39 +36,8 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi
pageSize: 10,
);
StudentHistory data = await getClient().getStudentHistory(params);
data.items.items.forEach((e) {
e.kgtList.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
e.zgtList.sort((a, b) {
try {
if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) {
return num.parse(a.questionNo).compareTo(num.parse(b.questionNo));
} else {
throw Exception();
}
} catch (e) {
return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase());
}
});
});
state.studentData.value = data;
/* state.kgtLine.value = [{'id':0,'rate':0}];
state.zgtLine.value = [{'id':0,'rate':0}];
state.allLine.value = [{'id':0,'rate':0}];*/
state.kgtLine.value = [];
state.zgtLine.value = [];
state.allLine.value = [];
for (var i = 0; i < state.studentData.value.items.items.length; i++) {
var element = state.studentData.value.items.items[i];
for (var element in state.studentData.value.items.items) {
int num = 0;
for (var item in element.kgtList) {
if (item.state == 0) {
@ -83,12 +52,7 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi
if (num == (element.kgtList.length + element.zgtList.length)) {
element.allNotDone = true;
}
state.kgtLine.add({'id': i + 1, 'rate': (element.kgtCorrectRate / 100 * 5).toStringAsFixed(2)});
state.zgtLine.add({'id': i + 1, 'rate': (element.zgtCorrectRate / 100 * 5).toStringAsFixed(2)});
state.allLine.add({'id': i + 1, 'rate': (element.correctRate / 100 * 5).toStringAsFixed(2)});
}
EasyLoading.dismiss();
}

View File

@ -17,7 +17,4 @@ class StudentWorkDetailState {
late RxString customTimeStr = '自定义'.obs;
late Rx<StudentHistory> studentData = Rx(StudentHistory(0, 0, Items([], 0), 0));
late final int subject;
late RxList kgtLine = [].obs;
late RxList zgtLine = [].obs;
late RxList allLine = [].obs;
}

View File

@ -1,4 +1,3 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -10,7 +9,6 @@ import 'package:making_school_asignment_app/common/utils/utils.dart';
import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart';
import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart';
import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart';
import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/line_chart.dart';
import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart';
import 'package:making_school_asignment_app/routes/app_pages.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
@ -126,22 +124,16 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
/* Text(
Text(
'总览:',
style: TextStyle(
fontSize: 12.sp,
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w600),
),*/
SizedBox(height: 10.r,),
SizedBox(
height: 200.r,
child: LineChartCon(isShowingMainData: true,lineNum: 3,line1:state.kgtLine.value,line2: state.zgtLine.value,line3: state.allLine.value,),
),
SizedBox(height: 20.r,),
ProgressBar(
title: '客观题正确率:',
color:const Color(0xFF4DE6BF),
color:Theme.of(context).primaryColor,
percent: state.studentData.value.kgtCorrectRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)),
@ -153,7 +145,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
marginEdg: EdgeInsets.only(top: 8.h)),
ProgressBar(
title: '总正确率:',
color: const Color(0xFF1890FF),
color: Theme.of(context).primaryColor,
percent: state.studentData.value.correctRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)),
@ -161,7 +153,6 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
),
);
}),
Obx(() {
return JobConditionFilter(
controller: logic.tabController,
@ -230,8 +221,8 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
height: 10.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.r)),
color: const Color(0xFF00B386),
border: Border.all(width: 1.r, color: const Color(0xFF00B386)),
// color: Color(0xFF4CC793),
border: Border.all(width: 1.r, color: Theme.of(context).primaryColor),
),
),
SizedBox(
@ -249,8 +240,8 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
height: 10.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.r)),
color: const Color(0xFFCB191B),
border: Border.all(width: 1.r, color: const Color(0xFFCB191B)),
// color: Color(0xFFFF7474),
border: Border.all(width: 1.r, color: Color(0xFFFF7474)),
),
),
SizedBox(
@ -431,7 +422,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
'客:',
style: TextStyle(
fontSize: 12.sp,
color: const Color(0xFF5B5B5B)),
color: Color(0xFF5B5B5B)),
),
SizedBox(
width: 5.r,
@ -453,18 +444,16 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
width: 25.r,
height: 25.r,
decoration: BoxDecoration(
color: subjective.state == 3
?const Color(0xFF00B386):subjective.state == 2
? const Color(0xFFCB191B):Colors.transparent,
color: Colors.transparent,
border: Border.all(
width: 1.r,
color: subjective.state == 0
? const Color(0xFFDDDDDD)
? Color(0xFFDDDDDD)
: subjective.state == 3
?const Color(0xFF00B386)
?Theme.of(context).primaryColor
: subjective.state == 2
? const Color(0xFFCB191B)
: const Color(0xFF666666)),
? Color(0xFFFF7474)
: Color(0xFF666666)),
borderRadius: BorderRadius.all(Radius.circular(12.5.r))),
child: Center(
child: Text(
@ -475,15 +464,16 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
color: subjective
.state ==
0
? const Color(
? Color(
0xFFDDDDDD)
: subjective.state ==
3
? Colors.white
? Theme.of(context).primaryColor
: subjective.state ==
2
?Colors.white
: const Color(
? Color(
0xFFFF7474)
: Color(
0xFF666666)),
)),
);
@ -494,7 +484,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
'',
style: TextStyle(
fontSize: 12.sp,
color: const Color(0xFF5B5B5B)),
color: Color(0xFF5B5B5B)),
),
],
),
@ -509,7 +499,7 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
'主:',
style: TextStyle(
fontSize: 12.sp,
color: const Color(0xFF5B5B5B)),
color: Color(0xFF5B5B5B)),
),
SizedBox(
width: 5.r,
@ -531,18 +521,16 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
width: 25.r,
height: 25.r,
decoration: BoxDecoration(
color: subjective.state == 3
? const Color(0xFF00B386):subjective.state == 2
? const Color(0xFFCB191B):Colors.transparent,
color: Colors.transparent,
border: Border.all(
width: 1.r,
color: subjective.state == 0
? const Color(0xFFDDDDDD)
? Color(0xFFDDDDDD)
: subjective.state == 3
? const Color(0xFF00B386)
? Theme.of(context).primaryColor
: subjective.state == 2
? const Color(0xFFCB191B)
: const Color(0xFF666666)),
? Color(0xFFFF7474)
: Color(0xFF666666)),
borderRadius: BorderRadius.all(Radius.circular(12.5.r))),
child: Center(
child: Text(
@ -553,15 +541,16 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
color: subjective
.state ==
0
? const Color(
? Color(
0xFFDDDDDD)
: subjective.state ==
3
? Colors.white
? Theme.of(context).primaryColor
: subjective.state ==
2
? Colors.white
: const Color(
? Color(
0xFFFF7474)
: Color(
0xFF666666)),
)),
);
@ -572,25 +561,25 @@ class _StudentWorkDetailPageState extends State<StudentWorkDetailPage> {
'',
style: TextStyle(
fontSize: 12.sp,
color: const Color(0xFF5B5B5B)),
color: Color(0xFF5B5B5B)),
),
],
),
ProgressBar(
title: '客观题正确率:',
color: const Color(0xFFB2DA93),
color: Color(0xFFB2DA93),
percent: item.kgtCorrectRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)),
ProgressBar(
title: '主观题正确率:',
color: const Color(0xFFB2DA93),
color: Color(0xFFB2DA93),
percent: item.zgtCorrectRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)),
ProgressBar(
title: '总正确率:',
color: const Color(0xFFB2DA93),
color: Color(0xFFB2DA93),
percent: item.correctRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)),

View File

@ -70,14 +70,14 @@ class _JobConditionFilterState extends State<JobConditionFilter> {
customTimeStr: widget.customTimeStr,
hasAll: widget.hasAll,
onTap: (int val) async {
if (val == 3 && widget.hasAll == true) {
if (val == 0 && widget.hasAll == true) {
widget.onTimeFilter(null, null);
} else if ((val == 0 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) {
} else if ((val == 1 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) {
widget.onTimeFilter(
Utils.getWeekStartDate().toString().substring(0, 10),
Utils.getWeekEndDate().toString().substring(0, 10),
);
} else if ((val == 1 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)) {
} else if ((val == 2 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)) {
widget.onTimeFilter(
getMonthStartDate().toString().substring(0, 10),
getMonthEndDate().toString().substring(0, 10),

View File

@ -1,237 +0,0 @@
import 'dart:math';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class LineChartCon extends StatefulWidget {
final bool isShowingMainData;
final int lineNum;
final List? line1;
final List? line2;
final List? line3;
LineChartCon(
{required this.isShowingMainData,
required this.lineNum,
this.line1,
this.line2,
this.line3});
@override
State<LineChartCon> createState() => _LineChartConState();
}
class _LineChartConState extends State<LineChartCon> {
double maxX = 0.0;
@override
void initState() {
super.initState();
}
getMaxX(){
if (widget.lineNum > 2) {
if (widget.line3!.length > widget.line2!.length &&
widget.line3!.length > widget.line1!.length) {
maxX = double.parse(widget.line3!.length.toString());
} else if (widget.line2!.length > widget.line3!.length &&
widget.line2!.length > widget.line1!.length) {
maxX = double.parse(widget.line2!.length.toString());
} else {
maxX = double.parse(widget.line1!.length.toString());
}
} else if (widget.lineNum > 1) {
}
print('maxx=======$maxX');
return maxX;
}
@override
Widget build(BuildContext context) {
return LineChart(
LineChartData(
lineTouchData: const LineTouchData(enabled: false),
gridData: gridData,
titlesData: titlesData1,
borderData: borderData,
lineBarsData: lineBarsData1,
minX: 1,
maxX: getMaxX()>0? getMaxX():3,
maxY: 6,
minY: 0,
),
duration: const Duration(milliseconds: 250),
);
}
FlTitlesData get titlesData1 => FlTitlesData(
bottomTitles: AxisTitles(
sideTitles: bottomTitles,
),
rightTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
topTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
leftTitles: AxisTitles(
sideTitles: leftTitles(),
),
);
List<LineChartBarData> get lineBarsData1 => [
lineChartBarData1_1,
lineChartBarData1_2,
lineChartBarData1_3,
];
Widget leftTitleWidgets(double value, TitleMeta meta) {
String text;
switch (value.toInt()) {
case 0:
text = '0';
break;
case 1:
text = '20%';
break;
case 2:
text = '40%';
break;
case 3:
text = '60%';
break;
case 4:
text = '80%';
break;
case 5:
text = '100%';
break;
default:
return Container();
}
return Text(text, style: TextStyle(fontSize: 12.sp, color: const Color(0xFF070707)), textAlign: TextAlign.left);
/* return SideTitleWidget(
axisSide: meta.axisSide,
child: Text(
'${value}',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF070707)),
),
);*/
}
SideTitles leftTitles() => SideTitles(
getTitlesWidget: leftTitleWidgets,
showTitles: true,
interval: 1,
reservedSize: 50,
);
Widget bottomTitleWidgets(double value, TitleMeta meta) {
return SideTitleWidget(
axisSide: meta.axisSide,
space: 10,
child: Text(
value.toString() == '0.0' ? '' : value.toStringAsFixed(0),
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12.sp,
color: const Color.fromRGBO(39, 39, 39, 0.5),
),
),
);
}
SideTitles get bottomTitles => SideTitles(
showTitles: true,
reservedSize: 32,
interval: 1,
getTitlesWidget: bottomTitleWidgets,
);
FlGridData get gridData => const FlGridData(
show: true, drawVerticalLine: false, horizontalInterval: 1.0);
FlBorderData get borderData => FlBorderData(
show: true,
border: const Border(
bottom: BorderSide(color: Colors.transparent, width: 1),
left: BorderSide(color: Colors.transparent),
right: BorderSide(color: Colors.transparent),
top: BorderSide(color: Colors.transparent),
),
);
LineChartBarData get lineChartBarData1_1 => LineChartBarData(
isCurved: true,
curveSmoothness: 0,
color: const Color(0xFF4DE6BF),
barWidth: 2,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(show: false),
spots: List.generate(widget.line1!.length, (index){
var element = widget.line1![index];
return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString()));
})
/* const [
FlSpot(1, 0),
FlSpot(3, 1.5),
FlSpot(5, 1.4),
FlSpot(7, 3.4),
FlSpot(10, 2),
FlSpot(12, 2.2),
FlSpot(13, 1.8),
],*/
);
LineChartBarData get lineChartBarData1_2 => LineChartBarData(
isCurved: true,
curveSmoothness: 0,
color: Theme.of(context).primaryColor,
barWidth: 2,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(
show: false,
color: Colors.yellow,
),
spots: List.generate(widget.line2!.length, (index){
var element = widget.line2![index];
return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString()));
})
/* const [
FlSpot(1, 1),
FlSpot(3, 2.8),
FlSpot(7, 1.2),
FlSpot(10, 2.8),
FlSpot(12, 2.6),
FlSpot(13, 3.9),
],*/
);
LineChartBarData get lineChartBarData1_3 => LineChartBarData(
isCurved: true,
curveSmoothness: 0,
color: const Color(0xFF1890FF),
barWidth: 2,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(show: false),
spots: List.generate(widget.line3!.length, (index){
var element = widget.line3![index];
return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString()));
})
/* const [
FlSpot(1, 2.8),
FlSpot(3, 1.9),
FlSpot(6, 3),
FlSpot(10, 1.3),
FlSpot(13, 2.5),
],*/
);
}

View File

@ -33,10 +33,10 @@ class _PersonalDetailTopBarState extends State<PersonalDetailTopBar> {
labelStyle: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: const Color(0xFF4CC793),
color: const Color(0xFF8C68FF),
),
isScrollable: true,
labelColor: const Color(0xFF4CC793),
labelColor:const Color(0xFF8C68FF),
unselectedLabelColor: const Color(0xFF505E6E),
padding: EdgeInsets.symmetric(horizontal: 14.r),
// indicatorSize: TabBarIndicatorSize.label, //
@ -44,15 +44,15 @@ class _PersonalDetailTopBarState extends State<PersonalDetailTopBar> {
indicator: UnderlineTabIndicator(
borderSide: BorderSide(
width: 2.r,
color:const Color(0xFF4CC793)
color:const Color(0xFF8C68FF)
),
),
tabs: <Widget>[
if(widget.hasAll == true)
const Tab(text: '全部'),
const Tab(text: '近一周'),
const Tab(text: '近一月'),
Tab(text: widget.customTimeStr),
if(widget.hasAll == true)
const Tab(text: '全部'),
],
),
);

View File

@ -106,7 +106,8 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
width: 20.r,
),
Expanded(
child: menuItem(bgImg: 'assets/images/home_bg_02.png', name: '知识点掌握', url: Routes.studentHistoryWorkPage, page: 'points'),
child:
menuItem(bgImg: 'assets/images/home_bg_02.png', name: '知识点点掌握', url: Routes.studentHistoryWorkPage, page: 'points'),
),
],
),

View File

@ -5,8 +5,6 @@
import FlutterMacOS
import Foundation
import app_installer
import app_settings
import auto_updater_macos
import connectivity_plus
import device_info_plus
@ -16,8 +14,6 @@ import sqflite
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppInstallerPlugin.register(with: registry.registrar(forPlugin: "AppInstallerPlugin"))
AppSettingsPlugin.register(with: registry.registrar(forPlugin: "AppSettingsPlugin"))
AutoUpdaterMacosPlugin.register(with: registry.registrar(forPlugin: "AutoUpdaterMacosPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.4+5
version: 1.0.0+1
environment:
sdk: '>=3.4.1 <4.0.0'
@ -48,7 +48,7 @@ dependencies:
# http请求插件
dio: ^5.4.2+1
# 网络缓存图片
cached_network_image: ^3.2.1
cached_network_image: ^3.3.1
# 上拉加载和下拉刷新的组件
flutter_easyrefresh: ^2.2.2
photo_view: ^0.15.0
@ -75,7 +75,7 @@ dependencies:
badges: ^3.1.2
# 图表
fl_chart: ^0.68.0
data_table_2: 2.5.10
data_table_2: ^2.5.10
flutter_staggered_grid_view: ^0.7.0
dropdown_button2: ^2.3.9
syncfusion_flutter_datepicker: ^25.2.5
@ -97,28 +97,28 @@ dependencies:
icons_launcher: ^2.1.7
app_settings: ^5.1.1
device_info_plus: ^11.1.0
zoom_widget: ^2.0.1
zoom_pinch_overlay: ^1.4.3
flutter_html_2: ^0.1.0
dev_dependencies:
flutter_test:
sdk: flutter
retrofit_generator: ^8.1.0
flutter_lints: ^4.0.0
retrofit_generator: ^9.0.0
build_runner: ^2.4.10
json_serializable: ^6.6.2
# 分离样式
functional_widget: ^0.10.2
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^3.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
# dependency_overrides:
# collection: ^1.19.0
flutter:
# The following line ensures that the Material Icons font is

View File

@ -197,8 +197,6 @@

View File

@ -28,7 +28,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
Win32Window::Point origin(10, 10);
// Win32Window::Size size(1280, 720);
Win32Window::Size size(700, 900);
if (!window.Create(L"", origin, size)) {
if (!window.Create(L"making_school_asignment_app", origin, size)) {
return EXIT_FAILURE;
}
window.SetQuitOnClose(true);