.
This commit is contained in:
+14
-1
@@ -24,6 +24,9 @@ from django.http import HttpResponseRedirect, HttpResponse
|
||||
|
||||
from .models import Question, Category, Exam, CidUserAnswer
|
||||
|
||||
from django_tables2 import SingleTableView, SingleTableMixin
|
||||
from django_filters.views import FilterView
|
||||
|
||||
from collections import defaultdict
|
||||
import os
|
||||
import base64
|
||||
@@ -39,6 +42,9 @@ from rest_framework.pagination import PageNumberPagination
|
||||
|
||||
from django.core.exceptions import PermissionDenied
|
||||
|
||||
from .tables import QuestionTable, UserAnswerTable
|
||||
from .filters import QuestionFilter, UserAnswerFilter
|
||||
|
||||
class AuthorOrCheckerRequiredMixin(object):
|
||||
def get_object(self, *args, **kwargs):
|
||||
obj = super().get_object(*args, **kwargs)
|
||||
@@ -348,4 +354,11 @@ def exam_take(request, pk, sk, cid):
|
||||
def loadJsonAnswer(answer):
|
||||
pass
|
||||
|
||||
SbasExamViews = ExamViews(Exam, Question, "sbas", "sbas", loadJsonAnswer)
|
||||
SbasExamViews = ExamViews(Exam, Question, "sbas", "sbas", loadJsonAnswer)
|
||||
|
||||
class QuestionView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
||||
model = Question
|
||||
table_class = QuestionTable
|
||||
template_name = "anatomy/anatomy_question_view.html"
|
||||
|
||||
filterset_class = QuestionFilter
|
||||
|
||||
Reference in New Issue
Block a user