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
64685e29
Commit
64685e29
authored
Nov 15, 2020
by
Samarth Joshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding role field in signup html and no quiz created error page
parent
dabce1db
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
3 deletions
+85
-3
quiz/static/img/undraw_blank_canvas.svg
quiz/static/img/undraw_blank_canvas.svg
+1
-0
quiz/templates/noquiz.html
quiz/templates/noquiz.html
+46
-0
quiz/templates/registration/signup.html
quiz/templates/registration/signup.html
+26
-0
quiz/views.py
quiz/views.py
+12
-3
No files found.
quiz/static/img/undraw_blank_canvas.svg
0 → 100644
View file @
64685e29
This diff is collapsed.
Click to expand it.
quiz/templates/noquiz.html
0 → 100644
View file @
64685e29
<!DOCTYPE html>
<html>
<head>
{% load static %}
<title>
Pariksha | Oops!
</title>
<link
rel=
"shortcut icon"
href=
"{% static 'img/favicon.svg' %}"
/>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"
></script>
<link
href=
"https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,700;1,400&display=swap"
rel=
"stylesheet"
>
<style>
*
{
font-family
:
'Source Sans Pro'
,
sans-serif
;
}
body
{
margin
:
0px
;
}
img
{
width
:
400px
;
height
:
400px
;
animation
:
appear
0.5s
1
;
}
@keyframes
appear
{
0
%
{
width
:
0px
;
height
:
0px
;
}
100
%
{
width
:
400px
;
height
:
400px
;
}
}
section
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
height
:
100vh
;
}
</style>
</head>
<body>
<section>
<img
src=
"{% static 'img/undraw_blank_canvas.svg' %}"
>
<h2>
Oops! You have not created any quiz.
</h2>
</section>
</body>
</html>
\ No newline at end of file
quiz/templates/registration/signup.html
View file @
64685e29
...
...
@@ -186,12 +186,16 @@ button:focus {
.helptext
{
font-size
:
0.7em
;
color
:
black
;
display
:
none
;
}
li
{
font-size
:
0.7em
;
line-height
:
20px
;
color
:
black
;
}
ul
{
display
:
none
;
}
@media
(
max-width
:
500px
)
{
.window
{
...
...
@@ -204,8 +208,25 @@ color: black;
}
}
p
{
display
:
flex
;
flex-direction
:
column
;
}
p
>
input
{
width
:
100%
;
height
:
40px
;
font-size
:
1em
;
}
.logo
{
width
:
100%
;
}
.role_select
{
width
:
100%
;
height
:
45px
;
margin-bottom
:
50px
;
border
:
none
;
}
</style>
</head>
...
...
@@ -221,6 +242,11 @@ color: black;
<form
class=
'input-line full-width'
method=
"post"
>
{% csrf_token %}
{{form.as_p}}
<label
for=
"role"
>
Role:
</label>
<select
class=
"role_select"
name=
"role"
>
<option
value=
"S"
>
Student
</option>
<option
value=
"P"
>
Professor
</option>
</select>
<div><button
class=
'sub_button full-width'
>
Sign up
</button></div>
</form>
...
...
quiz/views.py
View file @
64685e29
...
...
@@ -158,10 +158,10 @@ def instructor(request):
quizId
=
int
(
q_id
)
else
:
#quizId = quiz.objects.all().filter(quizInstructor=request.user)[0]
if
True
:
if
allquizs
:
quizId
=
allquizs
[
0
]
.
quizId
else
:
print
(
quizId
)
return
render
(
request
,
'noquiz.html'
)
quizInstance
=
quiz
.
objects
.
all
()
.
filter
(
quizId
=
quizId
,
quizInstructor
=
request
.
user
)[
0
]
students
=
results
.
objects
.
all
()
.
filter
(
quizId
=
quizId
)
.
values
(
'studentId'
)
...
...
@@ -237,6 +237,12 @@ def sign_up(request):
if
form
.
is_valid
():
user
=
form
.
save
()
login
(
request
,
user
)
role
=
(
request
.
POST
.
get
(
'role'
))
if
role
==
"P"
:
p
=
Permission
(
userId
=
request
.
user
,
role
=
"P"
)
p
.
save
()
return
render
(
request
,
'professor.html'
)
else
:
return
render
(
request
,
'student.html'
)
context
[
'form'
]
=
form
return
render
(
request
,
'registration/signup.html'
,
context
)
...
...
@@ -308,6 +314,9 @@ def monitor(request):
q_id
=
request
.
GET
.
get
(
'quiz'
)
allquizs
=
quiz
.
objects
.
all
()
.
filter
(
quizInstructor
=
request
.
user
)
.
order_by
(
'-date'
,
'-startTime'
)
if
not
allquizs
:
return
render
(
request
,
'noquiz.html'
)
if
q_id
:
quizId
=
int
(
q_id
)
quizInstance
=
quiz
.
objects
.
get
(
pk
=
quizId
)
...
...
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