Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
adega
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Odair M.
adega
Commits
8c119d4c
Commit
8c119d4c
authored
7 years ago
by
João Denis Rodrigues
Browse files
Options
Downloads
Patches
Plain Diff
Finalizando cache aluno
parent
9a81c461
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/degree/analysis.py
+0
-1
0 additions, 1 deletion
src/degree/analysis.py
src/script.py
+72
-1
72 additions, 1 deletion
src/script.py
src/student/analysis.py
+13
-6
13 additions, 6 deletions
src/student/analysis.py
with
85 additions
and
8 deletions
src/degree/analysis.py
+
0
−
1
View file @
8c119d4c
...
...
@@ -25,7 +25,6 @@ def average_time_graduation_degree(degree): # tempo_medio_formatura_curso
average_time
=
0
for
g
in
graduated
:
print
(
g
.
get_time_in_degree
())
average_time
+=
g
.
get_time_in_degree
()
average_time
/=
graduated_amount
...
...
This diff is collapsed.
Click to expand it.
src/script.py
+
72
−
1
View file @
8c119d4c
...
...
@@ -93,7 +93,78 @@ def generate_degree_data(degree, path):
def
generate_student_data
(
degree
,
path
):
print
(
"
\t
- Fazendo analises dos alunos
"
)
return
students
=
Student
.
objects
.
filter
(
admission__degree
=
degree
)
students_amount
=
students
.
count
()
counter
=
0
student_path
=
path
+
'
/student
'
if
not
os
.
path
.
exists
(
student_path
):
os
.
mkdir
(
student_path
)
for
student
in
students
:
student_klasses
=
StudentKlass
.
objects
.
filter
(
student
=
student
)
amount_courses_semester
=
get_student_courses_completed
(
student_klasses
)
failures_semester
=
semester_pass_rate
(
student
)
# failures_amount_courses_semester = merge_dicts(failures_semester, amount_courses_semester)
ira_courses
=
sorted
(
ira_amount_courses
(
student
).
items
())
pass_rate
=
pass_rate
(
student_klasses
)
pass_rate_semester
=
sorted
(
failures_semester
.
items
())
position
=
sorted
(
get_student_position
(
student
).
items
())
real_period
=
get_real_period
(
student
)
intended_period
=
get_intended_period
(
student
)
dict_ira_semester
=
{}
dict_ira_amount_courses
=
{}
dict_position
=
{}
dict_pass
=
{}
for
item
,
course_pass
,
pos
in
zip
(
ira_courses
,
pass_rate_semester
,
position
):
ca
=
list
(
course_pass
)
i
=
list
(
item
)
p
=
list
(
pos
)
d_pass
,
d_done
=
ap
[
1
]
date
=
ap
[
0
].
split
(
'
/
'
)
semester_data
=
{}
data
=
'
{}/{}
'
.
format
(
date
[
0
],
date
[
1
])
dict_ira_semester
[
data
]
=
i
[
1
][
0
]
dict_ira_amount_courses
[
data
]
=
[
i
[
1
][
0
],
d_done
]
dict_position
[
data
]
=
pos
[
1
]
dict_pass
[
data
]
=
[
d_pass
,
d_done
]
student_klasses
=
StudentKlass
.
objects
.
filter
(
student
=
student
)
student_klass
=
[]
for
sk
in
student_klasses
:
sk_dict
=
{
'
grade
'
:
sk
.
grade
,
'
name
'
:
sk
.
klass
.
course
.
name
,
'
code
'
:
sk
.
klass
.
course
.
code
,
'
situation
'
:
sk
.
situation
,
'
year
'
:
sk
.
klass
.
year
,
'
semester
'
:
sk
.
klass
.
semester
}
student_klass
.
append
(
sk_dict
)
student_data
=
{
'
ira_semester
'
:
dict_ira_semester
,
'
semester_pass_rate
'
:
dict_pass
,
'
position
'
:
dict_position
,
'
ira_amount_courses
'
:
dict_ira_amount_courses
,
'
pass_rate
'
:
pass_rate
,
'
intended_period
'
:
intended_period
,
'
real_period
'
:
real_period
,
'
student_klass
'
:
student_klass
}
counter
+=
1
with
io
.
open
(
student_path
+
'
/
'
+
student
.
grr
+
'
.json
'
,
'
w
'
,
encondig
=
'
utf8
'
)
as
output
:
str_
=
json
.
dumps
(
student_data
,
indent
=
3
,
sort_keys
=
True
,
separators
=
(
'
,
'
,
'
:
'
),
ensure_ascii
=
False
)
output
.
write
(
to_unicode
(
str_
))
if
counter
%
100
==
0
:
print
(
"
\t\t
- %d alunos processados de %d
"
%
(
counter
,
students_amount
))
return
def
generate_student_list_data
(
degree
,
path
):
print
(
"
\t
- Criando lista de alunos
"
)
...
...
This diff is collapsed.
Click to expand it.
src/student/analysis.py
+
13
−
6
View file @
8c119d4c
...
...
@@ -11,7 +11,7 @@ def pass_amount(student_klasses): # calcular_indice_aprovacao
amount_pass
=
0
amount_courses
=
0
for
student_klass
in
student_klasses
:
if
student_klass
.
situation
in
SITUATION_COURSE_COMPLETED
:
if
student_klass
.
situation
in
SITUATION
S
_COURSE_COMPLETED
:
amount_courses
+=
1
if
student_klass
.
situation
in
SITUATION_PASS
:
amount_pass
+=
1
...
...
@@ -21,7 +21,13 @@ def pass_amount(student_klasses): # calcular_indice_aprovacao
def
pass_rate
(
student_klasses
):
# indice_aprovacao
amount_pass
=
0
pass
amout_courses
=
0
for
sk
in
student_klasses
:
if
sk
.
situation
in
SITUATIONS_COURSE_COMPLETED
:
amount_courses
+=
1
if
sk
.
situation
in
SITUATION_PASS
:
amount_pass
+=
1
return
-
1
if
amount_courses
==
0
else
amount_pass
/
amount_courses
def
semester_pass_rate
(
student
):
# calcular_indice_aprovacao_semestral
index
=
{}
...
...
@@ -29,7 +35,7 @@ def semester_pass_rate(student): # calcular_indice_aprovacao_semestral
year
=
student
.
admission
.
year
semester
=
student
.
admission
.
semester
for
i
in
range
(
0
,
amoun_semesters
):
for
i
in
range
(
0
,
amoun
t
_semesters
):
#semester_student_klass = student.studentklass_set.filter(klass__year = year, klass__semester = semester
#semester_index = pass_amount
semester_index
=
student
.
studentklass_set
.
filter
(
klass__year
=
year
,
klass__semester
=
semester
,
situation__in
=
SITUATION_PASS
).
count
()
...
...
@@ -47,7 +53,8 @@ def get_student_courses_completed(student_klasses):
student_courses_completed
=
[]
for
student_klass
in
student_klasses
:
if
student_klass
.
situation
in
SITUATION_COURSE_COMPLETED
:
if
student_klass
.
situation
in
SITUATIONS_COURSE_COMPLETED
:
student_courses_completed
.
append
(
student_klass
)
return
student_courses_completed
...
...
@@ -126,13 +133,13 @@ def get_student_position(student):
def
ira_amount_courses
(
student
):
ira_semesters
=
get_ira_semester
(
student
)
amount_courses
=
get_
stude
nt_courses_completed
(
student
)
amount_courses
=
get_
amou
nt_courses_completed
(
student
)
ira_amount_course
=
{}
ira_amount_course
=
ira_amount_course
.
fromkeys
(
ira_semesters
.
keys
())
for
ira_semester
in
ira_semesters
:
ira_amount_course
[
ira_semester
]
=
[
ira_semesters
[
ira_semester
],
amount_course
[
ira_semester
]]
ira_amount_course
[
ira_semester
]
=
[
ira_semesters
[
ira_semester
],
amount_course
s
[
ira_semester
]]
return
ira_amount_course
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment