Commit 28c85d5f by solashirai

naming changes (partial), fixes to Mustache template usage

parent 7ee2a4c5
......@@ -115,7 +115,7 @@ class CrowdsourceHinter(XBlock):
data['submittedanswer']: The string of text that the student submits for a problem.
returns:
'Hints': the highest rated hint for an incorrect answer
'bestHint': the highest rated hint for an incorrect answer
or another random hint for an incorrect answer
or 'Sorry, there are no more hints for this answer.' if no more hints exist
"""
......@@ -146,12 +146,12 @@ class CrowdsourceHinter(XBlock):
# currently set by default to True
if best_hint not in self.Reported.keys():
self.Used.append(best_hint)
return {'Hints': best_hint, "StudentAnswer": answer}
return {'BestHint': best_hint, "StudentAnswer": answer}
if best_hint not in self.Used:
# choose highest rated hint for the incorrect answer
if best_hint not in self.Reported.keys():
self.Used.append(best_hint)
return {'Hints': best_hint, "StudentAnswer": answer}
return {'BestHint': best_hint, "StudentAnswer": answer}
# choose another random hint for the answer.
temporary_hints_list = []
for hint_keys in self.hint_database[str(answer)]:
......@@ -160,12 +160,12 @@ class CrowdsourceHinter(XBlock):
temporary_hints_list.append(str(hint_keys))
not_used = random.choice(temporary_hints_list)
self.Used.append(not_used)
return {'Hints': not_used, "StudentAnswer": answer}
return {'BestHint': not_used, "StudentAnswer": answer}
# find generic hints for the student if no specific hints exist
if len(self.generic_hints) != 0:
not_used = random.choice(self.generic_hints)
self.Used.append(not_used)
return {'Hints': not_used, "StudentAnswer": answer}
return {'BestHint': not_used, "StudentAnswer": answer}
else:
# if there are no more hints left in either the database or defaults
self.Used.append(str("There are no hints for" + " " + answer))
......
......@@ -22,7 +22,7 @@
flex-direction: column;
}
.csh_HintQuickFeedback{
.csh_hint_rating_on_incorrect{
display: flex;
flex-direction: row;
justify-content: flex-end;
......
<script type='x-tmpl/mustache' id='show_hint_feedback'>
<div class='csh_hint_value' value="{{hintvalue}}">
<script type='x-tmpl/mustache' id='show_hint_contribution'>
<div class='csh_hint_value' value="{{hintText}}">
<div class='csh_hint_data'>
<div class="csh_hint"><b>{{hint}}</b></div>
<div class="csh_hint"><b>{{hintText}}</b></div>
</div>
<div class='csh_rating_data'>
<div role="button" class="csh_rate_hint" data-rate="upvote">
......@@ -17,9 +17,9 @@
</div>
</script>
<script type="x-tmpl/mustache" id="show_reported_feedback">
<div class="csh_hint_value" value ="{{hint}}">
<div class="csh_hint">{{hint}}</div>
<script type="x-tmpl/mustache" id="show_reported_moderation">
<div class="csh_hint_value" value ="{{reportedHintText}}">
<div class="csh_hint">{{reportedHintText}}</div>
<div role="button" class="csh_staff_rate" data-rate="unreport" aria-label="unreport">
<u><b>Return hint for use in the hinter</b></u>
</div>
......@@ -30,7 +30,7 @@
</div>
</script>
<script type="x-tmpl/mustache" id="student_hint_creation">
<script type="x-tmpl/mustache" id="hint_text_input">
<p>
<input type="text" name="studentinput" class="csh_student_text_input">
</p>
......@@ -44,10 +44,10 @@
</div>
</script>
<script type="x-tmpl/mustache" id="show_answer_feedback">
<script type="x-tmpl/mustache" id="show_student_submission">
<div class="csh_student_answer">
<h class="csh_answer_text" answer={{answer}}>
<i> Improve hints for this question by leaving feedback on this hint or contributing your own! </i> <br>
<i> Improve hints for this question by rating hints as helpful/unhelpful or contributing your own! </i> <br>
<i> Your original answer was: {{answer}} </i></h>
</div>
</script>
......@@ -62,9 +62,9 @@
<div class="crowdsourcehinter_block">
<div class='csh_hint_reveal'>
<div class='csh_Hints' student_answer = '' hint_received=''>
<div class='csh_hint_text' student_answer = '' hint_received=''>
</div>
<div class='csh_HintQuickFeedback'>
<div class='csh_hint_rating_on_incorrect'>
<div role="button" class="csh_rate_hint" data-rate="upvote" title="This hint was helpful!">
<b>+</b>
</div>
......@@ -81,10 +81,7 @@
<div class="crowdsourcehinter_block">
<section class="csh_correct"></section>
<p>
<span class='Thankyou'></span>
</p>
<div class="csh_feedback">
<div class="csh_student_submission">
<div class="csh_reported_hints">
<span>moderate reported hints</span>
</div>
......
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