summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyc/grader/views.py7
-rw-r--r--pyc/templates/lab.html2
-rw-r--r--static/style.css3
3 files changed, 10 insertions, 2 deletions
diff --git a/pyc/grader/views.py b/pyc/grader/views.py
index 8718c5e..9c688be 100644
--- a/pyc/grader/views.py
+++ b/pyc/grader/views.py
@@ -19,7 +19,12 @@ def password_changed(request):
def lab(request, lab_id):
from datetime import timedelta
lab = Lab.objects.get(pk=lab_id)
- submissions = lab.submission_set.filter(user__is_staff=False).order_by('-grade', 'time')
+
+ submissions = lab.submission_set
+ if not request.user.is_staff:
+ # only staff can see other staff solutions
+ submissions = submissions.filter(user__is_staff=False)
+ submissions = submissions.order_by('-grade', 'time')
# times are stored in UTC; do the conversion here
tzoffset = timedelta(0, 0, 0, 0, 0, -7) # -7 hours
diff --git a/pyc/templates/lab.html b/pyc/templates/lab.html
index 9586558..32a0593 100644
--- a/pyc/templates/lab.html
+++ b/pyc/templates/lab.html
@@ -11,7 +11,7 @@ Lab {{ lab.id }} due {{ lab.due }} at 11:59:59 PDT (UTC-7):
<th>Time</th>
</tr>
{% for s in submissions %}
- <tr>
+ <tr{% if s.user.is_staff %} class="staff"{% endif %}>
<td>{{ s.user }}</td>
<td>
{% if staff %}
diff --git a/static/style.css b/static/style.css
index e918c8c..0c37846 100644
--- a/static/style.css
+++ b/static/style.css
@@ -9,3 +9,6 @@ table#lab {
border: 1px solid #000;
padding: 5px;
}
+#lab tr.staff td {
+ background-color: #ddd;
+}