Skip to content

Commit

Permalink
Made sure ed-fi isn't hard coded in the templates or earthmover
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruk committed Nov 13, 2024
1 parent c458c0a commit 3fb6537
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 23 deletions.
48 changes: 35 additions & 13 deletions assessments/KRAssessment/earthmover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,30 @@ config:
parameter_defaults:
STUDENT_ID_NAME: 'edFi_studentUniqueID' # default to the column added by the apply_xwalk package of student ID xwalking feature edFi_studentUniqueID
POSSIBLE_STUDENT_ID_COLUMNS: 'PS_StudentID,StudentSUNS'
DESCRIPTOR_NAMESPACE: uri://ed-fi.org

sources:
input:
file: ${INPUT_FILE}
header_rows: 1
assessments:
file: ${BUNDLE_DIR}/seeds/assessments.csv
file: ./seeds/assessments.csv
header_rows: 1
objectiveAssessments:
file: ${BUNDLE_DIR}/seeds/objectiveAssessments.csv
file: ./seeds/objectiveAssessments.csv
header_rows: 1
assessmentReportingMethodDescriptors:
file: ${BUNDLE_DIR}/seeds/assessmentReportingMethodDescriptors.csv
file: ./seeds/assessmentReportingMethodDescriptors.csv
header_rows: 1

gradeLevelDescriptors:
file: ${BUNDLE_DIR}/seeds/gradeLevelDescriptors.csv
file: ./seeds/gradeLevelDescriptors.csv
header_rows: 1
performanceLevelDescriptors:
file: ${BUNDLE_DIR}/seeds/performanceLevelDescriptors.csv
file: ./seeds/performanceLevelDescriptors.csv
header_rows: 1
assessmentCategoryDescriptors:
file: ${BUNDLE_DIR}/seeds/assessmentCategoryDescriptors.csv
file: ./seeds/assessmentCategoryDescriptors.csv
header_rows: 1

transformations:
Expand Down Expand Up @@ -129,13 +130,18 @@ transformations:
create_columns:
grade_json: agg(grade_json,,)

prepare_assessments:


stage_assessments:
source: $sources.assessments
operations:
- operation: add_columns
columns:
assessmentIdentifier: "KRA"

prepare_assessments:
source: $transformations.stage_assessments
operations:
- operation: join
sources:
- $transformations.grade_level_descriptors
Expand All @@ -155,6 +161,10 @@ transformations:
join_type: inner
left_key: assessmentIdentifier
right_key: assessmentIdentifier
- operation: add_columns
columns:
descriptorNamespace: ${DESCRIPTOR_NAMESPACE}


prepare_objective_assessments:
source: $sources.objectiveAssessments
Expand All @@ -165,7 +175,6 @@ transformations:
- operation: join
sources:
- $transformations.performance_levels

join_type: inner
left_key: assessmentIdentifier
right_key: assessmentIdentifier
Expand All @@ -175,24 +184,34 @@ transformations:
join_type: inner
left_key: assessmentIdentifier
right_key: assessmentIdentifier
- operation: add_columns
columns:
descriptorNamespace: ${DESCRIPTOR_NAMESPACE}



prepare_student_assessments:
source: $sources.input
source: $transformations.input
operations:
- operation: duplicate_columns
columns:
${STUDENT_ID_NAME}: studentUniqueId

- operation: rename_columns
columns:
SchoolCode: schoolId

- operation: add_columns
columns:
assessmentIdentifier: "KRA"
administrationDate: "{%raw%}{{ DateTaken }}{%endraw%}"
whenAssessedGradeLevelDescriptor: "uri://ed.sc.gov/GradeLevelDescriptor#0"
descriptorNamespace: ${DESCRIPTOR_NAMESPACE}
- operation: join
sources:
- $transformations.stage_assessments
join_type: inner
left_key: assessmentIdentifier
right_key: assessmentIdentifier

- operation: add_columns
columns:
studentAssessmentIdentifier: "{% raw %}{{ md5(assessmentIdentifier ~ '-' ~ studentUniqueId ~ '-' ~ DateTaken) }}{% endraw %}"
Expand All @@ -210,8 +229,10 @@ transformations:
PerformanceLevel_PDScore: "{%raw%}{% if PDScore >= minimumScore and PDScore <= maximumScore %}{{ codeValue }}{% endif %}{%endraw%}"
- operation: filter_rows
query: "(PerformanceLevel_SFScore != 'Unknown' ) or (PerformanceLevel_LLScore != 'Unknown') or (PerformanceLevel_MAScore != 'Unknown') or (PerformanceLevel_PDScore != 'Unknown' )"

behavior: include
- operation: rename_columns
columns:
namespace_x: namespace
- operation: group_by
group_by_columns:
- studentAssessmentIdentifier
Expand All @@ -228,12 +249,13 @@ transformations:
- MAScore
- PDScore
- schoolId
- descriptorNamespace
create_columns:
PerformanceLevel_SFScore: agg(PerformanceLevel_SFScore,)
PerformanceLevel_LLScore: agg(PerformanceLevel_LLScore,)
PerformanceLevel_MAScore: agg(PerformanceLevel_MAScore,)
PerformanceLevel_PDScore: agg(PerformanceLevel_PDScore,)



destinations:
Expand Down
6 changes: 3 additions & 3 deletions assessments/KRAssessment/templates/assessments.jsont
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"assessmentFamily": "{{assessmentIdentifier}}",
"namespace": "{{namespace}}",
"assessedGradeLevels": [{{grade_json}}],
"assessmentCategoryDescriptor": "{{namespace}}/AssessmentCategoryDescriptor#{{assessmentCategoryDescriptor}}",
"academicSubjects": [ {"academicSubjectDescriptor":"uri://ed.sc.gov/AcademicSubjectDescriptor#{{academicSubjectDescriptor}}"}],
"assessmentCategoryDescriptor": "{{assessmentCategoryDescriptor}}",
"academicSubjects": [ {"academicSubjectDescriptor":"{{academicSubjectDescriptor}}"}],
"scores": [
{
"assessmentReportingMethodDescriptor": "{{namespace}}/AssessmentReportingMethodDescriptor#ScaleScore",
"resultDatatypeTypeDescriptor": "uri://ed-fi.org/ResultDatatypeTypeDescriptor#Integer",
"resultDatatypeTypeDescriptor": "uri://{{descriptorNamespace}}/ResultDatatypeTypeDescriptor#Integer",
"minimumScore":"{{ minimumScore }}",
"maximumScore":"{{ maximumScore }}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scores": [
{
"assessmentReportingMethodDescriptor": "{{namespace}}/KRA/AssessmentReportingMethodDescriptor#ScaleScore",
"resultDatatypeTypeDescriptor": "uri://ed-fi.org/ResultDatatypeTypeDescriptor#Integer",
"resultDatatypeTypeDescriptor": "{{descriptorNamespace}}/ResultDatatypeTypeDescriptor#Integer",
"minimumScore":"{{ minimumScore | string }}",
"maximumScore":"{{ maximumScore | string}}"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"educationOrganizationAssociationTypeDescriptor": "uri://ed-fi.org/EducationOrganizationAssociationTypeDescriptor#Administration",
"educationOrganizationAssociationTypeDescriptor": "{{descriptorNamespace}}/EducationOrganizationAssociationTypeDescriptor#Administration",
"educationOrganizationReference": {
"educationOrganizationId": {{ schoolId }}
},
Expand Down
10 changes: 5 additions & 5 deletions assessments/KRAssessment/templates/studentAssessments.jsont
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% if OverallScore is not none and OverallScore | length %}
{
"assessmentReportingMethodDescriptor": "{{namespace}}/AssessmentReportingMethodDescriptor#ScaleScore",
"resultDatatypeTypeDescriptor": "uri://ed-fi.org/ResultDatatypeTypeDescriptor#Integer",
"resultDatatypeTypeDescriptor": "{{descriptorNamespace}}/ResultDatatypeTypeDescriptor#Integer",
"result": "{{OverallScore}}"
}
{% endif %}
Expand Down Expand Up @@ -53,7 +53,7 @@
"scoreResults": [
{
"assessmentReportingMethodDescriptor": "{{namespace}}/AssessmentReportingMethodDescriptor#ScaleScore",
"resultDatatypeTypeDescriptor": "uri://ed-fi.org/ResultDatatypeTypeDescriptor#Integer",
"resultDatatypeTypeDescriptor": "{{descriptorNamespace}}/ResultDatatypeTypeDescriptor#Integer",
"result": "{{ SFScore }}"
}
],
Expand All @@ -74,7 +74,7 @@
"scoreResults": [
{
"assessmentReportingMethodDescriptor": "{{namespace}}/AssessmentReportingMethodDescriptor#ScaleScore",
"resultDatatypeTypeDescriptor": "uri://ed-fi.org/ResultDatatypeTypeDescriptor#Integer",
"resultDatatypeTypeDescriptor": "{{descriptorNamespace}}/ResultDatatypeTypeDescriptor#Integer",
"result": "{{ LLScore }}"
}
],
Expand All @@ -95,7 +95,7 @@
"scoreResults": [
{
"assessmentReportingMethodDescriptor": "{{namespace}}/AssessmentReportingMethodDescriptor#ScaleScore",
"resultDatatypeTypeDescriptor": "uri://ed-fi.org/ResultDatatypeTypeDescriptor#Integer",
"resultDatatypeTypeDescriptor": "{{descriptorNamespace}}/ResultDatatypeTypeDescriptor#Integer",
"result": "{{ MAScore }}"
}
],
Expand All @@ -116,7 +116,7 @@
"scoreResults": [
{
"assessmentReportingMethodDescriptor": "{{namespace}}/AssessmentReportingMethodDescriptor#ScaleScore",
"resultDatatypeTypeDescriptor": "uri://ed-fi.org/ResultDatatypeTypeDescriptor#Integer",
"resultDatatypeTypeDescriptor": "{{descriptorNamespace}}/ResultDatatypeTypeDescriptor#Integer",
"result": "{{ PDScore }}"
}
],
Expand Down

0 comments on commit 3fb6537

Please sign in to comment.