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
39f9dee4
Commit
39f9dee4
authored
Oct 24, 2020
by
Roshan Rabinarayan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added models
parent
fd9ad911
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
70 additions
and
11 deletions
+70
-11
db.sqlite3
db.sqlite3
+0
-0
quiz/__pycache__/admin.cpython-38.pyc
quiz/__pycache__/admin.cpython-38.pyc
+0
-0
quiz/__pycache__/models.cpython-38.pyc
quiz/__pycache__/models.cpython-38.pyc
+0
-0
quiz/__pycache__/views.cpython-38.pyc
quiz/__pycache__/views.cpython-38.pyc
+0
-0
quiz/admin.py
quiz/admin.py
+2
-0
quiz/migrations/0002_auto_20201024_0840.py
quiz/migrations/0002_auto_20201024_0840.py
+23
-0
quiz/migrations/0003_auto_20201024_0927.py
quiz/migrations/0003_auto_20201024_0927.py
+37
-0
quiz/migrations/__pycache__/0002_auto_20201024_0840.cpython-38.pyc
...ations/__pycache__/0002_auto_20201024_0840.cpython-38.pyc
+0
-0
quiz/migrations/__pycache__/0003_auto_20201024_0927.cpython-38.pyc
...ations/__pycache__/0003_auto_20201024_0927.cpython-38.pyc
+0
-0
quiz/models.py
quiz/models.py
+7
-10
quiz/views.py
quiz/views.py
+1
-1
No files found.
db.sqlite3
View file @
39f9dee4
No preview for this file type
quiz/__pycache__/admin.cpython-38.pyc
View file @
39f9dee4
No preview for this file type
quiz/__pycache__/models.cpython-38.pyc
View file @
39f9dee4
No preview for this file type
quiz/__pycache__/views.cpython-38.pyc
View file @
39f9dee4
No preview for this file type
quiz/admin.py
View file @
39f9dee4
...
@@ -4,6 +4,8 @@ from django.contrib import admin
...
@@ -4,6 +4,8 @@ from django.contrib import admin
from
.models
import
Questions
from
.models
import
Questions
from
.models
import
submission
from
.models
import
submission
from
.models
import
cribs
from
.models
import
cribs
from
.models
import
quiz
admin
.
site
.
register
(
Questions
)
admin
.
site
.
register
(
Questions
)
admin
.
site
.
register
(
submission
)
admin
.
site
.
register
(
submission
)
admin
.
site
.
register
(
cribs
)
admin
.
site
.
register
(
cribs
)
admin
.
site
.
register
(
quiz
)
quiz/migrations/0002_auto_20201024_0840.py
0 → 100644
View file @
39f9dee4
# Generated by Django 2.2.7 on 2020-10-24 08:40
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'quiz'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'quiz'
,
name
=
'quizInfo'
,
field
=
models
.
CharField
(
default
=
'No Info Available'
,
max_length
=
100
),
),
migrations
.
AddField
(
model_name
=
'quiz'
,
name
=
'quizInstructor'
,
field
=
models
.
CharField
(
default
=
'No Name'
,
max_length
=
100
),
),
]
quiz/migrations/0003_auto_20201024_0927.py
0 → 100644
View file @
39f9dee4
# Generated by Django 2.2.7 on 2020-10-24 09:27
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'quiz'
,
'0002_auto_20201024_0840'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'cribs'
,
name
=
'quiz'
,
),
migrations
.
RemoveField
(
model_name
=
'questions'
,
name
=
'quiz'
,
),
migrations
.
AlterField
(
model_name
=
'cribs'
,
name
=
'quizId'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'quiz.quiz'
),
),
migrations
.
AlterField
(
model_name
=
'questions'
,
name
=
'quizId'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'quiz.quiz'
),
),
migrations
.
AlterField
(
model_name
=
'submission'
,
name
=
'quizId'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'quiz.quiz'
),
),
]
quiz/migrations/__pycache__/0002_auto_20201024_0840.cpython-38.pyc
0 → 100644
View file @
39f9dee4
File added
quiz/migrations/__pycache__/0003_auto_20201024_0927.cpython-38.pyc
0 → 100644
View file @
39f9dee4
File added
quiz/models.py
View file @
39f9dee4
...
@@ -6,8 +6,10 @@ class quiz(models.Model):
...
@@ -6,8 +6,10 @@ class quiz(models.Model):
quizId
=
models
.
AutoField
(
default
=
0
,
primary_key
=
True
)
#primary key
quizId
=
models
.
AutoField
(
default
=
0
,
primary_key
=
True
)
#primary key
startTime
=
models
.
DateTimeField
(
auto_now_add
=
True
)
startTime
=
models
.
DateTimeField
(
auto_now_add
=
True
)
length
=
models
.
FloatField
(
max_length
=
10
)
length
=
models
.
FloatField
(
max_length
=
10
)
quizCode
=
models
.
CharField
(
max_length
=
100
)
#
quizId for questions table
quizCode
=
models
.
CharField
(
max_length
=
100
)
#
#quiz Code set by instructor
quizDone
=
models
.
BooleanField
(
default
=
False
)
quizDone
=
models
.
BooleanField
(
default
=
False
)
quizInfo
=
models
.
CharField
(
max_length
=
100
,
default
=
"No Info Available"
)
quizInstructor
=
models
.
CharField
(
max_length
=
100
,
default
=
"No Name"
)
class
Questions
(
models
.
Model
):
class
Questions
(
models
.
Model
):
question
=
models
.
TextField
()
question
=
models
.
TextField
()
...
@@ -20,23 +22,18 @@ class Questions(models.Model):
...
@@ -20,23 +22,18 @@ class Questions(models.Model):
marks
=
models
.
IntegerField
(
default
=
1
)
marks
=
models
.
IntegerField
(
default
=
1
)
negative
=
models
.
FloatField
(
max_length
=
10
,
default
=
0
)
negative
=
models
.
FloatField
(
max_length
=
10
,
default
=
0
)
explainations
=
models
.
TextField
(
max_length
=
1000
,
default
=
'No Explaination Given'
)
explainations
=
models
.
TextField
(
max_length
=
1000
,
default
=
'No Explaination Given'
)
quizId
=
models
.
CharField
(
max_length
=
100
,
default
=
10
)
questionId
=
models
.
AutoField
(
primary_key
=
True
,)
questionId
=
models
.
AutoField
(
primary_key
=
True
,)
quiz
=
models
.
ForeignKey
(
quiz
,
to_field
=
'quizId'
,
on_delete
=
models
.
CASCADE
)
quiz
Id
=
models
.
ForeignKey
(
quiz
,
to_field
=
'quizId'
,
on_delete
=
models
.
CASCADE
)
#unique quiz identification
class
submission
(
models
.
Model
):
class
submission
(
models
.
Model
):
questionId
=
models
.
ForeignKey
(
Questions
,
to_field
=
'questionId'
,
on_delete
=
models
.
CASCADE
)
questionId
=
models
.
ForeignKey
(
Questions
,
to_field
=
'questionId'
,
on_delete
=
models
.
CASCADE
)
option
=
models
.
CharField
(
max_length
=
100
)
option
=
models
.
CharField
(
max_length
=
100
)
studentId
=
models
.
CharField
(
max_length
=
100
)
studentId
=
models
.
CharField
(
max_length
=
100
)
quizId
=
models
.
CharField
(
max_length
=
100
)
quizId
=
models
.
ForeignKey
(
quiz
,
to_field
=
'quizId'
,
on_delete
=
models
.
CASCADE
)
#unique quiz identification
class
cribs
(
models
.
Model
):
class
cribs
(
models
.
Model
):
studentId
=
models
.
CharField
(
max_length
=
100
)
studentId
=
models
.
CharField
(
max_length
=
100
)
cribs
=
models
.
CharField
(
max_length
=
1000
)
cribs
=
models
.
CharField
(
max_length
=
1000
)
quizId
=
models
.
CharField
(
max_length
=
100
)
quizId
=
models
.
ForeignKey
(
quiz
,
to_field
=
'quizId'
,
on_delete
=
models
.
CASCADE
)
quiz
=
models
.
ForeignKey
(
quiz
,
to_field
=
'quizId'
,
on_delete
=
models
.
CASCADE
,
default
=
0
)
questionId
=
models
.
ForeignKey
(
Questions
,
to_field
=
'questionId'
,
on_delete
=
models
.
CASCADE
)
questionId
=
models
.
ForeignKey
(
Questions
,
to_field
=
'questionId'
,
on_delete
=
models
.
CASCADE
)
\ No newline at end of file
quiz/views.py
View file @
39f9dee4
...
@@ -120,7 +120,7 @@ def handle_uploaded_file(f):
...
@@ -120,7 +120,7 @@ def handle_uploaded_file(f):
rows
=
readCSV
(
destination
)
rows
=
readCSV
(
destination
)
for
row
in
rows
:
for
row
in
rows
:
q
=
Questions
(
question
=
row
[
0
],
option1
=
row
[
1
],
option2
=
row
[
2
],
option3
=
row
[
3
],
option4
=
row
[
4
],
answer
=
row
[
5
],
type
=
row
[
6
],
marks
=
int
(
row
[
7
]),
negative
=
float
(
row
[
8
]),
explainations
=
row
[
9
],
quiz
Id
=
row
[
10
])
q
=
Questions
(
question
=
row
[
0
],
option1
=
row
[
1
],
option2
=
row
[
2
],
option3
=
row
[
3
],
option4
=
row
[
4
],
answer
=
row
[
5
],
type
=
row
[
6
],
marks
=
int
(
row
[
7
]),
negative
=
float
(
row
[
8
]),
explainations
=
row
[
9
],
quiz
Code
=
row
[
10
],
quizId
=
'0'
)
#hardcoded quizid
q
.
save
()
q
.
save
()
...
...
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