diff options
-rw-r--r-- | online_test/settings.py | 2 | ||||
-rw-r--r-- | yaksh/admin.py | 8 | ||||
-rw-r--r-- | yaksh/models.py | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/online_test/settings.py b/online_test/settings.py index 7129e83..90cec41 100644 --- a/online_test/settings.py +++ b/online_test/settings.py @@ -188,3 +188,5 @@ SOCIAL_AUTH_FACEBOOK_SCOPE = ['email'] SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = { 'fields': 'id, name, email' } + +TAGGIT_CASE_INSENSITIVE = True diff --git a/yaksh/admin.py b/yaksh/admin.py index 495b48d..9c36a98 100644 --- a/yaksh/admin.py +++ b/yaksh/admin.py @@ -9,6 +9,14 @@ from django.contrib import admin class AnswerPaperAdmin(admin.ModelAdmin): search_fields = ['user__first_name', 'user__last_name', 'user__username', "question_paper__quiz__description", "user_ip"] + list_filter = ['course__is_trial'] + readonly_fields = ["course", "question_paper"] + + def get_form(self, request, obj=None, **kwargs): + self.exclude = ("answers", "questions_unanswered", + "questions_answered", "questions") + form = super(AnswerPaperAdmin, self).get_form(request, obj, **kwargs) + return form class ProfileAdmin(admin.ModelAdmin): diff --git a/yaksh/models.py b/yaksh/models.py index 3894165..e161543 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1592,7 +1592,7 @@ class Answer(models.Model): self.marks = marks def __str__(self): - return self.answer + return "Answer for question {0}".format(self.question.summary) ############################################################################### |