Commit 28c85d5f by solashirai

naming changes (partial), fixes to Mustache template usage

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