.
This commit is contained in:
@@ -813,6 +813,9 @@ class CidUserAnswer(models.Model):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse("longs:user_answer_view", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1077,7 +1077,7 @@ class ExamCreate(RevisionMixin, LoginRequiredMixin, CreateView):
|
|||||||
class ExamClone(ExamCreate):
|
class ExamClone(ExamCreate):
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
old_object = get_object_or_404(Exam, pk=self.kwargs["exam_id"])
|
old_object = get_object_or_404(self.model, pk=self.kwargs["exam_id"])
|
||||||
initial_data = model_to_dict(old_object, exclude=["id"])
|
initial_data = model_to_dict(old_object, exclude=["id"])
|
||||||
|
|
||||||
questions = old_object.exam_questions.all().values_list("id", flat=True)
|
questions = old_object.exam_questions.all().values_list("id", flat=True)
|
||||||
|
|||||||
@@ -590,6 +590,9 @@ class CidUserAnswer(models.Model):
|
|||||||
# s = s.translate(str.maketrans('', '', string.punctuation))
|
# s = s.translate(str.maketrans('', '', string.punctuation))
|
||||||
# return s
|
# return s
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse("rapids:user_answer_view", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
def get_answer_score(self):
|
def get_answer_score(self):
|
||||||
q = self.question
|
q = self.question
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user