flex-tasks-processing
Safe HaskellNone
LanguageHaskell2010

FlexTask.Processing.Text

Description

Various text processing functions used to format input for display.

Synopsis

Control Sequences

Student answers for FlexTasks are compiled into a single String after retrieval. The answer String contains control sequences which encode the structure of the input form.

argDelimiter :: Text Source #

Outer delimiter for individual fields.

listDelimiter :: Text Source #

Inner delimiter for elements of a field list.

inputEscape :: Text Source #

Sequence denoting the start and end of a fields value.

missingMarker :: Text Source #

Marker for a missing field

emptyMarker :: Text Source #

Marker for a blank optional field

Formatting Functions

formatAnswer :: [[[Text]]] -> Maybe Text Source #

format a list of (nested) individual answers into a single answer String

formatIfFlexSubmission :: Text -> Text Source #

Format an answer String into a vertical text listing of individual values. This is used to display Flex submissions when using the "download all submission" feature in Autotool.

formatForJS :: Text -> Text Source #

Process Text containing Haskell Unicode representation for use in JavaScript.

removeUnicodeEscape :: String -> String Source #

Remove excessive escape characters in front of Unicode caused by conversion between Haskell and JavaScript representation.

Form Duplication for Autotool Comment View

uniqueFormCopy :: ([[Text]], Html) -> String -> ([[Text]], Html) Source #

Create an exact duplicate of the given form data, but append all field names with a unique identifier. This is used to render multiple views of the input form on the same page, e.g. the comments page in Autotool.

Internationalization

supportedLanguages :: [Lang] Source #

List of languages to cover for input form HTML in instances of RenderMessage for custom translations.