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
20542076
Commit
20542076
authored
Nov 06, 2020
by
Roshan Rabinarayan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added graph for scatter plot
parent
5690254b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
quiz/templates/upload.html
quiz/templates/upload.html
+1
-1
quiz/views.py
quiz/views.py
+11
-1
No files found.
quiz/templates/upload.html
View file @
20542076
...
...
@@ -59,7 +59,7 @@
<br><br>
</form>
<a
href=
'/instructor?quiz_id=0'
>
For analysis
</a>
<br><h1></h1>
</body>
...
...
quiz/views.py
View file @
20542076
...
...
@@ -12,6 +12,8 @@ from .models import quiz
from
django.db.models
import
Max
from
django.shortcuts
import
redirect
from
.models
import
result
as
results
import
numpy
as
np
from
scipy.stats
import
norm
import
csv
#for login
from
django.contrib.auth.models
import
User
...
...
@@ -147,7 +149,15 @@ def instructor(request):
students
=
results
.
objects
.
all
()
.
filter
(
quizId
=
q_id
)
.
values
(
'studentId'
)
marks
=
results
.
objects
.
all
()
.
filter
(
quizId
=
q_id
)
.
values
(
'marks'
)
fig
,
ax
=
plt
.
subplots
()
ax
.
scatter
([
1
,
10
],
[
5
,
9
])
allMarks
=
list
()
for
mark
in
marks
:
allMarks
.
append
(
mark
[
'marks'
])
allStudents
=
list
()
for
student
in
students
:
allStudents
.
append
(
student
[
'studentId'
])
std
=
np
.
std
(
allMarks
)
mean
=
np
.
mean
(
allMarks
)
ax
.
scatter
(
allMarks
,
allStudents
)
html_graph
=
mpld3
.
fig_to_html
(
fig
)
return
render
(
request
,
'instructor.html'
,{
"graph"
:
html_graph
,
"graph1"
:
html_graph
,
"graph2"
:
html_graph
,
'quiz_id'
:
q_id
})
...
...
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