.
This commit is contained in:
@@ -29,7 +29,7 @@ class UserAnswerSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class RapidSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Rapid
|
||||
fields = ('id', 'question', 'normal', "abnormality", "region", "examination", "exams", "author", "open_access")
|
||||
fields = ('id', 'question', 'normal', "abnormality", "region", "laterality", "examination", "exams", "author", "open_access")
|
||||
view_name = "rapid-detail"
|
||||
|
||||
class RapidLateralitySerializer(serializers.ModelSerializer):
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
</div>
|
||||
|
||||
<p class="pre-whitespace"><b>Rapid:</b> {{ question }}</p>
|
||||
<p class="pre-whitespace"><b>Normal:</b> {{ question.normal }} <button id="toggle-normal-button">toggle</button></p>
|
||||
<p class="pre-whitespace"><b>Region:</b> {{ question.get_regions }}</p>
|
||||
<p class="pre-whitespace"><b>Examination:</b> {{ question.get_examinations }}</p>
|
||||
<p class="pre-whitespace"><b>Laterality:</b> {{ question.laterality }}</p>
|
||||
@@ -83,6 +84,16 @@
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#toggle-normal-button").click(function(){
|
||||
$.ajax({url: "{% url 'rapid-detail' question.id %}",
|
||||
type: 'PATCH', timeout: 3000, data: { normal: {{question.normal|filter}} }
|
||||
})
|
||||
.fail(function(){
|
||||
alert('Error updating this model instance.');
|
||||
//chk_status_field.prop('checked', !chk_status_field.prop('checked'));
|
||||
});
|
||||
});
|
||||
|
||||
$(".suggested_answers li").each((n, el) => {
|
||||
$(el).append($("<span class='correct'>[Add Correct]</span>").on("click", function () {
|
||||
$.ajax({
|
||||
|
||||
Reference in New Issue
Block a user