Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
9d98b705
Commit
9d98b705
authored
Feb 01, 2013
by
Brian Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add course navigation back into timed exam. Add initial timer styling.
parent
07638440
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
8 deletions
+52
-8
lms/djangoapps/courseware/views.py
+8
-4
lms/static/sass/course.scss
+1
-1
lms/static/sass/course/layout/_timer.scss
+11
-0
lms/templates/courseware/testcenter_exam.html
+26
-3
lms/urls.py
+6
-0
No files found.
lms/djangoapps/courseware/views.py
View file @
9d98b705
...
...
@@ -352,7 +352,6 @@ def timed_exam(request, course_id, chapter, section):
context
=
{
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
# 'accordion': render_accordion(request, course, chapter, section),
'COURSE_TITLE'
:
course
.
title
,
'course'
:
course
,
'init'
:
''
,
...
...
@@ -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'
)
}
# 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
)
if
chapter_descriptor
is
not
None
:
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):
# they don't have access to.
raise
Http404
# Save where we are in the chapter
NOT!
#
instance_module = get_instance_module(course_id, request.user, chapter_module, student_module_cache)
#
save_child_position(chapter_module, section, instance_module)
# Save where we are in the chapter
:
instance_module
=
get_instance_module
(
course_id
,
request
.
user
,
chapter_module
,
student_module_cache
)
save_child_position
(
chapter_module
,
section
,
instance_module
)
context
[
'content'
]
=
section_module
.
get_html
()
...
...
lms/static/sass/course.scss
View file @
9d98b705
...
...
@@ -22,7 +22,7 @@
@import
'course/courseware/sidebar'
;
@import
'course/courseware/amplifier'
;
@import
'course/layout/calculator'
;
@import
'course/layout/timer'
;
// 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
...
...
lms/static/sass/course/layout/_timer.scss
0 → 100644
View file @
9d98b705
div
.timer-main
{
position
:
fixed
;
z-index
:
99
;
width
:
100%
;
div
#timer_wrapper
{
position
:
relative
;
float
:
right
;
margin-right
:
10px
;
}
}
lms/templates/courseware/testcenter_exam.html
View file @
9d98b705
...
...
@@ -78,6 +78,7 @@
// TBD...
if
(
remaining_secs
<=
0
)
{
return
"00:00:00"
;
// do we just set window.location =
<
url
>
value
?
}
// count down in terms of hours, minutes, and seconds:
...
...
@@ -104,19 +105,41 @@
</
%
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"
>
</div>
</div>
</div>
% if accordion:
<
%
include
file=
"/courseware/course_navigation.html"
args=
"active_page='courseware'"
/>
% endif
<span
id=
"exam_timer"
>
</span>
<section
class=
"container"
>
<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"
>
${content}
</section>
</div>
</section>
% if course.show_calculator:
<div
class=
"calc-main"
>
<a
aria-label=
"Open Calculator"
href=
"#"
class=
"calc"
>
Calculator
</a>
...
...
lms/urls.py
View file @
9d98b705
...
...
@@ -220,6 +220,12 @@ if settings.COURSEWARE_ENABLED:
# timed exam:
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/timed_exam/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'
,
'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
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/$'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment