more fixes

This commit is contained in:
Ross
2020-12-12 12:19:25 +00:00
parent fdca107d16
commit 5ca4438e77
4 changed files with 12 additions and 6 deletions
+3 -3
View File
@@ -181,12 +181,12 @@ class AnatomyQuestion(models.Model):
if i.status != i.MarkOptions.UNMARKED if i.status != i.MarkOptions.UNMARKED
] ]
) )
correct_answers = set([i.answer.lower() for i in self.answers.all()]) correct_answers = set([i.answer.get_compare_string() for i in self.answers.all()])
half_mark_answers = set( half_mark_answers = set(
[i.answer.lower() for i in self.half_mark_answers.all()] [i.answer.get_compare_string() for i in self.half_mark_answers.all()]
) )
incorrect_answers = set( incorrect_answers = set(
[i.answer.lower() for i in self.incorrect_answers.all()] [i.answer.get_compare_string() for i in self.incorrect_answers.all()]
) )
marked_answers = correct_answers | half_mark_answers | incorrect_answers marked_answers = correct_answers | half_mark_answers | incorrect_answers
+4
View File
@@ -13,6 +13,10 @@ a, a:link {
.answer-list { .answer-list {
font-size: 30px; font-size: 30px;
user-select: none;
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */
} }
.answer-list .correct { .answer-list .correct {
+3 -2
View File
@@ -28,10 +28,11 @@ class AnatomyQuestionTable(tables.Table):
# text='Clone', # text='Clone',
# args=[A('pk')], # args=[A('pk')],
# orderable=False) # orderable=False)
exams = tables.ManyToManyColumn(verbose_name="Exams")
class Meta: class Meta:
model = AnatomyQuestion model = AnatomyQuestion
template_name = "django_tables2/bootstrap4.html" template_name = "django_tables2/bootstrap4.html"
fields = ("question_type", "exams", "description", "examination", "modality", "region", fields = ("question_type", "description", "examination", "modality", "region",
"body_part", "created_date", "open_access", "author") "body_part", "created_date", "open_access", "author")
sequence = ("view", "image") sequence = ("view", "image", "exams")
+1
View File
@@ -273,6 +273,7 @@ def loadJsonAnswer(answer):
# should never be more than one (famous last words) # should never be more than one (famous last words)
ans = exiting_answers[0] ans = exiting_answers[0]
ans.answer = answer["ans"] ans.answer = answer["ans"]
ans.full_clean()
ans.save() ans.save()
return True return True