Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ARFA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
ARFA
ARFA
Commits
64e7c5b6
Commit
64e7c5b6
authored
Nov 25, 2018
by
SANCHIT JAIN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some interface improvement
parent
a00a3eaa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
32 deletions
+65
-32
ARFA/ARFA_app/forms.py
ARFA/ARFA_app/forms.py
+1
-1
ARFA/ARFA_app/templates/ARFA_app/create_Test.html
ARFA/ARFA_app/templates/ARFA_app/create_Test.html
+0
-7
ARFA/ARFA_app/templates/ARFA_app/faculty_home.html
ARFA/ARFA_app/templates/ARFA_app/faculty_home.html
+19
-12
ARFA/ARFA_app/templates/ARFA_app/home.html
ARFA/ARFA_app/templates/ARFA_app/home.html
+16
-9
ARFA/ARFA_app/views.py
ARFA/ARFA_app/views.py
+29
-3
No files found.
ARFA/ARFA_app/forms.py
View file @
64e7c5b6
...
...
@@ -32,4 +32,4 @@ VISIBILITY_CHOICES= ('1980', '1981', '1982')
class
TestForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Test
exclude
=
[
'test_ID'
,
'ownsership'
]
\ No newline at end of file
exclude
=
[
'test_ID'
,
'ownership'
]
\ No newline at end of file
ARFA/ARFA_app/templates/ARFA_app/create_Test.html
View file @
64e7c5b6
...
...
@@ -7,18 +7,11 @@
Create Test
{%endblock%}
{%block head%}
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"
>
MathJax
.
Hub
.
Config
({
tex2jax
:
{
inlineMath
:
[[
'
$
'
,
'
$
'
],
[
'
\\
(
'
,
'
\\
)
'
]]}});
</script>
{%endblock%}
{%block body%}
<h1>
You CAN CREATE A Test HERE prof {{username}}
</h1>
<link
rel=
"stylesheet"
href=
"//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"
>
<div
class=
"container"
>
<div
class=
"panel-default"
>
<div
class=
"panel-heading"
>
...
...
ARFA/ARFA_app/templates/ARFA_app/faculty_home.html
View file @
64e7c5b6
...
...
@@ -56,14 +56,21 @@ profile
<div
class=
"col-md-6 no-pad"
>
<div
class=
"user-pad"
>
<h3>
Welcome back, {{name}}
</h3>
<h4
class=
"white"
><i
class=
"fa fa-check-circle"
></i>
contact:{{phone_number}}
</h4>
<h4
class=
"white"
><i
class=
"fa fa-check-circle"
></i>
ID: {{email_ID}}
</h4>
<h4
class=
"white"
><i
class=
"fa fa-twitter"
></i>
address: {{address}}
</h4>
{% if phone_number %}
<h4
class=
"white"
><i
class=
"fa fa-phone"
></i>
contact:{{phone_number}}
</h4>
{% endif%}
{% if email_ID%}
<h4
class=
"white"
><i
class=
"fa fa-mail-bulk"
></i>
ID: {{email_ID}}
</h4>
{% endif %}
{% if address%}
<h4
class=
"white"
><i
class=
"fa fa-home"
></i>
address: {{address}}
</h4>
{% endif %}
<button
type=
"button"
class=
"btn btn-labeled btn-info"
href=
"#"
>
<span
class=
"btn-label"
><i
class=
"fa fa-
pencil
"
></i></span>
Update
</button>
<span
class=
"btn-label"
><i
class=
"fa fa-
edit
"
></i></span>
Update
</button>
</div>
</div>
<div
class=
"col-md-6 no-pad"
>
<!-- <i class="fa fa-user fa-10x" style="transform: translate(50%,30%);"></i> -->
<div
class=
"user-image"
>
{% load static %}
<img
src=
"{% static 'ARFA_app/prof_male.png' %}"
style=
"width: 100%"
class=
"img-responsive thumbnail"
>
...
...
@@ -72,17 +79,17 @@ profile
</div>
<div
class=
"row overview"
>
<div
class=
"col-md-4 user-pad text-center"
>
<h3>
Tests
Given
</h3>
<h4>
2,784
</h4>
<h3>
Tests
Created
</h3>
<h4>
{{ test_created}}
</h4>
</div>
<div
class=
"col-md-4 user-pad text-center"
>
<h3>
Rank
</h3>
<h4>
456
</h4>
</div>
<div
class=
"col-md-4 user-pad text-center"
>
<h3>
Questions Solved
</h3>
<h4>
4,901
</h4>
<h3>
Personal Questions
</h3>
<h4>
{{ personal_questions}}
</h4>
</div>
<!-- <div class="col-md-4 user-pad text-center">
<h3>Questions Accessible</h3>
<h4>{{ questions_accessible }}</h4>
</div> -->
</div>
</div>
<div
class=
"col-md-1 user-menu-btns"
>
...
...
ARFA/ARFA_app/templates/ARFA_app/home.html
View file @
64e7c5b6
...
...
@@ -62,11 +62,17 @@ profile
<div
class=
"col-md-6 no-pad"
>
<div
class=
"user-pad"
>
<h3>
Welcome back, {{name}}
</h3>
<h4
class=
"white"
><i
class=
"fa fa-check-circle"
></i>
contact:{{phone_number}}
</h4>
<h4
class=
"white"
><i
class=
"fa fa-check-circle"
></i>
ID: {{email_ID}}
</h4>
<h4
class=
"white"
><i
class=
"fa fa-home"
></i>
address: {{address}}
</h4>
{% if phone_number %}
<h4
class=
"white"
><i
class=
"fa fa-phone"
></i>
contact:{{phone_number}}
</h4>
{% endif%}
{% if email_ID%}
<h4
class=
"white"
><i
class=
"fa fa-mail-bulk"
></i>
ID: {{email_ID}}
</h4>
{% endif %}
{% if address%}
<h4
class=
"white"
><i
class=
"fa fa-home"
></i>
address: {{address}}
</h4>
{% endif %}
<button
type=
"button"
class=
"btn btn-labeled btn-info"
href=
"#"
>
<span
class=
"btn-label"
><i
class=
"fa fa-
pencil
"
></i></span>
Update
</button>
<span
class=
"btn-label"
><i
class=
"fa fa-
edits
"
></i></span>
Update
</button>
</div>
</div>
<div
class=
"col-md-6 no-pad"
>
...
...
@@ -79,15 +85,16 @@ profile
<div
class=
"row overview"
>
<div
class=
"col-md-4 user-pad text-center"
>
<h3>
Tests Given
</h3>
<h4>
2,784
</h4>
<h4>
{{tests_given}}
</h4>
</div>
<div
class=
"col-md-4 user-pad text-center"
>
<h3>
Rank
</h3>
<h4>
456
</h4>
<h3>
Questions Solved
</h3>
<h4>
{{questions_solved}}
</h4>
</div>
<div
class=
"col-md-4 user-pad text-center"
>
<h3>
Questions Solved
</h3>
<h4>
4,901
</h4>
<h3>
Best Rank
</h3>
<!-- TODO: Find rank relative to other students -->
<h4>
5
</h4>
</div>
</div>
</div>
...
...
ARFA/ARFA_app/views.py
View file @
64e7c5b6
...
...
@@ -91,6 +91,10 @@ def students(request):
args2
=
request
.
session
.
get
(
'args'
,
None
)
if
args2
!=
None
:
args
.
update
(
args2
)
tests_given
=
models
.
Takes
.
objects
.
filter
(
student
=
args
[
'user'
])
.
count
()
question_solved
=
models
.
Responses
.
objects
.
filter
(
student
=
args
[
'users'
])
.
annotate
(
"q_ID"
)
.
count
()
args3
=
{
'tests_given'
:
tests_given
,
'question_solved'
:
question_solved
}
args
.
update
(
args3
)
print
"Rendering All students Page"
return
render
(
request
,
'ARFA_app/students.html'
,
args
)
...
...
@@ -101,6 +105,10 @@ def faculty(request):
args2
=
request
.
session
.
get
(
'args'
,
None
)
if
args2
!=
None
:
args
.
update
(
args2
)
personal_questions
=
models
.
Question
.
objects
.
filter
(
faculty
=
args
[
'user'
])
.
count
()
test_created
=
models
.
Created_BY
.
objects
.
filter
(
faculty
=
args
[
'user'
])
.
count
()
args3
=
{
'personal_questions'
:
personal_questions
,
'test_created'
:
test_created
}
args
.
update
(
args3
)
print
"Rendering All faculty Page"
return
render
(
request
,
'ARFA_app/faculty.html'
,
args
)
...
...
@@ -133,11 +141,21 @@ def profile(request):
print
"Detected A session "
if
(
request
.
session
.
get
(
'role'
,
None
)
==
"student"
):
args
=
request
.
session
.
get
(
'args'
,
None
)
tests_given
=
models
.
Takes
.
objects
.
filter
(
student
=
args
[
'username'
])
.
count
()
question_solved
=
models
.
Responses
.
objects
.
filter
(
student
=
args
[
'username'
])
.
annotate
(
"q_ID"
)
.
count
()
args3
=
{
'tests_given'
:
tests_given
,
'question_solved'
:
question_solved
}
args
.
update
(
args3
)
print
"rendering student home for student "
+
args
[
'name'
]
return
render
(
request
,
'ARFA_app/home.html'
,
args
)
else
:
args
=
request
.
session
.
get
(
'args'
,
None
)
print
"rendering student home for faculty "
+
args
[
'name'
]
personal_questions
=
models
.
Question
.
objects
.
filter
(
faculty
=
args
[
'username'
])
.
count
()
test_created
=
models
.
Created_BY
.
objects
.
filter
(
faculty
=
args
[
'username'
])
.
count
()
args3
=
{
'personal_questions'
:
personal_questions
,
'test_created'
:
test_created
}
args
.
update
(
args3
)
print
"rendering faculty home for faculty "
+
args
[
'name'
]
return
render
(
request
,
'ARFA_app/faculty_home.html'
,
args
)
else
:
print
"No session Detected"
...
...
@@ -150,7 +168,6 @@ def profile(request):
else
:
request
.
session
[
'username'
]
=
args
[
'user'
]
request
.
session
[
'session'
]
=
True
request
.
session
.
get
(
'role'
,
None
)
request
.
session
[
'role'
]
=
authenticated
[
'role'
]
args
=
{
'name'
:
authenticated
[
"object"
]
.
name
,
...
...
@@ -163,9 +180,18 @@ def profile(request):
}
request
.
session
[
'args'
]
=
args
if
(
authenticated
[
'role'
]
==
"student"
):
print
(
"session before render "
+
str
(
request
.
session
.
get
(
'session'
,
None
)))
tests_given
=
models
.
Takes
.
objects
.
filter
(
student
=
args
[
'user'
])
.
count
()
question_solved
=
models
.
Responses
.
objects
.
filter
(
student
=
args
[
'users'
])
.
annotate
(
"q_ID"
)
.
count
()
args3
=
{
'tests_given'
:
tests_given
,
'question_solved'
:
question_solved
}
args
.
update
(
args3
)
# print("session before render "+str(request.session.get('session',None)))
return
render
(
request
,
'ARFA_app/home.html'
,
args
)
else
:
personal_questions
=
models
.
Question
.
objects
.
filter
(
faculty
=
args
[
'user'
])
.
count
()
test_created
=
models
.
Created_BY
.
objects
.
filter
(
faculty
=
args
[
'user'
])
.
count
()
args3
=
{
'personal_questions'
:
personal_questions
,
'test_created'
:
test_created
}
args
.
update
(
args3
)
return
render
(
request
,
'ARFA_app/faculty_home.html'
,
args
)
else
:
...
...
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