Commit 1700ee5f authored by Roshan Rabinarayan's avatar Roshan Rabinarayan
parents 9a00bf03 6bc80228
......@@ -9,7 +9,6 @@
</script>
<style>
#quiz_links {
background-color: #00fff0;
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%);
tr:nth-child(odd) {background-color: #F4D03F;
background-image: linear-gradient(132deg, #F4D03F 0%, #16A085 100%);
}
.qlinks {
height: 60px;
display: block;
cursor: pointer;
line-height: 60px;
font-size: 1.2em;
}
</style>
</head>
<body>
......@@ -53,7 +58,7 @@ background-image: linear-gradient(132deg, #F4D03F 0%, #16A085 100%);
<br>
<tr>
<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>
</tr>
......
......@@ -12,44 +12,10 @@
}
</script>
<style>
@media all and (min-width: 800px) {
.profile {
text-align: center;
}
.cards {
display: flex;
flex-direction: row;
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;
display: block;
min-height: 500px;
}
.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 {
width: 100%;
margin-top: 20px;
......@@ -69,14 +35,15 @@
display:block;
text-align: center;
}
.backdrop {
display: none;
}
* {
font-family: 'Source Sans Pro', sans-serif;
}
body {
margin: 0px;
background: url("{% static 'img/study.jpg' %}");
background-color: #f0f6f1;
}
.menu_card_content > h1 {
margin-top: 0px;
......@@ -93,16 +60,16 @@
margin-bottom: 0px;
}
.profile h1 {
z-index: 10000;
margin-top: 0px;
margin-bottom: 0px;
font-size: 2.3em;
font-size: 2.5em;
font-family: 'Slabo 13px', serif;
}
#menucard_ongoingquizzes {
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 {
background-color: #2595d6;
......@@ -111,7 +78,7 @@
#menucard_prevquiz {
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 {
background-color: #ce9a66;
......@@ -120,11 +87,97 @@
#menucard_logout {
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 {
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>
</head>
<body>
......@@ -133,6 +186,7 @@
<h1>Student {{user}}</h1>
</section>
<div class="backdrop"></div>
<section class="cards">
<a class="menu_card" id="menucard_ongoingquizzes" href="/ongoing_quiz/">
<div class="menu_card_wrapper">
......
<!DOCTYPE html>
<head>
{% 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>
<body>
{% for submission in submissions %}
<a href="../view_submission?q={{ submission.quizId }}">{{ submission.quizId }}</a>
{%if submissions%}
<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%}
</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>
</html>
......@@ -124,12 +124,8 @@ def student(request):
def ongoing_quiz(request):
"""Displays all ongoing quiz to the professor who has hosted the quiz"""
quizzes = quiz.objects.all().values('quizId', 'quizCode')
quizId = list()
quizCode = list()
for q in quizzes:
quizId.append((q['quizId'], q['quizCode']))
return render(request, 'ongoing_quiz.html', {'quizId': quizId})
quizzes = quiz.objects.all().order_by('-date', '-startTime')
return render(request, 'ongoing_quiz.html', {'quizId': quizzes})
def upload_file(request):
""" This function reads the csv file and inserts the questions into the database """
......@@ -244,7 +240,7 @@ def sign_up(request):
def submissions(request):
""" 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).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 })
......
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