Skip to content

Commit

Permalink
KBMBF-452: #37 Show ratio of oer-content
Browse files Browse the repository at this point in the history
KBMBF-502: Improving frontend
SD_WLO-238: Showing OER

Updating tree collection details table with required properties
  • Loading branch information
Robert Meissner committed Jul 21, 2022
1 parent 030840b commit 76cf41b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ __pycache__/
.ipynb_checkpoints/
local_tools/
/docs/build/
backup/
nginx/
5 changes: 3 additions & 2 deletions src/app/api/analytics/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class MaterialFieldValidation(BaseModel):
class MaterialValidationStats(ElasticValidationStats[MaterialFieldValidation]):
subjects: Optional[MaterialFieldValidation]
license: Optional[MaterialFieldValidation]
ads_qualifier: Optional[MaterialFieldValidation]
url: Optional[MaterialFieldValidation]
publisher: Optional[MaterialFieldValidation]
intended_end_user_role: Optional[MaterialFieldValidation]
material_type: Optional[MaterialFieldValidation]
object_type: Optional[MaterialFieldValidation]
38 changes: 19 additions & 19 deletions src/app/api/score/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,38 @@ class MissingCollectionProperties(BaseModel):

class MissingMaterialProperties(BaseModel):
total: int = Field(default=0, ge=0, description="Number of entries")
missing_edu_context: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without edu context"
)
missing_object_type: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without object type"
)
missing_description: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without description"
)
missing_license: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries with missing license"
)
missing_keywords: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without keywords"
)
missing_title: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without title"
)
missing_ads_qualifier: float = Field(
missing_material_type: float = Field(
default=0.0,
ge=0.0,
le=1.0,
description="Ratio of entries missing advertisement qualifier",
description="Ratio of entries missing material type",
)
missing_subjects: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries missing subjects"
)
missing_material_type: float = Field(
missing_url: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without url"
)
missing_license: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries with missing license"
)
missing_publisher: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without publisher"
)
missing_description: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without description"
)
missing_intended_end_user_role: float = Field(
default=0.0,
ge=0.0,
le=1.0,
description="Ratio of entries missing material type",
description="Ratio of entries without intended end user role",
)
missing_edu_context: float = Field(
default=0.0, ge=0.0, le=1.0, description="Ratio of entries without edu context"
)


Expand Down
16 changes: 9 additions & 7 deletions src/app/api/score/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,18 @@ def field_names_used_for_score_calculation(properties: dict) -> list[str]:

aggs_material_validation = {
"missing_title": amissing(qfield=LearningMaterialAttribute.TITLE),
"missing_keywords": amissing(qfield=LearningMaterialAttribute.KEYWORDS),
"missing_subjects": amissing(qfield=LearningMaterialAttribute.SUBJECTS),
"missing_description": amissing(qfield=LearningMaterialAttribute.DESCRIPTION),
"missing_license": afilter(query=query_missing_material_license()),
"missing_edu_context": amissing(qfield=LearningMaterialAttribute.EDU_CONTEXT),
"missing_ads_qualifier": amissing(qfield=LearningMaterialAttribute.CONTAINS_ADS),
"missing_material_type": amissing(
qfield=LearningMaterialAttribute.LEARNINGRESOURCE_TYPE
),
"missing_object_type": amissing(qfield=LearningMaterialAttribute.OBJECT_TYPE),
"missing_subjects": amissing(qfield=LearningMaterialAttribute.SUBJECTS),
"missing_url": amissing(qfield=LearningMaterialAttribute.WWW_URL),
"missing_license": afilter(query=query_missing_material_license()),
"missing_publisher": amissing(qfield=LearningMaterialAttribute.PUBLISHER),
"missing_description": amissing(qfield=LearningMaterialAttribute.DESCRIPTION),
"missing_intended_end_user_role": amissing(
qfield=LearningMaterialAttribute.EDUENDUSERROLE_DE
),
"missing_edu_context": amissing(qfield=LearningMaterialAttribute.EDU_CONTEXT),
}
aggs_collection_validation = {
"missing_title": amissing(qfield=CollectionAttribute.TITLE),
Expand Down

0 comments on commit 76cf41b

Please sign in to comment.