From 4ce27243442b3d5571ce2303f0b8d2453c716236 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 12 Jul 2024 10:38:11 +0200 Subject: [PATCH] use pink for comment index at pdf export --- teleforma/exam/views.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index cb435854..73ffee91 100755 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -173,6 +173,7 @@ class ScriptView(ScriptMixinView, CourseAccessMixin, UpdateView): def dispatch(self, *args, **kwargs): return super(ScriptView, self).dispatch(*args, **kwargs) + class ScriptDownloadView(ScriptMixinView, CourseAccessMixin): """ download the script pdf with its annotations @@ -200,15 +201,15 @@ class ScriptDownloadView(ScriptMixinView, CourseAccessMixin): # go to next page can.showPage() page = annotation.page - - # set text to red - can.setFillColorRGB(1,0,0) - + annotation_data = json.loads(annotation.content) # print(annotation_data) text = "N/A" # we handle only point (comment) and textbox (text) annotations if annotation_data.get('type') == 'point': + # set text to violet + can.setFillColorRGB(1,0,1) + # print(annotation.uuid) # print(uuid) comments = AnnotationComment.objects.filter( @@ -223,6 +224,9 @@ class ScriptDownloadView(ScriptMixinView, CourseAccessMixin): -12 + height - annotation_data['y'], str(len(bottom_texts))) elif annotation_data.get('type') == 'textbox': + # set text to red + can.setFillColorRGB(1,0,0) + can.drawString(annotation_data['x'], -12 + height - annotation_data['y'], annotation_data['content']) -- 2.39.5