diff options
author | Prabhu Ramachandran | 2018-03-22 18:09:03 +0530 |
---|---|---|
committer | GitHub | 2018-03-22 18:09:03 +0530 |
commit | 734b221a98745ccb6218f43923731323a265966a (patch) | |
tree | b9ad94f07ae3891295656203c169cb0b03b08d96 /yaksh/views.py | |
parent | 4b356aa2f6097cd0f46292218f31ded18b631e53 (diff) | |
parent | 09ab00808ba9ea288047662e5c7ee2a134f0ac41 (diff) | |
download | online_test-734b221a98745ccb6218f43923731323a265966a.tar.gz online_test-734b221a98745ccb6218f43923731323a265966a.tar.bz2 online_test-734b221a98745ccb6218f43923731323a265966a.zip |
Merge pull request #434 from maheshgudi/arrange_options
Arrange options question type
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index c22500d..083fd67 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -618,7 +618,7 @@ def show_question(request, question, paper, error_message=None, notification=Non if question.type == "code" else 'You have already attempted this question' ) - if question.type in ['mcc', 'mcq']: + if question.type in ['mcc', 'mcq', 'arrange']: test_cases = question.get_ordered_test_cases(paper) else: test_cases = question.get_test_cases() @@ -728,6 +728,9 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None, elif current_question.type == 'mcc': user_answer = request.POST.getlist('answer') + elif current_question.type == 'arrange': + user_answer_ids = request.POST.get('answer').split(',') + user_answer = [int(ids) for ids in user_answer_ids] elif current_question.type == 'upload': # if time-up at upload question then the form is submitted without # validation |