diff options
author | adityacp | 2018-03-08 11:53:39 +0530 |
---|---|---|
committer | adityacp | 2018-03-08 11:53:39 +0530 |
commit | 02705e4c676750291b6a5c4ea14e2947f29cb6c7 (patch) | |
tree | 9ddb47401e4937abb9d3157e2fe058c744950221 /yaksh/templates | |
parent | 438f8657021981fc7b2e5adbacc13eb332a2e6d3 (diff) | |
download | online_test-02705e4c676750291b6a5c4ea14e2947f29cb6c7.tar.gz online_test-02705e4c676750291b6a5c4ea14e2947f29cb6c7.tar.bz2 online_test-02705e4c676750291b6a5c4ea14e2947f29cb6c7.zip |
Allow to search the questions in design question paper
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/ajax_question_filter.html | 57 | ||||
-rw-r--r-- | yaksh/templates/yaksh/design_questionpaper.html | 38 |
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}}"> <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 1656e2b..c56a955 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 ></a> + <a class="btn btn-primary" id="fixed-next">Next ></a> </div> </div> <!-- /#fixed-questions --> @@ -183,10 +211,10 @@ select </div> <!-- /.row --> <br> <div class="pull-left"> - <a class="btn" id="random-prev">< Previous</a> + <a class="btn btn-primary" id="random-prev">< Previous</a> </div> <div class="pull-right"> - <a class="btn" id="random-next">Next ></a> + <a class="btn btn-primary" id="random-next">Next ></a> </div> </div> <!-- /#random-questions --> @@ -200,7 +228,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">< Previous</a> + <a class="btn btn-primary" id="finish-prev">< Previous</a> </div> </center> </div> <!-- /#finish --> |