Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
adega
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odair M.
adega
Commits
eb247779
Commit
eb247779
authored
Nov 20, 2018
by
legton
Committed by
Bruno Meyer
Dec 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#147: Troca tabs por espacos
parent
5dff2bc0
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
680 additions
and
680 deletions
+680
-680
deploy.sh
deploy.sh
+1
-1
src/adega/settings.py
src/adega/settings.py
+4
-4
src/adega/templates/adega/navbar.html
src/adega/templates/adega/navbar.html
+17
-17
src/admission/templates/admission/index.html
src/admission/templates/admission/index.html
+22
-22
src/course/templates/course/index.html
src/course/templates/course/index.html
+24
-24
src/degree/templates/degree/index.html
src/degree/templates/degree/index.html
+130
-130
src/educator/models.py
src/educator/models.py
+4
-4
src/script/analysis/admission_analysis.py
src/script/analysis/admission_analysis.py
+86
-86
src/script/analysis/cepe9615_analysis.py
src/script/analysis/cepe9615_analysis.py
+11
-11
src/script/analysis/student_analysis.py
src/script/analysis/student_analysis.py
+239
-239
src/student/templates/student/index.html
src/student/templates/student/index.html
+142
-142
No files found.
deploy.sh
View file @
eb247779
...
...
@@ -6,7 +6,7 @@
if
!
sudo
-u
postgres psql adega
then
sudo
-u
postgres psql < postgres/create.sql
sudo
-u
postgres psql < postgres/create.sql
fi
...
...
src/adega/settings.py
View file @
eb247779
...
...
@@ -44,10 +44,10 @@ INSTALLED_APPS = [
'adega'
,
'public'
,
'degree'
,
'educator'
,
'admission'
,
'course'
,
'student'
,
'educator'
,
'admission'
,
'course'
,
'student'
,
'report_api'
,
'uploads'
]
...
...
src/adega/templates/adega/navbar.html
View file @
eb247779
...
...
@@ -4,27 +4,27 @@
</div>
<div
class=
"collapse navbar-collapse"
id=
"navbartoggle"
>
<span
class=
"navbar-brand mr-auto"
>
{% if degree != None %}
<a
href=
"{% url 'degree:index' degree_id=degree.code%}"
>
{{degree.name}}
</a>
{% endif %}
{% if degree != None %}
<a
href=
"{% url 'degree:index' degree_id=degree.code%}"
>
{{degree.name}}
</a>
{% endif %}
</span>
{% comment %}
<li
class=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
role=
"button"
aria-expanded=
"false"
>
Cursos
<span
class=
"caret"
></span>
</a>
<ul
class=
"dropdown-menu"
role=
"menu"
>
{% if len(user.educator.degree.all()) > 1 %}
{% for degree in user.educator.degree.all() %}
<li><a
href=
"{% url 'degree:index'
degree_id=degree.code%}"
>
{{degree.name}}
</a></li>
{% endfor %}
{% else %}
{% endif %}
</ul>
</li>
<li
class=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
role=
"button"
aria-expanded=
"false"
>
Cursos
<span
class=
"caret"
></span>
</a>
<ul
class=
"dropdown-menu"
role=
"menu"
>
{% if len(user.educator.degree.all()) > 1 %}
{% for degree in user.educator.degree.all() %}
<li><a
href=
"{% url 'degree:index'
degree_id=degree.code%}"
>
{{degree.name}}
</a></li>
{% endfor %}
{% else %}
{% endif %}
</ul>
</li>
{% endcomment %}
<span
class=
"navbar-text"
>
Relatório 2016/1
...
...
src/admission/templates/admission/index.html
View file @
eb247779
...
...
@@ -7,9 +7,9 @@
{% block content %}
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<h2>
Turmas de Ingresso
</h2>
<table
class=
"table table-striped table-bordered"
id=
"admission_table"
>
<div
class=
"col-md-12"
>
<h2>
Turmas de Ingresso
</h2>
<table
class=
"table table-striped table-bordered"
id=
"admission_table"
>
<thead>
<tr>
<th>
Ano/Semestre
</th>
...
...
@@ -21,30 +21,30 @@
</tr>
</thead>
<tbody>
{% for ti in listage_admissions %}
<tr>
<td>
<a
href=
"{% url 'admission:detail' degree_id=degree.code ano=ti.ano semestre=ti.semestre %}"
>
{{ ti.ano }}/{{ ti.semestre }}
</a>
</td>
<td>
{{ti.ira|floatformat:2}}
&
plusmn {{ti.desvio_padrao|floatformat:2}}
</td>
<td>
NO
</td>
<td>
NO
</td>
<td>
NO
</td>
<td>
NO
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% for ti in listage_admissions %}
<tr>
<td>
<a
href=
"{% url 'admission:detail' degree_id=degree.code ano=ti.ano semestre=ti.semestre %}"
>
{{ ti.ano }}/{{ ti.semestre }}
</a>
</td>
<td>
{{ti.ira|floatformat:2}}
&
plusmn {{ti.desvio_padrao|floatformat:2}}
</td>
<td>
NO
</td>
<td>
NO
</td>
<td>
NO
</td>
<td>
NO
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock content %}
{% block js-foot %}
<script>
$
(
'
#admission_table
'
).
dataTable
({
$
(
'
#admission_table
'
).
dataTable
({
"
bPaginate
"
:
true
,
"
bInfo
"
:
false
,
"
aaSorting
"
:
[[
1
,
"
desc
"
]],
...
...
src/course/templates/course/index.html
View file @
eb247779
...
...
@@ -7,36 +7,36 @@
{% block content %}
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<h2>
Disciplinas
</h2>
<table
id=
"course_table"
class=
"table table-striped table-bordered"
>
<thead>
<tr>
<th>
Código
</th>
<th>
Nome
</th>
<th>
Nota Média
</th>
</tr>
</thead>
<tbody>
{% for key, value in courses.items %}
<tr>
<td>
<a
href=
"{% url 'course:detail' degree_id=degree.code codigo_disciplina=key %}"
>
{{key}}
</a>
</td>
<td>
{{value.name}}
</td>
<td>
{{value.nota.0 | floatformat:2}}
&
plusmn {{value.nota.1 | floatformat:2}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div
class=
"col-md-12"
>
<h2>
Disciplinas
</h2>
<table
id=
"course_table"
class=
"table table-striped table-bordered"
>
<thead>
<tr>
<th>
Código
</th>
<th>
Nome
</th>
<th>
Nota Média
</th>
</tr>
</thead>
<tbody>
{% for key, value in courses.items %}
<tr>
<td>
<a
href=
"{% url 'course:detail' degree_id=degree.code codigo_disciplina=key %}"
>
{{key}}
</a>
</td>
<td>
{{value.name}}
</td>
<td>
{{value.nota.0 | floatformat:2}}
&
plusmn {{value.nota.1 | floatformat:2}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock content %}
{% block js-foot %}
<script>
$
(
'
#course_table
'
).
dataTable
({
$
(
'
#course_table
'
).
dataTable
({
"
bPaginate
"
:
true
,
"
bInfo
"
:
false
,
"
aaSorting
"
:
[[
1
,
"
desc
"
]],
...
...
src/degree/templates/degree/index.html
View file @
eb247779
This diff is collapsed.
Click to expand it.
src/educator/models.py
View file @
eb247779
...
...
@@ -3,7 +3,7 @@ from django.contrib.auth.models import User
from
degree.models
import
Degree
class
Educator
(
models
.
Model
):
user
=
models
.
OneToOneField
(
User
)
degree
=
models
.
ManyToManyField
(
Degree
)
def
__str__
(
self
):
return
"{}"
.
format
(
self
.
user
.
username
)
user
=
models
.
OneToOneField
(
User
)
degree
=
models
.
ManyToManyField
(
Degree
)
def
__str__
(
self
):
return
"{}"
.
format
(
self
.
user
.
username
)
src/script/analysis/admission_analysis.py
View file @
eb247779
...
...
@@ -11,100 +11,100 @@ SEMESTRE_ATUAL = 2
def
admission_class_ira_per_semester
(
df
):
"""
Calculate the average IRA in every semester of the admission classes.
This function group the dataframe by admission classes.
Then group each class by semesters.
And finally group each semester by student.
Calculate each student's IRA and then the average IRA for the class.
Parameters
----------
df : DataFrame
Returns
-------
dict of {list:dict}
dict_admission={
(admission_class1):{semester1:ira, semester2:ira, ...},
(admission_class2):{semester1:ira, semester2:ira, ...},
...
}
Examples
--------
{('2005', '1'): {(2012, '1o. Semestre'): 0.485,
(2007, '1o. Semestre'): 0.6186531973412296, ...} ...}
"""
df
=
df
[
df
[
'SITUACAO'
].
isin
(
Situation
.
SITUATION_AFFECT_IRA
)]
df
=
df
[
df
[
'TOTAL_CARGA_HORARIA'
]
!=
0
]
admission_grouped
=
df
.
groupby
([
'ANO_INGRESSO_y'
,
'SEMESTRE_INGRESSO'
])
dict_admission
=
{}
for
admission
in
admission_grouped
:
#admission_grouped is a tuple of tuples, each tuple contains 0-tuple year/semester & 1-dataframe
dict_ira_semester
=
{}
semester_grouped
=
admission
[
1
].
groupby
([
'ANO'
,
'PERIODO'
])
for
semester
in
semester_grouped
:
student_grouped
=
semester
[
1
].
groupby
(
'ID_ALUNO'
)
ira_class
=
0
for
student
in
student_grouped
:
#TODO: Verify if this can be calculated without groupby
ira_individual
=
(
(
student
[
1
].
MEDIA_FINAL
*
student
[
1
].
TOTAL_CARGA_HORARIA
).
sum
()
)
/
(
100
*
student
[
1
].
TOTAL_CARGA_HORARIA
.
sum
())
ira_class
+=
ira_individual
ira_class
=
ira_class
/
len
(
student_grouped
)
dict_ira_semester
.
update
({
semester
[
0
]:
ira_class
})
dict_admission
.
update
({
admission
[
0
]:
dict_ira_semester
})
return
dict_admission
"""
Calculate the average IRA in every semester of the admission classes.
This function group the dataframe by admission classes.
Then group each class by semesters.
And finally group each semester by student.
Calculate each student's IRA and then the average IRA for the class.
Parameters
----------
df : DataFrame
Returns
-------
dict of {list:dict}
dict_admission={
(admission_class1):{semester1:ira, semester2:ira, ...},
(admission_class2):{semester1:ira, semester2:ira, ...},
...
}
Examples
--------
{('2005', '1'): {(2012, '1o. Semestre'): 0.485,
(2007, '1o. Semestre'): 0.6186531973412296, ...} ...}
"""
df
=
df
[
df
[
'SITUACAO'
].
isin
(
Situation
.
SITUATION_AFFECT_IRA
)]
df
=
df
[
df
[
'TOTAL_CARGA_HORARIA'
]
!=
0
]
admission_grouped
=
df
.
groupby
([
'ANO_INGRESSO_y'
,
'SEMESTRE_INGRESSO'
])
dict_admission
=
{}
for
admission
in
admission_grouped
:
#admission_grouped is a tuple of tuples, each tuple contains 0-tuple year/semester & 1-dataframe
dict_ira_semester
=
{}
semester_grouped
=
admission
[
1
].
groupby
([
'ANO'
,
'PERIODO'
])
for
semester
in
semester_grouped
:
student_grouped
=
semester
[
1
].
groupby
(
'ID_ALUNO'
)
ira_class
=
0
for
student
in
student_grouped
:
#TODO: Verify if this can be calculated without groupby
ira_individual
=
(
(
student
[
1
].
MEDIA_FINAL
*
student
[
1
].
TOTAL_CARGA_HORARIA
).
sum
()
)
/
(
100
*
student
[
1
].
TOTAL_CARGA_HORARIA
.
sum
())
ira_class
+=
ira_individual
ira_class
=
ira_class
/
len
(
student_grouped
)
dict_ira_semester
.
update
({
semester
[
0
]:
ira_class
})
dict_admission
.
update
({
admission
[
0
]:
dict_ira_semester
})
return
dict_admission
def
iras_alunos_turmas_ingressos
(
df
):
student_analysis
=
StudentAnalysis
(
df
)
iras
=
student_analysis
.
ira_alunos
()
student_analysis
=
StudentAnalysis
(
df
)
iras
=
student_analysis
.
ira_alunos
()
turmas_ingresso_grr
=
df
.
groupby
([
"ANO_INGRESSO"
,
"SEMESTRE_INGRESSO"
,
"MATR_ALUNO"
]
).
groups
# Cria um dicionario cujas chaves são GRR
# e valor são tuplas (ano_ingresso,semestre_ingresso)
ano_semestre_do_grr
=
{}
for
ti
in
turmas_ingresso_grr
:
ano_semestre_do_grr
[
ti
[
2
]
]
=
(
ti
[
0
],
ti
[
1
])
resultados
=
defaultdict
(
list
)
turmas_ingresso_grr
=
df
.
groupby
([
"ANO_INGRESSO"
,
"SEMESTRE_INGRESSO"
,
"MATR_ALUNO"
]
).
groups
# Cria um dicionario cujas chaves são GRR
# e valor são tuplas (ano_ingresso,semestre_ingresso)
ano_semestre_do_grr
=
{}
for
ti
in
turmas_ingresso_grr
:
ano_semestre_do_grr
[
ti
[
2
]
]
=
(
ti
[
0
],
ti
[
1
])
resultados
=
defaultdict
(
list
)
for
grr
in
iras
:
semestre_ano
=
ano_semestre_do_grr
[
grr
]
resultados
[
semestre_ano
].
append
(
iras
[
grr
])
for
grr
in
iras
:
semestre_ano
=
ano_semestre_do_grr
[
grr
]
resultados
[
semestre_ano
].
append
(
iras
[
grr
])
return
resultados
return
resultados
def
media_ira_turma_ingresso
(
df
):
iras_alunos_por_turma
=
iras_alunos_turmas_ingressos
(
df
)
# Calcula a média do ira para cada turma_ingresso
resultados
=
{}
for
r
in
iras_alunos_por_turma
:
aux
=
np
.
array
(
iras_alunos_por_turma
[
r
])
resultados
[
r
]
=
np
.
mean
(
aux
)
return
resultados
iras_alunos_por_turma
=
iras_alunos_turmas_ingressos
(
df
)
# Calcula a média do ira para cada turma_ingresso
resultados
=
{}
for
r
in
iras_alunos_por_turma
:
aux
=
np
.
array
(
iras_alunos_por_turma
[
r
])
resultados
[
r
]
=
np
.
mean
(
aux
)
return
resultados
def
desvio_padrao_turma_ingresso
(
df
):
iras_alunos_por_turma
=
iras_alunos_turmas_ingressos
(
df
)
# Calcula o desvio padrão para cada turma_ingresso
resultados
=
{}
for
r
in
iras_alunos_por_turma
:
aux
=
np
.
array
(
iras_alunos_por_turma
[
r
])
resultados
[
r
]
=
np
.
std
(
aux
)
return
resultados
iras_alunos_por_turma
=
iras_alunos_turmas_ingressos
(
df
)
# Calcula o desvio padrão para cada turma_ingresso
resultados
=
{}
for
r
in
iras_alunos_por_turma
:
aux
=
np
.
array
(
iras_alunos_por_turma
[
r
])
resultados
[
r
]
=
np
.
std
(
aux
)
return
resultados
src/script/analysis/cepe9615_analysis.py
View file @
eb247779
...
...
@@ -33,23 +33,23 @@ def student_fails_course(df):
-------
dict of {int:dict}
quantity={
"3":{aluno1:GRR, aluno2:GRR, ...},
"7":{aluno1:GRR, aluno2:GRR, ...},
...
}
quantity={
"3":{aluno1:GRR, aluno2:GRR, ...},
"7":{aluno1:GRR, aluno2:GRR, ...},
...
}
Examples
--------
"3" : {
"José da Silva Carvalho": 20114027,
"Pedro dos Santos" : 20152678,
"José da Silva Carvalho": 20114027,
"Pedro dos Santos" : 20152678,
...
}
"7" : {
"José da Silva Carvalho": 20114027,
"Pedro dos Santos" : 20152678,
"José da Silva Carvalho": 20114027,
"Pedro dos Santos" : 20152678,
...
}
"""
...
...
@@ -192,12 +192,12 @@ def fails_by_freq(df):
"""
people_studying_df
=
df
[
df
[
'FORMA_EVASAO'
]
==
EvasionForm
.
EF_ATIVO
]
//
workaround
:
SIT_REPROVADO_FREQ
é
o
item
1
na
tupla
SITUATION_FAIL
#
workaround: SIT_REPROVADO_FREQ é o item 1 na tupla SITUATION_FAIL
failedbyfreq
=
people_studying_df
.
loc
[
people_studying_df
[
'SITUACAO'
]
==
Situation
.
SITUATION_FAIL
[
1
]]
coursefailed_bystudent
=
failedbyfreq
.
groupby
([
"NOME_PESSOA"
,
"MATR_ALUNO"
,
"COD_ATIV_CURRIC"
])
final_dict
=
{}
for
n
in
fail
s_by_
freq
:
for
n
in
fail
edby
freq
:
final_dict
[
n
]
=
[]
for
fail
in
coursefailed_bystudent
:
if
fail
[
1
].
shape
[
0
]
==
n
:
...
...
src/script/analysis/student_analysis.py
View file @
eb247779
This diff is collapsed.
Click to expand it.
src/student/templates/student/index.html
View file @
eb247779
This diff is collapsed.
Click to expand it.
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