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
0923b528
Commit
0923b528
authored
Oct 20, 2020
by
Roshan Rabinarayan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cribs
parent
d980ce4b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
0 deletions
+22
-0
QuizSystem/__pycache__/urls.cpython-38.pyc
QuizSystem/__pycache__/urls.cpython-38.pyc
+0
-0
QuizSystem/urls.py
QuizSystem/urls.py
+1
-0
db.sqlite3
db.sqlite3
+0
-0
quiz/__pycache__/admin.cpython-38.pyc
quiz/__pycache__/admin.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/static/script.js
quiz/static/script.js
+6
-0
quiz/templates/index.html
quiz/templates/index.html
+3
-0
quiz/views.py
quiz/views.py
+10
-0
No files found.
QuizSystem/__pycache__/urls.cpython-38.pyc
View file @
0923b528
No preview for this file type
QuizSystem/urls.py
View file @
0923b528
...
...
@@ -27,6 +27,7 @@ urlpatterns = [
path
(
''
,
a
.
student
),
path
(
'quiz/'
,
a
.
index
),
path
(
'save_ans/'
,
a
.
save_ans
,
name
=
"saveans"
),
path
(
'save_cribs/'
,
a
.
save_cribs
,
name
=
"savecribs"
),
path
(
'result/'
,
a
.
result
,
name
=
"result"
),
url
(
r'^upload/'
,
TemplateView
.
as_view
(
template_name
=
'upload.html'
)),
path
(
'uploaded/'
,
a
.
upload_file
,
name
=
"uploaded"
)
...
...
db.sqlite3
View file @
0923b528
No preview for this file type
quiz/__pycache__/admin.cpython-38.pyc
View file @
0923b528
No preview for this file type
quiz/__pycache__/views.cpython-38.pyc
View file @
0923b528
No preview for this file type
quiz/admin.py
View file @
0923b528
...
...
@@ -3,5 +3,7 @@ from django.contrib import admin
# Register your models here.
from
.models
import
Questions
from
.models
import
submission
from
.models
import
cribs
admin
.
site
.
register
(
Questions
)
admin
.
site
.
register
(
submission
)
admin
.
site
.
register
(
cribs
)
quiz/static/script.js
View file @
0923b528
...
...
@@ -16,6 +16,12 @@ function save_ans() {
// alert(req.responseText)
}
};
if
(
1
==
1
)
{
req
.
open
(
"
GET
"
,
'
/save_cribs?cribs
'
+
document
.
getElementById
(
"
cribs
"
).
value
+
'
&quizId=
'
+
document
.
getElementById
(
'
quizId
'
).
innerHTML
+
'
&questionId=
'
+
document
.
getElementById
(
'
questionId
'
).
innerHTML
,
true
)
alert
(
'
/save_cribs?cribs=
'
+
document
.
getElementById
(
"
cribs
"
).
value
+
'
&quizId=
'
+
document
.
getElementById
(
'
quizId
'
).
innerHTML
+
'
&questionId=
'
+
document
.
getElementById
(
'
questionId
'
).
innerHTML
)
req
.
send
();
}
req
.
open
(
"
GET
"
,
url
,
true
);
req
.
send
();
}
quiz/templates/index.html
View file @
0923b528
...
...
@@ -28,6 +28,9 @@
<div
>
<label
><input
type=
"radio"
name=
"name"
id=
"option4"
value=
"{{i.option4}}"
>
{{i.option4}}
</label>
</div>
<div
>
<label
><input
type=
"textarea"
name=
"fame"
id=
"cribs"
value=
""
>
Cribs...
</label>
</div>
</form>
{%endfor%}
<div
>
...
...
quiz/views.py
View file @
0923b528
...
...
@@ -5,6 +5,7 @@ from django.core.paginator import Paginator
from
.forms
import
UploadFileForm
from
django.http
import
HttpResponseRedirect
from
.models
import
submission
from
.models
import
cribs
from
.
newQuiz
import
readCSV
import
csv
lst
=
[]
...
...
@@ -58,6 +59,15 @@ def save_ans(request):
t
.
save
()
lst
.
append
(
ans
)
return
HttpResponse
(
''
)
def
save_cribs
(
request
):
crib
=
request
.
GET
[
'cribs'
]
studentId
=
1
#set student id here
quizId
=
request
.
GET
[
'quizId'
]
questionId
=
request
.
GET
[
'questionId'
]
t
=
cribs
(
cribs
=
cribs
,
studentId
=
studentId
,
questionId
=
questionId
,
quizId
=
quizId
)
t
.
save
()
return
HttpResponse
(
'Suuuuuccess'
)
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