Commit 94b73dc9 by Sarina Canelake

Remove blank lines from tooltip display

parent c480fb8f
...@@ -179,7 +179,9 @@ class SequenceModule(SequenceFields, ProctoringFields, XModule): ...@@ -179,7 +179,9 @@ class SequenceModule(SequenceFields, ProctoringFields, XModule):
rendered_child = child.render(STUDENT_VIEW, context) rendered_child = child.render(STUDENT_VIEW, context)
fragment.add_frag_resources(rendered_child) fragment.add_frag_resources(rendered_child)
titles = child.get_content_titles() # `titles` is a list of titles to inject into the sequential tooltip display.
# We omit any blank titles to avoid blank lines in the tooltip display.
titles = [title.strip() for title in child.get_content_titles() if title.strip()]
childinfo = { childinfo = {
'content': rendered_child.content, 'content': rendered_child.content,
'title': "\n".join(titles), 'title': "\n".join(titles),
...@@ -193,13 +195,14 @@ class SequenceModule(SequenceFields, ProctoringFields, XModule): ...@@ -193,13 +195,14 @@ class SequenceModule(SequenceFields, ProctoringFields, XModule):
childinfo['title'] = child.display_name_with_default childinfo['title'] = child.display_name_with_default
contents.append(childinfo) contents.append(childinfo)
params = {'items': contents, params = {
'element_id': self.location.html_id(), 'items': contents,
'item_id': self.location.to_deprecated_string(), 'element_id': self.location.html_id(),
'position': self.position, 'item_id': self.location.to_deprecated_string(),
'tag': self.location.category, 'position': self.position,
'ajax_url': self.system.ajax_url, 'tag': self.location.category,
} 'ajax_url': self.system.ajax_url,
}
fragment.add_content(self.system.render_template("seq_module.html", params)) fragment.add_content(self.system.render_template("seq_module.html", params))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment