Commit 8f67c297 authored by Samarth Joshi's avatar Samarth Joshi

Adding custom questions

parent d9c8ce6a
No preview for this file type
question2,option1,option2,option3,option4,option1,type,10,5,explaination,6969
"Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?","[3, 4, 5, 20, 5, 25, 1, 3]","[1, 3, 3, 4, 5, 5, 20, 25]",,"[3, 5, 20, 5, 25, 1, 3]",2,1,1,0.33,pop(i) removes the ith index element from the list
What is called when a function is defined inside a class?,Module,Class,Another Function,Method,3,1,1,0.33,
"What is the output of the following segment :
chr(ord('A'))",A,B,a,Error,0,1,1,0.33,ord() function converts a character into its ASCII notation and chr() converts the ASCII to character.
Which command is used to create a blank file in Unix based OS,touchfile,grep,touch,sed -e,2,1,1,0.33,
"Which git command will display a summarized view of the commit history for a repo, showing one line per commit?",git log --format=short,git branch -D <name>,git log --graph --oneline,git checkout -b <branch>,2,1,1,0.33,
"What does the following command do?
Awk 'BEGIN {sum=0} {sum=sum+1} END {print sum}' testfile.txt",Prints zero because the addition methodology is wrong in the command written,Prints the total number of lines in the file testfile.txt,Prints the sum of numbers from 0 to the line number in the file,Prints line numbers aof the lines in the file testfile.txt along with the output,1,1,1,0.33,
question2,option1,option2,option3,option4,option1,type,10,5,explaination,6969
"Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?","[3, 4, 5, 20, 5, 25, 1, 3]","[1, 3, 3, 4, 5, 5, 20, 25]",,"[3, 5, 20, 5, 25, 1, 3]",2,1,1,0.33,pop(i) removes the ith index element from the list,AC22
What is called when a function is defined inside a class?,Module,Class,Another Function,Method,3,1,1,0.33,,
"What is the output of the following segment :
chr(ord('A'))",A,B,a,Error,0,1,1,0.33,ord() function converts a character into its ASCII notation and chr() converts the ASCII to character.,
"Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?","[3, 4, 5, 20, 5, 25, 1, 3]","[1, 3, 3, 4, 5, 5, 20, 25]","[3, 5, 20, 5, 25, 1, 2]","[3, 5, 20, 5, 25, 1, 3]",2,1,1,0.33,pop(i) removes the ith index element from the list
What is called when a function is defined inside a class?,Module,Class,Another Function,Method,3,1,1,0.33,
"What is the output of the following segment :
chr(ord('A'))",A,B,a,Error,0,1,1,0.33,ord() function converts a character into its ASCII notation and chr() converts the ASCII to character.
Which command is used to create a blank file in Unix based OS,touchfile,grep,touch,sed -e,2,1,1,0.33,
"Which git command will display a summarized view of the commit history for a repo, showing one line per commit?",git log --format=short,git branch -D <name>,git log --graph --oneline,git checkout -b <branch>,2,1,1,0.33,
"What does the following command do?
Awk 'BEGIN {sum=0} {sum=sum+1} END {print sum}' testfile.txt",Prints zero because the addition methodology is wrong in the command written,Prints the total number of lines in the file testfile.txt,Prints the sum of numbers from 0 to the line number in the file,Prints line numbers aof the lines in the file testfile.txt along with the output,1,1,1,0.33,
......@@ -13,6 +13,7 @@
}
#question_palette {
width: 300px;
height: 100vh;
grid-column-start: 2;
grid-row-start: 1;
display: grid;
......@@ -114,6 +115,7 @@
}
#timer {
font-size: 2em;
text-align: center;
}
/* ----- Quiz Pallete Start ----- */
......@@ -136,6 +138,7 @@
padding-left: 0px;
grid-column-start: 1;
grid-row-start: 2;
overflow-y: scroll;
}
.questions_list > li {
padding: 15px;
......
......@@ -35,12 +35,13 @@
</aside>
<section id="questions_area">
<input type="hidden" id="question_count" value="{{count}}">
<p id="timer">00:00:00</p>
<div id="questions_area_wrapper">
{% for i in questions%}
<div class="question">
<div class="rubrics_header question_header">
<p>Question <br/>{{ forloop.counter }} of {{ count }}</p>
<p id="timer">00:00:00</p>
<p></p>
<p class="marksarea">Marks: {{ i.marks }}<br/>Negative: -{{ i.negative }}</p>
</div>
<!-- <h1 id ='quizId'>{{i.quizId}}<h1> -->
......
......@@ -29,6 +29,8 @@ from django.contrib.auth.decorators import login_required
from django.db.models import Count
import matplotlib.pyplot as plt, mpld3
import json
import random
import string
lst = []
answers = []
......@@ -111,7 +113,8 @@ def student(request):
def upload_file(request):
uploaded=False
temp1='test'
q= quiz(length=request.POST.get('length'),quizCode=request.POST.get('quizCode'),quizInfo=request.POST.get('quizInfo'),date=request.POST.get('date'),
random_code = ''.join(random.choices(string.ascii_uppercase + string.digits, k = 6))
q= quiz(length=request.POST.get('length'),quizCode=random_code,quizInfo=request.POST.get('quiz_name'),date=request.POST.get('date'),
quizInstructor=request.user,startTime =request.POST.get('startTime'),quizDone=False)
q.save()
form = UploadFileForm(request.POST, request.FILES)
......@@ -165,7 +168,7 @@ def handle_uploaded_file(f,q1):
rows=readCSV(destination)
for row in rows:
q=Questions(question=row[0],option1=row[1],option2=row[2],option3=row[3],option4=row[4],answer=row[5],type=row[6],marks=int(row[7]),negative=float(row[8]),explainations=row[9],quizCode=row[10],quizId=q1)#hardcoded quizid
q=Questions(question=row[0],option1=row[1],option2=row[2],option3=row[3],option4=row[4],answer=row[5],type=row[6],marks=int(row[7]),negative=float(row[8]),explainations=row[9],quizCode=q1.quizCode,quizId=q1)#hardcoded quizid
q.save()
def create_quiz(request):
......@@ -216,8 +219,8 @@ def add_quiz(request):
for req in request.POST.values():
vals.append(req)
i=1
quizCode= vals[i]
print(quizCode)
quizName= vals[i]
print(quizName)
i+=1
date=vals[i]
print(date)
......@@ -229,7 +232,8 @@ def add_quiz(request):
print(length)
i+=1
print(request.user)
q= quiz(length=length,quizCode=quizCode,quizInfo='',date=date,
random_code = ''.join(random.choices(string.ascii_uppercase + string.digits, k = 6))
q= quiz(length=length,quizCode=random_code,quizInfo=quizName,date=date,
quizInstructor=request.user,startTime =startTime,quizDone=False)
q.save()
......
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