Commit 568115bb by dragonfi

Add question-title class to templates

parent f9176c1c
...@@ -113,12 +113,22 @@ class MentoringBlock(XBlockWithLightChildren): ...@@ -113,12 +113,22 @@ class MentoringBlock(XBlockWithLightChildren):
return (score, int(round(score*100)), correct, incorrect) return (score, int(round(score*100)), correct, incorrect)
def _index_steps(self):
index = 1
for child in self.steps:
child.index = index
index += 1
def student_view(self, context): def student_view(self, context):
self._index_steps()
fragment, named_children = self.get_children_fragment( fragment, named_children = self.get_children_fragment(
context, view_name='mentoring_view', context, view_name='mentoring_view',
not_instance_of=(MentoringMessageBlock, TitleBlock, SharedHeaderBlock) not_instance_of=(MentoringMessageBlock, TitleBlock, SharedHeaderBlock)
) )
fragment.add_content(render_template('templates/html/mentoring.html', { fragment.add_content(render_template('templates/html/mentoring.html', {
'self': self, 'self': self,
'named_children': named_children, 'named_children': named_children,
......
<fieldset class="choices questionnaire"> <fieldset class="choices questionnaire">
<legend class="question"> <legend class="question">
<h3>QUESTION {{ self.index }}</h3> <h3 class="question-title">QUESTION {{ self.index }}</h3>
<p>{{ self.question }}</p> <p>{{ self.question }}</p>
</legend> </legend>
<div class="choices-list"> <div class="choices-list">
......
<fieldset class="rating questionnaire"> <fieldset class="rating questionnaire">
<legend class="question">{{ self.question }}</legend> <legend class="question">
<h3 class="question-title">QUESTION {{ self.index }}</h3>
<p>{{ self.question }}</p>
</legend>
<div class="choices-list"> <div class="choices-list">
<div class="choice"> <div class="choice">
<div class="choice-result icon-2x"></div> <div class="choice-result icon-2x"></div>
......
<fieldset class="choices questionnaire" data-hide_results="{{self.hide_results}}"> <fieldset class="choices questionnaire" data-hide_results="{{self.hide_results}}">
<legend class="question"> <legend class="question">
<h3>QUESTION {{ self.index }}</h3> <h3 class="question-title">QUESTION {{ self.index }}</h3>
<p>{{ self.question }}</p> <p>{{ self.question }}</p>
</legend> </legend>
<div class="choices-list"> <div class="choices-list">
......
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