.
This commit is contained in:
@@ -32,7 +32,8 @@
|
||||
<p><b>Scrapped:</b> {{ question.scrapped }} <a href="{% url 'rapids:rapid_scrap' pk=question.pk %}">(toggle)</a>
|
||||
<p class="pre-whitespace">
|
||||
Answers (score): {% for answer in question.answers.all %}
|
||||
<span {% if answer.proposed %}class="proposed-answer" data-aid="{{answer.pk}}" data-question-type="rapid" {% endif %}>
|
||||
<span {% if answer.proposed %}class="proposed-answer" data-aid="{{answer.pk}}" data-question-type="rapid"
|
||||
{% endif %}>
|
||||
{{ answer }} ({{answer.status}}),
|
||||
</span>
|
||||
{% endfor %}
|
||||
@@ -84,15 +85,25 @@
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#toggle-normal-button").click(function(){
|
||||
$.ajax({url: "{% url 'rapid-detail' question.id %}",
|
||||
type: 'PATCH', timeout: 3000, data: { normal: {{question.normal|lower}} }
|
||||
})
|
||||
.fail(function(){
|
||||
alert('Error updating this model instance.');
|
||||
//chk_status_field.prop('checked', !chk_status_field.prop('checked'));
|
||||
$("#toggle-normal-button").click(function () {
|
||||
$.ajax({
|
||||
url: "{% url 'rapid-detail' question.id %}",
|
||||
type: 'PATCH',
|
||||
timeout: 3000,
|
||||
data: {
|
||||
normal: {
|
||||
{
|
||||
question.normal | lower
|
||||
}
|
||||
},
|
||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||
}
|
||||
})
|
||||
.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 () {
|
||||
|
||||
Reference in New Issue
Block a user