From: Guillaume Pellerin Date: Fri, 12 Jul 2024 08:38:11 +0000 (+0200) Subject: use pink for comment index at pdf export X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4ce27243442b3d5571ce2303f0b8d2453c716236;p=teleforma.git use pink for comment index at pdf export --- 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'])