You need to sign in or sign up before continuing.
Commit 8eb58ae2 authored by Roshan Rabinarayan's avatar Roshan Rabinarayan

stored the final score in result model

parent 15dade56
No preview for this file type
......@@ -10,6 +10,7 @@ from .models import cribs
from . newQuiz import readCSV
from .models import quiz
from django.db.models import Max
from .models import result as results
import csv
#for login
from django.contrib.auth.models import User
......@@ -62,6 +63,8 @@ def result(request):
score-=q[0]['negative']
t=submission(questionId=questionInstance, option=request.POST[questionno], studentId=request.user, quizId=quizInstance)
t.save()
t=results(quizId=quizInstance,studentId=request.user,marks=int(score))
t.save()
return HttpResponse(f"Successfully Submitted. Score:{score}")
else:
return HttpResponse("You have already submitted this quiz")
......
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