Commit 4bab9768 authored by Rahul-chunduru's avatar Rahul-chunduru

ui for view test

parent 26fb4de6
......@@ -29,9 +29,9 @@ class Test(models.Model):
test_name = models.CharField(max_length=200,unique=True)
visibility_student = models.CharField(max_length=20)
ownership = models.CharField(max_length=20)
expected_time_for_completion = models.DurationField(blank=True)
start_time = models.DateTimeField(auto_now=False, auto_now_add=False)
max_marks = models.FloatField(null=True)
expected_time_for_completion = models.CharField(max_length=10)
start_time = models.CharField(max_length=10)
max_marks = models.IntegerField(null=True)
# class TestQuestions(models.Model):
# test_ID = models.ForeignKey(
......
......@@ -24,10 +24,9 @@ Create Test
{%for question in questions%}
<li class="list-group-item">
<!-- <li> -->
<input type="checkbox" value= "True" name = "{{question.q_id}}" >
<div class="row toggle">
<div class="col-xs-10">
<input type="checkbox" value= "True" name = "i{{question.q_id}}" >
{{question.question_text}} {{question.q_id}} </br>
</div>
</div>
......
......@@ -323,8 +323,8 @@ def create_Test(request):
return render(request,'ARFA_app/create_Test.html',args)
if TestForm.is_valid():
test = TestForm.save()
test = TestForm.save()
# for attr in dir(Test):
# print attr
# try:
......@@ -337,26 +337,31 @@ def create_Test(request):
# test = Test()
containsObj = models.Contains(test_ID=test)
for q in data.keys():
try:
# try:
print q
if q[0] != 'i':
continue ;
q = q[1:]
int(q)
containsObj.q_ID_id = q
print q
#data[q] is an array ['True', 'pos_marks', 'neg_marks']
containsObj.marks_pos = data[q + "1"]
containsObj.marks_neg = data[q + "2"]
print data[q + "1"]
containsObj.pk = None
containsObj.save()
except ValueError as e:
print "success"
print containsObj
# except ValueError as e:
data.pop(q)
print e
continue
# for q in data:
print data
#print data
return render(request,'ARFA_app/view_personal_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