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
c5f9d94c
Commit
c5f9d94c
authored
May 21, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in comments, fix behavior
parent
c91fa2f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
lms/djangoapps/open_ended_grading/views.py
+14
-2
No files found.
lms/djangoapps/open_ended_grading/views.py
View file @
c5f9d94c
...
...
@@ -90,6 +90,11 @@ def staff_grading(request, course_id):
'staff_access'
:
True
,
})
def
find_peer_grading_module
(
course
):
"""
Given a course, finds the first peer grading module in it.
@param course: A course object.
@return: boolean found_module, string problem_url
"""
#Reverse the base course url
base_course_url
=
reverse
(
'courses'
)
found_module
=
False
...
...
@@ -117,7 +122,7 @@ def find_peer_grading_module(course):
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
peer_grading
(
request
,
course_id
):
'''
Show a peer grading interface
Show a peer grading interface
to the student. The interface is linked to from the button.
'''
#Get the current course
...
...
@@ -153,7 +158,8 @@ def generate_problem_url(problem_url_parts, base_course_url):
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
student_problem_list
(
request
,
course_id
):
'''
Show a student problem list
Show a student problem list to a student. Fetch the list from the grading controller server, get some metadata,
and then show it to the student.
'''
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
student_id
=
unique_id_for_user
(
request
.
user
)
...
...
@@ -175,6 +181,8 @@ def student_problem_list(request, course_id):
else
:
problem_list
=
problem_list_dict
[
'problem_list'
]
#A list of problems to remove (problems that can't be found in the course)
list_to_remove
=
[]
for
i
in
xrange
(
0
,
len
(
problem_list
)):
try
:
#Try to load each problem in the courseware to get links to them
...
...
@@ -184,6 +192,8 @@ def student_problem_list(request, course_id):
#Continue with the rest of the location to construct the list
error_message
=
"Could not find module for course {0} at location {1}"
.
format
(
course
.
id
,
problem_list
[
i
][
'location'
])
log
.
error
(
error_message
)
#Mark the problem for removal from the list
list_to_remove
.
append
(
i
)
continue
problem_url
=
generate_problem_url
(
problem_url_parts
,
base_course_url
)
problem_list
[
i
]
.
update
({
'actual_url'
:
problem_url
})
...
...
@@ -214,6 +224,8 @@ def student_problem_list(request, course_id):
log
.
error
(
"Problem with results from external grading service for open ended."
)
success
=
False
#Remove problems that cannot be found in the courseware from the list
problem_list
=
[
problem_list
[
i
]
for
i
in
xrange
(
0
,
len
(
problem_list
))
if
i
not
in
list_to_remove
]
ajax_url
=
_reverse_with_slash
(
'open_ended_problems'
,
course_id
)
return
render_to_response
(
'open_ended_problems/open_ended_problems.html'
,
{
...
...
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