Commit 1700ee5f authored by Roshan Rabinarayan's avatar Roshan Rabinarayan
parents 9a00bf03 6bc80228
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
</script> </script>
<style> <style>
#quiz_links { #quiz_links {
background-color: #00fff0;
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
} }
...@@ -38,7 +37,13 @@ background-image: linear-gradient(19deg, #FAACA8 0%, #DDD6F3 100%); ...@@ -38,7 +37,13 @@ background-image: linear-gradient(19deg, #FAACA8 0%, #DDD6F3 100%);
tr:nth-child(odd) {background-color: #F4D03F; tr:nth-child(odd) {background-color: #F4D03F;
background-image: linear-gradient(132deg, #F4D03F 0%, #16A085 100%); background-image: linear-gradient(132deg, #F4D03F 0%, #16A085 100%);
} }
.qlinks {
height: 60px;
display: block;
cursor: pointer;
line-height: 60px;
font-size: 1.2em;
}
</style> </style>
</head> </head>
<body> <body>
...@@ -53,7 +58,7 @@ background-image: linear-gradient(132deg, #F4D03F 0%, #16A085 100%); ...@@ -53,7 +58,7 @@ background-image: linear-gradient(132deg, #F4D03F 0%, #16A085 100%);
<br> <br>
<tr> <tr>
<td> <td>
<h2><a id="quiz_links" onclick="start_quiz({{quiz.0}})">Start Quiz Code:{{quiz.1}}</a></h2> <a id="quiz_links" class="qlinks" onclick="start_quiz({{quiz.quizId}})">Start Quiz :{{quiz.quizInfo}}</a>
</td> </td>
</tr> </tr>
......
...@@ -12,44 +12,10 @@ ...@@ -12,44 +12,10 @@
} }
</script> </script>
<style> <style>
@media all and (min-width: 800px) {
.profile {
text-align: center;
}
.cards { .cards {
display: flex; display: block;
flex-direction: row; min-height: 500px;
justify-content: center;
flex-wrap: wrap;
}
.menu_card_wrapper {
margin: 50px;
display: flex;
flex-direction: column;
}
.menu_card {
text-decoration: none;
width: 300px;
margin: 10px;
height: 400px;
display: flex;
align-self: center;
justify-content: center;
box-shadow: 1px 1px 5px rgb(158, 158, 158);
transition: height 0.2s;
} }
.menu_card:hover {
box-shadow: 1px 1px 5px rgb(87, 87, 87);
}
.img_wrapper {
min-width: 200px;
display:block;
text-align: center;
margin-bottom: 20px;
}
}
@media all and (max-width: 800px) {
.menu_card_wrapper { .menu_card_wrapper {
width: 100%; width: 100%;
margin-top: 20px; margin-top: 20px;
...@@ -69,14 +35,15 @@ ...@@ -69,14 +35,15 @@
display:block; display:block;
text-align: center; text-align: center;
} }
.backdrop {
display: none;
} }
* { * {
font-family: 'Source Sans Pro', sans-serif; font-family: 'Source Sans Pro', sans-serif;
} }
body { body {
margin: 0px; margin: 0px;
background: url("{% static 'img/study.jpg' %}"); background-color: #f0f6f1;
} }
.menu_card_content > h1 { .menu_card_content > h1 {
margin-top: 0px; margin-top: 0px;
...@@ -93,16 +60,16 @@ ...@@ -93,16 +60,16 @@
margin-bottom: 0px; margin-bottom: 0px;
} }
.profile h1 { .profile h1 {
z-index: 10000;
margin-top: 0px; margin-top: 0px;
margin-bottom: 0px; margin-bottom: 0px;
font-size: 2.3em; font-size: 2.5em;
font-family: 'Slabo 13px', serif; font-family: 'Slabo 13px', serif;
} }
#menucard_ongoingquizzes { #menucard_ongoingquizzes {
background-color: #00fff0; background-color: #00fff0;
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, width 0.2s ease, height 0.2s ease;
} }
#menucard_ongoingquizzes:hover { #menucard_ongoingquizzes:hover {
background-color: #2595d6; background-color: #2595d6;
...@@ -111,7 +78,7 @@ ...@@ -111,7 +78,7 @@
#menucard_prevquiz { #menucard_prevquiz {
background-color: #f0dcc8; background-color: #f0dcc8;
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, width 0.2s ease, height 0.2s ease;
} }
#menucard_prevquiz:hover { #menucard_prevquiz:hover {
background-color: #ce9a66; background-color: #ce9a66;
...@@ -120,11 +87,97 @@ ...@@ -120,11 +87,97 @@
#menucard_logout { #menucard_logout {
background-color: #ffeada; background-color: #ffeada;
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, width 0.2s ease, height 0.2s ease;
} }
#menucard_logout:hover { #menucard_logout:hover {
background-color: #d4b59e; background-color: #d4b59e;
} }
@media only screen and (min-width: 800px) {
.profile {
text-align: center;
color: white;
}
.cards {
display: flex;
flex-direction: row;
justify-content: center;
flex-wrap: wrap;
}
.menu_card_wrapper {
margin: 50px;
width: 280px;
flex-direction: column;
}
.menu_card {
text-decoration: none;
width: 280px;
height: 400px;
margin: 10px;
box-shadow: 1px 1px 5px rgb(158, 158, 158);
animation: grow 1s 1;
position: relative;
}
.menu_card * {
animation: fadeincust 1s 1;
}
@keyframes fadeincust {
0% {
opacity: 0;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes grow {
0% {
top: -300px;
width: 0px;
height: 0px;
}
100% {
top: 0px;
width: 280px;
height: 400px;
}
}
.menu_card:hover {
box-shadow: 1px 1px 5px rgb(87, 87, 87);
width: 330px;
height: 430px;
}
.img_wrapper {
min-width: 200px;
display:block;
text-align: center;
margin-bottom: 20px;
}
.backdrop {
display: block;
width: 100%;
height: 100%;
background: url("{% static 'img/study.jpg' %}");
position: absolute;
top:0px;
left:0px;
z-index: -100;
animation: appear 0.5s 1;
}
@keyframes appear {
0% {
height: 0px;
}
100% {
height: 100%;
}
}
}
</style> </style>
</head> </head>
<body> <body>
...@@ -133,6 +186,7 @@ ...@@ -133,6 +186,7 @@
<h1>Student {{user}}</h1> <h1>Student {{user}}</h1>
</section> </section>
<div class="backdrop"></div>
<section class="cards"> <section class="cards">
<a class="menu_card" id="menucard_ongoingquizzes" href="/ongoing_quiz/"> <a class="menu_card" id="menucard_ongoingquizzes" href="/ongoing_quiz/">
<div class="menu_card_wrapper"> <div class="menu_card_wrapper">
......
<!DOCTYPE html> <!DOCTYPE html>
<head> <head>
{% load static %} {% load static %}
<title>Pariksha | My Quizzes</title>
<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">
<link rel="stylesheet" type="text/css" href="{% static 'assets/DataTables/datatables.min.css' %}"/>
<script type="text/javascript" src="{% static 'assets/DataTables/datatables.min.js' %}"></script>
<style>
* {
font-family: 'Source Sans Pro', sans-serif;
}
.table_wrapper {
margin: 40px;
animation: appear 1s 1;
position: relative;
}
.action_btn {
color: white;
background-color: #1779BA;
cursor: pointer;
padding-left: 15px;
padding-right: 15px;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 6px;
}
@keyframes appear {
0% {
opacity: 0;
top: 50px;
}
100% {
opacity: 1;
top:0px;
}
}
.emptiness {
display: flex;
height: 100vh;
justify-content: center;
flex-direction: column;
align-items: center;
}
.heading {
width: 400px;
margin: 50px auto;
font-weight: bold;
}
</style>
</head> </head>
<body> <body>
{% for submission in submissions %} {%if submissions%}
<a href="../view_submission?q={{ submission.quizId }}">{{ submission.quizId }}</a> <h1 class="heading">My Quizzes</h1>
<section class="table_wrapper">
<table cellspacing="0" id="myTable">
<thead><th>Code</th><th>Quiz Name</th><th>Organized By</th><th>Date</th><th>Time</th><th>Duration</th><th>Marks Obtained</th><th>Actions</th></thead>
<tbody>
{% for sub in submissions %}
<tr>
<td>{{sub.quizId.quizCode}}</td><td>{{sub.quizId.quizInfo}}</td><td>{{sub.quizId.quizInstructor}}</td><td>{{sub.quizId.date}}</td><td>{{sub.quizId.startTime}}</td><td>{{sub.quizId.length}} minutes</td><td>{{sub.marks}}</td><td><a href="/view_submission/?q={{sub.quizId}}"><button class="action_btn" type="button">View Details</button></a></td>
</tr>
{%endfor%} {%endfor%}
</tbody>
</table>
</section>
{%else%}
<div class="emptiness">
<img src="{% static 'img/students.svg' %}" height="100px">
<h3>You have not attempted any quiz.</h3>
</div>
{%endif%}
<script>
function test() {
alert(1);
}
$(document).ready( function () {
$('#myTable').DataTable();
} );
</script>
</body> </body>
</html> </html>
...@@ -124,12 +124,8 @@ def student(request): ...@@ -124,12 +124,8 @@ def student(request):
def ongoing_quiz(request): def ongoing_quiz(request):
"""Displays all ongoing quiz to the professor who has hosted the quiz""" """Displays all ongoing quiz to the professor who has hosted the quiz"""
quizzes = quiz.objects.all().values('quizId', 'quizCode') quizzes = quiz.objects.all().order_by('-date', '-startTime')
quizId = list() return render(request, 'ongoing_quiz.html', {'quizId': quizzes})
quizCode = list()
for q in quizzes:
quizId.append((q['quizId'], q['quizCode']))
return render(request, 'ongoing_quiz.html', {'quizId': quizId})
def upload_file(request): def upload_file(request):
""" This function reads the csv file and inserts the questions into the database """ """ This function reads the csv file and inserts the questions into the database """
...@@ -244,7 +240,7 @@ def sign_up(request): ...@@ -244,7 +240,7 @@ def sign_up(request):
def submissions(request): def submissions(request):
""" This function helps in rendering the submission page showing the student all the previous attempted quizzes""" """ This function helps in rendering the submission page showing the student all the previous attempted quizzes"""
#prev_subm = submission.objects.all().filter(studentId=request.user) #prev_subm = submission.objects.all().filter(studentId=request.user)
prev_subm = submission.objects.all().filter(studentId=request.user).values('quizId').annotate(dcount=Count('quizId')) prev_subm = results.objects.all().filter(studentId=request.user).select_related().all()
return render(request,'submissions.html', { 'submissions' : prev_subm }) return render(request,'submissions.html', { 'submissions' : prev_subm })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment