more fixes
This commit is contained in:
+3
-3
@@ -181,12 +181,12 @@ class AnatomyQuestion(models.Model):
|
||||
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(
|
||||
[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(
|
||||
[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
|
||||
|
||||
@@ -13,6 +13,10 @@ a, a:link {
|
||||
|
||||
.answer-list {
|
||||
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 {
|
||||
@@ -313,4 +317,4 @@ img.uploading:hover {
|
||||
|
||||
.parent-help .help-text {
|
||||
opacity: 0%;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -28,10 +28,11 @@ class AnatomyQuestionTable(tables.Table):
|
||||
# text='Clone',
|
||||
# args=[A('pk')],
|
||||
# orderable=False)
|
||||
exams = tables.ManyToManyColumn(verbose_name="Exams")
|
||||
|
||||
class Meta:
|
||||
model = AnatomyQuestion
|
||||
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")
|
||||
sequence = ("view", "image")
|
||||
sequence = ("view", "image", "exams")
|
||||
@@ -273,6 +273,7 @@ def loadJsonAnswer(answer):
|
||||
# should never be more than one (famous last words)
|
||||
ans = exiting_answers[0]
|
||||
ans.answer = answer["ans"]
|
||||
ans.full_clean()
|
||||
ans.save()
|
||||
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user