Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions interface/migrations/0025_auto_20210310_2056.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.1.2 on 2021-03-10 18:56

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('interface', '0024_auto_20210124_1829'),
]

operations = [
migrations.AddField(
model_name='assignment',
name='assignment_on',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='historicalassignment',
name='assignment_on',
field=models.BooleanField(default=False),
),
]
1 change: 1 addition & 0 deletions interface/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_default_vm_info():
history = HistoricalRecords()
hidden_score = models.BooleanField(default=True)
hide = models.BooleanField(null=False, default=False)
assignment_on = models.BooleanField(null=False, default=False)

def clean(self):
penalty_weights = self.penalty_info["penalty_weights"]
Expand Down
2 changes: 1 addition & 1 deletion interface/templates/interface/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{% for assignment in assignments %}
<li>
{{ assignment.name }}:
{% if assignment.is_active %}
{% if assignment.is_active and assignment.assignment_on or assignment.is_active and user in assignment.course.teaching_assistants.all %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not be enough just to hide the upload button. Students could still find the url to the upload page for this assignment and use it. A check in the upload view is still necessary

<a href="{% url 'upload' assignment.course.pk assignment.pk %}">Upload</a>,
{% endif %}
<a href="{% url 'subs_for_assignment' assignment.course.pk assignment.pk %}">Results</a>
Expand Down