diff options
author | prathamesh | 2018-12-19 13:46:40 +0530 |
---|---|---|
committer | prathamesh | 2018-12-19 13:46:40 +0530 |
commit | 0e3353d489fd54a2c84c712ae04e44a9f8d8cd90 (patch) | |
tree | c481d2eff3512da0c9c72bb33203d4f9f3b3e636 /api/serializers.py | |
parent | a9e36d0ba393bc709c8bd61b133170e9506aa510 (diff) | |
download | online_test-0e3353d489fd54a2c84c712ae04e44a9f8d8cd90.tar.gz online_test-0e3353d489fd54a2c84c712ae04e44a9f8d8cd90.tar.bz2 online_test-0e3353d489fd54a2c84c712ae04e44a9f8d8cd90.zip |
Provide API version 1 for Yaksh
- Serializers for Question, Quiz, QuestionPaper, AnswerPaper
- Can create questions, quizzes, question and answer papers
- Can check mcq, mcc and code questions
- Tests for the API
Diffstat (limited to 'api/serializers.py')
-rw-r--r-- | api/serializers.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/api/serializers.py b/api/serializers.py new file mode 100644 index 0000000..919e429 --- /dev/null +++ b/api/serializers.py @@ -0,0 +1,25 @@ +from rest_framework import serializers +from yaksh.models import Question, Quiz, QuestionPaper, AnswerPaper + + +class QuestionSerializer(serializers.ModelSerializer): + class Meta: + model = Question + fields = '__all__' + + +class QuizSerializer(serializers.ModelSerializer): + class Meta: + model = Quiz + fields = '__all__' + + +class QuestionPaperSerializer(serializers.ModelSerializer): + class Meta: + model = QuestionPaper + fields = '__all__' + +class AnswerPaperSerializer(serializers.ModelSerializer): + class Meta: + model = AnswerPaper + fields = '__all__' |