.
This commit is contained in:
@@ -29,14 +29,14 @@
|
|||||||
<p><b>Checked by:</b> {% for verified in question.verified.all %} <a
|
<p><b>Checked by:</b> {% for verified in question.verified.all %} <a
|
||||||
href="{% url 'rapids:verified_detail' pk=verified.pk %}">{{verified}}</a>, {% endfor %}</p>
|
href="{% url 'rapids:verified_detail' pk=verified.pk %}">{{verified}}</a>, {% endfor %}</p>
|
||||||
<p><b>Scrapped:</b> {{ question.scrapped }} <a href="{% url 'rapids:rapid_scrap' pk=question.pk %}">(toggle)</a>
|
<p><b>Scrapped:</b> {{ question.scrapped }} <a href="{% url 'rapids:rapid_scrap' pk=question.pk %}">(toggle)</a>
|
||||||
<p class="pre-whitespace">
|
<p class="pre-whitespace">
|
||||||
Answers (score): {% for answer in question.answers.all %}
|
Answers (score): {% for answer in question.answers.all %}
|
||||||
<span {% if answer.proposed %}class="proposed-answer" data-aid="{{answer.pk}}" data-question-type="rapid" {%
|
<span {% if answer.proposed %}class="proposed-answer" data-aid="{{answer.pk}}" data-question-type="rapid"
|
||||||
endif %}>
|
{% endif %}>
|
||||||
{{ answer }} ({{answer.status}}),
|
{{ answer }} ({{answer.status}}),
|
||||||
</span>
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
@@ -87,18 +87,18 @@
|
|||||||
$(".suggested_answers li").each((n, el) => {
|
$(".suggested_answers li").each((n, el) => {
|
||||||
$(el).append($("<span class='correct'>[Add Correct]</span>").on("click", function () {
|
$(el).append($("<span class='correct'>[Add Correct]</span>").on("click", function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{% url 'answer_submit' %}",
|
url: "{% url 'answer_submit' %}",
|
||||||
data: {
|
data: {
|
||||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||||
//active: this.checked // true if checked else false
|
//active: this.checked // true if checked else false
|
||||||
question_type: "rapid",
|
question_type: "rapid",
|
||||||
qid: "{{question.pk}}",
|
qid: "{{question.pk}}",
|
||||||
status: 2,
|
status: 2,
|
||||||
answer: el.dataset.string,
|
answer: el.dataset.string,
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
})
|
})
|
||||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -123,17 +123,17 @@
|
|||||||
// Add button to confirm answer is correct
|
// Add button to confirm answer is correct
|
||||||
$(el).append($("<span class='confirm'>[Add Correct]</span>").on("click", function () {
|
$(el).append($("<span class='confirm'>[Add Correct]</span>").on("click", function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{% url 'answer_suggestion_confirm' %}",
|
url: "{% url 'answer_suggestion_confirm' %}",
|
||||||
data: {
|
data: {
|
||||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||||
//active: this.checked // true if checked else false
|
//active: this.checked // true if checked else false
|
||||||
question_type: "rapid",
|
question_type: "rapid",
|
||||||
aid: el.dataset.aid,
|
aid: el.dataset.aid,
|
||||||
status: 2,
|
status: 2,
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
})
|
})
|
||||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -154,17 +154,17 @@
|
|||||||
// Add button to confirm answer is incorrect
|
// Add button to confirm answer is incorrect
|
||||||
$(el).append($("<span class='confirm'>[Incorrect]</span>").on("click", function () {
|
$(el).append($("<span class='confirm'>[Incorrect]</span>").on("click", function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{% url 'answer_suggestion_confirm' %}",
|
url: "{% url 'answer_suggestion_confirm' %}",
|
||||||
data: {
|
data: {
|
||||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||||
//active: this.checked // true if checked else false
|
//active: this.checked // true if checked else false
|
||||||
question_type: "rapid",
|
question_type: "rapid",
|
||||||
aid: el.dataset.aid,
|
aid: el.dataset.aid,
|
||||||
status: 0,
|
status: 0,
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
})
|
})
|
||||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -183,5 +183,4 @@
|
|||||||
}))
|
}))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user