Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Pariksha
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roshan Rabinarayan
Pariksha
Commits
b24e8e1f
Commit
b24e8e1f
authored
Nov 15, 2020
by
Roshan Rabinarayan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comments
parent
d9bcc517
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
4 deletions
+12
-4
QuizSystem/settings.py
QuizSystem/settings.py
+2
-1
QuizSystem/urls.py
QuizSystem/urls.py
+1
-1
quiz/admin.py
quiz/admin.py
+1
-0
quiz/forms.py
quiz/forms.py
+1
-0
quiz/models.py
quiz/models.py
+7
-2
No files found.
QuizSystem/settings.py
View file @
b24e8e1f
...
...
@@ -52,6 +52,7 @@ MIDDLEWARE = [
ROOT_URLCONF
=
'QuizSystem.urls'
""" Added path to templates directory"""
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
...
...
@@ -73,7 +74,7 @@ WSGI_APPLICATION = 'QuizSystem.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
"""Added path to database"""
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
...
...
QuizSystem/urls.py
View file @
b24e8e1f
...
...
@@ -23,7 +23,7 @@ from django.views.generic import TemplateView
from
django.conf.urls.static
import
static
from
django.urls
import
path
,
include
from
django.contrib.auth
import
views
as
auth_views
"""Defined all url patterns to access various pages of the application"""
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
''
,
a
.
student
,
name
=
"student"
),
...
...
quiz/admin.py
View file @
b24e8e1f
...
...
@@ -8,6 +8,7 @@ from .models import quiz
from
.models
import
result
from
.models
import
Permission
from
.models
import
log
""""To easily insert and update data for the various models thorough django admin page"""
admin
.
site
.
register
(
Questions
)
admin
.
site
.
register
(
submission
)
admin
.
site
.
register
(
cribs
)
...
...
quiz/forms.py
View file @
b24e8e1f
from
django
import
forms
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
quiz/models.py
View file @
b24e8e1f
...
...
@@ -4,12 +4,13 @@ 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"""
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"""
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
)
length
=
models
.
FloatField
(
max_length
=
10
)
...
...
@@ -28,6 +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"""
question
=
models
.
TextField
()
option1
=
models
.
CharField
(
max_length
=
100
)
option2
=
models
.
CharField
(
max_length
=
100
)
...
...
@@ -48,7 +50,7 @@ class Questions(models.Model):
db_table
=
"Questions"
class
submission
(
models
.
Model
):
""" 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
)
...
...
@@ -56,6 +58,7 @@ class submission(models.Model):
class
cribs
(
models
.
Model
):
""" 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
)
...
...
@@ -65,12 +68,14 @@ class cribs(models.Model):
class
result
(
models
.
Model
):
"""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"""
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment