Enhance image display in mark_answer.html and add remote URL to context in mark_answer view for improved layout and functionality

This commit is contained in:
Ross
2025-09-08 11:25:28 +01:00
parent 9ed8fd90b3
commit 6b1db6b3c5
4 changed files with 12 additions and 4 deletions
+5
View File
@@ -1409,3 +1409,8 @@ span#user-id {
background-color: #b3d7ff !important;
color: #333;
}
.image-block {
min-width: 100px;
display: inline-block;
}
+2
View File
@@ -287,6 +287,8 @@ class Question(QuestionBase):
return json
class QuestionImage(models.Model):
question = models.ForeignKey(
Question, related_name="images", on_delete=models.CASCADE
+4 -4
View File
@@ -187,11 +187,11 @@
<p class="pre-whitespace mb-2"><b>Abnormality:</b> {{ question.get_abnormalities }}</p>
<div class="pre-whitespace multi-image-block mb-2"><b>Images:</b>
<div class="row">
<div class="col-md-4 mb-2 w-auto">
{% for image in question.images.all %}
<div class="col-md-4 mb-2">
<div class="card h-100 bg-dark text-light border-secondary">
<div class="card h-100 w-auto bg-dark text-light border-secondary">
<div class="card-body p-2">
<span class="image-block">
<span class="image-block" style="">
<strong>Image {{ forloop.counter }}</strong>
{% if image.description %} ({{image.description}}){% endif %}
{% if image.feedback_image %}
@@ -202,8 +202,8 @@
</span>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<p class="pre-whitespace mb-0"><b>Feedback:</b> {{ question.feedback }}</p>
+1
View File
@@ -545,6 +545,7 @@ def mark_answer(request, exam_id, question_number, answer_id, override=False):
"previous_answer_id": previous_answer_id,
"next_answer_id": next_answer_id,
"answer_id": answer_id,
"remote_url": settings.REMOTE_URL,
},
)