Commit 6814401c authored by ecrombag's avatar ecrombag

- Added commentary describing the basic input/output functions.

- Moved 'displayInstruction' from MessageTasks to InteractionTasks
- Removed MessageTasks

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@952 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent cfd7cf9b
......@@ -299,6 +299,22 @@ makeMessageTask message context actions tst=:{taskNr}
= case action of
Just action = (TaskFinished action, tst)
Nothing = (TaskBusy, tst)
showInstruction :: !String !instruction -> Task Void | html instruction
showInstruction title instruction = mkInstructionTask title (makeInstructionTask instruction Nothing)
showInstructionAbout :: !String !instruction b -> Task Void | html instruction & iTask b
showInstructionAbout title instruction context = mkInstructionTask title (makeInstructionTask instruction (Just (visualizeAsHtmlDisplay context)))
makeInstructionTask :: !instruction (Maybe [HtmlTag]) *TSt -> *(!TaskResult Void,!*TSt) | html instruction
makeInstructionTask instruction context tst
# (updates, tst) = getUserUpdates tst
| isEmpty updates
= case tst.tree of
(TTInstructionTask ti _ _) = (TaskBusy ,{tst & tree = TTInstructionTask ti (html instruction) context})
_ = (TaskException (dynamic "Illegal node in makeInstructionTask"), tst)
| otherwise
= (TaskFinished Void,tst)
//Shared value tasks
:: View s = E.a: Listener (Listener` s a) | E.a: Editor (Editor` s a)
......
definition module MessageTasks
import StdList
import Html, TSt
from InteractionTasks import class html(..)
showInstruction :: !String !instruction -> Task Void | html instruction
showInstructionAbout :: !String !instruction b -> Task Void | html instruction & iTask b
\ No newline at end of file
implementation module MessageTasks
import StdList
import Html, TSt
from InteractionTasks import class html(..)
//mkInstructionTask :: !String !(*TSt -> *(!TaskResult Void,!*TSt)) -> Task Void
//showInstruction
showInstruction :: !String !instruction -> Task Void | html instruction
showInstruction title instruction = mkInstructionTask title (makeInstructionTask instruction Nothing)
//showInstructionAbout
showInstructionAbout :: !String !instruction b -> Task Void | html instruction & iTask b
showInstructionAbout title instruction context = mkInstructionTask title (makeInstructionTask instruction (Just (visualizeAsHtmlDisplay context)))
makeInstructionTask :: !instruction (Maybe [HtmlTag]) *TSt -> *(!TaskResult Void,!*TSt) | html instruction
makeInstructionTask instruction context tst
# (updates, tst) = getUserUpdates tst
| isEmpty updates
= case tst.tree of
(TTInstructionTask ti _ _) = (TaskBusy ,{tst & tree = TTInstructionTask ti (html instruction) context})
_ = (TaskException (dynamic "Illegal node in makeInstructionTask"), tst)
| otherwise
= (TaskFinished Void,tst)
......@@ -8,7 +8,6 @@ import Engine // basic iTask system creator
// Basic tasks
, InteractionTasks // tasks for interaction with users
, MessageTasks // tasks for displaying static messages
, SystemTasks // tasks for interaction with the iTasks system itself
, StoreTasks // tasks for accessing the generic store
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment