diff options
author | Shelsy | 2018-07-05 18:49:06 +0530 |
---|---|---|
committer | ankitjavalkar | 2018-09-26 12:57:10 +0530 |
commit | ba6aa2c51faca1ad6dec8395f05648567e1fdef5 (patch) | |
tree | 6a1ddd0069cb1f7b2f6cccfa226aab9635c024a3 /yaksh/views.py | |
parent | 1df7a82f2263e3d4746ea5ad093937705fd15806 (diff) | |
download | online_test-ba6aa2c51faca1ad6dec8395f05648567e1fdef5.tar.gz online_test-ba6aa2c51faca1ad6dec8395f05648567e1fdef5.tar.bz2 online_test-ba6aa2c51faca1ad6dec8395f05648567e1fdef5.zip |
Add templatetag to get question numbers by type
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 1bb335c..5c3ba93 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -28,10 +28,12 @@ import re # Local imports. from yaksh.code_server import get_result as get_result_from_code_server from yaksh.models import ( - Answer, AnswerPaper, AssignmentUpload, Course, FileUpload, Profile, - QuestionPaper, QuestionSet, Quiz, Question, TestCase, User, - FIXTURES_DIR_PATH, MOD_GROUP_NAME, Lesson, LessonFile, LearningUnit, - LearningModule, CourseStatus + Answer, AnswerPaper, AssignmentUpload, Course, FileUpload, FloatTestCase, + HookTestCase, IntegerTestCase, McqTestCase, Profile, + QuestionPaper, QuestionSet, Quiz, Question, StandardTestCase, + StdIOBasedTestCase, StringTestCase, TestCase, User, + get_model_class, FIXTURES_DIR_PATH, MOD_GROUP_NAME, Lesson, LessonFile, + LearningUnit, LearningModule, CourseStatus, question_types ) from yaksh.forms import ( UserRegisterForm, UserLoginForm, QuizForm, QuestionForm, @@ -613,6 +615,7 @@ def show_question(request, question, paper, error_message=None, course = Course.objects.get(id=course_id) module = course.learning_module.get(id=module_id) all_modules = course.get_learning_modules() + all_question_types = [types[0] for types in question_types] context = { 'question': question, 'paper': paper, @@ -627,7 +630,8 @@ def show_question(request, question, paper, error_message=None, 'can_skip': can_skip, 'delay_time': delay_time, 'quiz_type': quiz_type, - 'all_modules': all_modules + 'all_modules': all_modules, + "question_types": all_question_types } answers = paper.get_previous_answers(question) if answers: |