diff --git a/marking_app/lib/common/model/marking/marking_text_question.dart b/marking_app/lib/common/model/marking/marking_text_question.dart index d917720..a0c9d4a 100644 --- a/marking_app/lib/common/model/marking/marking_text_question.dart +++ b/marking_app/lib/common/model/marking/marking_text_question.dart @@ -181,7 +181,9 @@ class MarkingTextQuestion extends Object { bool setImageList(String resImage, int imageIndex) { try { String oldImage = studentAnswerList[imageIndex]; - commentImageUrlMap[oldImage] = '$resImage?${DateTime.now().millisecondsSinceEpoch}'; + // commentImageUrlMap[oldImage] = 'https:$resImage?${DateTime.now().millisecondsSinceEpoch}'; + + commentImageUrlMap[oldImage] = 'https:$resImage?${DateTime.now().millisecondsSinceEpoch}'; return true; } catch (e) { return false; diff --git a/marking_app/lib/components/PictureOverview.dart b/marking_app/lib/components/PictureOverview.dart index d9e4fb4..cc02c0e 100644 --- a/marking_app/lib/components/PictureOverview.dart +++ b/marking_app/lib/components/PictureOverview.dart @@ -519,9 +519,8 @@ class _ExamPaperDrawingState extends ConsumerState with EventB if (index + 1 == pointsPureData.length) { pointsPureData = pointsPureData.sublist(0, index); - ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal(ref.read(drawMarkingProvider).data.sublist(0, index), pointsPureData)); index = pointsPureData.toList().lastIndexOf(null); - index == -1 ? -1 : index + 1; + index = index == -1 ? -1 : index + 1; } if (index != -1) { pointsPureData = pointsPureData.sublist(0, index); diff --git a/marking_app/lib/pages/marking/do_papers.dart b/marking_app/lib/pages/marking/do_papers.dart index fd45696..7990c7f 100644 --- a/marking_app/lib/pages/marking/do_papers.dart +++ b/marking_app/lib/pages/marking/do_papers.dart @@ -471,8 +471,13 @@ class _MarkingPapersState extends ConsumerState RestClient client = await getClient(); String? commentImageUrlStr; - List? commentImageUrl = - (currentQuestion?.commentImageUrl.isNotEmpty ?? false) || res?.url != null ? currentQuestion?.commentImageUrlMap.values.toList() : null; + List? commentImageUrl = (currentQuestion?.commentImageUrl.isNotEmpty ?? false) || res?.url != null + ? currentQuestion?.commentImageUrlMap.values.map((original) { + String withoutProtocol = original.replaceAll(RegExp(r"https?:"), ""); + if (withoutProtocol.contains('?')) withoutProtocol = withoutProtocol.split('?').first; + return withoutProtocol; + }).toList() + : null; if (commentImageUrl?.isNotEmpty ?? false) commentImageUrlStr = jsonEncode(commentImageUrl); BaseStructureResult result = await client.submitTestQuestionsOfExam(SubmitExamParams(