chore(study-modules): remove deprecated study module representation
This commit is contained in:
parent
ceebc4e6c9
commit
89b36f2d97
@ -40,8 +40,6 @@ CourseDescriptionPlaceholder: Bitte mindestens die Modulbeschreibung angeben
|
||||
CourseHomepageExternal: Externe Homepage
|
||||
CourseSemesterMultipleTip: Es stehen für Sie aktuell mehrere Semester zur Auswahl. Stellen Sie bitte sicher, dass Sie das für den Kurs korrekte Semester wählen.
|
||||
CourseHomepageExternalPlaceholder: Optionale externe URL
|
||||
CourseStudyModules: Assoziierte Module
|
||||
CourseStudyModulesTip: Komma-separierte Liste an Modulen, für welche Leistungen dieses Kurses verbucht werden können. Bitte nach Möglichkeit die Modulbezeichnung (z.B. WP1) sowie die Studienordnung (z.B. Master Informatik Hauptfach, 08. September 2010) angeben.
|
||||
CourseVisibleFrom: Sichtbar ab
|
||||
CourseVisibleTo: Sichtbar bis
|
||||
CourseVisibleFromTip: Ab diesem Zeitpunkt ist der Kurs für andere Nutzer:innen sichtbar. Ohne Datum ist der Kurs nie für andere Nutzer:innen sichtbar. Dozierende, Assistent:innen, Tutor:innen, Korrektor:innen, angemeldete Teilnehmer:innen sowie Bewerber:innen dieses Kurses sind nicht betroffen. Nimmt der Kurs an einer Zentralanmeldung teil wird die Kurssichtbarkeit während der Bewerbungsphase forciert.
|
||||
|
||||
@ -39,8 +39,6 @@ CourseSemester: Semester
|
||||
CourseDescriptionPlaceholder: Please include the module description
|
||||
CourseHomepageExternalPlaceholder: Optional external URL
|
||||
CourseHomepageExternal: External homepage
|
||||
CourseStudyModules: Associated study modules
|
||||
CourseStudyModulesTip: Comma-separated list of study modules for which results of this course may be credited. If possible, please specify the module identifier (e.g. WP1) as well as the respective study regulations (e.g. Master Computer Science Major, September 8, 2010).
|
||||
CourseSemesterMultipleTip: You are currently allowed to select from among multiple semesters. Please ensure that you select the appropriate semester for your course.
|
||||
CourseVisibleFrom: Visible from
|
||||
CourseVisibleTo: Visible to
|
||||
|
||||
@ -11,7 +11,6 @@ Course -- Information about a single course; contained info is always visible
|
||||
shorthand (CI Text) -- practical shorthand of course name, used for identification
|
||||
term TermId -- semester this course is taught
|
||||
school SchoolId
|
||||
studyModules StudyModules -- study modules this course may be credited for
|
||||
capacity Int Maybe -- number of allowed enrolements, if restricted
|
||||
-- canRegisterNow = maybe False (<= currentTime) registerFrom && maybe True (>= currentTime) registerTo
|
||||
visibleFrom UTCTime Maybe default=now() -- course may be visible from a given day onwards or always hidden
|
||||
|
||||
@ -36,7 +36,6 @@ data CourseForm = CourseForm
|
||||
, cfTerm :: TermId
|
||||
, cfDesc :: Maybe StoredMarkup
|
||||
, cfLink :: Maybe URI
|
||||
, cfStudyModules :: StudyModules
|
||||
, cfVisFrom :: Maybe UTCTime
|
||||
, cfVisTo :: Maybe UTCTime
|
||||
, cfMatFree :: Bool
|
||||
@ -74,7 +73,6 @@ courseToForm cEnt@(Entity cid Course{..}) lecs lecInvites alloc = CourseForm
|
||||
, cfShort = courseShorthand
|
||||
, cfTerm = courseTerm
|
||||
, cfSchool = courseSchool
|
||||
, cfStudyModules = courseStudyModules
|
||||
, cfCapacity = courseCapacity
|
||||
, cfSecret = courseRegisterSecret
|
||||
, cfMatFree = courseMaterialFree
|
||||
@ -297,8 +295,6 @@ makeCourseForm miButtonAction template = identifyForm FIDcourse . validateFormDB
|
||||
(cfDesc <$> template)
|
||||
<*> aopt urlField (fslpI MsgCourseHomepageExternal (mr MsgCourseHomepageExternalPlaceholder))
|
||||
(cfLink <$> template)
|
||||
<*> apopt studyModulesSimpleField (fslI MsgCourseStudyModules & setTooltip MsgCourseStudyModulesTip)
|
||||
(cfStudyModules <$> template)
|
||||
<*> aopt utcTimeField (fslpI MsgCourseVisibleFrom (mr MsgCourseDate)
|
||||
& setTooltip MsgCourseVisibleFromTip) (deepAlt (cfVisFrom <$> template) newVisFrom)
|
||||
<*> aopt utcTimeField (fslpI MsgCourseVisibleTo (mr MsgCourseDate)
|
||||
@ -498,7 +494,6 @@ courseEditHandler miButtonAction mbCourseForm = do
|
||||
, courseShorthand = cfShort
|
||||
, courseTerm = cfTerm
|
||||
, courseSchool = cfSchool
|
||||
, courseStudyModules = cfStudyModules
|
||||
, courseCapacity = cfCapacity
|
||||
, courseRegisterSecret = cfSecret
|
||||
, courseMaterialFree = cfMatFree
|
||||
@ -550,7 +545,6 @@ courseEditHandler miButtonAction mbCourseForm = do
|
||||
, courseShorthand = cfShort
|
||||
, courseTerm = cfTerm -- dangerous
|
||||
, courseSchool = cfSchool
|
||||
, courseStudyModules = cfStudyModules
|
||||
, courseCapacity = cfCapacity
|
||||
, courseRegisterSecret = cfSecret
|
||||
, courseMaterialFree = cfMatFree
|
||||
|
||||
@ -14,7 +14,6 @@ import Handler.Utils.Tutorial
|
||||
import qualified Data.CaseInsensitive as CI
|
||||
|
||||
import qualified Data.Map as Map
|
||||
import qualified Data.Set as Set
|
||||
|
||||
import qualified Database.Esqueleto.Legacy as E
|
||||
import qualified Database.Esqueleto.Utils as E
|
||||
|
||||
@ -2529,7 +2529,3 @@ i18nFieldW :: forall a ident handler.
|
||||
-> Maybe (Maybe (I18n a))
|
||||
-> WForm handler (FormResult (Maybe (I18n a)))
|
||||
i18nFieldW strField onlyAppLanguages miButtonAction miIdent fSettings fRequired mPrev' = aFormToWForm $ i18nFieldA strField onlyAppLanguages miButtonAction miIdent fSettings fRequired mPrev'
|
||||
|
||||
|
||||
studyModulesSimpleField :: Field Handler StudyModules
|
||||
studyModulesSimpleField = convertField (Set.fromList . map (StudyModuleFreeModule . CI.mk) . filter (not . Text.null) . map Text.strip . Text.splitOn ",") (intercalate ", " . map (CI.original . stdModFreeModule) . Set.toList) textField
|
||||
|
||||
@ -23,4 +23,3 @@ import Model.Types.Markup as Types
|
||||
import Model.Types.Room as Types
|
||||
import Model.Types.Csv as Types
|
||||
import Model.Types.Upload as Types
|
||||
import Model.Types.StudyModules as Types
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
module Model.Types.StudyModules
|
||||
where
|
||||
|
||||
import Import.NoModel
|
||||
|
||||
|
||||
data StudyModule
|
||||
= StudyModuleModule -- full (i.e. unambiguous) study module specification
|
||||
{ stdModRegulation :: CI Text -- TODO: Reference StudyDegree and StudyTerms instead?
|
||||
, stdModRegVersion :: UTCTime
|
||||
, stdModModule :: CI Text
|
||||
}
|
||||
| StudyModuleFreeModule -- allows for arbitrary module specifications
|
||||
{ stdModFreeModule :: CI Text
|
||||
}
|
||||
deriving (Eq, Ord, Read, Show, Generic, Typeable)
|
||||
deriving anyclass (NFData)
|
||||
|
||||
deriveJSON defaultOptions
|
||||
{ fieldLabelModifier = camelToPathPiece' 2
|
||||
, constructorTagModifier = camelToPathPiece' 2
|
||||
} ''StudyModule
|
||||
|
||||
derivePersistFieldJSON ''StudyModule
|
||||
|
||||
instance Binary StudyModule
|
||||
|
||||
|
||||
type StudyModules = Set StudyModule
|
||||
@ -69,20 +69,6 @@ $# #{summary}
|
||||
<div>
|
||||
#{descr}
|
||||
|
||||
$if not (Set.null (courseStudyModules course))
|
||||
<dt .deflist__dt>_{MsgCourseStudyModules}
|
||||
<dd .deflist__dd>
|
||||
<ul>
|
||||
$forall studyModule <- Set.toList (courseStudyModules course)
|
||||
<li>
|
||||
$case studyModule
|
||||
$of StudyModuleModule{..}
|
||||
#{CI.original stdModRegulation} #
|
||||
(^{formatTimeW SelFormatDate stdModRegVersion}): #
|
||||
#{CI.original stdModModule}
|
||||
$of StudyModuleFreeModule{..}
|
||||
#{CI.original stdModFreeModule}
|
||||
|
||||
<dt .deflist__dt>_{MsgTableCourseSchool}
|
||||
<dd .deflist__dd>
|
||||
#{schoolName}
|
||||
|
||||
@ -660,7 +660,6 @@ fillDb = do
|
||||
, courseShorthand = "FFP"
|
||||
, courseTerm = TermKey $ seasonTerm True Summer
|
||||
, courseSchool = ifi
|
||||
, courseStudyModules = Set.fromList $ (StudyModuleFreeModule . CI.mk) <$> [ "Bachelor Informatik HF P16", "Bachelor (Medien-)Informatik HF P17", "Bachelor Medieninformatik HF P18", "Master Informatik HF WP8/WP9", "Master Medieninformatik HF P2/P6", "Master Informatik NF WP20" ]
|
||||
, courseCapacity = Just 20
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
@ -814,7 +813,6 @@ fillDb = do
|
||||
, courseShorthand = "EIP"
|
||||
, courseTerm = TermKey $ seasonTerm False Winter
|
||||
, courseSchool = ifi
|
||||
, courseStudyModules = Set.fromList $ (StudyModuleFreeModule . CI.mk) <$> [ "Bachelor (Medien-)Informatik HF P1" ]
|
||||
, courseCapacity = Just 20
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
@ -841,7 +839,6 @@ fillDb = do
|
||||
, courseShorthand = "IXD"
|
||||
, courseTerm = TermKey $ seasonTerm True Summer
|
||||
, courseSchool = ifi
|
||||
, courseStudyModules = Set.fromList $ (StudyModuleFreeModule . CI.mk) <$> [ "Bachelor Medieninformatik HF WP16.1 + WP16.2" ]
|
||||
, courseCapacity = Just 20
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
@ -869,7 +866,6 @@ fillDb = do
|
||||
, courseTerm = TermKey $ seasonTerm True Winter
|
||||
, courseSchool = ifi
|
||||
, courseCapacity = Just 30
|
||||
, courseStudyModules = Set.fromList $ (StudyModuleFreeModule . CI.mk) <$> [ "Bachelor Medieninformatik HF WP16.3" ]
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
, courseRegisterFrom = Nothing
|
||||
@ -895,7 +891,6 @@ fillDb = do
|
||||
, courseShorthand = "ProMo"
|
||||
, courseTerm = TermKey $ seasonTerm True Summer
|
||||
, courseSchool = ifi
|
||||
, courseStudyModules = Set.fromList $ (StudyModuleFreeModule . CI.mk) <$> [ "Bachelor Informatik HF P4", "Bachelor Medieninformatik HF P2", "Bachelor Informatik NF WP1" ]
|
||||
, courseCapacity = Just 50
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
@ -1069,7 +1064,6 @@ fillDb = do
|
||||
, courseShorthand = "DBS"
|
||||
, courseTerm = TermKey $ seasonTerm False Winter
|
||||
, courseSchool = ifi
|
||||
, courseStudyModules = Set.fromList $ (StudyModuleFreeModule . CI.mk) <$> [ "Bachelor Informatik HF P15", "Bachelor Medieninformatik HF P10", "Bachelor Informatik NF WP10" ]
|
||||
, courseCapacity = Just 50
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
@ -1203,7 +1197,6 @@ fillDb = do
|
||||
, courseShorthand = "BS"
|
||||
, courseTerm = TermKey $ seasonTerm False Winter
|
||||
, courseSchool = ifi
|
||||
, courseStudyModules = Set.fromList $ (StudyModuleFreeModule . CI.mk) <$> [ "Bachelor Informatik HF P8", "Bachelor Medieninformatik HF P5", "Bachelor Informatik NF WP6" ]
|
||||
, courseCapacity = Just 50
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
@ -1280,7 +1273,6 @@ fillDb = do
|
||||
, courseShorthand = CI.mk csh
|
||||
, courseTerm = TermKey $ seasonTerm False Winter
|
||||
, courseSchool = ifi
|
||||
, courseStudyModules = Set.empty
|
||||
, courseCapacity = Just 50
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
@ -1343,7 +1335,6 @@ fillDb = do
|
||||
, courseShorthand = CI.mk csh
|
||||
, courseTerm = TermKey $ seasonTerm False Winter
|
||||
, courseSchool = ifi
|
||||
, courseStudyModules = Set.empty
|
||||
, courseCapacity = Just cap
|
||||
, courseVisibleFrom = Just now
|
||||
, courseVisibleTo = Nothing
|
||||
|
||||
Reference in New Issue
Block a user