111
This commit is contained in:
parent
f677fa4032
commit
a35f8f5572
|
|
@ -61,7 +61,9 @@ Widget $questionNumberScrollView({
|
||||||
usePiddingTop.value = sateZoomData.zoomFile.value?.imageHeightOffsetStart ?? 0;
|
usePiddingTop.value = sateZoomData.zoomFile.value?.imageHeightOffsetStart ?? 0;
|
||||||
});
|
});
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
var studentQuestionsStream = sateData.studentQuestions.listen((e) => studentQuestions.value = e ?? []);
|
var studentQuestionsStream = sateData.studentQuestions.listen((e) {
|
||||||
|
studentQuestions.value = e ?? [];
|
||||||
|
});
|
||||||
|
|
||||||
var stream = sateZoomData.initScale.listen((e) {
|
var stream = sateZoomData.initScale.listen((e) {
|
||||||
// print("initScale : $e");
|
// print("initScale : $e");
|
||||||
|
|
@ -155,8 +157,8 @@ Widget $scoringQuestionsView(BuildContext context, HomeworkReviewState sateData,
|
||||||
/// 学生打分数据
|
/// 学生打分数据
|
||||||
studentScoreListener() {
|
studentScoreListener() {
|
||||||
item.studentScore = studentScore.value;
|
item.studentScore = studentScore.value;
|
||||||
var theVal = sateData.studentQuestions.value?.firstWhereOrNull((e)=>e.questionNo==e.questionNo);
|
var theVal = sateData.studentQuestions.value?.firstWhereOrNull((e) => e.questionNo == e.questionNo);
|
||||||
if(theVal!=null) theVal.studentScore = studentScore.value;
|
if (theVal != null) theVal.studentScore = studentScore.value;
|
||||||
|
|
||||||
var studentQuestions = sateData.studentQuestions.value;
|
var studentQuestions = sateData.studentQuestions.value;
|
||||||
if (item.studentScore == null) return;
|
if (item.studentScore == null) return;
|
||||||
|
|
@ -171,7 +173,15 @@ Widget $scoringQuestionsView(BuildContext context, HomeworkReviewState sateData,
|
||||||
|
|
||||||
studentScore.addListener(studentScoreListener);
|
studentScore.addListener(studentScoreListener);
|
||||||
|
|
||||||
|
var studentQuestionsStream = sateData.studentQuestions.listen((e) {
|
||||||
|
var itemVal = (e ?? []).firstWhereOrNull((e1) => e1.questionNo == item.questionNo);
|
||||||
|
if (itemVal != null && studentScore.value != itemVal.studentScore) {
|
||||||
|
studentScore.value = itemVal.studentScore;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return () {
|
return () {
|
||||||
|
studentQuestionsStream.cancel();
|
||||||
studentScore.removeListener(studentScoreListener);
|
studentScore.removeListener(studentScoreListener);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue