Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quiz submission limit and Per Student Overrides #76

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

JasonGrace2282
Copy link
Member

@JasonGrace2282 JasonGrace2282 commented Aug 21, 2024

This PR

  • adds an optional limit to the amount of submissions on a assignment
  • allows for a different limit after the assignment is due
  • allows per student overrides for specific pieces of data on the Assignment model
  • adds tests to verify behavior

It adds two new views:

  • Manage Students: allows for a listing of students in the course and a button to manage their individual overrides. Accessible from Manage Students in the assignments show view.
  • Manage a specific student: form view for AssignmentOverride.

TODO

  • Implement the feature
  • Add tests
  • Add more tests (I don't trust myself)
  • Improve form CSS

tin/apps/assignments/models.py Outdated Show resolved Hide resolved
tin/templates/assignments/show.html Outdated Show resolved Hide resolved
@JasonGrace2282 JasonGrace2282 marked this pull request as draft September 1, 2024 23:28
First draft of allowing two submission caps for before and after a due date
@JasonGrace2282 JasonGrace2282 marked this pull request as ready for review September 4, 2024 02:16
Copy link
Member

@krishnans2006 krishnans2006 left a comment

Choose a reason for hiding this comment

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

Nice feature! Here are some initial "gut reaction" questions/comments for you to consider:

tin/apps/assignments/admin.py Outdated Show resolved Hide resolved
)
submission_cap_after_due = models.PositiveSmallIntegerField(
null=True,
validators=[MinValueValidator(1)],
Copy link
Member

Choose a reason for hiding this comment

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

Why can't the after-due-date-cap be zero? Seems like a logical use of the feature...

tin/apps/assignments/models.py Outdated Show resolved Hide resolved
submission_cap_after_due = models.PositiveSmallIntegerField(
null=True,
validators=[MinValueValidator(1)],
)
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to have default values (e.g. 15 and 0) for both caps at the assignment level - this would also improve validation logic and make it consistent with validation for stuff like quiz action and grader timeout

on_delete=models.CASCADE,
)

submission_cap = models.PositiveSmallIntegerField()
Copy link
Member

Choose a reason for hiding this comment

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

Why can only one of the caps be overridden at the student level? Seems like it could be useful to change the post-due-date-cap on a per-student basis as well (to let someone submit late, for example)

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe it would be better to have a SubmissionCap model, and two foreignkeys to that model 🤔 that would solve most limitations.

"<int:assignment_id>/manage_students/<int:student_id>",
views.manage_student,
name="create_student_override",
),
Copy link
Member

Choose a reason for hiding this comment

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

I think assignments/X/students/ would be better than assignments/X/manage_students/

@@ -535,6 +585,8 @@ def submit_view(request, assignment_id):
raise http.Http404

student = request.user
if not assignment.within_submission_limit(student):
return http.HttpResponseForbidden("Submission limit exceeded")
Copy link
Member

Choose a reason for hiding this comment

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

The 403 for exceeding the limit seems harsh - maybe an error message would be nicer?

Copy link
Member Author

@JasonGrace2282 JasonGrace2282 Jan 9, 2025

Choose a reason for hiding this comment

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

In theory, they shouldn't be able to even get to that screen without attempting to POST that URL or manualy entering the url.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but I figured there's a possibility that someone has Tin open on two devices (e.g. phone, pc). So, they would submit until they reach the cap on pc, forget about it, then open the page and submit on phone.

Very obscure/rare scenario and it's probably too much effort to fix the way I described, but probably replacing it with a redirect to the assignment page would be a better solution.

@@ -150,23 +150,26 @@ ul.no-list {
ul#course-list,
ul#assignment-list,
ul#venv-list,
ul#archive-list {
ul#archive-list,
ul.linebreak-list {
Copy link
Member

Choose a reason for hiding this comment

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

You should use #linebreak-list instead, I don't see why a class is necessary

{% extends "base.html" %}

{% block main %}
<h2>Managing Student {{ user.username }}</h2>
Copy link
Member

Choose a reason for hiding this comment

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

Also, consider showing the default (assignment level) caps on this page, styled in a way that it helps teachers compare

@@ -36,6 +36,7 @@ <h2 class="left">{% if assignment.is_quiz %}[QUIZ] {% endif %}{{ assignment.name
<a class="right tin-btn" href="{% url 'assignments:manage_grader' assignment.id %}" style="color:#EF1010;">Upload grader</a>
{% endif %}
<a class="right tin-btn" href="{% url 'assignments:manage_files' assignment.id %}">Manage files</a>
<a class="right tin-btn" href="{% url 'assignments:manage_students' assignment.id %}">Manage Students</a>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<a class="right tin-btn" href="{% url 'assignments:manage_students' assignment.id %}">Manage Students</a>
<a class="right tin-btn" href="{% url 'assignments:manage_students' assignment.id %}">Manage students</a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants