add markers to exams (move away from group based to content based permissions)
This commit is contained in:
@@ -185,6 +185,17 @@ class ExamAuthorFormMixin(ModelForm):
|
||||
widget=FilteredSelectMultiple(verbose_name="Authors", is_stacked=False),
|
||||
)
|
||||
|
||||
class ExamMarkerFormMixin(ModelForm):
|
||||
class Meta:
|
||||
fields = ["markers"]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
ModelForm.__init__(self, *args, **kwargs)
|
||||
self.fields["markers"] = ModelMultipleChoiceField(
|
||||
queryset=User.objects.all(),
|
||||
widget=FilteredSelectMultiple(verbose_name="Markers", is_stacked=False),
|
||||
)
|
||||
|
||||
|
||||
class ExaminationForm(ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
\ <a href="{% url exam.get_app_name|add:':exam_delete' exam.id %}" title="Delete the Exam">Delete</a>
|
||||
\ <a href="{% url exam.get_app_name|add:':exam_clone' exam.id %}" title="Clone the Exam">Clone</a>
|
||||
\ <a href="{% url exam.get_app_name|add:':exam_authors' exam.id %}" title="Edit Exam Authors">Authors</a>
|
||||
\ <a href="{% url exam.get_app_name|add:':exam_markers' exam.id %}" title="Edit Exam Markers">Markers</a>
|
||||
{% endif %}
|
||||
{% if can_edit and request.user.is_superuser %}
|
||||
\
|
||||
|
||||
Reference in New Issue
Block a user