.
This commit is contained in:
+1
-4
@@ -329,10 +329,7 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
|
|
||||||
@method_decorator(login_required)
|
@method_decorator(login_required)
|
||||||
def index(self, request):
|
def index(self, request):
|
||||||
if self.app_name == "physics":
|
exams = self.Exam.objects.filter(author__id=request.user.id)
|
||||||
exams = self.Exam.objects.all()
|
|
||||||
else:
|
|
||||||
exams = self.Exam.objects.filter(author__id=request.user.id)
|
|
||||||
|
|
||||||
if self.app_name == "rapids" and request.user.groups.filter(name='rapid_checker').exists():
|
if self.app_name == "rapids" and request.user.groups.filter(name='rapid_checker').exists():
|
||||||
exams = self.Exam.objects.all()
|
exams = self.Exam.objects.all()
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ from sortedm2m.fields import SortedManyToManyField
|
|||||||
|
|
||||||
from generic.models import ExamBase
|
from generic.models import ExamBase
|
||||||
|
|
||||||
|
import reversion
|
||||||
|
|
||||||
class Category(models.Model):
|
class Category(models.Model):
|
||||||
category = models.CharField(max_length=200)
|
category = models.CharField(max_length=200)
|
||||||
@@ -126,6 +127,7 @@ class Question(models.Model):
|
|||||||
return (self.a, self.b, self.c, self.d, self.e)
|
return (self.a, self.b, self.c, self.d, self.e)
|
||||||
|
|
||||||
|
|
||||||
|
@reversion.register
|
||||||
class Exam(ExamBase):
|
class Exam(ExamBase):
|
||||||
app_name = "rapids"
|
app_name = "rapids"
|
||||||
|
|
||||||
@@ -141,6 +143,12 @@ class Exam(ExamBase):
|
|||||||
|
|
||||||
recreate_json = None
|
recreate_json = None
|
||||||
|
|
||||||
|
author = models.ManyToManyField(settings.AUTH_USER_MODEL,
|
||||||
|
blank=True,
|
||||||
|
help_text='Author of exam',
|
||||||
|
related_name="rapid_exam_author")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CidUserAnswer(models.Model):
|
class CidUserAnswer(models.Model):
|
||||||
"""User answers by candidate"""
|
"""User answers by candidate"""
|
||||||
|
|||||||
Reference in New Issue
Block a user