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
8cd457b2
Commit
8cd457b2
authored
Nov 06, 2020
by
Roshan Rabinarayan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cribs to instructor module
parent
f858fbe3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
1 deletion
+50
-1
db.sqlite3
db.sqlite3
+0
-0
quiz/__pycache__/models.cpython-38.pyc
quiz/__pycache__/models.cpython-38.pyc
+0
-0
quiz/__pycache__/views.cpython-38.pyc
quiz/__pycache__/views.cpython-38.pyc
+0
-0
quiz/migrations/0005_auto_20201106_0534.py
quiz/migrations/0005_auto_20201106_0534.py
+21
-0
quiz/migrations/__pycache__/0005_auto_20201106_0534.cpython-38.pyc
...ations/__pycache__/0005_auto_20201106_0534.cpython-38.pyc
+0
-0
quiz/models.py
quiz/models.py
+4
-0
quiz/templates/instructor.html
quiz/templates/instructor.html
+15
-0
quiz/views.py
quiz/views.py
+10
-1
No files found.
db.sqlite3
View file @
8cd457b2
No preview for this file type
quiz/__pycache__/models.cpython-38.pyc
View file @
8cd457b2
No preview for this file type
quiz/__pycache__/views.cpython-38.pyc
View file @
8cd457b2
No preview for this file type
quiz/migrations/0005_auto_20201106_0534.py
0 → 100644
View file @
8cd457b2
# Generated by Django 3.1.2 on 2020-11-06 05:34
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'quiz'
,
'0004_result'
),
]
operations
=
[
migrations
.
AlterModelTable
(
name
=
'cribs'
,
table
=
'cribs'
,
),
migrations
.
AlterModelTable
(
name
=
'questions'
,
table
=
'Questions'
,
),
]
quiz/migrations/__pycache__/0005_auto_20201106_0534.cpython-38.pyc
0 → 100644
View file @
8cd457b2
File added
quiz/models.py
View file @
8cd457b2
...
...
@@ -34,6 +34,8 @@ class Questions(models.Model):
def
__str__
(
self
):
return
str
(
self
.
questionId
)
class
Meta
:
db_table
=
"Questions"
class
submission
(
models
.
Model
):
...
...
@@ -48,6 +50,8 @@ class cribs(models.Model):
cribs
=
models
.
CharField
(
max_length
=
1000
)
quizId
=
models
.
ForeignKey
(
quiz
,
to_field
=
'quizId'
,
on_delete
=
models
.
CASCADE
)
questionId
=
models
.
ForeignKey
(
Questions
,
to_field
=
'questionId'
,
on_delete
=
models
.
CASCADE
)
class
Meta
:
db_table
=
"cribs"
class
result
(
models
.
Model
):
...
...
quiz/templates/instructor.html
View file @
8cd457b2
...
...
@@ -3,6 +3,11 @@
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
<style>
table
,
th
,
td
{
border
:
1px
solid
black
;
}
</style>
</head>
<body>
<h1>
Hello Everyone
</h1>
...
...
@@ -12,6 +17,16 @@
{{graph|safe}}
{{graph1|safe}}
{{graph2|safe}}
<table
>
<th>
Question
</th><th>
StudentId
</th><th>
Cribs
</th>
{%for crib in cribs%}
<tr>
<td>
{{crib.0}}
</td>
<td>
{{crib.1}}
</td>
<td>
{{crib.2}}
</td>
</tr>
{%endfor%}
</table>
</div>
</body>
</html>
\ No newline at end of file
quiz/views.py
View file @
8cd457b2
...
...
@@ -12,11 +12,14 @@ from .models import quiz
from
django.db.models
import
Max
from
django.shortcuts
import
redirect
from
.models
import
result
as
results
from
.models
import
cribs
as
crib
from
django.db
import
connection
,
transaction
import
numpy
as
np
import
math
import
pandas
as
pd
import
scipy.stats
as
stats
import
csv
from
prettytable
import
PrettyTable
#for login
from
django.contrib.auth.models
import
User
from
django.contrib.auth.forms
import
UserCreationForm
...
...
@@ -150,6 +153,12 @@ def instructor(request):
print
(
q_id
)
students
=
results
.
objects
.
all
()
.
filter
(
quizId
=
q_id
)
.
values
(
'studentId'
)
marks
=
results
.
objects
.
all
()
.
filter
(
quizId
=
q_id
)
.
values
(
'marks'
)
cribs
=
crib
.
objects
.
raw
(
'select 1 as id, c.cribs,c.studentId,q.question from cribs c ,Questions q where c.quizId_id=q.quizId_id and c.quizId_id='
+
str
(
q_id
))
cribbs
=
list
()
for
cribb
in
cribs
:
result
=
(
cribb
.
question
,
cribb
.
studentId
,
cribb
.
cribs
)
if
result
not
in
cribbs
:
cribbs
.
append
(
result
)
fig
,
ax
=
plt
.
subplots
()
allMarks
=
list
()
for
mark
in
marks
:
...
...
@@ -168,7 +177,7 @@ def instructor(request):
x
=
np
.
linspace
(
mu
-
3
*
sigma
,
mu
+
3
*
sigma
,
100
)
ax1
.
plot
(
x
,
stats
.
norm
.
pdf
(
x
,
mu
,
sigma
))
html_graph1
=
mpld3
.
fig_to_html
(
fig1
)
return
render
(
request
,
'instructor.html'
,{
"graph"
:
html_graph
,
"graph1"
:
html_graph
,
"graph2"
:
html_graph1
,
'quiz_id'
:
q_id
})
return
render
(
request
,
'instructor.html'
,{
"graph"
:
html_graph
,
"graph1"
:
html_graph
,
"graph2"
:
html_graph1
,
'quiz_id'
:
q_id
,
'cribs'
:
cribbs
})
def
handle_uploaded_file
(
f
,
q1
):
...
...
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