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
88a30cb7
Commit
88a30cb7
authored
Mar 04, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes in response to Victor's comments.
parent
87784d1c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
lms/djangoapps/courseware/models.py
+3
-1
lms/djangoapps/courseware/views.py
+2
-1
lms/templates/courseware/submission_history.html
+1
-1
No files found.
lms/djangoapps/courseware/models.py
View file @
88a30cb7
...
...
@@ -67,6 +67,8 @@ class StudentModuleHistory(models.Model):
Student. Right now, we restrict this to problems so that the table doesn't
explode in size."""
HISTORY_SAVING_TYPES
=
{
'problem'
}
class
Meta
:
get_latest_by
=
"created"
...
...
@@ -81,7 +83,7 @@ class StudentModuleHistory(models.Model):
@receiver
(
post_save
,
sender
=
StudentModule
)
def
save_history
(
sender
,
instance
,
**
kwargs
):
if
instance
.
module_type
==
'problem'
:
if
instance
.
module_type
in
StudentModuleHistory
.
HISTORY_SAVING_TYPES
:
history_entry
=
StudentModuleHistory
(
student_module
=
instance
,
version
=
None
,
created
=
instance
.
modified
,
...
...
lms/djangoapps/courseware/views.py
View file @
88a30cb7
...
...
@@ -616,10 +616,11 @@ def submission_history(request, course_id, student_username, location):
Right now this only works for problems because that's all
StudentModuleHistory records.
"""
# Make sure our has_access check uses the course_id, eh? or is ourself
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
staff_access
=
has_access
(
request
.
user
,
course
,
'staff'
)
# Permission Denied if they don't have staff access and are trying to see
# somebody else's submission history.
if
(
student_username
!=
request
.
user
.
username
)
and
(
not
staff_access
):
raise
PermissionDenied
...
...
lms/templates/courseware/submission_history.html
View file @
88a30cb7
...
...
@@ -4,7 +4,7 @@
% for i, entry in enumerate(history_entries):
<hr/>
<div>
<b>
#${len(history_entries) - i}
</b>
: ${entry.created}
EST
</br>
<b>
#${len(history_entries) - i}
</b>
: ${entry.created}
UTC
</br>
Score: ${entry.grade} / ${entry.max_grade}
<pre>
${json.dumps(json.loads(entry.state), indent=2, sort_keys=True) | h}
...
...
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