Skip to content
Snippets Groups Projects
Commit 106f5262 authored by Martin Mareš's avatar Martin Mareš
Browse files

Merge branch 'anonymous-grading' into 'master'

Anonymní opravování

Closes #15

See merge request mj/owl!4
parents 54362820 283554fa
No related branches found
No related tags found
1 merge request!4Anonymní opravování
......@@ -30,7 +30,8 @@ CREATE TABLE owl_courses (
ident varchar(255) UNIQUE NOT NULL,
name varchar(255) NOT NULL,
enroll_token varchar(255) UNIQUE NOT NULL,
student_grading boolean NOT NULL DEFAULT FALSE
student_grading boolean NOT NULL DEFAULT FALSE,
anon_grading boolean NOT NULL DEFAULT FALSE
);
CREATE TABLE owl_enroll (
......
......@@ -7,7 +7,7 @@
<tr><th>Name<td>{{ g.course.name }}
<tr><th>Enroll token<td><code>{{ g.course.enroll_token }}</code>
<tr><th>Teachers<td>{{ teachers|sort|join(', ') }}
<tr><th>Student grading<td>{{ 'enabled' if g.course.student_grading else 'disabled' }}
<tr><th>Student grading<td>{{ 'enabled' if g.course.student_grading else 'disabled' }}{% if g.course.anon_grading %} (anonymous){% endif %}
</table>
<div class=buttons>
......
......@@ -18,7 +18,12 @@
{% else %}
<td>
{% endif %}
<td>{{ 'yes' if c.student_grading else 'no' }}
<td>
{% if c.student_grading %}
{{ 'anonymous' if c.anon_grading else 'yes' }}
{% else %}
no
{% endif %}
{% endfor %}
</table>
......
......@@ -10,12 +10,17 @@
<h3>Grade {{t.title}}</h3>
<table class=results>
<tr><th class='tbeforehdr'>Full name
<tr><th class='tbeforehdr'>Name
<th>Points
<tr><th class='tbeforehdr'>max.
<td class='pts'>{{ t.max_points if t.max_points != None else "" }}
{% for s in students.values() %}
<tr><td class='tbeforehdr'>{{ s.full_name }}
<tr><td class='tbeforehdr'>
{% if c.anon_grading and s.uid != g.uid %}
Student {{ s.uid }}
{% else %}
{{ s.full_name }}
{% endif %}
{% set sol=solutions[s.uid] %}
{% set cls=[] %}
{% if sol.last_activity == None %}
......
......@@ -40,7 +40,12 @@
{% endif %}
<div id=p{{ p.pid }} class='{{ cls | join(" ") }}'>
<p class=phdr>{{ p.author_name }} —
<p class=phdr>
{%- if g.course.anon_grading and not g.is_teacher and p.author_uid != g.uid and p.author_uid == student_uid -%}
Student {{student_uid}} —
{% else -%}
{{ p.author_name }} —
{% endif -%}
{% if p.modified != None %}
{% set when=p.modified %}
modified
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment