Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
c59cbfe7
Commit
c59cbfe7
authored
Jan 29, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First pass at the debug submission view
parent
c724f90f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
apps/submissions/templates/submissions.html
+1
-0
apps/submissions/urls.py
+6
-3
apps/submissions/views.py
+12
-8
No files found.
apps/submissions/templates/submissions.html
View file @
c59cbfe7
<h3>
Submissions for {{ student_id }} > {{ course_id }} > {{ item_id }}:
</h3>
<h3>
Submissions for {{ student_id }} > {{ course_id }} > {{ item_id }}:
</h3>
{{ error }}
<br/>
{{ submissions|length }} total submissions.
<br/>
{{ submissions|length }} total submissions.
<br/>
<br/>
<br/>
<table
border=
1
>
<table
border=
1
>
...
...
apps/submissions/urls.py
View file @
c59cbfe7
from
django.conf.urls
import
url
,
patterns
from
django.conf.urls
import
url
,
patterns
urlpatterns
=
patterns
(
'submissions.views'
,
urlpatterns
=
patterns
(
url
(
r'^submissions/(?P<student_id>[^/]+)/(?P<course_id>[^/]+)/(?P<item_id>[^/]+)$'
,
'submissions.views'
,
'get_submissions_for_student_item'
),
url
(
r'^submissions/(?P<student_id>[^/]+)/(?P<course_id>[^/]+)/(?P<item_id>[^/]+)$'
,
'get_submissions_for_student_item'
),
(
r'^accounts/login/$'
,
'django.contrib.auth.views.login'
),
)
)
apps/submissions/views.py
View file @
c59cbfe7
import
logging
import
logging
from
django.contrib.auth.decorators
import
login_required
from
django.shortcuts
import
render_to_response
from
django.shortcuts
import
render_to_response
from
submissions
import
api
from
submissions
.api
import
SubmissionRequestError
,
get_submissions
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
@login_required
()
def
get_submissions_for_student_item
(
request
,
course_id
,
student_id
,
item_id
):
def
get_submissions_for_student_item
(
request
,
course_id
,
student_id
,
item_id
):
"""Retrieve all submissions associated with the given student item.
"""Retrieve all submissions associated with the given student item.
...
@@ -20,7 +22,9 @@ def get_submissions_for_student_item(request, course_id, student_id, item_id):
...
@@ -20,7 +22,9 @@ def get_submissions_for_student_item(request, course_id, student_id, item_id):
item_id (str): The item id for this student item.
item_id (str): The item id for this student item.
Returns:
Returns:
HttpResponse: The response object for this request.
HttpResponse: The response object for this request. Renders a simple
development page with all the submissions related to the specified
student item.
"""
"""
student_item_dict
=
dict
(
student_item_dict
=
dict
(
...
@@ -28,11 +32,11 @@ def get_submissions_for_student_item(request, course_id, student_id, item_id):
...
@@ -28,11 +32,11 @@ def get_submissions_for_student_item(request, course_id, student_id, item_id):
student_id
=
student_id
,
student_id
=
student_id
,
item_id
=
item_id
,
item_id
=
item_id
,
)
)
submissions
=
api
.
get_submissions
(
student_item_dict
)
context
=
dict
(
**
student_item_dict
)
try
:
context
=
dict
(
submissions
=
get_submissions
(
student_item_dict
)
submissions
=
submissions
,
context
[
"submissions"
]
=
submissions
**
student_item_dict
except
SubmissionRequestError
:
)
context
[
"error"
]
=
"The specified student item was not found."
return
render_to_response
(
'submissions.html'
,
context
)
return
render_to_response
(
'submissions.html'
,
context
)
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