Compare commits

..

2 Commits

Author SHA1 Message Date
machuanyu 6719526cd2 Merge branch 'mcy_revision' into main 2024-04-11 13:45:33 +08:00
1147192855@qq.com 1c17e014a4 no message 2024-04-11 10:59:15 +08:00
2 changed files with 23 additions and 10 deletions

View File

@ -18,17 +18,20 @@ class MarkingTextQuestionJobTabParams extends Object {
@JsonKey(name: 'studentId')
int? studentId;
@JsonKey(name: 'defaultFirst')
bool? isDefaultFirst;
MarkingTextQuestionJobTabParams({
required this.taskId,
required this.pageIndex,
this.isDefaultFirst,
this.paperId,
this.studentId,
this.nextPageIndex,
this.previousPageIndex,
});
factory MarkingTextQuestionJobTabParams.fromJson(Map<String, dynamic> srcJson) =>
_$MarkingTextQuestionJobTabParamsFromJson(srcJson);
factory MarkingTextQuestionJobTabParams.fromJson(Map<String, dynamic> srcJson) => _$MarkingTextQuestionJobTabParamsFromJson(srcJson);
Map<String, dynamic> toJson() => _$MarkingTextQuestionJobTabParamsToJson(this);
}

View File

@ -151,7 +151,6 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
if (doMarkingInfo.value == null) return Container();
return InkWell(
onTap: () async {
print('点击了...');
List<JobConcernedWithStudent>? students = await getStudents();
if (students == null) return;
students = students..sort((e, e1) => e.studentName.compareTo(e1.studentName));
@ -237,7 +236,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
});
// tab改变时
useValueChanged<JobPageTab?, String>(_useSwitchStudentAndType.currentTab.value, (_, __) {
useValueChanged<JobPageTab?, String>(_useSwitchStudentAndType.currentTab.value, (_oldValue, __) {
var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex;
JobDoPapersStudentBus? studentBus = _useSwitchStudentAndType.studentBusInfo.value;
if (studentBus != null && studentBus.pageIndex == thePageIndex) return; //
@ -313,7 +312,6 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
_useSwitchStudentAndType.eventCancel();
};
}, []);
print(_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.finishCount < e.total)?.toJson());
return Container(
padding: EdgeInsets.only(bottom: 2.r, left: 12.r, right: 12.r),
decoration: BoxDecoration(
@ -524,6 +522,7 @@ class ExamPaperAndScoringView extends StatefulHookConsumerWidget {
class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringView> with EventBusMixin, CommonMixin {
final GlobalKey<JobPictureOverviewState> scaffoldKeyPictureOverview = GlobalKey<JobPictureOverviewState>();
Future<MarkingTextQuestionJob?>? _future; //
MarkingTextQuestionJob? theJobData;
bool firstLoading = true;
JobDoSynchroTab? synchroTabs;
late RemoveListener _doJobObtainGradingDataProviderListener; //
@ -539,13 +538,18 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
eventOn(callback: (eventVal) {
switch (eventVal.runtimeType) {
case MarkingTextQuestionJobTabParamsBus:
MarkingTextQuestionJobTabParamsBus theEventVal = eventVal as MarkingTextQuestionJobTabParamsBus;
var theEventVal = eventVal as MarkingTextQuestionJobTabParamsBus;
bool? isDefaultFirst;
if (theJobData != null) {
isDefaultFirst = theJobData!.pageIndex < theEventVal.pageIndex;
}
ref.read(doJobObtainGradingDataProvider.notifier).setVal(MarkingTextQuestionJobTabParams(
pageIndex: theEventVal.pageIndex,
taskId: theEventVal.taskId,
studentId: theEventVal.studentId,
previousPageIndex: theEventVal.previousPageIndex,
nextPageIndex: theEventVal.nextPageIndex,
isDefaultFirst: isDefaultFirst,
));
break;
case JobDoSynchroTab:
@ -573,6 +577,7 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
BaseStructureResult<MarkingTextQuestionJob> _result = await _client.getJobTabOfExam(params);
if (_result.success) {
var jobDetails = _result.data;
theJobData = jobDetails;
if (jobDetails != null) {
jobDetails.previousPageIndex = synchroTabs?.getPreviousPageIndex(jobDetails.pageIndex - 1);
jobDetails.nextPageIndex = synchroTabs?.getNextPageIndex(jobDetails.pageIndex - 1);
@ -613,6 +618,7 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
pageIndex: jobData.pageIndex,
nextPageIndex: jobData.nextPageIndex,
previousPageIndex: jobData.previousPageIndex,
isDefaultFirst: true,
);
if (model.paperId == 0 && jobData.nextPageIndex != null) {
//
@ -629,6 +635,7 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
paperId: jobData.prevId,
nextPageIndex: jobData.nextPageIndex,
previousPageIndex: jobData.previousPageIndex,
isDefaultFirst: false,
);
if (model.paperId == 0 && jobData.previousPageIndex != null) {
model.paperId = null;
@ -664,8 +671,6 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
final double containerHeight = constraints.maxHeight; //
if (jobData == null) return Container(); //
// print('容器宽度:${containerWidth};容器高度:${containerHeight}');
return Stack(
children: [
JobPictureOverview(
@ -860,7 +865,12 @@ Widget $examPaperAndScoringKeyboardView(
if (question.accuracy > 0)
Padding(
padding: EdgeInsets.only(bottom: 1.5.h),
child: quickText('正确率:${question.accuracy}%', size: 8.sp, color: Colors.white, align: TextAlign.end),
child: quickText(
'正确率:${getDoubleRemoveZero(question.accuracy, question.accuracy.toString())}%',
size: 8.sp,
color: Colors.white,
align: TextAlign.end,
),
)
],
),
@ -1063,7 +1073,7 @@ Widget $examPaperAndScoringKeyboardView(
}
@swidget
Widget $materialBtn({required Widget child, Color? bgc, Color? splashColor, GestureTapCallback? onTap, BorderRadius? borderRadius}) {
Widget $materialBtn({required Widget child, Color? bgc, Color? splashColor, GestureTapCallback? onTap, BorderRadiusGeometry? borderRadius}) {
return Material(
color: bgc,
borderRadius: borderRadius,