Began enforcing one-vote-per-person. This can be disabled with debug="True" in the <crowdsource_hinter> tag. Started tests of the hint manager.
142 lines
3.8 KiB
HTML
142 lines
3.8 KiB
HTML
## The hinter module passes in a field called ${op}, which determines which
|
|
## sub-function to render.
|
|
|
|
|
|
<%def name="get_hint()">
|
|
% if best_hint != '':
|
|
<h4> Other students who arrived at the wrong answer of ${answer} recommend the following hints: </h4>
|
|
<ul>
|
|
<li> ${best_hint} </li>
|
|
% endif
|
|
% if rand_hint_1 != '':
|
|
<li> ${rand_hint_1} </li>
|
|
% endif
|
|
% if rand_hint_2 != '':
|
|
<li> ${rand_hint_2} </li>
|
|
% endif
|
|
</ul>
|
|
</%def>
|
|
|
|
<%def name="get_feedback()">
|
|
<style>
|
|
#answer-tabs {
|
|
background: transparent;
|
|
border: none;
|
|
}
|
|
|
|
#answer-tabs .ui-widget-header {
|
|
border-bottom: 1px solid #DCDCDC;
|
|
}
|
|
|
|
#answer-tabs .ui-tabs-nav .ui-state-default {
|
|
border: 1px solid #DCDCDC;
|
|
background: #EEEEEE;
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
#answer-tabs .ui-tabs-nav .ui-state-default:hover {
|
|
background: transparent;
|
|
}
|
|
|
|
#answer-tabs .ui-tabs-nav .ui-state-active {
|
|
border: 1px solid #DCDCDC;
|
|
background: transparent;
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
#answer-tabs .ui-tabs-nav .ui-state-active a {
|
|
color: #222222;
|
|
}
|
|
|
|
#answer-tabs .ui-tabs-nav .ui-state-default a:hover {
|
|
color: #222222;
|
|
}
|
|
|
|
.hint-inner-container {
|
|
padding-left: 15px;
|
|
padding-right: 15px;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.vote {
|
|
padding-top: 0px !important;
|
|
padding-bottom: 0px !important;
|
|
}
|
|
|
|
</style>
|
|
|
|
<i> Participation in the hinting system is strictly optional, and will not influence
|
|
your grade. </i>
|
|
<br />
|
|
Help us improve our hinting system. Start by picking one of your previous incorrect answers from below:
|
|
<br /><br />
|
|
|
|
<div id="answer-tabs">
|
|
<ul>
|
|
% for index, answer in index_to_answer.items():
|
|
<li><a href="#previous-answer-${index}"> ${answer} </a></li>
|
|
% endfor
|
|
</ul>
|
|
|
|
% for index, answer in index_to_answer.items():
|
|
<div class = "previous-answer" id="previous-answer-${index}">
|
|
<div class = "hint-inner-container">
|
|
% if index in index_to_hints and len(index_to_hints[index]) > 0:
|
|
Which hint was most helpful when you got the wrong answer of ${answer}?
|
|
<br />
|
|
% for hint_text, hint_pk in index_to_hints[index]:
|
|
<input class="vote" data-answer="${index}" data-hintno="${hint_pk}" type="button" value="Vote">
|
|
${hint_text}
|
|
<br />
|
|
% endfor
|
|
Don't like any of the hints above? You can also submit your own.
|
|
% else:
|
|
Write a hint for other students who get the wrong answer of ${answer}.
|
|
% endif
|
|
Try to describe what concepts you misunderstood, or what mistake you made. Please don't
|
|
give away the answer.
|
|
<textarea cols="50" style="height:100px" class="custom-hint" id="custom-hint-${index}">
|
|
What would you say to help someone who got this wrong answer?
|
|
(Don't give away the answer, please.)
|
|
</textarea>
|
|
|
|
<input class="submit-hint" data-answer="${index}" type="button" value="submit">
|
|
</div></div>
|
|
% endfor
|
|
</div>
|
|
|
|
</%def>
|
|
|
|
<%def name="show_votes()">
|
|
Thank you for voting!
|
|
<br />
|
|
% for hint, votes in hint_and_votes:
|
|
<span style="color:green"> ${votes} votes. </span>
|
|
${hint}
|
|
<br />
|
|
% endfor
|
|
</%def>
|
|
|
|
<%def name="simple_message()">
|
|
${message}
|
|
</%def>
|
|
|
|
% if op == "get_hint":
|
|
${get_hint()}
|
|
% endif
|
|
|
|
% if op == "get_feedback":
|
|
${get_feedback()}
|
|
% endif
|
|
|
|
% if op == "submit_hint":
|
|
${simple_message()}
|
|
% endif
|
|
|
|
% if op == "vote":
|
|
${show_votes()}
|
|
% endif
|
|
|
|
|
|
|