Commit 792936b5 authored by Roshan Rabinarayan's avatar Roshan Rabinarayan

added comments

parent b24e8e1f
No preview for this file type
from django import forms
##
# @breif This is class is used to create the form for uploading the quiz in CSV form by the instructor
##
class UploadFileForm(forms.Form):
"""To create the form for uploading the quiz in CSV form by the instructor"""
file = forms.FileField()
\ No newline at end of file
......@@ -4,12 +4,12 @@ import datetime
from django.utils import timezone
class Permission(models.Model):
"""Defines the permission of the user default permission is Student the admin can provide staff permission"""
"""This class is used to create the userspermission table in database.Defines the permission of the user default permission is Student the admin can provide staff permission"""
userId=models.ForeignKey(to=User, on_delete=models.CASCADE)
role=models.CharField(max_length=1,default="S")
class quiz(models.Model):
"""Contains information about the quiz time,length,code and instructor who has created it"""
"""This class is used to create the quiz table in database.Contains information about the quiz time,length,code and instructor who has created it"""
quizId=models.AutoField(primary_key=True) #primary key
startTime=models.TimeField()
date=models.DateField(default=datetime.date.today)
......@@ -29,7 +29,7 @@ class quiz(models.Model):
return str(self.quizId)
class Questions(models.Model):
""" Contains info about the questions within a particular quiz and its attributes like socre and negative marks and correct answer"""
""" This class is used to create the Questions table in database.Contains info about the questions within a particular quiz and its attributes like socre and negative marks and correct answer"""
question = models.TextField()
option1 = models.CharField(max_length=100)
option2 = models.CharField(max_length=100)
......@@ -50,7 +50,7 @@ class Questions(models.Model):
db_table="Questions"
class submission(models.Model):
""" Contains info about each questions answer submitted by each student"""
""" This class is used to create the Submission table in database.Contains info about each questions answer submitted by each student"""
questionId=models.ForeignKey(Questions,to_field='questionId',on_delete=models.CASCADE)
option=models.CharField(max_length=100)
studentId=models.ForeignKey(to=User, on_delete=models.CASCADE)
......@@ -58,7 +58,7 @@ class submission(models.Model):
class cribs(models.Model):
""" Contains cribs raised by students"""
""" This class is used to create the cribs table in database.Contains cribs raised by students"""
studentId=models.ForeignKey(to=User, on_delete=models.CASCADE)
cribs=models.CharField(max_length=1000)
quizId=models.ForeignKey(quiz,to_field='quizId',on_delete=models.CASCADE)
......@@ -68,14 +68,14 @@ class cribs(models.Model):
class result(models.Model):
"""Stores cumulative score by each student in each quiz"""
"""This class is used to create the result table in database.Stores cumulative score by each student in each quiz"""
studentId = models.ForeignKey(to=User, on_delete=models.CASCADE)
quizId = models.ForeignKey(quiz, to_field='quizId', on_delete=models.CASCADE)
marks=models.IntegerField(default=0)
class log(models.Model):
"""stores the student activity information for monitoring the students"""
"""This class is used to create the log table in database.stores the student activity information for monitoring the students"""
quizId=models.ForeignKey(quiz,to_field='quizId',on_delete=models.CASCADE, default="")
studentId = models.ForeignKey(to=User, on_delete=models.CASCADE, default="")
logtime = models.DateTimeField(default=timezone.now)
......
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