.
This commit is contained in:
+1
-1
@@ -764,7 +764,7 @@ class GenericViewBase:
|
|||||||
def question_user_answers(self, request, pk):
|
def question_user_answers(self, request, pk):
|
||||||
question = get_object_or_404(self.question_object, pk=pk)
|
question = get_object_or_404(self.question_object, pk=pk)
|
||||||
|
|
||||||
answers = self.cid_user_answer_object.objects.filter(question__id=rapid.pk)
|
answers = self.cid_user_answer_object.objects.filter(question__id=question.pk)
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
|
|||||||
@@ -1,19 +1,40 @@
|
|||||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images=""
|
<div id="single-dicom-viewer" class="dicom-viewer" data-images="" data-annotations=''>
|
||||||
data-annotations=''>
|
|
||||||
</div>
|
</div>
|
||||||
<button class="previous-btn">Previous</button>
|
<button class="previous-btn">Previous</button>
|
||||||
<button class="next-btn">Next</button>
|
<button class="next-btn">Next</button>
|
||||||
|
|
||||||
|
|
||||||
{% for id in ids %}
|
{% for id in ids %}
|
||||||
{{id}}
|
{{id}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
data: {
|
||||||
|
csrfmiddlewaretoken: {{csrf_token}},
|
||||||
|
answer_ids: JSON.stringify(answer_ids) // true if checked else false
|
||||||
|
},
|
||||||
|
type: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
})
|
||||||
|
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||||
|
.done(function (data) {
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
if (data.status == "success") {
|
||||||
|
toastr.info('Deleted.')
|
||||||
|
}
|
||||||
|
// show some message according to the response.
|
||||||
|
// For eg. A message box showing that the status has been changed
|
||||||
|
})
|
||||||
|
.always(function () {
|
||||||
|
console.log('[Done]');
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user