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
df416dc6
Commit
df416dc6
authored
Oct 24, 2020
by
Roshan Rabinarayan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed modesl
parent
367be50c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
3 deletions
+41
-3
db.sqlite3
db.sqlite3
+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/migrations/0006_quiz.py
quiz/migrations/0006_quiz.py
+24
-0
quiz/migrations/__pycache__/0006_quiz.cpython-38.pyc
quiz/migrations/__pycache__/0006_quiz.cpython-38.pyc
+0
-0
quiz/models.py
quiz/models.py
+9
-1
quiz/views.py
quiz/views.py
+8
-2
No files found.
db.sqlite3
View file @
df416dc6
No preview for this file type
quiz/__pycache__/models.cpython-38.pyc
View file @
df416dc6
No preview for this file type
quiz/__pycache__/views.cpython-38.pyc
View file @
df416dc6
No preview for this file type
quiz/migrations/0006_quiz.py
0 → 100644
View file @
df416dc6
# Generated by Django 2.2.7 on 2020-10-24 07:25
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'quiz'
,
'0005_auto_20201020_0755'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'quiz'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'quizId'
,
models
.
CharField
(
max_length
=
100
)),
(
'startTime'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'length'
,
models
.
FloatField
(
max_length
=
10
)),
(
'quizCode'
,
models
.
CharField
(
max_length
=
100
)),
(
'quizDone'
,
models
.
BooleanField
(
default
=
False
)),
],
),
]
quiz/migrations/__pycache__/0006_quiz.cpython-38.pyc
0 → 100644
View file @
df416dc6
File added
quiz/models.py
View file @
df416dc6
...
@@ -18,7 +18,7 @@ class Questions(models.Model):
...
@@ -18,7 +18,7 @@ class Questions(models.Model):
questionId
=
models
.
AutoField
(
primary_key
=
True
,)
questionId
=
models
.
AutoField
(
primary_key
=
True
,)
class
submission
(
models
.
Model
):
class
submission
(
models
.
Model
):
#submission( questionid,selectedoption, quizid, studentid)
questionId
=
models
.
CharField
(
max_length
=
100
)
questionId
=
models
.
CharField
(
max_length
=
100
)
option
=
models
.
CharField
(
max_length
=
100
)
option
=
models
.
CharField
(
max_length
=
100
)
studentId
=
models
.
CharField
(
max_length
=
100
)
studentId
=
models
.
CharField
(
max_length
=
100
)
...
@@ -29,3 +29,11 @@ class cribs(models.Model):
...
@@ -29,3 +29,11 @@ class cribs(models.Model):
cribs
=
models
.
CharField
(
max_length
=
1000
)
cribs
=
models
.
CharField
(
max_length
=
1000
)
quizId
=
models
.
CharField
(
max_length
=
100
)
quizId
=
models
.
CharField
(
max_length
=
100
)
questionId
=
models
.
CharField
(
max_length
=
100
)
questionId
=
models
.
CharField
(
max_length
=
100
)
class
quiz
(
models
.
Model
):
quizId
=
models
.
CharField
(
max_length
=
100
)
#primary key
startTime
=
models
.
DateTimeField
(
auto_now_add
=
True
)
length
=
models
.
FloatField
(
max_length
=
10
)
quizCode
=
models
.
CharField
(
max_length
=
100
)
quizDone
=
models
.
BooleanField
(
default
=
False
)
quiz/views.py
View file @
df416dc6
...
@@ -36,6 +36,7 @@ def index(request):
...
@@ -36,6 +36,7 @@ def index(request):
questions=paginator.page(paginator.num_pages) """
questions=paginator.page(paginator.num_pages) """
return
render
(
request
,
'index.html'
,{
'questions'
:
obj
,
'count'
:
count
})
return
render
(
request
,
'index.html'
,{
'questions'
:
obj
,
'count'
:
count
})
#quiz started #quiz completed.
def
result
(
request
):
def
result
(
request
):
...
@@ -94,7 +95,7 @@ def upload(request):
...
@@ -94,7 +95,7 @@ def upload(request):
@
login_required
@
login_required
def
student
(
request
):
def
student
(
request
):
lst
.
clear
()
return
render
(
request
,
'student.html'
)
return
render
(
request
,
'student.html'
)
def
upload_file
(
request
):
def
upload_file
(
request
):
...
@@ -118,12 +119,13 @@ def handle_uploaded_file(f):
...
@@ -118,12 +119,13 @@ def handle_uploaded_file(f):
destination
=
open
(
"name.csv"
,
"r"
)
destination
=
open
(
"name.csv"
,
"r"
)
rows
=
readCSV
(
destination
)
rows
=
readCSV
(
destination
)
for
row
in
rows
:
for
row
in
rows
:
print
(
str
(
row
))
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
],
quizId
=
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
],
quizId
=
row
[
10
])
q
.
save
()
q
.
save
()
#login functionality
#login functionality
def
sign_up
(
request
):
def
sign_up
(
request
):
context
=
{}
context
=
{}
...
@@ -136,3 +138,7 @@ def sign_up(request):
...
@@ -136,3 +138,7 @@ def sign_up(request):
context
[
'form'
]
=
form
context
[
'form'
]
=
form
return
render
(
request
,
'registration/signup.html'
,
context
)
return
render
(
request
,
'registration/signup.html'
,
context
)
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