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
2df8581c
Commit
2df8581c
authored
Jan 29, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First pass at a submissions dev view
parent
d066182f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
10 deletions
+71
-10
apps/submissions/templates/submissions.html
+19
-0
apps/submissions/urls.py
+7
-0
apps/submissions/views.py
+38
-1
doc/source/conf.py
+3
-3
settings/base.py
+4
-6
No files found.
apps/submissions/templates/submissions.html
0 → 100644
View file @
2df8581c
<h3>
Submissions for {{ student_id }} > {{ course_id }} > {{ item_id }}:
</h3>
{{ submissions|length }} total submissions.
<br/>
<br/>
<table
border=
1
>
<th>
Student Item
</th>
<th>
Attempt Number
</th>
<th>
Answer
</th>
<th>
Submitted At
</th>
<th>
Created At
</th>
{% for submission in submissions%}
<tr>
<td>
{{ submission.student_item }}
</td>
<td>
{{ submission.attempt_number }}
</td>
<td>
{{ submission.answer }}
</td>
<td>
{{ submission.submitted_at }}
</td>
<td>
{{ submission.created_at }}
</td>
</tr>
{% endfor %}
</table>
apps/submissions/urls.py
0 → 100644
View file @
2df8581c
from
django.conf.urls
import
url
,
patterns
urlpatterns
=
patterns
(
'submissions.views'
,
url
(
r'^submissions/(?P<student_id>[^/]+)/(?P<course_id>[^/]+)/(?P<item_id>[^/]+)$'
,
'get_submissions_for_student_item'
),
)
apps/submissions/views.py
View file @
2df8581c
__author__
=
'stephensanchez'
import
logging
from
django.shortcuts
import
render_to_response
from
submissions
import
api
log
=
logging
.
getLogger
(
__name__
)
def
get_submissions_for_student_item
(
request
,
course_id
,
student_id
,
item_id
):
"""Retrieve all submissions associated with the given student item.
Developer utility for accessing all the submissions associated with a
student item. The student item is specified by the unique combination of
course, student, and item.
Args:
request (dict): The request.
course_id (str): The course id for this student item.
student_id (str): The student id for this student item.
item_id (str): The item id for this student item.
Returns:
HttpResponse: The response object for this request.
"""
student_item_dict
=
dict
(
course_id
=
course_id
,
student_id
=
student_id
,
item_id
=
item_id
,
)
submissions
=
api
.
get_submissions
(
student_item_dict
)
context
=
dict
(
submissions
=
submissions
,
**
student_item_dict
)
return
render_to_response
(
'submissions.html'
,
context
)
doc/source/conf.py
View file @
2df8581c
...
@@ -22,11 +22,11 @@ import sys, os
...
@@ -22,11 +22,11 @@ import sys, os
# If your documentation needs a minimal Sphinx version, state it here.
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
#needs_sphinx = '1.0'
root
=
os
.
path
.
abspath
(
'../..'
)
root
=
os
.
path
.
abspath
(
'../..
/apps
'
)
sys
.
path
.
append
(
root
)
sys
.
path
.
append
(
root
)
sys
.
path
.
append
(
os
.
path
.
join
(
root
,
"
common_grading
"
))
sys
.
path
.
append
(
os
.
path
.
join
(
root
,
"
submissions
"
))
sys
.
path
.
append
(
os
.
path
.
join
(
root
,
"
peer_grading
"
))
sys
.
path
.
append
(
os
.
path
.
join
(
root
,
"
openassessment/peer
"
))
# Add any Sphinx extension module names here, as strings. They can be extensions
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
...
...
settings/base.py
View file @
2df8581c
# Django settings for
peer_grading
project.
# Django settings for
Tim
project.
import
os
import
os
import
sys
import
sys
...
@@ -109,15 +109,13 @@ MIDDLEWARE_CLASSES = (
...
@@ -109,15 +109,13 @@ MIDDLEWARE_CLASSES = (
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
)
ROOT_URLCONF
=
'
common_grading
.urls'
ROOT_URLCONF
=
'
submissions
.urls'
# Python dotted path to the WSGI application used by Django's runserver.
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION
=
'peer_grading
.wsgi.application'
# WSGI_APPLICATION = 'submissions
.wsgi.application'
TEMPLATE_DIRS
=
(
TEMPLATE_DIRS
=
(
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
"apps/submissions/templates"
,
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
)
INSTALLED_APPS
=
(
INSTALLED_APPS
=
(
...
...
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