summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorKing2018-07-12 02:29:40 -0700
committerGitHub2018-07-12 02:29:40 -0700
commita850749942d163f9aedb19a1d19c4b8d7016745d (patch)
tree9b93d232ad093f595a5e62d22f5d2a6af9629602 /yaksh/templates
parente3ad85ace916354ab96b23c1359ee72a6c2a740b (diff)
parent0e2910668a8b2c79dd422cd49813e263f117b00d (diff)
downloadonline_test-a850749942d163f9aedb19a1d19c4b8d7016745d.tar.gz
online_test-a850749942d163f9aedb19a1d19c4b8d7016745d.tar.bz2
online_test-a850749942d163f9aedb19a1d19c4b8d7016745d.zip
Merge pull request #489 from adityacp/search_tags_in_design_qp
Get questions using tags during question paper setup
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/ajax_question_filter.html57
-rw-r--r--yaksh/templates/yaksh/design_questionpaper.html38
2 files changed, 78 insertions, 17 deletions
diff --git a/yaksh/templates/yaksh/ajax_question_filter.html b/yaksh/templates/yaksh/ajax_question_filter.html
index a63354c..ea0d0b5 100644
--- a/yaksh/templates/yaksh/ajax_question_filter.html
+++ b/yaksh/templates/yaksh/ajax_question_filter.html
@@ -1,16 +1,49 @@
<div id="questions">
+ <script>
+ $(document).ready(function(){
+ $("#checkall").change(function(){
+ if($(this).prop("checked")) {
+ $("#filtered-questions input:checkbox").each(function(index, element) {
+ $(this).prop('checked', true);
+ });
+ }
+ else {
+ $("#filtered-questions input:checkbox").each(function(index, element) {
+ $(this).prop('checked', false);
+ });
+ }
+ });
+ });
+ </script>
{% if questions %}
- <h5 class="highlight"><input type="checkbox" id="checkall" class="ignore"> Select All </h5>
+ <h5 class="highlight"><input type="checkbox" id="checkall">
+ Select All
+ </h5>
+ <ul class="inputs-list">
+ <table id="questions-table" class="tablesorter table table table-striped">
+ <thead>
+ <tr>
+ <th> Select </th>
+ <th> Summary </th>
+ <th> Language </th>
+ <th> Type </th>
+ <th> Marks </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for question in questions %}
+ <tr>
+ <td>
+ <input type="checkbox" name="question" value="{{ question.id }}">
+ </td>
+ <td><a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}">{{question.summary|capfirst}}</a></td>
+ <td>{{question.language|capfirst}}</td>
+ <td>{{question.type|capfirst}}</td>
+ <td>{{question.points}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </ul>
{% endif %}
- <ul class="inputs-list">
-
- {% for question in questions %}
- <li>
- <label>
- <input type="checkbox" name="question" data-qid="{{question.id}}" value=
- "{{question.id}}">&nbsp;&nbsp;<a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}">{{ question }}</a><br>
- </label>
- </li>
- {% endfor %}
- </ul>
</div>
diff --git a/yaksh/templates/yaksh/design_questionpaper.html b/yaksh/templates/yaksh/design_questionpaper.html
index d982d27..7e6d5c0 100644
--- a/yaksh/templates/yaksh/design_questionpaper.html
+++ b/yaksh/templates/yaksh/design_questionpaper.html
@@ -68,8 +68,36 @@ select
</div>
</div> <!-- /.row -->
<br><br>
-
+ {% csrf_token %}
<div class="tab-pane active" id="fixed-questions">
+ <h4 style="padding-left: 20px;">Or</h4>
+ <!-- Search questions using tags -->
+ <h4 style="padding-left: 20px;">Search using Tags: </h4>
+ <div class="col-md-14">
+ <div class="input-group">
+ <span class="input-group-addon" id="basic-addon1">Search Questions </span>
+ <input type="text" id="question_tags" name="question_tags" class="form-control"
+ placeholder="Search using comma separated Tags">
+ <span class="input-group-btn">
+ <button class="btn btn-default" type="submit">Search</button>
+ </span>
+ <div class="col-md-6">
+ <select class="form-control" id="sel1" onchange="append_tag(this);">
+ {% if all_tags %}
+ <option value="" disabled selected>Available Tags</option>
+ {% for tag in all_tags %}
+ <option>
+ {{tag}}
+ </option>
+ {% endfor %}
+ {% else %}
+ <option value="" disabled selected>No Available Tags</option>
+ {% endif %}
+ </select>
+ </div>
+ </div>
+ </div>
+ <br><br>
<div class="row">
<div class="col-md-6">
<div id="fixed-available-wrapper">
@@ -116,7 +144,7 @@ select
</div> <!-- /.row -->
<br>
<div class="pull-right">
- <a class="btn" id="fixed-next">Next &gt;</a>
+ <a class="btn btn-primary" id="fixed-next">Next &gt;</a>
</div>
</div> <!-- /#fixed-questions -->
@@ -183,10 +211,10 @@ select
</div> <!-- /.row -->
<br>
<div class="pull-left">
- <a class="btn" id="random-prev">&lt; Previous</a>
+ <a class="btn btn-primary" id="random-prev">&lt; Previous</a>
</div>
<div class="pull-right">
- <a class="btn" id="random-next">Next &gt;</a>
+ <a class="btn btn-primary" id="random-next">Next &gt;</a>
</div>
</div> <!-- /#random-questions -->
@@ -204,7 +232,7 @@ select
<input class ="btn primary large" type="submit" name="save" id="save" value="Save question paper">
<br>
<div class="pull-left">
- <a class="btn" id="finish-prev">&lt; Previous</a>
+ <a class="btn btn-primary" id="finish-prev">&lt; Previous</a>
</div>
</center>
</div> <!-- /#finish -->