Commit 35764df6 authored by Rinus Plasmeijer's avatar Rinus Plasmeijer

bug in multiple choice task / pull down meny is verwijderd

algemenere multiple coice gemaakt


git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@106 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent fb4f0f3d
......@@ -19,6 +19,9 @@ derive write Void, TCl
:: *TSt // abstract task state
:: Task a :== St *TSt a // an interactive task
:: LabeledTask a :== !(!String,!Task a) // a Task with a label used for labeling buttons, pull down menu, and the like
:: HtmlCode :== [BodyTag] // most programmers will only write bodytags
:: Void = Void // for tasks returning non interesting results, won't show up in editors either
......@@ -61,19 +64,21 @@ workFlowTask :: ![StartUpOptions] !(Task (Int,a))
| ThreadStorage Lifespan // for Ajax: where to store threadinformation: default = TxtFile
| ShowUsers Int // for multiUserTask, toggle between given maximum number of users, default: ShowUser 5
| VersionCheck | VersionNoCheck // for single & multiUser: default = VersionNoCheck
| MyHeader [BodyTag] // wil replace standard iTask information line
| MyHeader HtmlCode // wil replace standard iTask information line
// *********************************************************************************************************************************
// Here follow the iTasks combinators:
/* promote any iData editor to the iTask domain
editTask :: create a task editor to edit a value of given type, and add a button with given name to finish the task
editTask :: create a task editor (with submit button) to edit a value of given type, finish only if predicate holds
*/
editTask :: !String !a -> Task a | iData a
editTaskPred :: !a !(a -> (Bool, [BodyTag])) -> Task a | iData a
editTaskPred :: !a !(a -> (Bool, HtmlCode)) -> Task a | iData a
/* standard monadic combinators on iTasks:
(=>>) :: for sequencing: bind
(#>>) :: for sequencing: bind, but no argument passed
return_V :: lift a value to the iTask domain and return it
......@@ -84,6 +89,7 @@ return_V :: lift a value to the iTask domain and return it
return_V :: !a -> Task a | iCreateAndPrint a
/* prompting variants:
(?>>) :: prompt as long as task is active but not finished
(!>>) :: prompt when task is activated
(<<?) :: same as ?>>, except that prompt is displayed *after* task
......@@ -94,25 +100,27 @@ return_VF :: return the value and show the Html code specified
return_D :: return the value and show it in iData display format
*/
(?>>) infixr 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(!>>) infixr 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(<<?) infixl 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<<!) infixl 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<|) infixl 6 :: !(Task a) !(a -> (Bool, [BodyTag])) -> Task a | iCreate a
(?>>) infixr 5 :: !HtmlCode !(Task a) -> Task a | iCreate a
(!>>) infixr 5 :: !HtmlCode !(Task a) -> Task a | iCreate a
(<<?) infixl 5 :: !(Task a) !HtmlCode -> Task a | iCreate a
(<<!) infixl 5 :: !(Task a) !HtmlCode -> Task a | iCreate a
(<|) infixl 6 :: !(Task a) !(a -> (Bool, HtmlCode)) -> Task a | iCreate a
(<!) infixl 6 :: !(Task a) !(a -> .Bool) -> Task a | iCreateAndPrint a
return_VF :: ![BodyTag] !a -> Task a | iCreateAndPrint a
return_VF :: !HtmlCode !a -> Task a | iCreateAndPrint a
return_D :: !a -> Task a | gForm {|*|}, iCreateAndPrint a
/* Assign tasks to user with indicated id:
(@:) :: will prompt who is waiting for task with give name
(@::) :: same, default task name given
*/
//(@:) infix 3 :: !(!String,!Int) (Task a) -> (Task a) | iCreateAndPrint a
//(@::) infix 3 :: !Int (Task a) -> (Task a) | iCreate a
(@:) infix 3 :: !(!String,!Int) !(Task a) -> Task a | iData a
(@:) infix 3 :: !Int !(LabeledTask a) -> Task a | iData a
(@::) infix 3 :: !Int !(Task a) -> Task a | iData a
/* Handling recursion and loops:
newTask :: use the to promote a (recursively) defined user function to as task
foreverTask :: infinitely repeating Task
repeatTask :: repeat Task until predicate is valid
......@@ -122,27 +130,36 @@ foreverTask :: !(Task a) -> Task a | iData a
repeatTask :: !(a -> Task a) !(a -> Bool) a -> Task a | iData a
/* Sequencing Tasks:
seqTasks :: do all iTasks one after another, task completed when all done
*/
seqTasks :: ![(String,Task a)] -> Task [a] | iCreateAndPrint a
seqTasks :: ![LabeledTask a] -> Task [a] | iCreateAndPrint a
/* Choose out one or more Tasks sequentially before they are executed sequentially:
/* Choose Tasks:
buttonTask :: Choose the iTask when button pressed
chooseTask :: Choose one iTask from list, depending on button pressed, button horizontal displayed
chooseTaskV :: Choose one iTask from list, depending on button pressed, buttons vertical displayed
chooseTask_pdm :: Choose one iTask from list, depending on pulldownmenu item selected
mchoiceTask :: Multiple Choice of iTasks, depending on marked checkboxes
mchoiceTask2 :: Multiple Choice of iTasks, depending on marked checkboxes, boolean used for initial checking
mchoiceTask2 :: as mchoiceTask, boolean used for initial checking
mchoiceTask3 :: as mchoiceTask2, function can be used to (re)set the checkboxes
*/
buttonTask :: !String !(Task a) -> Task a | iCreateAndPrint a
chooseTask :: ![BodyTag] ![(String,Task a)] -> Task a | iCreateAndPrint a
chooseTaskV :: ![BodyTag] ![(String,Task a)] -> Task a | iCreateAndPrint a
chooseTask_pdm :: ![BodyTag] ![(String,Task a)] -> Task a | iCreateAndPrint a
mchoiceTasks :: ![BodyTag] ![(String,Task a)] -> (Task [a]) | iCreateAndPrint a
mchoiceTasks2 :: ![BodyTag] ![(!(!Bool,!String),Task a)] -> Task [a] | iCreateAndPrint a
mchoiceTasks3 :: ![BodyTag] ![((Bool,Bool [Bool] -> Bool,String),Task a)] -> (Task [a]) | iCreateAndPrint a
chooseTask :: !HtmlCode ![LabeledTask a] -> Task a | iCreateAndPrint a
chooseTaskV :: !HtmlCode ![LabeledTask a] -> Task a | iCreateAndPrint a
chooseTask_pdm :: !HtmlCode ![LabeledTask a] -> Task a | iCreateAndPrint a
mchoiceTasks :: !HtmlCode ![LabeledTask a] -> Task [a] | iCreateAndPrint a
mchoiceTasks2 :: !HtmlCode ![(!Bool,LabeledTask a)] -> Task [a] | iCreateAndPrint a
mchoiceTasks3 :: !HtmlCode ![((!Bool,!ChoiseUpdate,!HtmlCode),LabeledTask a)]
-> Task [a] | iCreateAndPrint a
:: ChoiseUpdate :== !Bool [Bool] -> [Bool] // changed checkbox + current settings -> new settings
/* Do m Tasks parallel / interleaved and FINISH as soon as SOME Task completes:
orTask :: do both iTasks in any order, combined task completed as any subtask is done
(-||-) :: same, now as infix combinator
orTask2 :: do both iTasks in any order, combined task completed as any subtask is done
......@@ -152,7 +169,7 @@ orTask :: !(Task a,Task a) -> Task a | iCreateAndPrint a
(-||-) infixr 3 :: !(Task a) !(Task a) -> Task a | iCreateAndPrint a
orTask2 :: !(Task a,Task b) -> Task (EITHER a b)
| iCreateAndPrint a & iCreateAndPrint b
orTasks :: ![(String,Task a)] -> Task a | iData a
orTasks :: ![LabeledTask a] -> Task a | iData a
/* Do Tasks parallel / interleaved and FINISH when ALL Tasks done:
andTask :: do both iTasks in any order (interleaved), task completed when both done
......@@ -163,12 +180,12 @@ andTasks_mu :: assign task to indicated users, task completed when all done
*/
andTask :: !(Task a,Task b) -> Task (a,b) | iCreateAndPrint a & iCreateAndPrint b
(-&&-) infixr 4 :: !(Task a) !(Task b) -> Task (a,b) | iCreateAndPrint a & iCreateAndPrint b
andTasks :: ![(String,Task a)] -> Task [a] | iData a
andTasksCond :: !([a] -> Bool) ![(String,Task a)] -> Task [a] | iData a
andTasks :: ![LabeledTask a] -> Task [a] | iData a
andTasksCond :: !([a] -> Bool) ![LabeledTask a] -> Task [a] | iData a
andTasks_mu :: !String ![(Int,Task a)] -> Task [a] | iData a
/* Time and Date management:
waitForTimeTask :: Task is done when time has come
waitForTimerTask:: Task is done when specified amount of time has passed
waitForDateTask :: Task is done when date has come
......@@ -178,6 +195,7 @@ waitForTimerTask:: !HtmlTime -> Task HtmlTime
waitForDateTask :: !HtmlDate -> Task HtmlDate
/* Experimental department:
Will not work when the tasks are garbage collected to soon !!
-!> :: a task, either finished or interrupted (by completion of the first task) is returned in the closure
if interrupted, the work done so far is returned (!) which can be continued somewhere else
......@@ -198,6 +216,7 @@ closureTask :: String (Task a) -> Task (TCl a) | iCreateAndPrint a
closureLzTask :: String (Task a) -> Task (TCl a) | iCreateAndPrint a
/* Exception Handling:
<^> :: Evaluate the task; An exception of type e raised by this task, will be catched by the closest handler.
One can use the function create a proper task value or signal the fact that an exception has occured.
Raise :: Raises an exception of type e which will be catched by the closest parent handler for this type
......@@ -205,8 +224,8 @@ Raise :: Raises an exception of type e which will be catched by the closest p
(<^>) infix 1 :: !(e -> a) !(Task a) -> Task a | iData a & TC e // assigns an exception Handler
Raise :: e -> Task a | iCreate a & TC e // rases an exception
/* Lifting to iTask domain
(*>>) :: lift functions of type (TSt -> (a,TSt)) to iTask domain
(@>>) :: lift functions of (TSt -> TSt) to iTask domain
appIData :: lift iData editors to iTask domain
......@@ -235,5 +254,5 @@ addHtml :: add html code
taskId :: TSt -> (Int,TSt)
userId :: TSt -> (Int,TSt)
addHtml :: [BodyTag] TSt -> TSt
addHtml :: HtmlCode TSt -> TSt
This diff is collapsed.
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