-- |

module Modelling.CdOd.NameCdError.Instance where

import qualified Data.Map                         as M (fromList)

import Modelling.Auxiliary.Shuffle.All  (ShuffleInstance (..))
import Modelling.CdOd.NameCdError (
  NameCdErrorInstance (..),
  NameCdErrorTaskTextElement (..),
  Reason (..),
  Relevance (..),
  )

import Modelling.CdOd.Types (
  Annotation (..),
  AnnotatedClassDiagram (..),
  CdDrawSettings (..),
  LimitedLinking (..),
  OmittedDefaultMultiplicities (..),
  Relationship (..),
  )

import Control.OutputCapable.Blocks (
  ArticleToUse (DefiniteArticle),
  ExtraText (..),
  Language (English, German),
  )
import Control.OutputCapable.Blocks.Generic.Type (
  GenericOutput (Paragraph, Special, Translated),
  )
import Data.Map                         (Map)

listToFM :: Ord a => [(a, b)] -> Map a b
listToFM :: forall a b. Ord a => [(a, b)] -> Map a b
listToFM = [(a, b)] -> Map a b
forall a b. Ord a => [(a, b)] -> Map a b
M.fromList

{-|
points: 0.15
-}
task2024_14 :: ShuffleInstance NameCdErrorInstance
task2024_14 :: ShuffleInstance NameCdErrorInstance
task2024_14 = ShuffleInstance {
  taskInstance :: NameCdErrorInstance
taskInstance = NameCdErrorInstance {
    byName :: Bool
byName = Bool
True,
    classDiagram :: AnnotatedCd Relevance
classDiagram = AnnotatedClassDiagram {
      annotatedClasses :: [String]
annotatedClasses = [String
"Professor", String
"FacilityManager", String
"Person", String
"Room", String
"Building", String
"UniversityCampus"],
      annotatedRelationships :: [Annotation Relevance (AnyRelationship String String)]
annotatedRelationships = [
        Annotation {
          annotated :: AnyRelationship String String
annotated = Relationship String String -> AnyRelationship String String
forall a b. b -> Either a b
Right Composition {
            compositionName :: String
compositionName = String
"isPartOf",
            compositionPart :: LimitedLinking String
compositionPart = LimitedLinking {
              linking :: String
linking = String
"Room",
              limits :: (Int, Maybe Int)
limits = (Int
2, Maybe Int
forall a. Maybe a
Nothing)
              },
            compositionWhole :: LimitedLinking String
compositionWhole = LimitedLinking {
              linking :: String
linking = String
"Building",
              limits :: (Int, Maybe Int)
limits = (Int
1, Int -> Maybe Int
forall a. a -> Maybe a
Just Int
1)
              }
            },
          annotation :: Relevance
annotation = Relevant {
            contributingToProblem :: Bool
contributingToProblem = Bool
False,
            listingPriority :: Int
listingPriority = Int
4,
            referenceUsing :: ArticleToUse
referenceUsing = ArticleToUse
DefiniteArticle
            }
          },
        Annotation {
          annotated :: AnyRelationship String String
annotated = Relationship String String -> AnyRelationship String String
forall a b. b -> Either a b
Right Association {
            associationName :: String
associationName = String
"isResponsibleFor",
            associationFrom :: LimitedLinking String
associationFrom = LimitedLinking {
              linking :: String
linking = String
"FacilityManager",
              limits :: (Int, Maybe Int)
limits = (Int
1, Int -> Maybe Int
forall a. a -> Maybe a
Just Int
1)
              },
            associationTo :: LimitedLinking String
associationTo = LimitedLinking {
              linking :: String
linking = String
"Building",
              limits :: (Int, Maybe Int)
limits = (Int
1, Maybe Int
forall a. Maybe a
Nothing)
              }
            },
          annotation :: Relevance
annotation = Relevant {
            contributingToProblem :: Bool
contributingToProblem = Bool
False,
            listingPriority :: Int
listingPriority = Int
1,
            referenceUsing :: ArticleToUse
referenceUsing = ArticleToUse
DefiniteArticle
            }
          },
        Annotation {
          annotated :: AnyRelationship String String
annotated = Relationship String String -> AnyRelationship String String
forall a b. b -> Either a b
Right Association {
            associationName :: String
associationName = String
"hasOfficeIn",
            associationFrom :: LimitedLinking String
associationFrom = LimitedLinking {
              linking :: String
linking = String
"Professor",
              limits :: (Int, Maybe Int)
limits = (Int
1, Int -> Maybe Int
forall a. a -> Maybe a
Just Int
1)
              },
            associationTo :: LimitedLinking String
associationTo = LimitedLinking {
              linking :: String
linking = String
"Room",
              limits :: (Int, Maybe Int)
limits = (Int
1, Int -> Maybe Int
forall a. a -> Maybe a
Just Int
1)
              }
            },
          annotation :: Relevance
annotation = Relevant {
            contributingToProblem :: Bool
contributingToProblem = Bool
True,
            listingPriority :: Int
listingPriority = Int
2,
            referenceUsing :: ArticleToUse
referenceUsing = ArticleToUse
DefiniteArticle
            }
          },
        Annotation {
          annotated :: AnyRelationship String String
annotated = Relationship String String -> AnyRelationship String String
forall a b. b -> Either a b
Right Inheritance {
            subClass :: String
subClass = String
"Professor",
            superClass :: String
superClass = String
"Person"
            },
          annotation :: Relevance
annotation = Relevant {
            contributingToProblem :: Bool
contributingToProblem = Bool
False,
            listingPriority :: Int
listingPriority = Int
5,
            referenceUsing :: ArticleToUse
referenceUsing = ArticleToUse
DefiniteArticle
            }
          },
        Annotation {
          annotated :: AnyRelationship String String
annotated = Relationship String String -> AnyRelationship String String
forall a b. b -> Either a b
Right Inheritance {
            subClass :: String
subClass = String
"FacilityManager",
            superClass :: String
superClass = String
"Person"
            },
          annotation :: Relevance
annotation = Relevant {
            contributingToProblem :: Bool
contributingToProblem = Bool
False,
            listingPriority :: Int
listingPriority = Int
6,
            referenceUsing :: ArticleToUse
referenceUsing = ArticleToUse
DefiniteArticle
            }
          },
        Annotation {
          annotated :: AnyRelationship String String
annotated = Relationship String String -> AnyRelationship String String
forall a b. b -> Either a b
Right Composition {
            compositionName :: String
compositionName = String
"isOn",
            compositionPart :: LimitedLinking String
compositionPart = LimitedLinking {
              linking :: String
linking = String
"Building",
              limits :: (Int, Maybe Int)
limits = (Int
2, Maybe Int
forall a. Maybe a
Nothing)
              },
            compositionWhole :: LimitedLinking String
compositionWhole = LimitedLinking {
              linking :: String
linking = String
"UniversityCampus",
              limits :: (Int, Maybe Int)
limits = (Int
1, Int -> Maybe Int
forall a. a -> Maybe a
Just Int
1)
              }
            },
          annotation :: Relevance
annotation = Relevant {
            contributingToProblem :: Bool
contributingToProblem = Bool
False,
            listingPriority :: Int
listingPriority = Int
3,
            referenceUsing :: ArticleToUse
referenceUsing = ArticleToUse
DefiniteArticle
            }
          }
        ]
      },
    cdDrawSettings :: CdDrawSettings
cdDrawSettings = CdDrawSettings {
      omittedDefaults :: OmittedDefaultMultiplicities
omittedDefaults = OmittedDefaultMultiplicities {
        aggregationWholeOmittedDefaultMultiplicity :: Maybe (Int, Maybe Int)
aggregationWholeOmittedDefaultMultiplicity = (Int, Maybe Int) -> Maybe (Int, Maybe Int)
forall a. a -> Maybe a
Just (Int
0, Maybe Int
forall a. Maybe a
Nothing),
        associationOmittedDefaultMultiplicity :: Maybe (Int, Maybe Int)
associationOmittedDefaultMultiplicity = (Int, Maybe Int) -> Maybe (Int, Maybe Int)
forall a. a -> Maybe a
Just (Int
0, Maybe Int
forall a. Maybe a
Nothing),
        compositionWholeOmittedDefaultMultiplicity :: Maybe (Int, Maybe Int)
compositionWholeOmittedDefaultMultiplicity = Maybe (Int, Maybe Int)
forall a. Maybe a
Nothing
        },
      printNames :: Bool
printNames = Bool
True,
      printNavigations :: Bool
printNavigations = Bool
True
      },
    errorReasons :: Map Char (Bool, Reason)
errorReasons = [(Char, (Bool, Reason))] -> Map Char (Bool, Reason)
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
      (Char
'a', (Bool
False, Map Language String -> Reason
Custom ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
        (Language
English, String
"contains a syntax error"),
        (Language
German, String
"enthält einen Syntaxfehler")
        ]))),
      (Char
'b', (Bool
False, Map Language String -> Reason
Custom ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
        (Language
English, String
"does not have any corresponding object diagram"),
        (Language
German, String
"hat gar kein passendes Objektdiagramm")
        ]))),
      (Char
'c', (Bool
False, Map Language String -> Reason
Custom ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
        (Language
English, String
"is fully correctly modelled"),
        (Language
German, String
"ist vollständig richtig modelliert")
        ]))),
      (Char
'd', (Bool
True, Map Language String -> Reason
Custom ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
        (Language
English, String
"violates a requirement of the scenario"),
        (Language
German, String
"hält eine Vorgabe des Szenarios nicht ein")
        ])))
      ],
    showSolution :: Bool
showSolution = Bool
True,
    taskText :: NameCdErrorTaskText
taskText = [
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [
        Map Language String
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
Map language String -> GenericOutput language element
Translated ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
          (Language
English, String
"A student received the following scenario:"),
          (Language
German, String
"Ein Studierender hat folgendes Szenario erhalten:")
          ])
        ],
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [
        Map Language String
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
Map language String -> GenericOutput language element
Translated ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
          (Language
English, String
"A university campus consists of different buildings. Facility managers are responsible for buildings and each building is cared for by a facility manager. A facility manager is a person. Another kind of persons are the professors, who each have a specific room as own office. A building consists of different rooms, not each of which is a professor's office."),
          (Language
German, String
"Ein Universitätscampus besteht aus verschiedenen Gebäuden. Hausmeister sind für Gebäude zuständig und jedes Gebäude wird von einem Hausmeister betreut. Ein Hausmeister ist eine Person. Eine andere Art von Personen sind die Professoren, die jeweils einen bestimmten Raum als eigenes Büro haben. Ein Gebäude besteht aus verschiedenen Räumen, von denen nicht jeder ein Professorenbüro ist.")
          ])
        ],
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [
        Map Language String
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
Map language String -> GenericOutput language element
Translated ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
          (Language
English, String
"The student solved the task of creating a class diagram for this scenario in the following way:"),
          (Language
German, String
"Die Aufgabe, ein Klassendiagramm für dieses Szenario zu erzeugen, hat der Studierende folgendermaßen gelöst:")
          ])
        ],
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [NameCdErrorTaskTextElement
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element. element -> GenericOutput language element
Special NameCdErrorTaskTextElement
IncorrectCd],
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [
        Map Language String
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
Map language String -> GenericOutput language element
Translated ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
          (Language
English, String
"It contains the following relationships between classes:"),
          (Language
German,String
"Es enthält die folgenden Beziehungen zwischen Klassen:")
          ])
        ],
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [NameCdErrorTaskTextElement
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element. element -> GenericOutput language element
Special NameCdErrorTaskTextElement
RelationshipsList],
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [
        Map Language String
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
Map language String -> GenericOutput language element
Translated ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
          (Language
English, String
"Analyse and take a stance on the created class diagram regarding the scenario task of the student! In case, indicate all the specific relationships that would need to be changed!"),
          (Language
German, String
"Analysieren Sie und beziehen Sie Stellung zum erzeugten Klassendiagramm hinsichtlich der Szenario-Aufgabe des Studierenden! Gegebenenfalls, führen Sie alle konkreten Beziehungen auf, die geändert werden müssten!")
          ])
        ],
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [
        Map Language String
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
Map language String -> GenericOutput language element
Translated ([(Language, String)] -> Map Language String
forall a b. Ord a => [(a, b)] -> Map a b
listToFM [
          (Language
English, String
"The class diagram ..."),
          (Language
German, String
"Das Klassendiagramm ...")
          ])
        ],
      NameCdErrorTaskText
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element.
[GenericOutput language element] -> GenericOutput language element
Paragraph [NameCdErrorTaskTextElement
-> GenericOutput Language NameCdErrorTaskTextElement
forall language element. element -> GenericOutput language element
Special NameCdErrorTaskTextElement
ReasonsList]
      ],
    addText :: ExtraText
addText = ExtraText
NoExtraText
    },
  allowLayoutMangling :: Bool
allowLayoutMangling = Bool
False,
  shuffleNames :: Bool
shuffleNames = Bool
False,
  shuffleOptions :: Bool
shuffleOptions = Bool
True
  }

{-|
points: 0.15
-}
task2025_12 :: ShuffleInstance NameCdErrorInstance
task2025_12 :: ShuffleInstance NameCdErrorInstance
task2025_12 = ShuffleInstance NameCdErrorInstance
task2024_14