diff options
author | Prabhu Ramachandran | 2017-01-25 09:47:46 +0530 |
---|---|---|
committer | GitHub | 2017-01-25 09:47:46 +0530 |
commit | 35b610d92ca8bdd9a2f160f3ef41faadf9600d73 (patch) | |
tree | 1d45a300f8a4d2863935a40a1008260582ad4b6d /yaksh | |
parent | 6db62cad24e0b7cd9c1a5f354566cc0e9186d1cd (diff) | |
parent | 643321cad6922be48bffc1727473f5885ef73670 (diff) | |
download | online_test-35b610d92ca8bdd9a2f160f3ef41faadf9600d73.tar.gz online_test-35b610d92ca8bdd9a2f160f3ef41faadf9600d73.tar.bz2 online_test-35b610d92ca8bdd9a2f160f3ef41faadf9600d73.zip |
Merge pull request #184 from maheshgudi/mcq_bugfix
Minor view changes
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/models.py | 40 | ||||
-rw-r--r-- | yaksh/templates/yaksh/course_detail.html | 9 | ||||
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/monitor.html | 6 | ||||
-rw-r--r-- | yaksh/templates/yaksh/user_data.html | 23 |
5 files changed, 23 insertions, 57 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 5800ebd..7e0ce16 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -68,43 +68,6 @@ test_status = ( ('completed', 'Completed'), ) -instructions_data = dedent("""\ - <p> - This examination system has been developed with the intention of - making you learn programming and be assessed in an interactive and - fun manner. You will be presented with a series of programming questions - and problems that you will answer online and get immediate - feedback for. - </p> - <p> - Here are some important instructions and rules that you should - understand carefully.</p> - <ul> - <li>For any programming questions, you can submit solutions as many - times as you want without a penalty. You may skip questions - and solve them later.</li> - <li> You <strong>may</strong> use your computer's Python/IPython - shell or an editor to solve the problem and cut/paste the - solution to the web interface. - </li> - <li> <strong>You are not allowed to use any internet resources, - i.e. no google etc.</strong> - </li> - <li> Do not copy or share the questions or answers with anyone - until the exam is complete <strong>for everyone</strong>. - </li> - <li> <strong>All</strong> your attempts at the questions are logged. - Do not try to outsmart and break the testing system. - If you do, we know who you are and we will expel you from the - course. You have been warned. - </li> - </ul> - <p> - We hope you enjoy taking this - exam !!! - </p> - """) - def get_assignment_dir(instance, filename): return '%s/%s/%s' % (instance.user.user, instance.assignmentQuestion.id, filename) @@ -609,7 +572,6 @@ class Quiz(models.Model): end_date_time=timezone.now() + timedelta(176590), duration=30, active=True, attempts_allowed=-1, - instructions=instructions_data, time_between_attempts=0, description='Yaksh Demo quiz', pass_criteria=0, language='Python', prerequisite=None, @@ -1222,7 +1184,7 @@ class StdIOBasedTestCase(TestCase): class McqTestCase(TestCase): - options = models.CharField(max_length=100) + options = models.TextField(default=None) correct = models.BooleanField(default=False) def get_field_value(self): diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html index c54f153..57193fe 100644 --- a/yaksh/templates/yaksh/course_detail.html +++ b/yaksh/templates/yaksh/course_detail.html @@ -8,6 +8,11 @@ <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/course.js"></script> {% endblock %} {% block content %} +<br/> +<div class="pull-right"> + <a class="btn btn-primary" href="{{URL_ROOT}}/exam/manage/toggle_status/{{ course.id }}/">{% if course.active %}Deactivate Course {% else %} Activate Course {% endif %}</a> +</div> +<br/> <div class="row"> <div class="col-md-6"> <center><b><u>Requests</u></b></center><br> @@ -82,7 +87,5 @@ </form> </div> </div> -<div class="pull-right"> - <a class="btn btn-primary" href="{{URL_ROOT}}/exam/manage/toggle_status/{{ course.id }}/">{% if course.active %}Deactivate Course {% else %} Activate Course {% endif %}</a> -</div> + {% endblock %} diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index b2ee7bc..1de9420 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -151,7 +151,7 @@ Status : <b style="color: green;"> Passed </b><br/> {% for ans in answers %} {% if ans.answer.correct %} <div class="panel panel-success"> - <div class="panel-heading">Correct: + <div class="panel-heading">Correct answer: {% else %} <div class="panel panel-danger"> <div class="panel-heading">Error: diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html index 0ad6401..b84f050 100644 --- a/yaksh/templates/yaksh/monitor.html +++ b/yaksh/templates/yaksh/monitor.html @@ -11,10 +11,10 @@ <script type="text/javascript"> $(document).ready(function() { - $("#result-table").tablesorter(); - } -); + $("#result-table").tablesorter({sortList: [[5,1]]}); + }); </script> + {% endblock %} diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 9cc2372..e4b3767 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -84,36 +84,37 @@ User IP address: {{ paper.user_ip }} </div> </div> {% if question.type == "mcq" or question.type == "mcc" %} - {% if "Correct answer" in answers.0.error %} + {% if "Correct answer" in answers.0.error_list %} <div class="panel panel-success"> {% else %} <div class="panel panel-danger"> {% endif %} <div class="panel-heading"> - Autocheck: {{ answers.0.error }} + Autocheck: {{ answers.0.error_list.0 }} </div> <div class="panel-body"> <h5><u>Student answer:</u></h5> - <pre><code>{{forloop.counter}}. {{ answers.0 }}</code></pre> + <pre><code>{{forloop.counter}}. {{ answers.0.answer }}</code></pre> </div> </div> {% else %} <h5>Student answer: </h5> {% for answer in answers %} {% if not answer.skipped %} - {% if answer.correct %} + {% if answer.answer.correct %} <div class="panel panel-success"> + <div class="panel-heading">Correct answer {% else %} <div class="panel panel-danger"> - {% endif %} - <div class="panel-heading"> - {% for error in error %} - <div class="panel-body"> - <pre><code>{{ error }}</code></pre> - </div> + <div class="panel-heading">Error + + {% for error in answer.error_list %} + <div><pre><code>{{ error }}</code></pre></div> {% endfor %} + {% endif %} + </div> - <div class="panel-body"><pre><code>{{ answer.answer.strip }}</code></pre></div> + <div class="panel-body"><pre><code>{{ answer.answer.answer.strip }}</code></pre></div> </div> {% endif %} {% endfor %} |