Commit 9d98b705 by Brian Wilson

add course navigation back into timed exam. Add initial timer styling.

parent 07638440
...@@ -352,7 +352,6 @@ def timed_exam(request, course_id, chapter, section): ...@@ -352,7 +352,6 @@ def timed_exam(request, course_id, chapter, section):
context = { context = {
'csrf': csrf(request)['csrf_token'], 'csrf': csrf(request)['csrf_token'],
# 'accordion': render_accordion(request, course, chapter, section),
'COURSE_TITLE': course.title, 'COURSE_TITLE': course.title,
'course': course, 'course': course,
'init': '', 'init': '',
...@@ -361,6 +360,11 @@ def timed_exam(request, course_id, chapter, section): ...@@ -361,6 +360,11 @@ def timed_exam(request, course_id, chapter, section):
'xqa_server': settings.MITX_FEATURES.get('USE_XQA_SERVER','http://xqa:server@content-qa.mitx.mit.edu/xqa') 'xqa_server': settings.MITX_FEATURES.get('USE_XQA_SERVER','http://xqa:server@content-qa.mitx.mit.edu/xqa')
} }
# in general, we may want to disable accordion display on timed exams.
provide_accordion = True
if provide_accordion:
context['accordion'] = render_accordion(request, course, chapter, section)
chapter_descriptor = course.get_child_by(lambda m: m.url_name == chapter) chapter_descriptor = course.get_child_by(lambda m: m.url_name == chapter)
if chapter_descriptor is not None: if chapter_descriptor is not None:
instance_module = get_instance_module(course_id, request.user, course_module, student_module_cache) instance_module = get_instance_module(course_id, request.user, course_module, student_module_cache)
...@@ -387,9 +391,9 @@ def timed_exam(request, course_id, chapter, section): ...@@ -387,9 +391,9 @@ def timed_exam(request, course_id, chapter, section):
# they don't have access to. # they don't have access to.
raise Http404 raise Http404
# Save where we are in the chapter NOT! # Save where we are in the chapter:
# instance_module = get_instance_module(course_id, request.user, chapter_module, student_module_cache) instance_module = get_instance_module(course_id, request.user, chapter_module, student_module_cache)
# save_child_position(chapter_module, section, instance_module) save_child_position(chapter_module, section, instance_module)
context['content'] = section_module.get_html() context['content'] = section_module.get_html()
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
@import 'course/courseware/sidebar'; @import 'course/courseware/sidebar';
@import 'course/courseware/amplifier'; @import 'course/courseware/amplifier';
@import 'course/layout/calculator'; @import 'course/layout/calculator';
@import 'course/layout/timer';
// course-specific courseware (all styles in these files should be gated by a // course-specific courseware (all styles in these files should be gated by a
// course-specific class). This should be replaced with a better way of // course-specific class). This should be replaced with a better way of
......
div.timer-main {
position: fixed;
z-index: 99;
width: 100%;
div#timer_wrapper {
position: relative;
float: right;
margin-right: 10px;
}
}
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
// TBD... // TBD...
if (remaining_secs <= 0) { if (remaining_secs <= 0) {
return "00:00:00"; return "00:00:00";
// do we just set window.location = <url> value?
} }
// count down in terms of hours, minutes, and seconds: // count down in terms of hours, minutes, and seconds:
...@@ -104,19 +105,41 @@ ...@@ -104,19 +105,41 @@
</%block> </%block>
<!-- %include file="/courseware/course_navigation.html" args="active_page='courseware'" / --> <div class="timer-main">
<div id="timer_wrapper">
<div class="timer_label">Time Remaining:</div> <div id="exam_timer" class="timer_value">&nbsp;</div>
</div>
</div>
% if accordion:
<%include file="/courseware/course_navigation.html" args="active_page='courseware'" />
% endif
<span id="exam_timer">&nbsp;</span>
<section class="container"> <section class="container">
<div class="course-wrapper"> <div class="course-wrapper">
% if accordion:
<section aria-label="Course Navigation" class="course-index">
<header id="open_close_accordion">
<a href="#">close</a>
</header>
<div id="accordion" style="display: none">
<nav>
${accordion}
</nav>
</div>
</section>
% endif
<section class="course-content"> <section class="course-content">
${content} ${content}
</section> </section>
</div> </div>
</section> </section>
% if course.show_calculator: % if course.show_calculator:
<div class="calc-main"> <div class="calc-main">
<a aria-label="Open Calculator" href="#" class="calc">Calculator</a> <a aria-label="Open Calculator" href="#" class="calc">Calculator</a>
......
...@@ -220,6 +220,12 @@ if settings.COURSEWARE_ENABLED: ...@@ -220,6 +220,12 @@ if settings.COURSEWARE_ENABLED:
# timed exam: # timed exam:
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/timed_exam/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$', url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/timed_exam/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$',
'courseware.views.timed_exam', name="timed_exam"), 'courseware.views.timed_exam', name="timed_exam"),
# (handle hard-coded 6.002x exam explicitly as a timed exam, but without changing the URL.
# not only because Pearson doesn't want us to change its location, but because we also include it
# in the navigation accordion we display with this exam (so students can see what work they have already
# done). Those are generated automatically using reverse(courseware_section).
url(r'^courses/(?P<course_id>MITx/6.002x/2012_Fall)/courseware/(?P<chapter>Final_Exam)/(?P<section>Final_Exam_Fall_2012)/$',
'courseware.views.timed_exam'),
#Inside the course #Inside the course
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/$', url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/$',
......
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