Commit d6cc754c authored by Steffen Michels's avatar Steffen Michels

fix problem with group events

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1118 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 53687986
......@@ -62,7 +62,7 @@ makeInformationTask question initial context actions actionStored tst=:{taskNr,
= (TaskBusy,tst)
| otherwise
//Check for events
# (events,tst) = getEvents tst
# (events,tst) = getEvents False tst
| isEmpty events
// no change for this task
# tst = setTUIUpdates [] [] tst
......@@ -169,7 +169,7 @@ makeChoiceTask question options initsel context actions tst=:{taskNr, newTask}
= (TaskBusy, tst)
| otherwise
//Check for user updates
# (events,tst) = getEvents tst
# (events,tst) = getEvents False tst
| isEmpty events
// no change for this task
# tst = setTUIUpdates [] [] tst
......@@ -254,7 +254,7 @@ makeMultipleChoiceTask question options initsel context actions tst=:{taskNr, ne
= (TaskBusy, tst)
| otherwise
//Check for events
# (events,tst) = getEvents tst
# (events,tst) = getEvents False tst
| isEmpty events
// no change for this task
# tst = setTUIUpdates [] [] tst
......@@ -316,7 +316,7 @@ makeMessageTask message context actions tst=:{taskNr}
# taskId = taskNrToString taskNr
# editorId = "tf-" +++ taskId
# buttonActions = getButtonActions actions
# (events,tst) = getEvents tst
# (events,tst) = getEvents False tst
| isEmpty events
# menuActions = evaluateConditions (getMenuActions actions) True Void
# buttonActions = evaluateConditions buttonActions True Void
......@@ -336,7 +336,7 @@ showInstructionAbout title instruction context = mkInstructionTask title (makeIn
makeInstructionTask :: !instruction (Maybe [HtmlTag]) *TSt -> *(!TaskResult Void,!*TSt) | html instruction
makeInstructionTask instruction context tst
# (events, tst) = getEvents tst
# (events, tst) = getEvents False tst
| isEmpty events
= case tst.tree of
(TTInstructionTask ti _ _) = (TaskBusy ,{tst & tree = TTInstructionTask ti (html instruction) context})
......@@ -378,7 +378,7 @@ where
# nEditV = editorFrom new
# tst=:{TSt|iworld} = tst
# (mask,iworld) = defaultMask nEditV iworld
# (events,tst) = getEvents {TSt|tst & iworld = iworld}
# (events,tst) = getEvents False {TSt|tst & iworld = iworld}
# updpaths = events2Paths postValues
= (determineEditorUpdates (editorId taskNr n) (Just n) updpaths mask mask oEditV nEditV,tst)
......@@ -422,7 +422,7 @@ makeSharedTask question actions sharedId views actionStored tst=:{taskNr, newTas
# tst = setTUIFunc createDefs (html question) tst
= (TaskBusy, tst)
| otherwise
# (events,tst) = getEvents tst
# (events,tst) = getEvents False tst
# dpEvents = [(s2dp key,value) \\ (key,value) <- events | isdps key]
// determine new shared value by accumulating updates of all views
# (nvalue,_,tst) = foldl (updateSharedForView dpEvents) (cvalue,0,tst) views
......
......@@ -124,7 +124,7 @@ where
# grTaskNr = drop 1 taskNr // get taskNr of group-task
# (events,tst) = getEventsFor (taskNrToString grTaskNr) True tst
# (pst,tst) = loadPSt grTaskNr tst
# gAction = case parseString (http_getValue "_group" events "") of
# gAction = case parseString (http_getValue "group" events "") of
Nothing = parseString (http_getValue "menuAndGroup" events "")
res = res
# (gActionStop,mbFocus,pst)
......
......@@ -389,11 +389,12 @@ setFocusCommand :: !String !*TSt -> *TSt //Only for group tasks
/**
* Get the events (name/value pairs) for the current task
*
* @param Include group events
* @param The task state
*
* @return The modified task state
*/
getEvents :: !*TSt -> ([(!String,!String)],!*TSt)
getEvents :: !Bool !*TSt -> ([(!String,!String)],!*TSt)
/**
* Get the events for a specific tasks
*
......
......@@ -892,9 +892,9 @@ getTaskStoreFor taskNr key tst=:{TSt|iworld=iworld=:{IWorld|store,world}}
where
storekey = "iTask_" +++ (taskNrToString taskNr) +++ "-" +++ key
getEvents :: !*TSt -> ([(!String,!String)],!*TSt)
getEvents tst=:{taskNr,events}
= ([(name,value) \\ (task,name,value) <- events | task == taskId], tst)
getEvents :: !Bool !*TSt -> ([(!String,!String)],!*TSt)
getEvents includeGroupEvents tst=:{taskNr,events}
= ([(name,value) \\ (task,name,value) <- events | task == taskId && (includeGroupEvents || name <> "group")], tst)
where
taskId = taskNrToString taskNr
......
......@@ -227,7 +227,7 @@ where
[(groupA,groupAEnabled,_):_] = [TUIMenuItem { TUIMenuItem
| id = Just (ti.TaskInfo.taskId +++ "-menu-" +++ toString id)
, text = label
, name = Just (if (taskAEnabled && groupAEnabled) "menuAndGroup" (if taskAEnabled "menu" "_group"))
, name = Just (if (taskAEnabled && groupAEnabled) "menuAndGroup" (if taskAEnabled "menu" "group"))
, value = Just (printToString action)
, disabled = not (taskAEnabled || groupAEnabled)
, menu = Nothing
......@@ -252,7 +252,7 @@ where
[(groupA,groupAEnabled,topLevel):_] = [TUIMenuItem { TUIMenuItem
| id = Just (ti.TaskInfo.taskId +++ "-menu-" +++ toString id)
, text = label
, name = Just "_group"
, name = Just "group"
, value = Just (printToString action)
, disabled = not groupAEnabled
, menu = Nothing
......
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