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 @@
% if msg: diff --git a/common/lib/xmodule/xmodule/css/annotatable/display.scss b/common/lib/xmodule/xmodule/css/annotatable/display.scss index 4279c454cf..0e18de5ff9 100644 --- a/common/lib/xmodule/xmodule/css/annotatable/display.scss +++ b/common/lib/xmodule/xmodule/css/annotatable/display.scss @@ -66,56 +66,57 @@ .annotatable-discussion { display: none; } -} -.annotatable-problem { + .annotatable-problem { border: 1px solid #ccc; border-radius: 1em; margin: 0 0 1em 0; -} -.annotatable-problem-header { + } + .annotatable-problem-header { font-weight: bold; border-bottom: 1px solid #ccc; .annotatable-problem-index { font-weight: normal; } -} -.annotatable-problem-body { + } + .annotatable-problem-body { position: relative; textarea { - display: inline-block; - width: 55%; - } + display: inline-block; + width: 55%; + } .annotatable-problem-prompt { - font-style: italic; + font-style: italic; } ul.annotatable-problem-tags { - display: block; - list-style-type: none; - margin: 1em 0; - padding: 0; - li { - cursor: pointer; - display: inline; - padding: .5em; - margin: 0 .5em 0 0; - background-color: #ccc; - border: 1px solid #000; - &.selected { - background-color: rgba(255,255,10,0.3); - } + display: block; + list-style-type: none; + margin: 1em 0; + padding: 0; + li { + cursor: pointer; + display: inline; + padding: .5em; + margin: 0 .5em 0 0; + background-color: #ccc; + border: 1px solid #000; + &.selected { + background-color: rgba(255,255,10,0.3); } + } } - .annotatable-problem-controls { - display: inline-block; - margin: 0 4px 0 8px; + .annotatable-problem-controls { + display: inline-block; + margin: 0 4px 0 8px; } -} -.annotatable-problem-footer {} + } + .annotatable-problem-footer {} -.annotatable-problem-header, -.annotatable-problem-body, -.annotatable-problem-footer { + .annotatable-problem-header, + .annotatable-problem-body, + .annotatable-problem-footer { padding: .5em 1em; + } } + .ui-tooltip.qtip.ui-tooltip { font-size: $body-font-size; border: 1px solid #333; diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index d40bdb556e..cea86716b5 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -802,4 +802,49 @@ section.problem { display: none; } } + + .annotation-input { + $yellow: rgba(255,255,10,0.3); + + border: 1px solid #ccc; + border-radius: 1em; + margin: 0 0 1em 0; + .header { + font-weight: bold; + border-bottom: 1px solid #ccc; + padding: .5em 1em; + } + .body { padding: .5em 1em; } + .prompt { font-style: italic; } + .prompt.prompt-text { + padding: .5em; + color: #333; + background-color: $yellow; + font-style: normal; + border: 1px solid darken($yellow, 10%); + } + .prompt, ul.tags { + margin: .5em 0; + padding: 0; + } + ul.tags { + display: block; + list-style-type: none; + margin-left: 1em; + li { + display: block; + margin: 1em 0 0 1.5em; + span { + cursor: pointer; + display: inline-block; + padding: .25em .5em; + border: 1px solid rgb(102,102,102); + &.selected { + background-color: $yellow; + } + } + } + } + textarea { width: 100%; } + } } diff --git a/common/static/js/capa/annotationinput.js b/common/static/js/capa/annotationinput.js index 8bb18b1497..ee6fa60afe 100644 --- a/common/static/js/capa/annotationinput.js +++ b/common/static/js/capa/annotationinput.js @@ -1,4 +1,5 @@ (function () { + console.log('annotation input loaded: ', this); var update = function() { alert("o hi"); };