Merge branch 'master' of ssh://161.35.163.87:/home/django/rad
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
|
||||
{% extends 'rapids/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
CID: {{ciduseranswer.cid}}
|
||||
|
||||
<h3>Question</h3>
|
||||
{{ciduseranswer.question}}
|
||||
|
||||
<h3>Answers</h3>
|
||||
{{ciduseranswer.model_observations}}<br/>
|
||||
{{ciduseranswer.model_interpretation}}<br/>
|
||||
{{ciduseranswer.model_principle_diagnosis}}<br/>
|
||||
{{ciduseranswer.model_differential_diagnosis}}<br/>
|
||||
{{ciduseranswer.model_management}}<br/>
|
||||
|
||||
|
||||
|
||||
{% endblock content %}
|
||||
@@ -62,6 +62,8 @@
|
||||
</div>
|
||||
<a href="{% url 'longs:exam_json' pk=exam.pk %}">JSON</a>
|
||||
<a href="{% url 'longs:exam_json_recreate' pk=exam.pk %}">Refresh JSON cache</a>
|
||||
<a href="{% url 'longs:refresh_exam_question_json' pk=exam.pk %}">Refresh Question JSON cache</a>
|
||||
|
||||
<button id='button-open-access'>Make questions open access</button>
|
||||
<button id='button-closed-access'>Make questions closed access</button>
|
||||
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
<div id="stats-block">
|
||||
<h3>Stats</h3>
|
||||
Candidates: {{cids|length}}<br />
|
||||
Max score: {{max_score}}<br/>
|
||||
Max score: {{max_score}}<br />
|
||||
Mean: {{mean}}, Median {{median}}, Mode {{mode}}
|
||||
|
||||
|
||||
<div id="stats-plot">{{plot|safe}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<div class="col-sm-4">
|
||||
<table class="table table-dark table-striped table-hover table-sm">
|
||||
<tr>
|
||||
<th>Candidate ID</th>
|
||||
<th>Score</th>
|
||||
@@ -35,30 +35,32 @@
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Answers as a table</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Candidate</th>
|
||||
{% for cid in cids %}
|
||||
<th>{{cid}}</th>
|
||||
{% endfor %}
|
||||
<div class="col">
|
||||
<h3>Results as a table</h3>
|
||||
<table class="longs table table-dark table-striped table-hover table-sm">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Candidate</th>
|
||||
{% for cid in cids %}
|
||||
<th>{{cid}}</th>
|
||||
{% endfor %}
|
||||
|
||||
</tr>
|
||||
{% for question in questions %}
|
||||
<tr>
|
||||
<td>Question {{forloop.counter}}</td>
|
||||
{% for ans, score in by_question|get_item:question %}
|
||||
<td class="user-answer-score-{{score}}" title="answer score: {{score}}">{{score}}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for question in questions %}
|
||||
<tr>
|
||||
<td>Question {{forloop.counter}}</td>
|
||||
{% for ans, score in by_question|get_item:question %}
|
||||
<td class="user-answer-score-{{score}}" title="answer score: {{score}}">{{score}}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td>Score:</td>
|
||||
{% for score in user_scores_list %}
|
||||
<td>{{score}}</td>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<tr>
|
||||
<td>Score:</td>
|
||||
{% for score in user_scores_list %}
|
||||
<td>{{score}}</td>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
{% extends 'longs/base.html' %}
|
||||
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block css %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="view-filter-options">
|
||||
<h3>Filter Long </h3>
|
||||
<form action="" method="get">
|
||||
{{ filter.form }}
|
||||
<input class="btn btn-primary btn-sm mt-1 mb-1" type="submit" />
|
||||
</form>
|
||||
</div>
|
||||
<button id="delete-all-button">Delete all</button>
|
||||
{% render_table table %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
//$("thead input:checked").each((n, el) => {
|
||||
|
||||
answer_ids = [];
|
||||
$("tbody input:checked").each((n, el) => {
|
||||
answer_ids.push(el.value);
|
||||
})
|
||||
$("#delete-all-button").on("click", function () {
|
||||
$.ajax({
|
||||
url: "{% url 'longs:user_answer_delete_multiple' %}",
|
||||
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>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user