完成作业报告
This commit is contained in:
parent
79f33983e4
commit
a8b8ba5d81
|
|
@ -185,3 +185,5 @@ marking_app/lib/pages/homework_correction/eventBus/job_do_papers_switch_operatio
|
|||
marking_app/lib/pages/homework_correction/eventBus/job_notes_view_bus.g.dart
|
||||
marking_app/lib/pages/homework_correction/eventBus/job_notes_view_bus.g.dart
|
||||
marking_app/lib/common/model/job/job_report_model.g.dart
|
||||
marking_app/lib/common/model/job/job_report_join_class.g.dart
|
||||
marking_app/lib/pages/homework_correction/job_report.g.dart
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
|
|
@ -0,0 +1,45 @@
|
|||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'job_report_join_class.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class JobReportJoinClass extends Object {
|
||||
@JsonKey(name: 'schoolId')
|
||||
int schoolId;
|
||||
|
||||
@JsonKey(name: 'schoolName')
|
||||
String schoolName;
|
||||
|
||||
@JsonKey(name: 'gradeId')
|
||||
int gradeId;
|
||||
|
||||
@JsonKey(name: 'gradeName')
|
||||
String gradeName;
|
||||
|
||||
@JsonKey(name: 'graduationYear')
|
||||
String graduationYear;
|
||||
|
||||
@JsonKey(name: 'className')
|
||||
String className;
|
||||
|
||||
@JsonKey(name: 'toBeSubmitCount')
|
||||
int toBeSubmitCount;
|
||||
|
||||
@JsonKey(name: 'submitCount')
|
||||
int submitCount;
|
||||
|
||||
JobReportJoinClass(
|
||||
this.schoolId,
|
||||
this.schoolName,
|
||||
this.gradeId,
|
||||
this.gradeName,
|
||||
this.graduationYear,
|
||||
this.className,
|
||||
this.toBeSubmitCount,
|
||||
this.submitCount,
|
||||
);
|
||||
|
||||
factory JobReportJoinClass.fromJson(Map<String, dynamic> srcJson) => _$JobReportJoinClassFromJson(srcJson);
|
||||
|
||||
Map<String, dynamic> toJson() => _$JobReportJoinClassToJson(this);
|
||||
}
|
||||
|
|
@ -8,13 +8,13 @@ class JobReportModel extends Object {
|
|||
int studentCount;
|
||||
|
||||
@JsonKey(name: 'finishRate')
|
||||
int finishRate;
|
||||
double finishRate;
|
||||
|
||||
@JsonKey(name: 'correctRate')
|
||||
int correctRate;
|
||||
double correctRate;
|
||||
|
||||
@JsonKey(name: 'errorRate')
|
||||
int errorRate;
|
||||
double errorRate;
|
||||
|
||||
@JsonKey(name: 'validCount')
|
||||
int validCount;
|
||||
|
|
@ -81,7 +81,7 @@ class KnowledgeInfos extends Object {
|
|||
String knowledgeName;
|
||||
|
||||
@JsonKey(name: 'rate')
|
||||
int rate;
|
||||
double rate;
|
||||
|
||||
KnowledgeInfos(
|
||||
this.knowledgeId,
|
||||
|
|
@ -112,13 +112,13 @@ class QuestionAnswerInfos extends Object {
|
|||
List<FinishInfos> finishInfos;
|
||||
|
||||
@JsonKey(name: 'correctRate')
|
||||
int correctRate;
|
||||
double correctRate;
|
||||
|
||||
@JsonKey(name: 'errorRate')
|
||||
int errorRate;
|
||||
double errorRate;
|
||||
|
||||
@JsonKey(name: 'noAnswerRate')
|
||||
int noAnswerRate;
|
||||
double noAnswerRate;
|
||||
|
||||
QuestionAnswerInfos(
|
||||
this.questionId,
|
||||
|
|
@ -145,7 +145,7 @@ class FinishInfos extends Object {
|
|||
int finishCount;
|
||||
|
||||
@JsonKey(name: 'correctRate')
|
||||
int correctRate;
|
||||
double correctRate;
|
||||
|
||||
FinishInfos(
|
||||
this.title,
|
||||
|
|
@ -170,10 +170,10 @@ class StudentAnswerInfos extends Object {
|
|||
int useTime;
|
||||
|
||||
@JsonKey(name: 'correctRate')
|
||||
int correctRate;
|
||||
double correctRate;
|
||||
|
||||
@JsonKey(name: 'finishRate')
|
||||
int finishRate;
|
||||
double finishRate;
|
||||
|
||||
@JsonKey(name: 'noAnswerCount')
|
||||
int noAnswerCount;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,181 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:marking_app/utils/index.dart';
|
||||
|
||||
/// 说明: 贝塞尔曲线测试画布
|
||||
class FlutterWaveLoading extends StatefulWidget {
|
||||
final double width;
|
||||
final double height;
|
||||
final double waveHeight;
|
||||
final Color color;
|
||||
final double strokeWidth;
|
||||
final double progress;
|
||||
final double factor;
|
||||
final int secondAlpha;
|
||||
final double borderRadius;
|
||||
final bool isOval;
|
||||
final int milliseconds;
|
||||
|
||||
FlutterWaveLoading(
|
||||
{this.width = 100,
|
||||
this.height = 100 / 0.618,
|
||||
this.factor = 1,
|
||||
this.waveHeight = 5,
|
||||
this.progress = 0.5,
|
||||
this.color = Colors.green,
|
||||
this.strokeWidth = 3,
|
||||
this.secondAlpha = 88,
|
||||
this.isOval = false,
|
||||
this.milliseconds = 3000,
|
||||
this.borderRadius = 20});
|
||||
|
||||
@override
|
||||
_FlutterWaveLoadingState createState() => _FlutterWaveLoadingState();
|
||||
}
|
||||
|
||||
class _FlutterWaveLoadingState extends State<FlutterWaveLoading> with SingleTickerProviderStateMixin {
|
||||
late AnimationController _controller;
|
||||
late Animation _anim;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_controller = AnimationController(vsync: this, duration: Duration(milliseconds: widget.milliseconds))
|
||||
..addListener(toSetState)
|
||||
..repeat();
|
||||
_anim = CurveTween(curve: Curves.linear).animate(_controller);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void toSetState() => toUpState(setState, () {}, mounted);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
try {
|
||||
_controller
|
||||
..removeListener(toSetState)
|
||||
..dispose();
|
||||
} catch (e) {
|
||||
print('报错了.........:');
|
||||
print(e);
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return UnconstrainedBox(
|
||||
child: Container(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
child: CustomPaint(
|
||||
painter: BezierPainter(
|
||||
factor: _anim.value,
|
||||
waveHeight: widget.waveHeight,
|
||||
progress: widget.progress,
|
||||
color: widget.color,
|
||||
strokeWidth: widget.strokeWidth,
|
||||
secondAlpha: widget.secondAlpha,
|
||||
isOval: widget.isOval,
|
||||
borderRadius: widget.borderRadius),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BezierPainter extends CustomPainter {
|
||||
late Paint _mainPaint;
|
||||
late Path _mainPath;
|
||||
|
||||
double waveWidth = 80;
|
||||
late double wrapHeight;
|
||||
|
||||
final double waveHeight;
|
||||
final Color color;
|
||||
final double strokeWidth;
|
||||
final double progress;
|
||||
final double factor;
|
||||
final int secondAlpha;
|
||||
final double borderRadius;
|
||||
final bool isOval;
|
||||
|
||||
BezierPainter(
|
||||
{this.factor = 1,
|
||||
this.waveHeight = 8,
|
||||
this.progress = 0.5,
|
||||
this.color = Colors.green,
|
||||
this.strokeWidth = 3,
|
||||
this.secondAlpha = 88,
|
||||
this.isOval = false,
|
||||
this.borderRadius = 20}) {
|
||||
_mainPaint = Paint()
|
||||
..color = Colors.yellow
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 2;
|
||||
_mainPath = Path();
|
||||
}
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
// print(size);
|
||||
waveWidth = size.width / 2;
|
||||
wrapHeight = size.height;
|
||||
|
||||
Path path = Path();
|
||||
if (!isOval) {
|
||||
path.addRRect(RRect.fromRectXY(Offset(0, 0) & size, borderRadius, borderRadius));
|
||||
canvas.clipPath(path);
|
||||
// 边框
|
||||
// canvas.drawPath(
|
||||
// path,
|
||||
// _mainPaint
|
||||
// ..strokeWidth = strokeWidth
|
||||
// ..color = color);
|
||||
}
|
||||
if (isOval) {
|
||||
path.addOval(Offset(0, 0) & size);
|
||||
canvas.clipPath(path);
|
||||
canvas.drawPath(
|
||||
path,
|
||||
_mainPaint
|
||||
..strokeWidth = strokeWidth
|
||||
..color = color);
|
||||
}
|
||||
canvas.translate(0, wrapHeight);
|
||||
canvas.save();
|
||||
canvas.translate(0, waveHeight);
|
||||
canvas.save();
|
||||
canvas.translate(-4 * waveWidth + 2 * waveWidth * factor, 0);
|
||||
drawWave(canvas);
|
||||
canvas.drawPath(
|
||||
_mainPath,
|
||||
_mainPaint
|
||||
..style = PaintingStyle.fill
|
||||
..color = color.withAlpha(88));
|
||||
canvas.restore();
|
||||
|
||||
canvas.translate(-4 * waveWidth + 2 * waveWidth * factor * 2, 0);
|
||||
drawWave(canvas);
|
||||
canvas.drawPath(
|
||||
_mainPath,
|
||||
_mainPaint
|
||||
..style = PaintingStyle.fill
|
||||
..color = color);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
void drawWave(Canvas canvas) {
|
||||
_mainPath.moveTo(0, 0);
|
||||
_mainPath.relativeLineTo(0, -wrapHeight * progress);
|
||||
_mainPath.relativeQuadraticBezierTo(waveWidth / 2, -waveHeight * 2, waveWidth, 0);
|
||||
_mainPath.relativeQuadraticBezierTo(waveWidth / 2, waveHeight * 2, waveWidth, 0);
|
||||
_mainPath.relativeQuadraticBezierTo(waveWidth / 2, -waveHeight * 2, waveWidth, 0);
|
||||
_mainPath.relativeQuadraticBezierTo(waveWidth / 2, waveHeight * 2, waveWidth, 0);
|
||||
_mainPath.relativeQuadraticBezierTo(waveWidth / 2, -waveHeight * 2, waveWidth, 0);
|
||||
_mainPath.relativeQuadraticBezierTo(waveWidth / 2, waveHeight * 2, waveWidth, 0);
|
||||
_mainPath.relativeLineTo(0, wrapHeight);
|
||||
_mainPath.relativeLineTo(-waveWidth * 3 * 2.0, 0);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(CustomPainter oldDelegate) => true;
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ import 'package:marking_app/common/model/job/job_concerned_with_student.dart';
|
|||
import 'package:marking_app/common/model/job/job_concerned_with_student_params.dart';
|
||||
import 'package:marking_app/common/model/job/job_note_taking_trajectory.dart';
|
||||
import 'package:marking_app/common/model/job/job_page_tab.dart';
|
||||
import 'package:marking_app/common/model/job/job_report_join_class.dart';
|
||||
import 'package:marking_app/common/model/job/job_report_model.dart';
|
||||
import 'package:marking_app/common/model/job/job_review_submission.dart';
|
||||
import 'package:marking_app/common/model/job/job_task_item.dart';
|
||||
|
|
@ -249,7 +250,11 @@ abstract class RestClient {
|
|||
@the_retrofit.POST("${RequestConfig.hwProxyKeywords}/api/Marking/auto")
|
||||
Future<BaseStructureResult<bool>> toJobOneClickReview(@the_retrofit.Field() int taskId);
|
||||
|
||||
// 作业 => 一键批阅
|
||||
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Marking/auto")
|
||||
Future<BaseStructureResult<JobReportModel>> getJobReport(@the_retrofit.Field() int jobId);
|
||||
// 作业 => 获取作业报告
|
||||
@the_retrofit.GET("/api/jobs/job-report")
|
||||
Future<BaseStructureResult<JobReportModel>> getJobReport(@the_retrofit.Queries() Map<String, dynamic> params);
|
||||
|
||||
// 作业 => 获取作业报告
|
||||
@the_retrofit.GET("/api/jobs/student-job-for-class")
|
||||
Future<BaseStructureResult<List<JobReportJoinClass>>> getJobReportJoinClasses(@the_retrofit.Query("jobId") int jobId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue