Commit 06868c56 authored by SANCHIT JAIN's avatar SANCHIT JAIN

merge conflict issues solved

parent 0e78b576
......@@ -4,7 +4,7 @@ from django.contrib.auth.models import User
from .models import *
from django.forms.widgets import Select, Widget,DateTimeInput,TimeInput
import datetime
from datetimepicker.widgets import DateTimePicker
# from datetimepicker.widgets import DateTimePicker
# class QuestionForm(forms.ModelForm):
# class Meta:
......
......@@ -22,7 +22,7 @@ from django.db import IntegrityError
from django.db.models import F
from .forms import TestForm
import datetime
from django.views.decorators.cache import never_cache
def login(request):
print("session currently is "+str(request.session.get('session',None)))
......@@ -93,7 +93,6 @@ def send_mess(request):
else:
return redirect('/arfa/ContactUs')
# @never_cache
def profile(request):
if request.method=='POST' or request.session.get('session',None)==True:
if(request.session.get('session',None)==True):
......@@ -325,17 +324,7 @@ def create_Test(request):
if not data: #only csrf token was sent, display create test page
return render(request,'ARFA_app/create_Test.html',args)
<<<<<<< HEAD
if TestForm.is_valid():
test = TestForm.save()
# for attr in dir(Test):
# print attr
# try:
# data.pop(attr)
# except KeyError as e:
# pass
=======
if form.is_valid():
test = form.save()
creator = models.Created_BY(test_ID=test,faculty=models.Faculty.objects.filter(username=request.session['username']).get())
......@@ -353,66 +342,33 @@ def create_Test(request):
data.pop(attr)
except KeyError as e:
pass
>>>>>>> 4d542e9d29b7dc0879b73a66c89a6617595f2a80
#data is being sent
#create test object
# test = Test()
containsObj = models.Contains(test_ID=test)
<<<<<<< HEAD
for q in data.keys():
# try:
print q
if q[0] != 'i':
continue ;
q = q[1:]
=======
print data
for q in data.keys():
if len(data[q]) != 3:
continue
try:
# if q[0] != 'i':
# continue ;
>>>>>>> 4d542e9d29b7dc0879b73a66c89a6617595f2a80
int(q)
containsObj.q_ID_id = q
#data[q] is an array ['True', 'pos_marks', 'neg_marks']
<<<<<<< HEAD
containsObj.marks_pos = data[q + "1"]
containsObj.marks_neg = data[q + "2"]
print data[q + "1"]
=======
containsObj.marks_pos = data[q][1]
containsObj.marks_neg = data[q][2]
>>>>>>> 4d542e9d29b7dc0879b73a66c89a6617595f2a80
containsObj.pk = None
containsObj.save()
print "success"
print containsObj
# except ValueError as e:
except ValueError as e:
data.pop(q)
print e
continue
# for q in data:
<<<<<<< HEAD
#print data
return render(request,'ARFA_app/view_personal_Test.html',args)
def view_personal_Test(request):
args={'username':request.session['username']}
return render(request,'ARFA_app/view_personal_Test.html',args)
=======
# return HttpResponse("Test Created")
return view_personal_Test(request)
>>>>>>> 4d542e9d29b7dc0879b73a66c89a6617595f2a80
def view_all_Test(request):
args={'username':request.session['username']}
return render(request,'ARFA_app/view_all_Test.html',args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment