-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.qmd
More file actions
174 lines (156 loc) · 4.64 KB
/
index.qmd
File metadata and controls
174 lines (156 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
output: html
jupyter: python3
execute:
echo: false
warning: false
---
```{python}
#| label: imports
#| output: false
import pandas as pd
from utils.db_connection import query_to_dataframe
pd.set_option('display.max_colwidth', None)
```
## Domeniul de Competență
```{python}
#| label: comp-areas
#| output: true
areas_df = query_to_dataframe("""
SELECT
ca.nume as "Arie",
ca.descriere as "Descriere"
FROM digcomp.comp_arie ca
ORDER BY ca.id
""")
try:
display(areas_df.style.hide(axis='index'))
except:
# Fallback for even older pandas versions
display(areas_df)
print("Note: First column shown is just the index, not part of your data")
```
## Competența
```{python}
#| label: descriptors
#| output: true
descriptors_df = query_to_dataframe("""
SELECT
ca.nume as "Arie",
cd.scaff_cod as "Cod",
cd.nume as "Nume",
cd.descriere as "Descriere"
FROM digcomp.comp_arie ca
LEFT JOIN digcomp.comp_descriptor cd ON ca.id = cd.comp_arie_id
ORDER BY ca.id, cd.scaff_cod
""")
# Group and display by area
for arie in descriptors_df["Arie"].unique():
area_descriptors = descriptors_df[descriptors_df["Arie"] == arie]
try:
display(area_descriptors[["Cod", "Nume", "Descriere"]].style.hide(axis='index'))
except:
# Fallback if .hide() doesn't work
from IPython.display import HTML
display(HTML(area_descriptors[["Cod", "Nume", "Descriere"]].to_html(index=False)))
print("\n") # Add spacing between areas
```
## Structura Competențelor
```{python}
#| label: competency-structure
#| output: true
structure_df = query_to_dataframe("""
SELECT
cd.scaff_cod as "Cod",
cd.nume as "Competenta",
cn.granular_nivel as "Nivel Granular de Performanță",
cnc.nume as "Nivel de Performanță",
pc.nivel as "Proces Cognitiv",
cn.complexitate as "Complexitate",
cn.autonomie as "Autonomie",
COUNT(ce.id) as "Numar Exemple"
FROM digcomp.comp_descriptor cd
JOIN digcomp.comp_nivel_descriptor cnd ON cd.id = cnd.comp_descriptor_id
JOIN digcomp.comp_nivel cn ON cnd.comp_nivel_id = cn.id
JOIN digcomp.comp_nivel_categorie cnc ON cn.comp_nivel_categorie_id = cnc.id
JOIN digcomp.proces_cognitiv pc ON cn.proces_cognitiv_id = pc.id
LEFT JOIN digcomp.comp_exemplu ce ON cd.id = ce.comp_descriptor_id
WHERE cd.scaff_cod = 'd.1'
GROUP BY
cd.scaff_cod,
cd.nume,
cn.granular_nivel,
cnc.nume,
pc.nivel,
cn.complexitate,
cn.autonomie
ORDER BY cn.granular_nivel;
""")
try:
display(structure_df.style.hide(axis='index'))
except:
display(structure_df)
```
## Nivelul de perfomanță
```{python}
#| label: prof-levels
#| output: true
levels_df = query_to_dataframe("""
SELECT
cn.granular_nivel as "Nivel Granular de Perfromanță",
cnc.nume as "Nivel de Perfromanță",
cn.complexitate as "Complexitate",
cn.autonomie as "Autonomie",
pc.nivel as "Proces Cognitiv"
FROM digcomp.comp_nivel cn
JOIN digcomp.comp_nivel_categorie cnc ON cn.comp_nivel_categorie_id = cnc.id
JOIN digcomp.proces_cognitiv pc ON cn.proces_cognitiv_id = pc.id
ORDER BY cn.granular_nivel
""")
try:
display(levels_df.style.hide(axis='index'))
except:
# Fallback for even older pandas versions
display(levels_df)
print("Note: First column shown is just the index, not part of the data")
```
## Rezultate de învățare pe nivel de competență
```{python}
#| label: learning-outcomes
#| output: true
outcomes_df = query_to_dataframe("""
WITH nivel_info AS (
SELECT cn.id, cn.granular_nivel, cn.complexitate, cn.autonomie,
cnc.nume as categorie,
pc.nivel as proces_cognitiv
FROM digcomp.comp_nivel cn
JOIN digcomp.comp_nivel_categorie cnc ON cn.comp_nivel_categorie_id = cnc.id
JOIN digcomp.proces_cognitiv pc ON cn.proces_cognitiv_id = pc.id
WHERE cn.granular_nivel = 1
)
SELECT
'General' as "Tip Rezultat",
rig.descriere as "Descriere Sarcină",
ni.categorie as "Nivel Performanță",
ni.complexitate as "Complexitate",
ni.autonomie as "Autonomie",
ni.proces_cognitiv as "Proces Cognitiv"
FROM nivel_info ni
JOIN digcomp.rezultat_invatare_general rig ON rig.comp_nivel_id = ni.id
UNION ALL
SELECT
'Specific' as "Tip Rezultat",
ris.descriere as "Descriere",
ni.categorie as "Nivel Performanță",
ni.complexitate as "Complexitate",
ni.autonomie as "Autonomie",
ni.proces_cognitiv as "Proces Cognitiv"
FROM nivel_info ni
JOIN digcomp.rezultat_invatare_specific ris ON ris.comp_nivel_id = ni.id
ORDER BY "Tip Rezultat";
""")
try:
display(outcomes_df.style.hide(axis='index'))
except:
display(outcomes_df)
```