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
b2696eb8
Commit
b2696eb8
authored
Oct 20, 2020
by
Roshan Rabinarayan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
models for cribs and submissions
parent
fb96024d
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
67 additions
and
10 deletions
+67
-10
db.sqlite3
db.sqlite3
+0
-0
name.csv
name.csv
+1
-1
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/file.csv
quiz/file.csv
+1
-1
quiz/migrations/0004_auto_20201020_0733.py
quiz/migrations/0004_auto_20201020_0733.py
+42
-0
quiz/migrations/__pycache__/0004_auto_20201020_0733.cpython-38.pyc
...ations/__pycache__/0004_auto_20201020_0733.cpython-38.pyc
+0
-0
quiz/models.py
quiz/models.py
+14
-1
quiz/static/script.js
quiz/static/script.js
+3
-3
quiz/templates/index.html
quiz/templates/index.html
+1
-1
quiz/templates/result.html
quiz/templates/result.html
+2
-0
quiz/views.py
quiz/views.py
+3
-3
No files found.
db.sqlite3
View file @
b2696eb8
No preview for this file type
name.csv
View file @
b2696eb8
question
1
,option1,option2,option3,option4,option1,type,10,5,explaination,6969
question
2
,option1,option2,option3,option4,option1,type,10,5,explaination,6969
quiz/__pycache__/models.cpython-38.pyc
View file @
b2696eb8
No preview for this file type
quiz/__pycache__/views.cpython-38.pyc
View file @
b2696eb8
No preview for this file type
quiz/file.csv
View file @
b2696eb8
question
1
,option1,option2,option3,option4,option1,type,10,5,explaination,6969
question
2
,option1,option2,option3,option4,option1,type,10,5,explaination,6969
quiz/migrations/0004_auto_20201020_0733.py
0 → 100644
View file @
b2696eb8
# Generated by Django 2.2.7 on 2020-10-20 07:33
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'quiz'
,
'0003_auto_20201020_0359'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'cribs'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'studentId'
,
models
.
CharField
(
max_length
=
100
)),
(
'cribs'
,
models
.
CharField
(
max_length
=
1000
)),
(
'quizId'
,
models
.
CharField
(
max_length
=
100
)),
(
'questionId'
,
models
.
CharField
(
max_length
=
100
)),
],
),
migrations
.
CreateModel
(
name
=
'submission'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'questionId'
,
models
.
CharField
(
max_length
=
100
)),
(
'option'
,
models
.
CharField
(
max_length
=
100
)),
(
'studentId'
,
models
.
CharField
(
max_length
=
100
)),
(
'quizId'
,
models
.
CharField
(
max_length
=
100
)),
],
),
migrations
.
RemoveField
(
model_name
=
'questions'
,
name
=
'id'
,
),
migrations
.
AddField
(
model_name
=
'questions'
,
name
=
'questionId'
,
field
=
models
.
AutoField
(
default
=
0
,
primary_key
=
True
,
serialize
=
False
),
),
]
quiz/migrations/__pycache__/0004_auto_20201020_0733.cpython-38.pyc
0 → 100644
View file @
b2696eb8
File added
quiz/models.py
View file @
b2696eb8
...
...
@@ -15,4 +15,17 @@ class Questions(models.Model):
negative
=
models
.
FloatField
(
max_length
=
10
,
default
=
0
)
explainations
=
models
.
TextField
(
max_length
=
1000
,
default
=
'No Explaination Given'
)
quizId
=
models
.
CharField
(
max_length
=
100
,
default
=
10
)
#questionId=models.AutoField(default=10)
questionId
=
models
.
AutoField
(
primary_key
=
True
,)
class
submission
(
models
.
Model
):
#submission( questionid,selectedoption, quizid, studentid)
questionId
=
models
.
CharField
(
max_length
=
100
)
option
=
models
.
CharField
(
max_length
=
100
)
studentId
=
models
.
CharField
(
max_length
=
100
)
quizId
=
models
.
CharField
(
max_length
=
100
)
class
cribs
(
models
.
Model
):
studentId
=
models
.
CharField
(
max_length
=
100
)
cribs
=
models
.
CharField
(
max_length
=
1000
)
quizId
=
models
.
CharField
(
max_length
=
100
)
questionId
=
models
.
CharField
(
max_length
=
100
)
quiz/static/script.js
View file @
b2696eb8
window
.
onload
=
initall
;
var
save
BookButton
;
var
save
;
function
initall
()
{
save
BookButton
=
document
.
getElementById
(
'
save_ans
'
)
//save_ans
save
BookButton
.
onclick
=
save_ans
;
save
=
document
.
getElementById
(
'
save_ans
'
)
//save_ans
save
.
onclick
=
save_ans
;
}
function
save_ans
()
{
var
ans
=
$
(
"
input:radio[name=name]:checked
"
).
val
()
...
...
quiz/templates/index.html
View file @
b2696eb8
...
...
@@ -33,7 +33,7 @@
<div
>
<div>
{% if questions.has_next %}
<a
href=
"?page={{ questions.next_page_number }}"
><button
id=
"s
ubmitAnswer
"
>
Next
</button></a>
<a
href=
"?page={{ questions.next_page_number }}"
><button
id=
"s
ave_ans
"
>
Next
</button></a>
{% else %}
<a
href=
"/result/"
><button
>
Submit Quiz
</button></a>
{% endif %}
...
...
quiz/templates/result.html
View file @
b2696eb8
...
...
@@ -7,6 +7,8 @@
<body>
<div>
<center><a
href=
"/showAnswers/"
><h3>
Your Score {{score}}
</h3></a></center>
{{anslist}}
{{lst}}
</div>
<script
src=
"https://code.jquery.com/jquery-3.5.1.slim.min.js"
></script>
...
...
quiz/views.py
View file @
b2696eb8
...
...
@@ -9,7 +9,6 @@ import csv
lst
=
[]
answers
=
Questions
.
objects
.
all
()
#print("hello"+str(answers))
anslist
=
[]
marksList
=
[]
negative
=
[]
...
...
@@ -34,7 +33,7 @@ def index(request):
questions
=
paginator
.
page
(
paginator
.
num_pages
)
return
render
(
request
,
'index.html'
,{
'obj'
:
obj
,
'questions'
:
questions
,
'count'
:
count
})
'''
'''
def index(request):
pass
'''
...
...
@@ -46,12 +45,13 @@ def result(request):
score
+=
marksList
[
i
]
else
:
score
-=
negative
[
i
]
return
render
(
request
,
'result.html'
,{
'score'
:
score
,
'lst'
:
lst
})
return
render
(
request
,
'result.html'
,{
'score'
:
score
,
'lst'
:
lst
,
'anslist'
:
anslist
})
def
save_ans
(
request
):
ans
=
request
.
GET
[
'ans'
]
lst
.
append
(
ans
)
return
HttpResponse
(
''
)
def
upload
(
request
):
return
render
(
request
,
'upload.html'
)
...
...
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