diff --git a/lms/djangoapps/courseware/models.py b/lms/djangoapps/courseware/models.py index 58ede38d58..3ad850f066 100644 --- a/lms/djangoapps/courseware/models.py +++ b/lms/djangoapps/courseware/models.py @@ -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, diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index b6fb31fc25..d2da893776 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -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 diff --git a/lms/templates/courseware/submission_history.html b/lms/templates/courseware/submission_history.html index cd14e9b2ab..3d78cbd4f0 100644 --- a/lms/templates/courseware/submission_history.html +++ b/lms/templates/courseware/submission_history.html @@ -4,7 +4,7 @@ % for i, entry in enumerate(history_entries):
-#${len(history_entries) - i}: ${entry.created} EST
+#${len(history_entries) - i}: ${entry.created} UTC
Score: ${entry.grade} / ${entry.max_grade}
 ${json.dumps(json.loads(entry.state), indent=2, sort_keys=True) | h}