Files
edx-platform/lms/templates/problem.html
Victor Shnayder ae06f13b96 Fix broken submission in firefox
- apparently have to define functions before using them...
2012-09-21 18:35:00 -04:00

66 lines
1.9 KiB
HTML

<%namespace name='static' file='static_content.html'/>
<h2 class="problem-header">
${ problem['name'] }
% if problem['weight'] != 1 and problem['weight'] != None:
: ${ problem['weight'] } points
% endif
</h2>
<section class="problem">
${ problem['html'] }
<section class="action">
<input type="hidden" name="problem_id" value="${ problem['name'] }">
% if check_button:
<input class="check ${ check_button }" type="button" value="${ check_button }">
% endif
% if reset_button:
<input class="reset" type="button" value="Reset">
% endif
% if save_button:
<input class="save" type="button" value="Save">
% endif
% if answer_available:
<input class="show" type="button" value="Show Answer">
% endif
% if attempts_allowed :
<section class="submission_feedback">
You have used ${ attempts_used } of ${ attempts_allowed } submissions
</section>
% endif
</section>
</section>
<%block name="js_extra">
<script type="text/javascript" charset="utf-8">
var collapsibleSet;
$(function(){
// this should be brought back into problems
$('.longform').hide();
$('.shortform').append('<a href="#" class="full">See full output</a>');
$('.full').click(function() {
$(this).parent().siblings().slideToggle();
$(this).parent().parent().toggleClass('open');
var text = $(this).text() == 'See full output' ? 'Hide output' : 'See full output';
$(this).text(text);
return false;
});
function toggleHint(e) {
$(this).parent().siblings().slideToggle();
$(this).parent().parent().toggleClass('open');
return false;
}
if(!collapsibleSet) {
collapsibleSet = true;
$('.collapsible section').hide();
$('.collapsible header a').bind('click', toggleHint);
}
});
</script>
</%block>