summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authorprathamesh2020-04-02 16:33:20 +0530
committerprathamesh2020-04-02 16:53:00 +0530
commit2e360f7d5772c3059a42db8915530cde952a01c6 (patch)
treef253fc25a4f449dda1fa7bcfccb816ecf119cb29 /yaksh/forms.py
parent61abccdcb0b0a44f4db60e3bb4d09d1ec5dc50e3 (diff)
downloadonline_test-2e360f7d5772c3059a42db8915530cde952a01c6.tar.gz
online_test-2e360f7d5772c3059a42db8915530cde952a01c6.tar.bz2
online_test-2e360f7d5772c3059a42db8915530cde952a01c6.zip
Show prettified R error messages and fix filter
R language available in filter form. Values taken from models. R messages are prettified like python assertion messages. Text up to first colon in the R error message removed, as it is simply a filename or unwanted text.
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py24
1 files changed, 3 insertions, 21 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index c0f40ea..52ef75d 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -1,7 +1,7 @@
from django import forms
from yaksh.models import (
get_model_class, Profile, Quiz, Question, Course, QuestionPaper, Lesson,
- LearningModule, TestCase
+ LearningModule, TestCase, languages, question_types
)
from grades.models import GradingSystem
from django.contrib.auth import authenticate
@@ -17,27 +17,9 @@ from string import punctuation, digits
import pytz
from .send_emails import generate_activation_key
-languages = (
- ("select", "Select Language"),
- ("python", "Python"),
- ("bash", "Bash"),
- ("c", "C Language"),
- ("cpp", "C++ Language"),
- ("java", "Java Language"),
- ("scilab", "Scilab"),
-)
+languages = (("select", "Select Language"),) + languages
-question_types = (
- ("select", "Select Question Type"),
- ("mcq", "Multiple Choice"),
- ("mcc", "Multiple Correct Choices"),
- ("code", "Code"),
- ("upload", "Assignment Upload"),
- ("integer", "Answer in Integer"),
- ("string", "Answer in String"),
- ("float", "Answer in Float"),
- ("arrange", "Arrange in Correct Order"),
-)
+question_types = (("select", "Select Question Type"),) + question_types
test_case_types = (
("standardtestcase", "Standard Testcase"),