From a8178de497f3e6fe01cefae9ac90d4cf54ca6bba Mon Sep 17 00:00:00 2001 From: Arthur Barrett Date: Thu, 21 Feb 2013 13:52:22 -0500 Subject: [PATCH] Added styling to the annotationinput capa problem. --- common/lib/capa/capa/inputtypes.py | 7 +- .../capa/capa/templates/annotationinput.html | 50 +++++++------- .../xmodule/css/annotatable/display.scss | 65 ++++++++++--------- .../lib/xmodule/xmodule/css/capa/display.scss | 45 +++++++++++++ common/static/js/capa/annotationinput.js | 1 + 5 files changed, 109 insertions(+), 59 deletions(-) diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 8b646733a8..c20ee1101c 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -970,6 +970,7 @@ class AnnotationInput(InputTypeBase): def setup(self): xml = self.xml + self.title = xml.findtext('./title', 'Annotation Exercise') self.text = xml.findtext('./text') self.comment_prompt = xml.findtext('./comment_prompt') self.tag_prompt = xml.findtext('./tag_prompt') @@ -981,15 +982,15 @@ class AnnotationInput(InputTypeBase): for option in self.xml.findall('./options/option'): options.append({ 'id': index, - 'tag': option.text, - 'description': option.get('description', ''), + 'description': option.text, 'score': option.get('score', 0) }) index += 1 return options def _extra_context(self): - return {'text': self.text, + return {'title': self.title, + 'text': self.text, 'comment_prompt': self.comment_prompt, 'tag_prompt': self.tag_prompt, 'options': self.options} diff --git a/common/lib/capa/capa/templates/annotationinput.html b/common/lib/capa/capa/templates/annotationinput.html index 9009f440ff..48a00259d9 100644 --- a/common/lib/capa/capa/templates/annotationinput.html +++ b/common/lib/capa/capa/templates/annotationinput.html @@ -1,34 +1,36 @@
-TODO: make the textline hidden once it all works
-

Text: ${text}

+
${title}
+
+
${text}
+
${comment_prompt}
+