Commit 197845a3 authored by Roshan Rabinarayan's avatar Roshan Rabinarayan

made multiple changes

parent e5db01e4
No preview for this file type
......@@ -8,7 +8,6 @@ class Permission(models.Model):
class quiz(models.Model):
quizId=models.AutoField(primary_key=True) #primary key
#startTime=models.DateTimeField(auto_now_add=True,default=datetime.datetime.now)
startTime=models.TimeField()
date=models.DateField(default=datetime.date.today)
......
......@@ -10,12 +10,11 @@
</style>
</head>
<body>
<h1>Hello Everyone</h1>
<h1> Quiz :{{quiz_id}}</h1>
<form><input type="hidden" id="quizId" name="quizId" value="123"></form>
<div id="dashboard">
{{quiz_id}}
{{graph|safe}}
{{graph1|safe}}
{{graph2|safe}}
<table >
<th>Question</th><th>StudentId</th><th>Cribs</th>
......
......@@ -9,12 +9,10 @@
</script>
</head>
<body>
<center><h1><a>Welcome Student{{user}}</a></h1>
<br><h1><a href="/quiz/?q=0">Start Quiz</a></h1>
<center><h1><a>Welcome Student {{user}}</a></h1>
{%for quiz in quizId%}
<br><h1><a onclick="start_quiz({{quiz.0}})">Start Quiz Code:{{quiz.1}}</a></h1>
{%endfor%}
<br><h1><a href="/quiz/?q={{quizID}}">{{quizcode}}</a></h1>
<br><h1><a href="/submissions/">View Previous Quizzes</a></h1>
</body>
</html>
......@@ -50,7 +50,7 @@
<button style = "border:0px;background-color:#4285F4; margin-top:8%;
height:35px; width:80%; margin-left:19%;" type = "submit" value = "Login" >
<strong>Login</strong>
<strong>Upload The Quiz</strong>
</button>
......
......@@ -65,8 +65,8 @@
<div class="rubrics_wrapper">
<div class="question_header">
<p class="rubrics">
You selected: {% if sub.option == '0' %} A {% elif sub.option == '1' %} B {% elif sub.option == '2' %} C {% elif sub.option == '3' %} D {% else %} Wrong value in db {% endif %} <br/>
Correct answer: {% if sub.questionId.answer == '0' %} A {% elif sub.questionId.answer == '1' %} B {% elif sub.questionId.answer == '2' %} C {% elif sub.questionId.answer == '3' %} D {% else %} Wrong value in db {% endif %}
You selected: {% if sub.option == '0' %} A {% elif sub.option == '1' %} B {% elif sub.option == '2' %} C {% elif sub.option == '3' %} D {% else %} NA {% endif %} <br/>
Correct answer: {% if sub.questionId.answer == '0' %} A {% elif sub.questionId.answer == '1' %} B {% elif sub.questionId.answer == '2' %} C {% elif sub.questionId.answer == '3' %} D {% else %} NA {% endif %}
</p>
<p id="blankspace"></p>
<p class="marksarea rubrics">Marks: {{ sub.questionId.marks }}<br/>Negative: -{{ sub.questionId.negative }}</p>
......
......@@ -225,7 +225,7 @@ def view_sub(request):
else:
score = score - sub.questionId.negative
total = total + sub.questionId.marks
return render(request,'view_submissions.html', { 'submissions' : subs , 'score': score, 'total': total })
return render(request,'view_submissions.html', { 'submissions' : subs , 'score': round(score,2), 'total': total })
def add_quiz(request):
......@@ -255,7 +255,7 @@ def add_quiz(request):
row=(vals[i],vals[i+1],vals[i+2],vals[i+3],vals[i+4],vals[i+5],vals[i+6],vals[i+7],vals[i+8])
q1=Questions(question=row[0],option1=row[1],option2=row[2],option3=row[3],option4=row[4],
answer=row[7],marks=int(row[5]),negative=float(row[6]),explainations=row[7],quizCode=quizCode,quizId=q)
answer=row[7],marks=int(row[5]),negative=float(row[6]),explainations=row[7],quizCode=q.quizCode,quizId=q)
q1.save()
i=i+9
return HttpResponse('sucess')#(request,'success')
\ No newline at end of file
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