Compare commits

..

No commits in common. "cf5ec5d25c93a7b2faaaa5c32f1a96ede42f7f99" and "c790a37e83e4ddf88de59cc7d6ebcfebe184205a" have entirely different histories.

20 changed files with 1254 additions and 1041 deletions

1
.gitignore vendored
View File

@ -51,4 +51,3 @@ making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view
making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view.g.dart
making_school_asignment_app/lib/common/api/retrofit_client.g.dart
making_school_asignment_app/lib/page/home_page/children/read_over/read_over_view.g.dart
.vscode/settings.json

View File

@ -54,60 +54,6 @@
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe62c;</span>
<div class="name">Frame-1</div>
<div class="code-name">&amp;#xe62c;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62a;</span>
<div class="name">Frame-2</div>
<div class="code-name">&amp;#xe62a;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62b;</span>
<div class="name">Frame</div>
<div class="code-name">&amp;#xe62b;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe63f;</span>
<div class="name">Frame 2223726</div>
<div class="code-name">&amp;#xe63f;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe640;</span>
<div class="name">Frame 2223727</div>
<div class="code-name">&amp;#xe640;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe641;</span>
<div class="name">Frame 2223723</div>
<div class="code-name">&amp;#xe641;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe642;</span>
<div class="name">Frame 2223725</div>
<div class="code-name">&amp;#xe642;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe643;</span>
<div class="name">Frame 2223728</div>
<div class="code-name">&amp;#xe643;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe644;</span>
<div class="name">Frame 2223724</div>
<div class="code-name">&amp;#xe644;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe63e;</span>
<div class="name">Frame</div>
@ -468,9 +414,9 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1718091057560') format('woff2'),
url('iconfont.woff?t=1718091057560') format('woff'),
url('iconfont.ttf?t=1718091057560') format('truetype');
src: url('iconfont.woff2?t=1710142362036') format('woff2'),
url('iconfont.woff?t=1710142362036') format('woff'),
url('iconfont.ttf?t=1710142362036') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -496,87 +442,6 @@
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-Frame-114"></span>
<div class="name">
Frame-1
</div>
<div class="code-name">.icon-Frame-114
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-Frame-25"></span>
<div class="name">
Frame-2
</div>
<div class="code-name">.icon-Frame-25
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-Frame15"></span>
<div class="name">
Frame
</div>
<div class="code-name">.icon-Frame15
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223726"></span>
<div class="name">
Frame 2223726
</div>
<div class="code-name">.icon-a-Frame2223726
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223727"></span>
<div class="name">
Frame 2223727
</div>
<div class="code-name">.icon-a-Frame2223727
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223723"></span>
<div class="name">
Frame 2223723
</div>
<div class="code-name">.icon-a-Frame2223723
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223725"></span>
<div class="name">
Frame 2223725
</div>
<div class="code-name">.icon-a-Frame2223725
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223728"></span>
<div class="name">
Frame 2223728
</div>
<div class="code-name">.icon-a-Frame2223728
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223724"></span>
<div class="name">
Frame 2223724
</div>
<div class="code-name">.icon-a-Frame2223724
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-Frame14"></span>
<div class="name">
@ -1117,78 +982,6 @@
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-Frame-114"></use>
</svg>
<div class="name">Frame-1</div>
<div class="code-name">#icon-Frame-114</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-Frame-25"></use>
</svg>
<div class="name">Frame-2</div>
<div class="code-name">#icon-Frame-25</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-Frame15"></use>
</svg>
<div class="name">Frame</div>
<div class="code-name">#icon-Frame15</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223726"></use>
</svg>
<div class="name">Frame 2223726</div>
<div class="code-name">#icon-a-Frame2223726</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223727"></use>
</svg>
<div class="name">Frame 2223727</div>
<div class="code-name">#icon-a-Frame2223727</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223723"></use>
</svg>
<div class="name">Frame 2223723</div>
<div class="code-name">#icon-a-Frame2223723</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223725"></use>
</svg>
<div class="name">Frame 2223725</div>
<div class="code-name">#icon-a-Frame2223725</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223728"></use>
</svg>
<div class="name">Frame 2223728</div>
<div class="code-name">#icon-a-Frame2223728</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223724"></use>
</svg>
<div class="name">Frame 2223724</div>
<div class="code-name">#icon-a-Frame2223724</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-Frame14"></use>

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3423846 */
src: url('iconfont.woff2?t=1718091057560') format('woff2'),
url('iconfont.woff?t=1718091057560') format('woff'),
url('iconfont.ttf?t=1718091057560') format('truetype');
src: url('iconfont.woff2?t=1710142362036') format('woff2'),
url('iconfont.woff?t=1710142362036') format('woff'),
url('iconfont.ttf?t=1710142362036') format('truetype');
}
.iconfont {
@ -13,42 +13,6 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-Frame-114:before {
content: "\e62c";
}
.icon-Frame-25:before {
content: "\e62a";
}
.icon-Frame15:before {
content: "\e62b";
}
.icon-a-Frame2223726:before {
content: "\e63f";
}
.icon-a-Frame2223727:before {
content: "\e640";
}
.icon-a-Frame2223723:before {
content: "\e641";
}
.icon-a-Frame2223725:before {
content: "\e642";
}
.icon-a-Frame2223728:before {
content: "\e643";
}
.icon-a-Frame2223724:before {
content: "\e644";
}
.icon-Frame14:before {
content: "\e63e";
}

File diff suppressed because one or more lines are too long

View File

@ -5,69 +5,6 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "40679475",
"name": "Frame-1",
"font_class": "Frame-114",
"unicode": "e62c",
"unicode_decimal": 58924
},
{
"icon_id": "40679413",
"name": "Frame-2",
"font_class": "Frame-25",
"unicode": "e62a",
"unicode_decimal": 58922
},
{
"icon_id": "40679411",
"name": "Frame",
"font_class": "Frame15",
"unicode": "e62b",
"unicode_decimal": 58923
},
{
"icon_id": "39942228",
"name": "Frame 2223726",
"font_class": "a-Frame2223726",
"unicode": "e63f",
"unicode_decimal": 58943
},
{
"icon_id": "39942227",
"name": "Frame 2223727",
"font_class": "a-Frame2223727",
"unicode": "e640",
"unicode_decimal": 58944
},
{
"icon_id": "39942225",
"name": "Frame 2223723",
"font_class": "a-Frame2223723",
"unicode": "e641",
"unicode_decimal": 58945
},
{
"icon_id": "39942224",
"name": "Frame 2223725",
"font_class": "a-Frame2223725",
"unicode": "e642",
"unicode_decimal": 58946
},
{
"icon_id": "39942226",
"name": "Frame 2223728",
"font_class": "a-Frame2223728",
"unicode": "e643",
"unicode_decimal": 58947
},
{
"icon_id": "39942223",
"name": "Frame 2223724",
"font_class": "a-Frame2223724",
"unicode": "e644",
"unicode_decimal": 58948
},
{
"icon_id": "39483566",
"name": "Frame",

View File

@ -2,7 +2,6 @@ import 'package:dio/dio.dart' hide Headers;
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
import 'package:making_school_asignment_app/common/job/marking_models/favor_param.dart';
import 'package:making_school_asignment_app/common/job/marking_models/review_submission_params.dart';
import 'package:retrofit/retrofit.dart';
import 'package:making_school_asignment_app/common/job/annotated_class.dart';
import 'package:making_school_asignment_app/common/job/class_item.dart';
@ -114,13 +113,10 @@ abstract class RetrofitClient {
//
@GET("/api/hms/FavStudent/GetList")
Future<BasePageData<HomeworkFavs>> getFavList(@Query('HomeworkName') String homeworkName, @Query('ClassId') String classId);
Future<BasePageData<HomeworkFavs>> getFavList(
@Query('HomeworkName') String homeworkName, @Query('ClassId') String classId);
// ()
@POST("/api/hms/Annotate/AllCorrect")
Future getAllCorrect(@Field() String homeworkId, @Field() String classId);
//
@POST("/api/hms/Annotate/AnnotateSubmit")
Future reviewSubmission(@Body() ReviewSubmissionParams param);
Future getAllCorrect(@Field() String homeworkId,@Field() String classId);
}

View File

@ -1,5 +1,4 @@
import 'package:get/get.dart';
import 'package:get/get_connect/http/src/request/request.dart';
import 'package:json_annotation/json_annotation.dart';
part 'do_paper_details_result.g.dart';
@ -128,43 +127,33 @@ class StudentQuestions extends Object {
@JsonKey(name: 'questionNo')
int questionNo;
//
@JsonKey(name: 'score')
int? score;
//
@JsonKey(name: 'scoreStep')
int? scoreStep;
//
@JsonKey(name: 'isNeedAnnotate')
bool isNeedAnnotate;
//
@JsonKey(name: 'studentScore')
int? studentScore;
//
@JsonKey(name: 'isCorrect')
bool? isCorrect;
//
@JsonKey(name: 'correctRate')
int correctRate;
@JsonKey(name: 'height')
double height;
StudentQuestions({
required this.height,
required this.questionNo,
required this.correctRate,
required this.isNeedAnnotate,
StudentQuestions(
this.questionNo,
this.score,
this.scoreStep,
this.isNeedAnnotate,
this.studentScore,
this.isCorrect,
});
this.correctRate,
);
factory StudentQuestions.fromJson(Map<String, dynamic> srcJson) => _$StudentQuestionsFromJson(srcJson);

View File

@ -1,61 +0,0 @@
import 'package:json_annotation/json_annotation.dart';
part 'do_test_questions_image_info.g.dart';
@JsonSerializable()
class TestQuestionsImageInfo extends Object {
@JsonKey(name: 'boxHeight')
double boxHeight;
@JsonKey(name: 'boxWidth')
double boxWidth;
@JsonKey(name: 'imageWidth') //
double imageWidth;
@JsonKey(name: 'imageHeight') //
double imageHeight;
@JsonKey(name: 'url')
String url;
@JsonKey(name: 'actualImgWidth') //
double actualImgWidth;
@JsonKey(name: 'actualImgHeight') //
double actualImgHeight;
@JsonKey(name: 'remainingHeight') // .()
double remainingHeight;
//
@JsonKey(name: 'scaleRatio')
double scaleRatio;
//
@JsonKey(name: 'zoom')
double zoom;
TestQuestionsImageInfo({
required this.url,
required this.boxWidth,
required this.boxHeight,
required this.imageWidth,
required this.imageHeight,
this.scaleRatio = 1,
this.zoom = 1,
this.actualImgWidth = 0,
this.actualImgHeight = 0,
this.remainingHeight = 0,
}) {
//
scaleRatio = boxWidth / imageWidth;
actualImgWidth = imageWidth * scaleRatio;
actualImgHeight = imageHeight * scaleRatio;
remainingHeight = boxHeight - actualImgHeight;
}
factory TestQuestionsImageInfo.fromJson(Map<String, dynamic> srcJson) => _$TestQuestionsImageInfoFromJson(srcJson);
Map<String, dynamic> toJson() => _$TestQuestionsImageInfoToJson(this);
}

View File

@ -1,55 +0,0 @@
import 'package:json_annotation/json_annotation.dart';
part 'review_submission_params.g.dart';
@JsonSerializable(includeIfNull: false)
class ReviewSubmissionParams extends Object {
@JsonKey(name: 'homeworkId')
String homeworkId;
@JsonKey(name: 'templateId')
int templateId;
@JsonKey(name: 'studentId')
int studentId;
@JsonKey(name: 'studentScores')
List<StudentScores> studentScores;
@JsonKey(name: 'pictureBytes')
String? zgtAnnotate;
ReviewSubmissionParams({
required this.homeworkId,
required this.templateId,
required this.studentId,
required this.studentScores,
this.zgtAnnotate,
});
factory ReviewSubmissionParams.fromJson(Map<String, dynamic> srcJson) => _$ReviewSubmissionParamsFromJson(srcJson);
Map<String, dynamic> toJson() => _$ReviewSubmissionParamsToJson(this);
}
@JsonSerializable()
class StudentScores extends Object {
@JsonKey(name: 'questionNo')
int questionNo;
@JsonKey(name: 'studentScore')
int studentScore;
@JsonKey(name: 'isCorrect')
bool isCorrect;
StudentScores({
required this.questionNo,
required this.studentScore,
required this.isCorrect,
});
factory StudentScores.fromJson(Map<String, dynamic> srcJson) => _$StudentScoresFromJson(srcJson);
Map<String, dynamic> toJson() => _$StudentScoresToJson(this);
}

View File

@ -1,53 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
part 'cached_network_img.g.dart';
@hwidget
Widget $theCachedNetworkImage(ImageWidgetBuilder imageBuilder, {required String imageUrl}) {
UseCachedImgRefresh useImgRefsh = UseCachedImgRefresh.use();
return CachedNetworkImage(
key: useImgRefsh.imageKey.value,
cacheKey: imageUrl,
fit: BoxFit.fitWidth,
width: double.infinity,
imageUrl: imageUrl,
imageBuilder: imageBuilder,
placeholder: (context, url) => Center(child: SpinKitWave(color: Theme.of(context).primaryColor, size: 50.r)),
errorListener: (e) {
print('图片报错.............$e');
},
errorWidget: (context, url, error) {
return GestureDetector(
onTap: () => (useImgRefsh.imageKey.value = UniqueKey()),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset('assets/images/test_paper_loading_failed.png'),
quickText('加载失败,点击重试', color: const Color.fromRGBO(148, 163, 182, 1), size: 12.sp),
],
),
);
},
);
}
// CachedNetworkImage
class UseCachedImgRefresh {
ValueNotifier<int> refreshNumber;
ValueNotifier<Key> imageKey;
UseCachedImgRefresh._({required this.refreshNumber, required this.imageKey});
//
factory UseCachedImgRefresh.use() {
return UseCachedImgRefresh._(refreshNumber: useState(0), imageKey: useState(UniqueKey()));
}
}

View File

@ -23,11 +23,12 @@ class AnnotateItem extends StatefulWidget {
}
class _AnnotateItemState extends State<AnnotateItem> {
Future<bool> confirmDialog() async {
return await showDialog(
context: context,
builder: (context) => AlertDialog(
shape: RoundedRectangleBorder(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), //
),
actionsPadding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
@ -50,9 +51,9 @@ class _AnnotateItemState extends State<AnnotateItem> {
),
child: const Center(
child: Text(
'确定',
style: TextStyle(color: Colors.white),
))),
'确定',
style: TextStyle(color: Colors.white),
))),
onTap: () {
//
Get.back(result: true);
@ -71,9 +72,9 @@ class _AnnotateItemState extends State<AnnotateItem> {
),
child: const Center(
child: Text(
'取消',
style: TextStyle(color: Color(0xFF666666)),
))),
'取消',
style: TextStyle(color: Color(0xFF666666)),
))),
),
],
),
@ -128,15 +129,10 @@ class _AnnotateItemState extends State<AnnotateItem> {
Expanded(
flex: 4,
child: ItemBtn(
title: "收藏夹${widget.item.homeworkFavs.isNotEmpty ? '(${widget.item.homeworkFavs.length})' : ''}",
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
});
Get.toNamed(Routes.favStudentPage,arguments: {'homeworkName':widget.name,'classId':widget.item.classId,'homeworkId':widget.logic.state.homeworkId.value,'grade':widget.item.grade});
},
),
),
@ -151,10 +147,12 @@ class _AnnotateItemState extends State<AnnotateItem> {
child: ItemBtn(
title: "一键批阅",
font: widget.font - 2.sp,
clickFunction: () async {
var confim = await confirmDialog();
clickFunction: () async{
var confim =
await confirmDialog();
if (confim) {
widget.logic.getAllCorrect(widget.item.classId);
widget.logic.getAllCorrect(
widget.item.classId);
}
},
),
@ -180,15 +178,10 @@ class _AnnotateItemState extends State<AnnotateItem> {
Expanded(
flex: 4,
child: ItemBtn(
title: "收藏夹${widget.item.homeworkFavs.isNotEmpty ? '(${widget.item.homeworkFavs.length})' : ''}",
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
});
Get.toNamed(Routes.favStudentPage,arguments: {'homeworkName':widget.name,'classId':widget.item.classId,'homeworkId':widget.logic.state.homeworkId.value,'grade':widget.item.grade});
},
),
),
@ -294,7 +287,6 @@ class _AnnotateItemState extends State<AnnotateItem> {
Expanded(
child: InkWell(
onTap: () {
print('批阅..........');
Get.toNamed(Routes.reviewHomework, arguments: {
'homeworkId': widget.homeworkId,
'homeworkName': widget.name,

View File

@ -4,7 +4,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.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/my_text.dart';
import '../configuration_files/index.dart';
@ -18,7 +17,6 @@ class BottomAnnotationSwitch extends StatefulWidget {
class _BottomAnnotationSwitchJobState extends State<BottomAnnotationSwitch> with SingleTickerProviderStateMixin {
late AnimationController _animationController; //
final _homeworkLogic = Get.find<HomeworkReviewLogic>();
final _logicControl = Get.find<HomeworkReviewLogic>().annotationState;
StreamSubscription? _opControllisten;
@ -55,154 +53,101 @@ class _BottomAnnotationSwitchJobState extends State<BottomAnnotationSwitch> with
@override
Widget build(BuildContext context) {
double iconSize = 18.sp;
double iconSize = 24.sp;
Color actionColor = Colors.white;
Color defaultColor = const Color.fromRGBO(132, 146, 163, 1);
return Container(
width: double.infinity,
height: _animationController.value * 64.h,
height: _animationController.value * 44.h,
color: const Color.fromRGBO(83, 83, 83, 1),
// padding: EdgeInsets.symmetric(vertical: 1.h),
padding: EdgeInsets.symmetric(vertical: 1.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
flex: 7,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
flex: 8,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: Row(
children: [
//
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: IconButton(
icon: Obx(() {
return Icon(
const IconData(0xe635, fontFamily: "AlibabaIcon"),
size: iconSize,
color: _logicControl.pen.value ? actionColor : defaultColor,
);
}),
onPressed: () => easyThrottle('homework_bottom_action_bar_annotations', () {
_logicControl.gestureMove.value = false;
_logicControl.pen.value = !_logicControl.pen.value;
}),
),
),
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
//
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: IconButton(
icon: Obx(
() {
return Icon(
const IconData(0xe636, fontFamily: "AlibabaIcon"),
size: iconSize,
color: _logicControl.gestureMove.value ? actionColor : defaultColor,
);
},
),
onPressed: () => easyThrottle('homework_bottom_action_bar_annotations', () {
_logicControl.pen.value = false;
_logicControl.gestureMove.value = !_logicControl.gestureMove.value;
}),
),
),
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
//
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: TextButton(
child: quickText('全 对', color: Colors.white, size: 12.sp),
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.allWrongRating()),
),
),
),
],
),
InkWell(
onTap: () => easyThrottle('BottomAnnotationSwitch', () {
// if (jobNotesModel != null) {
// return AchievementView(
// elevation: 5,
// duration: Duration(seconds: 1),
// title: "笔记回显提示",
// subTitle: "当前正处于笔记回显",
// color: Theme.of(context).primaryColor,
// ).show(context);
// }
// easyThrottle('setSwitchBrush', () => ref.read(annotationGraffitiSwitchProvider.notifier).setSwitchBrush());
_logicControl.pen.value = !_logicControl.pen.value;
}),
child: Obx(() {
return Icon(
const IconData(0xe635, fontFamily: "AlibabaIcon"),
size: iconSize,
color: _logicControl.pen.value ? actionColor : defaultColor,
);
}),
),
Container(width: double.infinity, color: Colors.white, height: 0.5.h),
Expanded(
child: Row(
children: [
//
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: IconButton(
onPressed: () => easyThrottle('homework_bottom_action_bar_annotations', () {}),
icon: Icon(const IconData(0xe638, fontFamily: "AlibabaIcon"), size: iconSize, color: defaultColor),
),
),
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: IconButton(
icon: Icon(const IconData(0xe637, fontFamily: "AlibabaIcon"), size: iconSize, color: defaultColor),
onPressed: () => easyThrottle('homework_bottom_action_bar_annotations', () {}),
),
),
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
//
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: TextButton(
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.allPairs()),
child: quickText('全 错', color: Colors.white, size: 12.sp),
),
),
),
],
),
InkWell(
onTap: () => easyThrottle('BottomAnnotationSwitch', () {
// if (jobNotesModel != null) {
// return AchievementView(
// elevation: 5,
// duration: Duration(seconds: 1),
// title: "笔记回显提示",
// subTitle: "当前正处于笔记回显",
// color: Theme.of(context).primaryColor,
// ).show(context);
// }
// easyThrottle('setSwitchBrush', () => ref.read(annotationGraffitiSwitchProvider.notifier).setSwitchBrush());
_logicControl.pen.value = !_logicControl.pen.value;
}),
child: Icon(const IconData(0xe638, fontFamily: "AlibabaIcon"), size: iconSize, color: defaultColor),
),
InkWell(
onTap: () => easyThrottle('BottomAnnotationSwitch', () {
_logicControl.gestureMove.value = !_logicControl.gestureMove.value;
}),
// IconData(0xe62f, fontFamily: "AlibabaIcon")
child: Icon(const IconData(0xe636, fontFamily: "AlibabaIcon"),
size: iconSize, color: _logicControl.gestureMove.value ? actionColor : defaultColor),
),
InkWell(
onTap: () => easyThrottle('BottomAnnotationSwitch', () {
// TODO
}),
child: Icon(const IconData(0xe637, fontFamily: "AlibabaIcon"), size: iconSize, color: defaultColor),
),
],
),
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
Expanded(
flex: 3,
child: Row(
children: [
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: TextButton(
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.cancelAllRatings()),
child: quickText('取 消', size: 12.sp, color: Colors.white),
),
),
flex: 2,
child: Container(
child: InkWell(
onTap: () => easyThrottle('BottomAnnotationSwitch', () {
// if (jobNotesModel != null) {
// return AchievementView(
// elevation: 5,
// duration: Duration(seconds: 1),
// title: "笔记回显提示",
// subTitle: "当前正处于笔记回显",
// color: Theme.of(context).primaryColor,
// ).show(context);
// }
// easyThrottle('setSwitchBrush', () => ref.read(annotationGraffitiSwitchProvider.notifier).setSwitchBrush());
_logicControl.opControl.value = !_logicControl.opControl.value;
}),
child: Icon(
const IconData(0xe639, fontFamily: "AlibabaIcon"),
size: iconSize,
color: _logicControl.opControl.value ? actionColor : defaultColor,
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: TextButton(
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () => _homeworkLogic.submit()),
child: quickText('提 交', size: 12.sp, color: const Color.fromRGBO(76, 199, 147, 1)),
),
),
),
],
),
),
),
],

View File

@ -1,19 +1,12 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/config/request_config.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_test_questions_image_info.dart';
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
import 'package:making_school_asignment_app/common/utils/cached_network_img.dart';
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
import 'package:making_school_asignment_app/page/home_page/children/homework_review/configuration_files/index.dart';
import 'package:percent_indicator/linear_percent_indicator.dart';
import 'dropdown_switch_students_type.dart';
@ -33,290 +26,78 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
@override
Widget build(BuildContext context) {
return Row(
children: [
//
Expanded(
flex: 7,
child: LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
var maxWidth = constraints.maxWidth;
var maxHeight = constraints.maxHeight;
return Stack(
children: [
//
$QuestionImageView(maxWidth, maxHeight, sateData),
//
Positioned(right: 3.w, bottom: 4.h, child: const $ContinueToReview(isFloatingAction: true)),
//
Positioned(
left: 2.w,
top: (maxHeight / 2) - 20.h,
child: Obx(() {
LastPage? lastPageVal = sateData.data.value?.lastPage;
if (lastPageVal == null) return const SizedBox();
return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
var maxWidth = constraints.maxWidth;
var maxHeight = constraints.maxHeight;
return Stack(
children: [
$MainBox(maxWidth, maxHeight),
Positioned(
left: 3.w,
top: (maxHeight / 2) - 20.h,
child: Obx(() {
LastPage? lastPageVal = sateData.data.value?.lastPage;
if (lastPageVal == null) return const SizedBox();
return FloatingActionButton(
heroTag: '点击前往上一题',
tooltip: '点击前往上一题',
focusColor: Theme.of(context).primaryColor,
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.1),
elevation: 6.r,
onPressed: () => easyThrottle('TestQuestionSwitch', () {
var param = sateData.param.value;
param.studentId = lastPageVal.studentId;
param.templateId = lastPageVal.templateId;
sateData.param.value = DoPaperDetailsParam.fromJson(param.toJson());
}),
child: Icon(Icons.arrow_back_ios, color: Colors.white, size: 22.sp),
);
}),
),
//
Positioned(
right: 2.w,
top: (maxHeight / 2) - 20.h,
child: Obx(() {
NextPage? nextPageVal = sateData.data.value?.nextPage;
if (nextPageVal == null) return const SizedBox();
return FloatingActionButton(
heroTag: '点击前往上一题',
tooltip: '点击前往上一题',
focusColor: Theme.of(context).primaryColor,
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.1),
elevation: 6.r,
onPressed: () => easyThrottle('TestQuestionSwitch', () {
var param = sateData.param.value;
param.studentId = lastPageVal.studentId;
param.templateId = lastPageVal.templateId;
sateData.param.value = DoPaperDetailsParam.fromJson(param.toJson());
}),
child: Icon(Icons.arrow_back_ios, color: Colors.white, size: 22.sp),
);
}),
),
Positioned(
right: 2.w,
top: (maxHeight / 2) - 20.h,
child: Obx(() {
NextPage? nextPageVal = sateData.data.value?.nextPage;
if (nextPageVal == null) return const SizedBox();
return FloatingActionButton(
heroTag: '点击前往下一题',
tooltip: '点击前往下一题',
elevation: 6.r,
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.1),
onPressed: () => easyThrottle('TestQuestionSwitch', () {
var param = sateData.param.value;
param.studentId = nextPageVal.studentId;
param.templateId = nextPageVal.templateId;
sateData.param.value = DoPaperDetailsParam.fromJson(param.toJson());
}),
child: Icon(Icons.arrow_forward_ios, color: Colors.white, size: 22.sp),
);
}),
),
],
);
}),
),
//
Expanded(flex: 2, child: $QuestionNumberView(sateData)),
],
);
return FloatingActionButton(
heroTag: '点击前往下一题',
tooltip: '点击前往下一题',
elevation: 6.r,
backgroundColor: const Color.fromRGBO(24, 32, 32, 0.1),
onPressed: () => easyThrottle('TestQuestionSwitch', () {
var param = sateData.param.value;
param.studentId = nextPageVal.studentId;
param.templateId = nextPageVal.templateId;
sateData.param.value = DoPaperDetailsParam.fromJson(param.toJson());
}),
child: Icon(Icons.arrow_forward_ios, color: Colors.white, size: 22.sp),
);
}),
),
],
);
});
}
}
//
@hwidget
Widget $questionNumberView(BuildContext context, HomeworkReviewState sateData) {
final scrollControllerNum = useScrollController(); //
useEffect(() {
StreamSubscription listenVal = sateData.slide.listen((e) => scrollControllerNum.jumpTo(e));
//
return () {
listenVal.cancel();
};
}, []);
return Container(
height: double.infinity,
decoration: BoxDecoration(
color: const Color.fromRGBO(159, 159, 159, 0.97),
boxShadow: [
BoxShadow(
color: const Color.fromRGBO(46, 91, 255, 0.2),
offset: Offset(0, 8.w), //y轴偏移量
blurRadius: 1, //
spreadRadius: 2, //
)
],
),
child: SingleChildScrollView(
controller: scrollControllerNum,
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical, //
child: Obx(() {
var imageVal = sateData.imageScale.value;
if (imageVal == null) return const SizedBox();
var studentQuestions = sateData.studentQuestions.value;
print('书哈哈哈...');
return Padding(
padding: EdgeInsets.only(top: imageVal.remainingHeight > 0 ? imageVal.remainingHeight / 2 : 0),
child: Column(
children: studentQuestions?.asMap().keys.map((e) => $ScoringQuestionsView(studentQuestions[e], imageVal.scaleRatio)).toList() ?? [],
),
);
}),
),
);
}
//
@hwidget
Widget $scoringQuestionsView(BuildContext context, StudentQuestions item, double scaleRatio) {
var studentScore = useState<int?>(item.studentScore);
useValueChanged<int?, void>(studentScore.value, (_, __) {
item.studentScore = studentScore.value;
});
useValueChanged<StudentQuestions, void>(item, (_, __) {
studentScore.value = item.studentScore;
});
Widget $mainBox(double maxWidth, double maxHeight) {
useEffect(() {
return () {};
}, []);
return Container(
alignment: Alignment.topCenter,
height: item.height * scaleRatio,
child: Stack(
children: [
Row(
children: [
//
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Icon(
size: 22.sp,
color: studentScore.value == 2 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62b, fontFamily: "AlibabaIcon"),
),
onPressed: () => easyThrottle('scoring_homework_questions', () {
studentScore.value = studentScore.value == 2 ? null : 2;
}),
),
),
//
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Icon(
size: 22.sp,
color: studentScore.value == 1 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62c, fontFamily: "AlibabaIcon"),
),
onPressed: () => easyThrottle('scoring_homework_questions', () {
studentScore.value = studentScore.value == 1 ? null : 1;
}),
),
),
//
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Icon(
size: 22.sp,
color: studentScore.value == 0 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62a, fontFamily: "AlibabaIcon"),
),
onPressed: () => easyThrottle('scoring_homework_questions', () {
studentScore.value = studentScore.value == 0 ? null : 0;
}),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 1.1.w),
quickText('${item.questionNo}', color: Theme.of(context).primaryColor.withOpacity(0.7), size: 8.sp),
if (item.correctRate > 0) quickText(' 正确率', color: Colors.grey, size: 5.sp),
if (item.correctRate > 0)
Expanded(
child: LinearPercentIndicator(
lineHeight: 6.h,
percent: item.correctRate / 100,
barRadius: Radius.circular(1.2.r),
alignment: MainAxisAlignment.center,
progressColor: const Color.fromRGBO(76, 199, 147, 0.6),
backgroundColor: const Color(0xFFB8C7CB).withOpacity(0.35),
center: quickText("${item.correctRate}%", size: 5.sp, align: TextAlign.center, color: Colors.white),
),
)
],
)
],
));
}
//
@hwidget
Widget $questionImageView(double maxWidth, double maxHeight, HomeworkReviewState sateData) {
final scrollControllerQuestion = useScrollController(); //
ImageStream? imageStream;
ImageStreamListener imageStreamListener = ImageStreamListener((ImageInfo info, bool _) {
WidgetsBinding.instance.addPostFrameCallback((_) {
sateData.imageScale.value = TestQuestionsImageInfo(
boxWidth: maxWidth,
boxHeight: maxHeight,
imageWidth: info.image.width.toDouble(),
imageHeight: info.image.height.toDouble(),
url: sateData.data.value!.zgtAnswer,
);
});
});
//
useEffect(() {
scrollControllerQuestion.addListener(() {
//
sateData.slide.value = scrollControllerQuestion.offset;
});
//
return () {
imageStream?.removeListener(imageStreamListener);
};
}, []);
return Container(
height: maxHeight,
// padding: EdgeInsets.only(bottom: 2.h, top: 2.h),
alignment: Alignment.center,
child: SingleChildScrollView(
controller: scrollControllerQuestion,
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical, //
child: Obx(() {
var imageUrl = sateData.data.value?.zgtAnswer;
print(imageUrl);
if (imageUrl == null) return const SizedBox();
// return Container(
// color: Colors.green,
// height: 394.45145018915514,
// );
return $TheCachedNetworkImage(
(context, imageProvider) {
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
imageStream?.removeListener(imageStreamListener);
imageStream = imageWidget.image.resolve(const ImageConfiguration())..addListener(imageStreamListener);
return imageWidget;
},
imageUrl: RequestConfig.imgUrl + imageUrl,
// imageUrl: 'https://cdn3-banquan.ituchong.com/weili/image/l/2000260200787476490.jpeg',
);
}),
),
return Stack(
alignment: const FractionalOffset(0.94, 0.94),
children: [
Container(
width: maxWidth,
height: maxHeight,
color: Colors.yellow,
),
//
const $ContinueToReview(isFloatingAction: true)
],
);
}

View File

@ -1,11 +1,8 @@
import 'dart:async';
import 'dart:convert';
import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_test_questions_image_info.dart';
import 'package:making_school_asignment_app/common/job/marking_models/review_submission_params.dart';
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
@ -17,9 +14,6 @@ class HomeworkReviewState {
// late String homeworkName;
late Rx<DoPaperDetailsParam> param;
late Rx<DoPaperDetailsResult?> data;
late Rx<List<StudentQuestions>?> studentQuestions;
late Rx<double> slide; //
late Rx<TestQuestionsImageInfo?> imageScale;
// late String dateEnd = '';
// late int knowledgeId = 0;
@ -46,7 +40,6 @@ class HomeworkReviewBinding extends Bindings {
class HomeworkReviewLogic extends GetxController with RequestToolMixin {
late StreamSubscription<DoPaperDetailsParam> _paramListen;
late StreamSubscription<DoPaperDetailsResult?> _dataListen;
final HomeworkReviewState state = HomeworkReviewState();
final HomeworkReviewAnnotationsControlState annotationState = HomeworkReviewAnnotationsControlState();
@ -60,19 +53,13 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
subject: Get.arguments['subject'],
).obs;
state.data = Rx<DoPaperDetailsResult?>(null);
state.studentQuestions = Rx<List<StudentQuestions>?>(null);
state.imageScale = Rx<TestQuestionsImageInfo?>(null);
state.slide = 0.0.obs;
getData();
//
_paramListen = state.param.listen((e) => getData());
//
_dataListen = state.data.listen((e) => state.imageScale.value = null);
}
@override
void disposeId(Object id) {
_dataListen.cancel();
_paramListen.cancel();
super.disposeId(id);
}
@ -81,90 +68,11 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
var timerControl = Timer(const Duration(milliseconds: 300), () => ToastUtils.showLoading());
try {
DoPaperDetailsResult? data = await getClient().getDoPaperDetails(state.param.value);
// var studentQuestions = data.studentQuestions;
// // 0
// for (var i = 0; i < studentQuestions.length; i++) {
// var item = studentQuestions[i];
// item.topHeight = itemPre.height;
// }
state.data.value = data;
state.studentQuestions.value = data.studentQuestions;
} finally {
if (timerControl.isActive) timerControl.cancel();
ToastUtils.dismiss();
}
}
//
void cancelAllRatings() {
var studentQuestions = state.studentQuestions.value;
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
List<StudentQuestions> data = [];
for (var e in studentQuestions!) {
var newe = StudentQuestions.fromJson(e.toJson());
newe.studentScore = null;
data.add(newe);
}
state.studentQuestions.value = data;
state.data.value?.studentQuestions = data;
}
//
void allPairs([int score = 2]) async {
var studentQuestions = state.studentQuestions.value;
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
List<StudentQuestions> data = [];
for (var e in studentQuestions!) {
var newe = StudentQuestions.fromJson(e.toJson());
newe.studentScore = score;
data.add(newe);
}
state.studentQuestions.value = data;
state.data.value?.studentQuestions = data;
await submit();
}
//
void allWrongRating([int score = 0]) async {
var studentQuestions = state.studentQuestions.value;
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
List<StudentQuestions> data = [];
for (var e in studentQuestions!) {
var newe = StudentQuestions.fromJson(e.toJson());
newe.studentScore = score;
data.add(newe);
}
state.studentQuestions.value = data;
state.data.value?.studentQuestions = data;
await submit();
}
//
/// allPairs
Future<void> submit() async {
var data = state.data.value;
if (data == null) return;
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
var studentQuestions = state.data.value!.studentQuestions;
var noRatingElement = studentQuestions.firstWhereOrNull((e) => e.studentScore == null);
if (noRatingElement != null) {
ToastUtils.showInfo('${noRatingElement.questionNo}题请评分');
return;
}
// TODO
await getClient().reviewSubmission(ReviewSubmissionParams(
homeworkId: state.param.value.homeworkId,
templateId: data.templateId,
studentId: data.studentId,
studentScores: studentQuestions.map((e) {
var studentScore = e.studentScore!;
return StudentScores(
isCorrect: studentScore == 2,
questionNo: e.questionNo,
studentScore: studentScore,
);
}).toList()));
}
}

View File

@ -26,7 +26,7 @@ class _HomeworkReviewState extends State<HomeworkReview> {
@override
void initState() {
WidgetsFlutterBinding.ensureInitialized();
// SystemChrome.setPreferredOrientations([DeviceOrientation.portraitDown]);
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitDown]);
super.initState();
}

File diff suppressed because it is too large Load Diff

View File

@ -81,7 +81,6 @@ dependencies:
syncfusion_flutter_datepicker: ^25.2.5
easy_debounce: ^2.0.3 # 防抖节流
flutter_hooks: ^0.20.5
flutter_spinkit: ^5.2.1
dev_dependencies:
flutter_test: