mcy_new #1
|
|
@ -116,4 +116,7 @@ abstract class RetrofitClient {
|
|||
Future<BasePageData<HomeworkFavs>> getFavList(
|
||||
@Query('HomeworkName') String homeworkName, @Query('ClassId') String classId);
|
||||
|
||||
//一键批阅 (默认未批阅的题目全部正确)
|
||||
@POST("/api/hms/Annotate/AllCorrect")
|
||||
Future getAllCorrect(@Field() String homeworkId,@Field() String classId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class UserStore extends GetxController with RequestToolMixin {
|
|||
|
||||
RxInt readOver = 0.obs;
|
||||
|
||||
RxInt assessType = 0.obs;
|
||||
|
||||
UserStore init() {
|
||||
token = StorageService.to.read(AppStorageKey.token.value);
|
||||
xToken = StorageService.to.read(AppStorageKey.xToken.value);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
|||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:making_school_asignment_app/common/job/annotated_class.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/routes/app_pages.dart';
|
||||
|
||||
import 'annotate_class_state.dart';
|
||||
|
|
@ -42,6 +43,17 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin {
|
|||
EasyLoading.dismiss();
|
||||
}
|
||||
|
||||
void getAllCorrect(classId) async{
|
||||
EasyLoading.show(status: 'loading...');
|
||||
try {
|
||||
await getClient().getAllCorrect(state.homeworkId.value,classId);
|
||||
getList();
|
||||
} catch (e) {
|
||||
EasyLoading.dismiss();
|
||||
ToastUtils.showError('操作失败,请重试');
|
||||
}
|
||||
}
|
||||
|
||||
void goQuickDataCheck(item) {
|
||||
Get.toNamed(Routes.quickDataCheckPage,
|
||||
arguments: {'homeworkId': state.homeworkId.value, 'classId': item.classId, 'grade': state.grade, 'className': item.className});
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ class _AnnotateClassPageState extends State<AnnotateClassPage> {
|
|||
return CompletedAnnotateItem(
|
||||
taskItem: taskItem,
|
||||
logic: logic,
|
||||
name: state.name.value,
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
|
|
@ -69,6 +70,7 @@ class _AnnotateClassPageState extends State<AnnotateClassPage> {
|
|||
return CompletedAnnotateItem(
|
||||
taskItem: taskItem,
|
||||
logic: logic,
|
||||
name: state.name.value,
|
||||
);
|
||||
})
|
||||
: Utils.isPad()
|
||||
|
|
|
|||
|
|
@ -23,6 +23,64 @@ class AnnotateItem extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _AnnotateItemState extends State<AnnotateItem> {
|
||||
|
||||
Future<bool> confirmDialog() async {
|
||||
return await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0), // 设置圆角大小
|
||||
),
|
||||
actionsPadding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
|
||||
content: SizedBox(
|
||||
width: 200.r,
|
||||
child: Text(
|
||||
'一键批阅后,默认学生答题结果全部正确, 是否进行此操作?',
|
||||
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505E6E)),
|
||||
),
|
||||
),
|
||||
actionsAlignment: MainAxisAlignment.center,
|
||||
actions: <Widget>[
|
||||
InkWell(
|
||||
child: Container(
|
||||
width: 97.r,
|
||||
height: 27.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
color: const Color(0xFF6888FD),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'确定',
|
||||
style: TextStyle(color: Colors.white),
|
||||
))),
|
||||
onTap: () {
|
||||
// 执行操作
|
||||
Get.back(result: true);
|
||||
},
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.back(result: false);
|
||||
},
|
||||
child: Container(
|
||||
width: 97.r,
|
||||
height: 27.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
color: const Color(0xFFF4F4F4),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(color: Color(0xFF666666)),
|
||||
))),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AnnotatedClass itemData = widget.item;
|
||||
|
|
@ -71,7 +129,7 @@ class _AnnotateItemState extends State<AnnotateItem> {
|
|||
Expanded(
|
||||
flex: 4,
|
||||
child: ItemBtn(
|
||||
title: "收藏夹",
|
||||
title: "收藏夹${widget.item.homeworkFavs.isNotEmpty?'(${ widget.item.homeworkFavs.length})':''}",
|
||||
font: widget.font - 2.sp,
|
||||
clickFunction: () {
|
||||
Get.toNamed(Routes.favStudentPage,arguments: {'homeworkName':widget.name,'classId':widget.item.classId,'homeworkId':widget.logic.state.homeworkId.value,'grade':widget.item.grade});
|
||||
|
|
@ -89,7 +147,14 @@ class _AnnotateItemState extends State<AnnotateItem> {
|
|||
child: ItemBtn(
|
||||
title: "一键批阅",
|
||||
font: widget.font - 2.sp,
|
||||
clickFunction: () {},
|
||||
clickFunction: () async{
|
||||
var confim =
|
||||
await confirmDialog();
|
||||
if (confim) {
|
||||
widget.logic.getAllCorrect(
|
||||
widget.item.classId);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const Expanded(
|
||||
|
|
@ -113,7 +178,7 @@ class _AnnotateItemState extends State<AnnotateItem> {
|
|||
Expanded(
|
||||
flex: 4,
|
||||
child: ItemBtn(
|
||||
title: "收藏夹",
|
||||
title: "收藏夹${widget.item.homeworkFavs.isNotEmpty?'(${ widget.item.homeworkFavs.length})':''}",
|
||||
font: widget.font - 2.sp,
|
||||
clickFunction: () {
|
||||
Get.toNamed(Routes.favStudentPage,arguments: {'homeworkName':widget.name,'classId':widget.item.classId,'homeworkId':widget.logic.state.homeworkId.value,'grade':widget.item.grade});
|
||||
|
|
|
|||
|
|
@ -8,11 +8,13 @@ import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
|||
import 'package:making_school_asignment_app/page/global_widget/show_student_list.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart';
|
||||
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
||||
|
||||
class CompletedAnnotateItem extends StatelessWidget {
|
||||
final AnnotatedClass taskItem;
|
||||
final AnnotateClassLogic logic;
|
||||
const CompletedAnnotateItem({Key? key, required this.taskItem, required this.logic}) : super(key: key);
|
||||
final String name;
|
||||
const CompletedAnnotateItem({Key? key, required this.taskItem, required this.logic,required this.name}) : super(key: key);
|
||||
|
||||
void showStudentList(context, List<AnnotatedStudents> students, [bool submitted = false]) async {
|
||||
showDialog(
|
||||
|
|
@ -47,7 +49,7 @@ class CompletedAnnotateItem extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ProgressBar(
|
||||
color: Color.fromRGBO(76, 199, 147, 1),
|
||||
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||
percent: taskItem.kgtCorrectRate / 100,
|
||||
title: '客观题正确率:',
|
||||
padingEdg: EdgeInsets.only(left: 10.w, right: 10.w),
|
||||
|
|
@ -56,7 +58,7 @@ class CompletedAnnotateItem extends StatelessWidget {
|
|||
marginEdg: EdgeInsets.only(top: 5.h),
|
||||
),
|
||||
ProgressBar(
|
||||
color: Color.fromRGBO(76, 199, 147, 1),
|
||||
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||
percent: taskItem.zgtCorrectRate / 100,
|
||||
title: '主观题正确率:',
|
||||
fontSize: 8.sp,
|
||||
|
|
@ -65,7 +67,7 @@ class CompletedAnnotateItem extends StatelessWidget {
|
|||
marginEdg: EdgeInsets.only(top: 5.h),
|
||||
),
|
||||
ProgressBar(
|
||||
color: Color.fromRGBO(76, 199, 147, 1),
|
||||
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||
percent: taskItem.correctRate / 100,
|
||||
title: '总正确率:',
|
||||
fontSize: 8.sp,
|
||||
|
|
@ -133,14 +135,16 @@ class CompletedAnnotateItem extends StatelessWidget {
|
|||
color: Color.fromRGBO(244, 244, 244, 1),
|
||||
borderRadius: BorderRadius.circular(20.r),
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.favStudentPage,arguments: {'homeworkName':name,'classId':taskItem.classId,'homeworkId':logic.state.homeworkId.value,'grade':taskItem.grade});
|
||||
},
|
||||
splashColor: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(vertical: 4.h),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
|
||||
child: quickText('收藏夹', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||
child: quickText('收藏夹${taskItem.homeworkFavs.isNotEmpty?'(${taskItem.homeworkFavs.length})':''}', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||
),
|
||||
),
|
||||
)),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|||
import 'package:get/get.dart';
|
||||
import 'package:making_school_asignment_app/common/job/annotated_class.dart';
|
||||
import 'package:making_school_asignment_app/common/job/common/base_page_data.dart';
|
||||
import 'package:making_school_asignment_app/common/job/marking_models/favor_param.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 'fav_student_state.dart';
|
||||
|
||||
|
|
@ -56,14 +58,21 @@ class FavStudentLogic extends GetxController with RequestToolMixin {
|
|||
EasyLoading.dismiss();
|
||||
}
|
||||
|
||||
getDelete(student) async {
|
||||
/* RestClient _client = await getClient();
|
||||
BaseStructureResult res = await _client.getJobDeFavorites(
|
||||
widget.jobId, student.studentId, student.questionPage!);
|
||||
if (res.success) {
|
||||
_future = getData();
|
||||
setState(() {});
|
||||
}*/
|
||||
void getDelete(student) async {
|
||||
EasyLoading.show(status: 'loading...');
|
||||
try {
|
||||
await getClient().toFavStudent(FavorParam(
|
||||
homeworkId: state.homeworkId,
|
||||
studentId: student.studentId,
|
||||
templateId: student.templateId,
|
||||
questionNo: student.questionNo,
|
||||
isFav: false,
|
||||
));
|
||||
getList();
|
||||
} catch (e) {
|
||||
EasyLoading.dismiss();
|
||||
ToastUtils.showError('操作失败,请重试');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
actionsPadding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
|
||||
content: Text(
|
||||
'确定删除吗?',
|
||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505E6E)),
|
||||
style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505E6E)),
|
||||
),
|
||||
actionsAlignment: MainAxisAlignment.center,
|
||||
actions: <Widget>[
|
||||
|
|
@ -58,7 +58,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
height: 27.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
color: Color(0xFF6888FD),
|
||||
color: const Color(0xFF6888FD),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
|
|
@ -81,7 +81,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
height: 27.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
color: Color(0xFFF4F4F4),
|
||||
color: const Color(0xFFF4F4F4),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
|
|
@ -96,14 +96,14 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
|
||||
backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
|
||||
appBar: AppBar(
|
||||
// titleSpacing: 0,
|
||||
elevation: 0.0,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back_ios),
|
||||
icon: const Icon(Icons.arrow_back_ios),
|
||||
onPressed: () => Navigator.of(context).pop()),
|
||||
iconTheme: IconThemeData(color: Colors.black),
|
||||
iconTheme: const IconThemeData(color: Colors.black),
|
||||
title: quickText('收藏夹'),
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.white,
|
||||
|
|
@ -111,8 +111,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
ReturnToHomepage(),
|
||||
],
|
||||
),
|
||||
body: Container(
|
||||
child: Column(
|
||||
body: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 0.r, horizontal: 14.r),
|
||||
|
|
@ -125,7 +124,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
return Text(
|
||||
state.homeworkName.value,
|
||||
style:
|
||||
TextStyle(fontSize: 14.sp, color: Color(0xFF3C3C3C),),
|
||||
TextStyle(fontSize: 14.sp, color: const Color(0xFF3C3C3C),),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
);
|
||||
}),
|
||||
|
|
@ -191,7 +190,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
'第${item['questionPage']}页',
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Color(0xFF2E5BFF)),
|
||||
color: const Color(0xFF2E5BFF)),
|
||||
),
|
||||
),
|
||||
GridView(
|
||||
|
|
@ -248,12 +247,12 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
/* var confim =
|
||||
var confim =
|
||||
await confirmDialog();
|
||||
if (confim) {
|
||||
getDelete(
|
||||
logic.getDelete(
|
||||
student);
|
||||
}*/
|
||||
}
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/favorite_delete_icon.png',
|
||||
|
|
@ -291,7 +290,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
'第${item['questionPage']}页',
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: Color(0xFF2E5BFF)),
|
||||
color: const Color(0xFF2E5BFF)),
|
||||
),
|
||||
),
|
||||
ListView.builder(
|
||||
|
|
@ -299,8 +298,8 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
HomeworkFavs student = item['list'][i];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
/* showStudentDialog(
|
||||
context, student, groupList);*/
|
||||
showStudentDialog(
|
||||
context, student, state.favList);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
|
|
@ -318,7 +317,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
.spaceBetween,
|
||||
children: [
|
||||
quickText(student.studentName,
|
||||
color: Color(0xFF333333),
|
||||
color: const Color(0xFF333333),
|
||||
size: 14.sp),
|
||||
Expanded(child: Container()),
|
||||
Padding(
|
||||
|
|
@ -328,17 +327,17 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
student.className!,
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: Color(
|
||||
color: const Color(
|
||||
0xFF666666)),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
/*var confim =
|
||||
var confim =
|
||||
await confirmDialog();
|
||||
if (confim) {
|
||||
getDelete(student);
|
||||
}*/
|
||||
logic.getDelete(student);
|
||||
}
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/favorite_delete_icon.png',
|
||||
|
|
@ -372,7 +371,7 @@ class _FavStudentPageState extends State<FavStudentPage> {
|
|||
}),
|
||||
|
||||
],
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_rx/get_rx.dart';
|
||||
import 'package:making_school_asignment_app/common/config/request_config.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:photo_view/photo_view.dart';
|
||||
|
|
@ -141,7 +142,7 @@ class _FavoriteStudentDialogState extends State<FavoriteStudentDialog> {
|
|||
builder: (BuildContext context, int index) {
|
||||
final HomeworkFavs item = imageList[index];
|
||||
return PhotoViewGalleryPageOptions(
|
||||
imageProvider: NetworkImage(item.zgtAnswer!),
|
||||
imageProvider: NetworkImage(RequestConfig.imgUrl + item.zgtAnswer!),
|
||||
heroAttributes: PhotoViewHeroAttributes(tag: item.id!),
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi
|
|||
late final EasyRefreshController refreshController2;
|
||||
|
||||
WorkStudentParams params = WorkStudentParams(
|
||||
assessType: 0,
|
||||
assessType: UserStore.to.assessType.value,
|
||||
pageSize: 10,
|
||||
);
|
||||
WorkStudentParams params2 = WorkStudentParams(
|
||||
assessType: 0,
|
||||
assessType: UserStore.to.assessType.value,
|
||||
pageSize: 10,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
|||
padding: EdgeInsets.only(left: 10.w),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
// SystemNavigator.pop();
|
||||
Get.back();
|
||||
},
|
||||
child: Icon(
|
||||
|
|
|
|||
Loading…
Reference in New Issue