diff options
author | Sashi20 | 2018-10-08 12:31:00 +0530 |
---|---|---|
committer | GitHub | 2018-10-08 12:31:00 +0530 |
commit | f2e673ece244d91778e60b9b21f7a566d06d09c3 (patch) | |
tree | 20e6ef72f393d99dbe4685ffda74d3b2a0cddc16 /website | |
parent | 51d4feffd7f8210b0b865c279d76b1aa216649b9 (diff) | |
parent | 2c38381937925703c6da219253819d66b59112d9 (diff) | |
download | nccps-2018-f2e673ece244d91778e60b9b21f7a566d06d09c3.tar.gz nccps-2018-f2e673ece244d91778e60b9b21f7a566d06d09c3.tar.bz2 nccps-2018-f2e673ece244d91778e60b9b21f7a566d06d09c3.zip |
Merge pull request #21 from Sashi20/master
Disabled submission interface
Diffstat (limited to 'website')
-rwxr-xr-x | website/forms.py | 10 | ||||
-rw-r--r-- | website/models.py | 15 | ||||
-rw-r--r-- | website/urls.py | 2 | ||||
-rw-r--r-- | website/views.py | 43 |
4 files changed, 6 insertions, 64 deletions
diff --git a/website/forms.py b/website/forms.py index d833979..72bdace 100755 --- a/website/forms.py +++ b/website/forms.py @@ -377,11 +377,5 @@ class UserRegistrationForm(forms.Form): new_profile.save() key = Profile.objects.get(user=new_user).activation_key return u_name, pwd, key - -#class QuestionForm(forms.ModelForm): - """Creates a form to add or edit a Question. - It has the related fields and functions required.""" - -""" class Meta: - model = Question - exclude = ['user', 'active'] """
\ No newline at end of file + +
\ No newline at end of file diff --git a/website/models.py b/website/models.py index 0a6e690..7906960 100644 --- a/website/models.py +++ b/website/models.py @@ -1,6 +1,5 @@ from django.db import models from django.contrib.auth.models import User - from social.apps.django_app.default.models import UserSocialAuth from nccps2018 import settings from django.core.validators import RegexValidator @@ -99,13 +98,7 @@ class Profile(models.Model): self.user.last_name, self.user.email ) - -"""class Question(models.Model): - Question for a quiz. - - question = models.CharField(max_length=100) - option_1 = models.CharField(max_length=100) - option_2 = models.CharField(max_length=100) - option_3 = models.CharField(max_length=100) - option_4 = models.CharField(max_length=100) - correct_answer = models.CharField(max_length=100) """
\ No newline at end of file + + + +
\ No newline at end of file diff --git a/website/urls.py b/website/urls.py index 57e5bae..2d4e8d8 100644 --- a/website/urls.py +++ b/website/urls.py @@ -18,8 +18,6 @@ urlpatterns = [ re_path(r'^cfp/$', views.cfp, name='cfp'), - #re_path(r'^quiz/$', views.quiz_view, name='quiz_view'), - #re_path(r'^question-add/$', views.question_add, name='question_add'), re_path(r'^submit-cfp/$', views.submitcfp, name='submitcfp'), re_path(r'^submit-cfw/$', views.submitcfw, name='submitcfw'), #url(r'^submit-cfp/$', 'website.views.cfp', name='home'), diff --git a/website/views.py b/website/views.py index ea44a0b..7e10006 100644 --- a/website/views.py +++ b/website/views.py @@ -990,47 +990,4 @@ def view_profile(request): return redirect('/login/') except: return redirect('/register/') -"""@csrf_protect -@login_required -def question_add(request): - context = {} - if request.user.is_authenticated: - social_user = request.user - - django_user = User.objects.get(username=social_user) - context['user'] = django_user - if request.method == 'POST': - form = QuestionForm(request.POST) - if form.is_valid(): - data = form.save(commit=False) - data.user = django_user - data.email = social_user.email - data.save() - return render_to_response('question-display.html', context) - return HttpResponse(template.render(context, request)) - else: - context['qform'] = form - template = loader.get_template('question-display.html') - return HttpResponse(template.render(context, request)) - else: - form = QuestionForm() - return render(request, 'question-display.html', {'qform': form}) - else: - context['login_required'] = True - return render_to_response('login.html', context) -@csrf_protect -def quiz_view(request): - context = {} - if request.user.is_authenticated: - social_user = request.user - django_user = User.objects.get(username=social_user) - questions = Question.objects.all() - context['user'] = django_user - context['questions'] = questions - template = loader.get_template('quiz-display.html') - return HttpResponse(template.render(context, request)) - else: - context['login_required'] = True - return render_to_response('login.html', context) -""" |