summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/code_evaluator.py4
-rw-r--r--yaksh/models.py4
-rw-r--r--yaksh/templates/yaksh/user_data.html2
3 files changed, 3 insertions, 7 deletions
diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py
index fda0a8d..b39a1d7 100644
--- a/yaksh/code_evaluator.py
+++ b/yaksh/code_evaluator.py
@@ -86,10 +86,10 @@ class CodeEvaluator(object):
"""
self.setup()
- success, error, marks = self.safe_evaluate(**kwargs)
+ success, error, weightage = self.safe_evaluate(**kwargs)
self.teardown()
- result = {'success': success, 'error': error, 'marks': marks}
+ result = {'success': success, 'error': error, 'weightage': weightage}
return result
# Private Protocol ##########
diff --git a/yaksh/models.py b/yaksh/models.py
index 05528c7..bdcc43e 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -1090,14 +1090,10 @@ class AnswerPaper(models.Model):
user_answer.marks = (question.points * result['weightage'] /
question.get_maximum_test_case_weightage()) \
if question.partial_grading and question.type == 'code' else question.points
- # user_answer.marks = question.points * result['weightage'] \
- # if question.partial_grading and question.type == 'code' else question.points
else:
user_answer.marks = (question.points * result['weightage'] /
question.get_maximum_test_case_weightage()) \
if question.partial_grading and question.type == 'code' else 0
- # user_answer.marks = question.points * result['weightage'] \
- # if question.partial_grading and question.type == 'code' else 0
user_answer.save()
self.update_marks('completed')
return True, msg
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index 0a7e4aa..378e7fd 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -94,7 +94,7 @@ User IP address: {{ paper.user_ip }}
<h5>Student answer: </h5>
{% for answer in answers %}
{% if not answer.skipped %}
- {% if "Correct answer" in answer.error %}
+ {% if answer.correct %}
<div class="panel panel-success">
{% else %}
<div class="panel panel-danger">