Python:RelevanceLevel

From wiki
Jump to navigation Jump to search

from dataclasses import dataclass from typing import Optional import dacite @dataclass class RelevanceLevel:

   """
   I am a relevance level
   """
   pageTitle:str
   id:Optional[str] # the id of this RelevanceLevel
   expectation:Optional[str] # the expectation for this RelevanceLevel
   examination:Optional[str] # how items for this RelevanceLevel are covered during examination
   description:Optional[str] # the description of this RelevanceLevel
   @classmethod
   def askQuery(cls):
       """
       get the ask Query for RelevanceLevel
       
       Returns:
           str: the mediawiki markup for the ask query
       """

ask="""

pageTitleidexpectationexaminationdescription
Rl/R1R1Contents will be part of the examination.These are the contents participants will be expected to learn and know for the exam. Within the course, these contents will be covered through exercises and discussions.
Rl/R2R2Contents may be part of the examination.These are the contents participants are expected to understand in principle e.g. as part of an R1 learning goal Excercises and exam content might cover this as part of an R1 learning goal
Rl/R3R3Contents will not be part of examination.These contents (keywords, concepts, methods, practices or similar) can enhance understanding and motivate the topic. They may be covered in lectures or exercises if required.

"""

       return ask
       
   @classmethod
   def fromDict(cls,data:dict):
       """
       create a RelevanceLevel from the given dict
       
       Args:
           data(dict): the dict to create the RelevanceLevel from
       
       Returns:
           RelevanceLevel: the freshly created RelevanceLevel
       """
       relevancelevel=dacite.from_dict(data_class=cls,data=data)
       return relevancelevel