summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2016-11-18 09:32:18 +0530
committeradityacp2016-11-18 09:32:18 +0530
commit70c28a87d0768df6d68e7098741c49f68a11ec50 (patch)
treebcda454ce293ff4f08de2aa8d928c5d8614a4c52
parentd3ee68891f96642262c8ec3765f69a3a3f3f39a7 (diff)
downloadonline_test-70c28a87d0768df6d68e7098741c49f68a11ec50.tar.gz
online_test-70c28a87d0768df6d68e7098741c49f68a11ec50.tar.bz2
online_test-70c28a87d0768df6d68e7098741c49f68a11ec50.zip
fixed tooltip and Show files which are not hidden for a question
-rw-r--r--yaksh/static/yaksh/js/course.js24
-rw-r--r--yaksh/static/yaksh/js/question_filter.js8
-rw-r--r--yaksh/templates/yaksh/add_question.html7
-rw-r--r--yaksh/templates/yaksh/question.html9
4 files changed, 26 insertions, 22 deletions
diff --git a/yaksh/static/yaksh/js/course.js b/yaksh/static/yaksh/js/course.js
index 3a21f0d..5b79e68 100644
--- a/yaksh/static/yaksh/js/course.js
+++ b/yaksh/static/yaksh/js/course.js
@@ -1,37 +1,37 @@
$(document).ready(function(){
-$(".checkall").click( function(){
- if($(this).attr("checked")) {
+$(".checkall").change( function(){
+ if($(this).prop("checked")) {
$("#enroll-all input:checkbox").each(function(index, element) {
- $(this).attr('checked', true);
+ $(this).prop('checked', true);
});
}
else {
$("#enroll-all input:checkbox").each(function(index, element) {
- $(this).attr('checked', false);
+ $(this).prop('checked', false);
});
}
});
-$(".enroll").click( function(){
- if($(this).attr("checked")) {
+$(".enroll").change( function(){
+ if($(this).prop("checked")) {
$("#enroll input:checkbox").each(function(index, element) {
- $(this).attr('checked', true);
+ $(this).prop('checked', true);
});
}
else {
$("#enroll input:checkbox").each(function(index, element) {
- $(this).attr('checked', false);
+ $(this).prop('checked', false);
});
}
});
-$(".reject").click( function(){
- if($(this).attr("checked")) {
+$(".reject").change( function(){
+ if($(this).prop("checked")) {
$("#reject input:checkbox").each(function(index, element) {
- $(this).attr('checked', true);
+ $(this).prop('checked', true);
});
}
else {
$("#reject input:checkbox").each(function(index, element) {
- $(this).attr('checked', false);
+ $(this).prop('checked', false);
});
}
});
diff --git a/yaksh/static/yaksh/js/question_filter.js b/yaksh/static/yaksh/js/question_filter.js
index 065b06b..aa3a229 100644
--- a/yaksh/static/yaksh/js/question_filter.js
+++ b/yaksh/static/yaksh/js/question_filter.js
@@ -32,15 +32,15 @@ $(document).ready(function(){
question_filter()
});
- $("#checkall").live("click", function(){
- if($(this).attr("checked")) {
+ $("#checkall").change(function(){
+ if($(this).prop("checked")) {
$("#filtered-questions input:checkbox").each(function(index, element) {
- $(this).attr('checked', true);
+ $(this).prop('checked', true);
});
}
else {
$("#filtered-questions input:checkbox").each(function(index, element) {
- $(this).attr('checked', false);
+ $(this).prop('checked', false);
});
}
});
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index 9822333..e1b05fe 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -27,11 +27,14 @@
<tr><td>Partial Grading: <td>{{ form.partial_grading }}
<tr><td> Test Case Type: <td> {{ form.test_case_type }}{{ form.test_case_type.errors }}
<tr><td> File: <td> {{ upload_form.file_field }}{{ upload_form.file_field.errors }}
- {% if uploaded_files %}<br><b>Uploaded files:</b><br>Check the box to delete or extract files<br>
+ {% if uploaded_files %}<br><b>Uploaded files:</b><br>Check on delete to delete files,
+ extract to extract files and hide to hide files from student(if required)<br>
{% for file in uploaded_files %}
<input type="checkbox" name="clear" value="{{file.id}}">&nbsp;delete</input>&nbsp;
<input type="checkbox" name="extract" value="{{file.id}}" >{% if file.extract %} dont extract{% else %}
- extract{% endif %}</input><br>
+ extract{% endif %}</input>&nbsp;&nbsp;
+ <input type="checkbox" name="hide" value="{{file.id}}" >{% if file.hide %} show{% else %}
+ hide{% endif %}</input><br>
<a href="{{file.file.url}}">{{ file.file.name }}</a>
<br>
{% endfor %}{% endif %}
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index bfb235b..74ac786 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -107,9 +107,12 @@ function call_skip(url)
{% for qid in paper.questions.all %}
{% if qid in paper.questions_unanswered.all %}
{% if qid.id == question.id %}
- <li class="active"><a href="#"data-toggle="tooltip" title="{{ qid.description }}" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li>
+ <li class="active"><a href="#"data-toggle="tooltip"
+ title="{{ qid.description|striptags }}"
+ onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li>
{% else %}
- <li><a href="#" data-toggle="tooltip" title="{{ qid.description }}" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li>
+ <li><a href="#" data-toggle="tooltip" title="{{ qid.description|striptags }}"
+ onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li>
{% endif %}
{% endif %}
{% if qid in paper.questions_answered.all %}
@@ -152,9 +155,7 @@ function call_skip(url)
{% if files %}
<h4>Files to download for this question</h4>
{% for f_name in files %}
- {% if f_name.question_id == question.id %}
<h5><a href="{{f_name.file.url}}">{{f_name.file.name}}</a></h5>
- {% endif %}
{% endfor %}
{% endif %}
</div>