You need to sign in or sign up before continuing.
Commit 524528a3 authored by Samarth Joshi's avatar Samarth Joshi

Adding download csv template in upload.html

parent 710cf218
Question,OptionA,OptionB,OptionC,OptionD,Correct Option Index (Starts from 0),Question Type,Marks,Negative Marks,Explanation
\ No newline at end of file
...@@ -6,9 +6,58 @@ ...@@ -6,9 +6,58 @@
<link href="{% static 'css/quiz_attempt_page.css' %}" rel="stylesheet"> <link href="{% static 'css/quiz_attempt_page.css' %}" rel="stylesheet">
<link href="{% static 'css/quiz_create_page.css' %}" rel="stylesheet"> <link href="{% static 'css/quiz_create_page.css' %}" rel="stylesheet">
<script src="{% static 'js/quiz_create_page.js' %}"></script> <script src="{% static 'js/quiz_create_page.js' %}"></script>
<style>
.flow {
border: solid 2px #3F51B5;
background-color: white;
border-radius: 1em;
margin-bottom: 200px;
box-shadow: #999999 3px 5px 6px;
}
.step {
margin: 40px;
}
button {
padding: 15px;
font-size: 1em;
font-weight: bold;
width: 200px;
background-color: white;
border: solid 2px #3F51B5;
cursor: pointer;
border-radius: 6px;
color: #3F51B5;
transition: background-color 0.2s ease, color 0.2s ease;
}
button > a {
display: block;
}
.custom-file-upload {
display: block;
text-align: center;
padding: 15px;
font-size: 1em;
font-weight: bold;
width: 166px;
cursor: pointer;
background-color: white;
border: solid 2px #3F51B5;
border-radius: 6px;
color: #3F51B5;
transition: background-color 0.2s ease, color 0.2s ease;
}
button:hover, .custom-file-upload:hover {
background-color: #3F51B5;
border: solid 2px #3F51B5;
color: white
}
input[type="file"] {
display: none;
}
</style>
</head> </head>
<body> <body>
<a href="{% url "logout" %}?next=/">logout</a>
<form name = "form" enctype = "multipart/form-data" <form name = "form" enctype = "multipart/form-data"
action = "{% url "uploaded" %}" method = "POST" id="quiz_create_form">{% csrf_token %} action = "{% url "uploaded" %}" method = "POST" id="quiz_create_form">{% csrf_token %}
...@@ -35,33 +84,33 @@ ...@@ -35,33 +84,33 @@
</div> </div>
</div> </div>
</div> </div>
<br>
<div style = "max-width:470px;">
<center>
<input type = "file" style = "margin-left:20%;"
placeholder = "file" name = "file" id= />
</center>
</div>
<br>
<div style = "max-width:470px;"> <div class="flow">
<center> <section class="step">
<h1>Step 1: Download Quiz Template</h1>
<button style = "border:0px;background-color:#4285F4; margin-top:8%; <a href="{% static 'assets/upload_template.csv' %}" download="upload_template.csv"><button type="button">Download CSV</button></a>
height:35px; width:80%; margin-left:19%;" type = "submit" value = "Login" > </section>
<strong>Upload The Quiz</strong> <hr/>
<section class="step">
<h1>Step 2: Open downloaded csv file and add questions in each row</h1>
<p>Format is as follows: (also specified inside the csv file)</p>
<p>Question | OptionA | OptionB | OptionC | OptionD | CorrectOption | QuestionType | Marks | NegativeMarks | Explanation</p>
</section>
<hr/>
<section class="step">
<h1>Step 3: Upload the modified document</h1>
<label class="custom-file-upload"><input type="file" placeholder="file" name="file" id= />Upload</label>
</section>
<hr/>
<section class="step">
<h1>Step 4: After uploading the document click on Submit to create the quiz.</h1>
<button type = "submit">
<strong>Submit</strong>
</button> </button>
</section>
</center>
</div> </div>
<br><br>
</form>
<a href='/instructor?quiz_id=0'>For analysis</a>
<br><h1></h1>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -291,5 +291,5 @@ def add_quiz(request): ...@@ -291,5 +291,5 @@ def add_quiz(request):
return HttpResponse('sucess')#(request,'success') return HttpResponse('sucess')#(request,'success')
def monitor(request): def monitor(request):
quizzes=quiz.objects.all().filter(quizInstructor=request.user.id).values('quizId','quizCode','quizInstructor') allquizs = quiz.objects.all().filter(quizInstructor=request.user).order_by('-date', '-startTime')
return render(request, 'monitor.html') return render(request, 'monitor.html', { 'quizs': allquizs })
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