diff options
author | CruiseDevice | 2019-01-04 16:33:26 +0530 |
---|---|---|
committer | CruiseDevice | 2019-01-28 13:07:02 +0530 |
commit | a4c6a0a3c013f02c7cdd1d365a180ff6de121d6e (patch) | |
tree | 83055ac859ae88740790197fbf8db01352bbd1e9 /yaksh/views.py | |
parent | f72b744db670d88c095200832a638b69f514f55c (diff) | |
download | online_test-a4c6a0a3c013f02c7cdd1d365a180ff6de121d6e.tar.gz online_test-a4c6a0a3c013f02c7cdd1d365a180ff6de121d6e.tar.bz2 online_test-a4c6a0a3c013f02c7cdd1d365a180ff6de121d6e.zip |
Code refactor and resolves requested changes.
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 4c23ba6..3eaa165 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -616,55 +616,6 @@ 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] - types = {} - categorized_questions = {} - categorized_questions["objectives"] = questions.filter(Q(type="mcq") | - Q(type="mcc") | - Q(type="arrange")) - categorized_questions["blanks"] = questions.filter(Q(type="integer") | - Q(type="string") | - Q(type="float")) - categorized_questions["programming"] = questions.filter(Q(type="code")) - categorized_questions["upload"] = questions.filter(Q(type="upload")) - - types["objective_types"] = set([_type.type - for _type in - categorized_questions["objectives"]]) - types["blank_types"] = set([_type.type - for _type in - categorized_questions["blanks"]]) - types["programming_types"] = set([_type.type - for _type in - categorized_questions["programming"]]) - types["upload_types"] = set([_type.type - for _type in categorized_questions["upload"]]) - - all_ordered_questions = paper.get_all_ordered_questions() - - objectives_index = paper.get_questions_by_type( - all_ordered_questions, - types["objective_types"] - ) - blanks_index = paper.get_questions_by_type( - all_ordered_questions, - types["blank_types"] - ) - programming_index = paper.get_questions_by_type( - all_ordered_questions, - types["programming_types"] - ) - upload_index = paper.get_questions_by_type( - all_ordered_questions, - types["upload_types"] - ) - - index = { - 'objectives_index': objectives_index, - 'blanks_index': blanks_index, - 'programming_index': programming_index, - 'upload_index': upload_index - } context = { 'question': question, 'paper': paper, @@ -680,8 +631,6 @@ def show_question(request, question, paper, error_message=None, 'delay_time': delay_time, 'quiz_type': quiz_type, 'all_modules': all_modules, - "question_types": all_question_types, - "index": index, } answers = paper.get_previous_answers(question) if answers: |