improve exam group management
This commit is contained in:
+5
-1
@@ -8,7 +8,7 @@ from django.forms import (
|
||||
CharField,
|
||||
)
|
||||
from django.forms import inlineformset_factory
|
||||
from generic.forms import ExamAuthorFormMixin, ExamFormMixin, ExamMarkerFormMixin
|
||||
from generic.forms import ExamAuthorFormMixin, ExamFormMixin, ExamGroupsFormMixin, ExamMarkerFormMixin
|
||||
|
||||
from longs.models import (
|
||||
# Examination,
|
||||
@@ -318,3 +318,7 @@ class ExamAuthorForm(ExamAuthorFormMixin):
|
||||
class ExamMarkerForm(ExamMarkerFormMixin):
|
||||
class Meta(ExamMarkerFormMixin.Meta):
|
||||
model = Exam
|
||||
|
||||
class ExamGroupsForm(ExamGroupsFormMixin):
|
||||
class Meta(ExamGroupsFormMixin.Meta):
|
||||
model = Exam
|
||||
@@ -83,6 +83,7 @@ urlpatterns = [
|
||||
name="mark",
|
||||
),
|
||||
path("exam/<int:pk>/markers", views.ExamMarkersUpdate.as_view(), name="exam_markers"),
|
||||
path("exam/<int:pk>/groups", views.ExamGroupsUpdate.as_view(), name="exam_groups_edit"),
|
||||
path("exam/<int:pk>/authors", views.ExamAuthorUpdate.as_view(), name="exam_authors"),
|
||||
path(
|
||||
"exam/<int:pk>/question_json_refresh",
|
||||
|
||||
@@ -26,6 +26,7 @@ from django.http import HttpResponseRedirect, HttpResponse
|
||||
|
||||
from .forms import (
|
||||
ExamAuthorForm,
|
||||
ExamGroupsForm,
|
||||
ExamMarkerForm,
|
||||
LongForm,
|
||||
LongSeriesForm,
|
||||
@@ -81,6 +82,7 @@ from generic.views import (
|
||||
ExamCloneMixin,
|
||||
ExamCreateBase,
|
||||
ExamDeleteBase,
|
||||
ExamGroupsUpdateBase,
|
||||
ExamUpdateBase,
|
||||
ExamViews,
|
||||
SeriesImagesZipViewBase,
|
||||
@@ -991,6 +993,10 @@ class ExamMarkersUpdate(
|
||||
|
||||
template_name = "markers_form.html"
|
||||
|
||||
class ExamGroupsUpdate(ExamGroupsUpdateBase):
|
||||
model = Exam
|
||||
form_class = ExamGroupsForm
|
||||
|
||||
|
||||
# class ExamViewSet(RevisionMixin, viewsets.ModelViewSet):
|
||||
# queryset = Exam.objects.all().order_by("name")
|
||||
|
||||
Reference in New Issue
Block a user