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
07638440
Commit
07638440
authored
Jan 31, 2013
by
Brian Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename testcenter_exam to timed_exam, and read duration from metadata (policy.json)
parent
9b3d7efb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
lms/djangoapps/courseware/views.py
+12
-5
lms/templates/courseware/testcenter_exam.html
+2
-1
lms/urls.py
+3
-3
No files found.
lms/djangoapps/courseware/views.py
View file @
07638440
...
@@ -301,7 +301,7 @@ def index(request, course_id, chapter=None, section=None,
...
@@ -301,7 +301,7 @@ def index(request, course_id, chapter=None, section=None,
@login_required
@login_required
@ensure_csrf_cookie
@ensure_csrf_cookie
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
t
estcenter
_exam
(
request
,
course_id
,
chapter
,
section
):
def
t
imed
_exam
(
request
,
course_id
,
chapter
,
section
):
"""
"""
Displays only associated content. If course, chapter,
Displays only associated content. If course, chapter,
and section are all specified, renders the page, or returns an error if they
and section are all specified, renders the page, or returns an error if they
...
@@ -387,20 +387,27 @@ def testcenter_exam(request, course_id, chapter, section):
...
@@ -387,20 +387,27 @@ def testcenter_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
# Save where we are in the chapter
NOT!
# 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
()
# figure out when the exam should end. Going forward, this is determined by getting a "normal"
# figure out when the
timed
exam should end. Going forward, this is determined by getting a "normal"
# duration from the test, then doing some math to modify the duration based on accommodations,
# duration from the test, then doing some math to modify the duration based on accommodations,
# and then use that value as the end. Once we have calculated this, it should be sticky -- we
# and then use that value as the end. Once we have calculated this, it should be sticky -- we
# use the same value for future requests, unless it's a tester.
# use the same value for future requests, unless it's a tester.
# get value for duration from the section's metadata:
if
'duration'
not
in
section_descriptor
.
metadata
:
raise
Http404
# for now, assume that the duration is set as an integer value, indicating the number of seconds:
duration
=
int
(
section_descriptor
.
metadata
.
get
(
'duration'
))
#
Let's try 600s for now..
.
#
This value should be UTC time as number of milliseconds since epoch
.
context
[
'end_date'
]
=
(
time
()
+
600
)
*
1000
context
[
'end_date'
]
=
(
time
()
+
duration
)
*
1000
result
=
render_to_response
(
'courseware/testcenter_exam.html'
,
context
)
result
=
render_to_response
(
'courseware/testcenter_exam.html'
,
context
)
except
Exception
as
e
:
except
Exception
as
e
:
...
...
lms/templates/courseware/testcenter_exam.html
View file @
07638440
...
@@ -67,7 +67,8 @@
...
@@ -67,7 +67,8 @@
return
(
num
<
10
?
"0"
:
""
)
+
num
;
return
(
num
<
10
?
"0"
:
""
)
+
num
;
}
}
// set the end time when the template is rendered
// set the end time when the template is rendered.
// This value should be UTC time as number of milliseconds since epoch.
var
endTime
=
new
Date
(
$
{
end_date
});
var
endTime
=
new
Date
(
$
{
end_date
});
var
currentTime
=
new
Date
();
var
currentTime
=
new
Date
();
var
remaining_secs
=
Math
.
floor
((
endTime
-
currentTime
)
/
1000
);
var
remaining_secs
=
Math
.
floor
((
endTime
-
currentTime
)
/
1000
);
...
...
lms/urls.py
View file @
07638440
...
@@ -217,9 +217,9 @@ if settings.COURSEWARE_ENABLED:
...
@@ -217,9 +217,9 @@ if settings.COURSEWARE_ENABLED:
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/about$'
,
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/about$'
,
'courseware.views.course_about'
,
name
=
"about_course"
),
'courseware.views.course_about'
,
name
=
"about_course"
),
# t
estcenter
exam:
# t
imed
exam:
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/t
estcenter
_exam/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'
,
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/t
imed
_exam/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'
,
'courseware.views.t
estcenter_exam'
,
name
=
"testcenter
_exam"
),
'courseware.views.t
imed_exam'
,
name
=
"timed
_exam"
),
#Inside the course
#Inside the course
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/$'
,
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