The SDK of this version is still being tested, and these pages are being updated with it: names, menus and procedures may still change before the release. If you build content for a platform already in production, follow the documentation of that version — pick it from the version menu at the top right.
Procedure
ProcedurePlaceholder
A procedure turns the Task System into a training run that is scored: each step is worth points, wrong actions and hints cost points, errors and time can end the run, the user hears and sees whether an action was right, and a summary shows the result at the end. The run is also reported to the Back Office analytics.
The procedure knows tasks and results, not scene objects. The objects of the scene (a valve, a door, a quiz) report what the user did on a task, through the task elements, a Task Step, the Tasks API or Visual Scripting nodes, and the procedure scores it.
A Task System without a Procedure Placeholder works as before: nothing is scored and no summary shows. Adding the placeholder is what turns the manager on.
Add a procedure to your scene
- Drag the TasksLogic_Procedure prefab into the scene instead of TasksLogic. You find it in Virtuademy-SDK-Environments > Runtime > Tasks > Prefabs, next to TasksLogic.
- Build the task graph on its TaskSystem object, as in Task System Graph and Nodes.
- Make each task completed by an element (or by your own logic), and write its texts: Task Step.
- Set the rules on the Procedure Placeholder of the TaskSystem object.
The package has a finished example, the sample Procedure: find the hazards (Package Manager, Virtuademy-SDK-Environments, Samples): see Sample scene.
The prefab holds everything the procedure needs, already wired:
- TaskSystem: the task system, with the Procedure Placeholder on it. The placeholder must be on the object of a task system: anywhere else it does nothing, and its inspector says so.
- TaskPanel: a Task UI Placeholder connected to the task system. It shows the current task, the errors, the clock and the hint button. The old uGUI canvas of TasksLogic is switched off in this prefab.
- ProcedureFeedback: the SuccessPanel and ErrorPanel used when the feedback is shown as a panel, the SharedCueFeedback mark and flash, and the ProcedureSummary panel.
How a run goes
- It starts when the task system is ready and the scene is shown to the user. In Play mode of your own project, without the app, it starts when the task system is ready.
- It finishes when every scored task is completed or failed, when a fail condition ends it (too many errors, time up, a failed task that ends the procedure), or when you call Finish (see Failures).
- The result is Passed when the score reaches the passing score and no fail condition happened, otherwise Failed. A run that is ended before every task is done by Abort, Exit, Retry or the task system being reverted is Abandoned.
The run's live state is on the placeholder: IsRunning, IsFinished, Score, MaxScore, PassingScore, Percent, Errors, HintsUsed, ElapsedSeconds, RemainingSeconds (-1 without a time limit), Outcome, RunKey and Summary (null until it finishes).
Guided and assessed
The Mode setting decides how much the user is told while the run goes.
| Guided | Assessed | |
|---|---|---|
| Next target | The interaction cue of the next task shows its next-target look | No next-target look. A hint still shows the task's targets for a moment |
| Text of a right or wrong action | Shown at once: the task's feedback text, the reason of the result, or a generic text | A neutral "Recorded". The reasons are kept for the summary's timeline |
| Marks, flash and sounds | Shown | Shown |
| Hints | As set in Hints | As set in Hints |
Hints are not tied to the mode: Hints Enabled, the penalty and the charge are your choice in both.
Settings
Rules
| Setting | Default | What it does |
|---|---|---|
| Mode | Guided | Guided or Assessed (above) |
| Max Score | 100 | The points the whole procedure is worth |
| Pass Percent | 60 | The percentage of Max Score that passes. The passing score is Max Score x Pass Percent / 100, rounded |
| Max Errors | 0 | Wrong attempts that fail the procedure. 0: no limit. See Errors |
| Error Penalty | 0.25 | The fraction of a task's points lost for each wrong attempt on that task |
Hints
| Setting | Default | What it does |
|---|---|---|
| Hints Enabled | on | Whether the user can ask for a hint. Off: no hint button and no hint |
| Hint Penalty | 0.25 | The fraction of a task's points a charged hint costs |
| Hint Charge | Once Per Task | Once Per Task: the first hint on a task costs the penalty, more hints on the same task are free. Never: hints are free |
| Hint Shows Target | on | A hint also shows the task's targets as the next target for a moment (at least three seconds) |
Time
| Setting | Default | What it does |
|---|---|---|
| Time Limit Seconds | 0 | Seconds the user has. 0: no limit. Running out is a fail condition |
| Show Timer | on | Shows the clock on the task panel when there is a limit |
Failure
| Setting | Default | What it does |
|---|---|---|
| On Fail Condition | End Now | End Now: the procedure ends at once, failed. Continue As Failed: it goes on to the end and ends failed |
| On Task Failed | Continue | Continue: a failed task scores 0 and the flow goes on to the next task. End Procedure: a failed task is a fail condition |
| Out Of Order Is Error | off | An action on a task that is not unlocked yet counts as a wrong attempt, instead of being ignored |
Feedback and summary
| Setting | Default | What it does |
|---|---|---|
| Feedback Presentation | Toast | How the text of a right or wrong action (and of a hint) shows: a Toast, a Panel (the Success and Error panels below), or None |
| Success Panel, Error Panel | from the prefab | The panels used when Feedback Presentation is Panel. A hint is shown in the Success Panel |
| Play Sounds | on | Plays the sounds of right and wrong actions, finished steps and the summary |
| Sounds | the SDK's asset | The sounds: the Interaction Cue Settings asset |
| Shared Feedback | from the prefab | The mark and flash moved above a target whose cue has no feedback objects of its own |
| Show Summary | on | Shows the summary at the end |
| Summary Panel | from the prefab | The summary panel |
| Timeline | Lost Points Only | Which events the summary lists under "What happened": Off, Lost Points Only or All |
| Timeline Max Rows | 13 | The most rows the timeline lists |
| Retry Mode | Reload Session | What Retry does: reload the session, or revert the task system in place |
| Override Button Actions | off | The summary's Retry and Exit buttons only raise their events: your environment does the rest |
Analytics
| Setting | Default | What it does |
|---|---|---|
| Send Analytics | on | Reports the run to the Back Office. Without the app the statements are only logged |
| Analytics Key Prefix | empty | Letters and digits, at most seven. Empty: the scene's name |
| Analytics Context | empty | The context of the experience statements. Empty: the scene's name |
Events
On Attempt, On Hint Used, On Score Changed, On Passed, On Failed, On Finished, On Retry and On Exit are UnityEvents you can connect in the inspector. The same moments are events for scripts and nodes: see Reading the procedure.
Steps and scoring
Only scored tasks count. A task is scored when it is a leaf (it has no sub-tasks) and is shown in the task panel; a Task Step can force it on or off with Scored.
- Each scored task is worth
Max Score x weight / total weightpoints. The weights come from the Task Step (1 when a task has none). The shares are rounded so that they add up exactly to Max Score: the largest fractions are rounded up first, and the earlier task wins a tie. - A task earns its points when it is completed, multiplied by the score of the result (1 for right, 0 for wrong, in between for partial), minus
Error Penaltyfor each wrong attempt on it andHint Penaltyfor a charged hint. The result never goes below zero for the task. - A failed task earns 0.
- A distractor without a task takes its own points off the total (see Elements). The total never goes below zero.
- Tasks that were already completed when the run started (the Task Step Setter's "start from step", a room restored for a late joiner) are left out: they are not in the maximum or in the score.
An example
A procedure with Max Score 100, Pass Percent 60, Error Penalty 0.25, Hint Penalty 0.25, Hint Charge Once Per Task, and three scored tasks of weight 1. The shares are 34, 33 and 33.
| Task | What happened | Points |
|---|---|---|
| 1 | Done right at the first attempt | 34 |
| 2 | One wrong attempt, then done right | 33 x 0.75 = 24.75, rounded to 25 |
| 3 | A hint asked, then done right | 33 x 0.75 = 24.75, rounded to 25 |
The score is 84 of 100: passed (the passing score is 60). The summary shows 1 error and 1 hint. If the user had also used a distractor worth 5 points without a task, the score would be 79.
Errors
The summary's Errors count the actions the procedure took as wrong:
- a wrong attempt on a task (a wrong choice, a wrong item or tool, a Report Attempt node with a wrong result);
- a distractor, with a task or when it has Counts As Error;
- a question answered below its Wrong Below;
- an action on a locked task, when Out Of Order Is Error is on.
When the errors reach Max Errors the procedure fails (a fail condition). A Task Step can also fail one task after a number of wrong attempts on it.
Hints
The user asks for a hint with the ? button of the task panel; you can also call Request Hint (a method, a node, ITasksApi.RequestHint) or a Task Step's Show Hint.
- The hint shows the text of the task that is to do: the hint key of its Localize Task Placeholder, else the hint written on the task node. It is shown as a toast, or in the Success Panel when Feedback Presentation is Panel, and the user can ask for it again at any time.
- A hint counts (the summary's Hints, the penalty) even when the task has no hint text. Give a hint text to every task of a procedure that has hints on, or turn Hints Enabled off.
- With Hint Shows Target the task's targets show their next-target look for a moment, also in Assessed mode.
- Feedback Presentation None hides the hint text too.
Time
With a Time Limit the task panel shows the clock (if Show Timer is on) and the procedure fails when it runs out; the summary then says the time limit was the reason. The clock is the only part that runs every second, and only while it is on screen.
Failures
A fail condition is: the errors reach Max Errors, the time runs out, or a task fails while On Task Failed is End Procedure. What it does is On Fail Condition:
- End Now: the run finishes at once as failed and the summary shows.
- Continue As Failed: the user keeps going to the end, and the run finishes as failed whatever the score.
The summary says why it failed: too many errors, time limit, a failed task, or "manual" when a script called Abort.
Fail a task. A task fails when a script, a node (Fail Task) or a Task Step's maximum attempts fail it. With On Task Failed: Continue a failed task lets the flow go on to the next task, as a completed one does, and scores 0. This only works in a Task System with a Procedure Placeholder: without one, a failed task does not advance the chain.
Finish by hand. Finish() ends the run now: it passes or fails on the score so far. Abort() ends it as abandoned. Use them when your environment decides that the run is over.
Feedback
Every result of an action is shown to the user on every client of the room, with the name of the user who did it in front of the text when it was somebody else:
- The cue of the objects involved shows the right or wrong look: see Interaction cue. A wrong action shows on the cue of the object that caused it (a decoy, a wrong choice) and not on the task's other objects.
- The sound: a wrong sound for a wrong action, a right or finished-step sound for a right one. A cue that plays its own sound is the only one heard.
- The text: a toast, or the Success or Error panel, as Feedback Presentation says.
- The mark and flash of Shared Feedback are moved above a target whose cue has no feedback objects of its own (use the cue's Add feedback objects to give it its own).
The text of a right action is the task's right feedback: the key of its Localize Task Placeholder, else the text on the task node, else a generic "well done". The text of a wrong one is the wrong feedback in the same way, else the reason the result carries, else a generic text. A right attempt that does not complete the task shows nothing.
The summary
When the run finishes (and Show Summary is on) the summary panel shows, in the middle of the screen on desktop and mobile and in front of the user in VR:
- the outcome (passed or not passed, and why), the score and its percentage, the time, the errors and the hints;
- one row for each scored task, with its points and a mark;
- with Timeline not Off, a page "What happened": time, step, who, good or mistake, points lost and the reason;
- the buttons Retry and Exit.
The summary does not show when the run is abandoned. With Show Summary off, the task panel shows its own end card instead.
Retry and Exit first wait, for up to eight seconds, for the run's analytics statements to be sent (the summary says so). Retry then starts again, as Retry Mode says: Reload Session loads the session again, Revert In Place reverts the task system and starts a new run. A shared procedure always retries in place. Exit returns to the lobby. With Override Button Actions on, the buttons only raise On Retry and On Exit.
Shared procedures
A procedure is shared when its Task System has Is Networked on and the Tasks RPC Manager Placeholder (see Task System Multiplayer setup), in a multiplayer session. Then:
- Every result, failure, hint, distractor and the time running out reach every user, who sees the same feedback and has the same score. The action of a teammate counts for the whole room.
- The master client keeps a snapshot of the run in the room: a user who joins late, or after the master changes, receives it and continues from it. The master runs the time limit on the network clock.
- Retry is always in place and starts a new run for the room.
For a procedure that every user runs on their own, leave Is Networked off.
Analytics
With Send Analytics on, the run is reported to the Back Office:
- One run for each time the procedure runs, with a key made of the Analytics Key Prefix and eight random characters.
- ExpStart when the run starts, a StepStart when a scored step starts, and exactly one StepComplete for each step that started (with its points, its maximum and its passing score; a step that had started and is not done when the run ends is reported as failed with 0 points; a step that never started sends nothing), and one ExpComplete with the result: Pass, Fail, or, for a run ended early without a fail condition, NA with the score so far.
- The statements are sent in order, one at a time. A statement that fails is sent again after 2, 4, 8, 16 and then every 30 seconds.
- ExpComplete is sent by the procedure's own logic only: when it finishes, or when Finish, Abort, Retry or Exit end it. A user who leaves the scene through the app (menu, home, a lost connection) sends nothing, and the run stays incomplete in the analytics. If your environment needs a completed run, call
FinishorAbortyourself. - In a shared procedure there is one team run for the room: the master client creates it and sends ExpStart, the steps and ExpComplete (once), and every participant sends ExpJoin once, so the run lists who took part. A user who joins late joins the run and never starts another. After a Retry, a new team run starts.
The legacy Control Manager and Experience Verb Manager graphs send experience statements too. If a scene has them and a Procedure Placeholder with Send Analytics on, the session records two runs: the inspector warns about it. Turn one of the two off.
Reading the procedure from scripts and graphs
| What | Script (on the placeholder) | Node |
|---|---|---|
| Live state | Score, MaxScore, PassingScore, Percent, Errors, HintsUsed, ElapsedSeconds, RemainingSeconds, IsRunning, IsFinished, Outcome, Summary | Get Procedure State |
| Ask for a hint | RequestHint() | Request Hint |
| End or restart | Finish(), Abort(), Retry(), Exit(), ShowSummary() | Finish Procedure, Retry Procedure |
| Every result reported | event Attempted (TaskResultHandler) | On Task Attempt (for one task) |
| A hint used | event HintUsed (ProcedureHintHandler: the task and the hints so far) | On Hint Used |
| The score, errors or hints changed | event ScoreChanged (ProcedureEventHandler) | On Score Changed |
| It ended | events Passed, Failed (ProcedureEventHandler), Finished (ProcedureFinishedHandler, with the summary) | On Procedure Finished |
Failed is raised for every ending that is not a pass, an abandoned run included; Finished is raised for all of them and carries the summary: Outcome, FailReason, Score, MaxScore, PassingScore, Percent, ElapsedSeconds, Errors, HintsUsed, Tasks (name, step id, points, maximum, state, wrong attempts and hints of each scored task) and Timeline.
The nodes are in Procedure nodes. A handler of a script is written as a method group, as the other events of the scripting API: see Tasks API.
What not to do
- Do not put the placeholder anywhere but on the Task System object, and one per object.
- Do not count on leaving the scene to complete the run. The analytics never get an ExpComplete that way: end the run with the procedure.
- Do not leave hints on without hint texts: the user is charged for a hint that says nothing.
- Do not set a task on a distractor that should cost its own points. With a task, using it is a wrong attempt on that task (the task's error penalty and one error); Penalty Points apply only to a distractor without a task.
- Do not build on the legacy Control Manager kit when a procedure fits: see Control Manager nodes.
Known limits
- A failed task advances the flow only with a Procedure. In a Task System with a Procedure Placeholder whose On Task Failed is Continue, a failed task scores 0 and the next task unlocks. In a Task System without one, a task set to Failed (the Fail Task node,
FailTask, or a Task Step's Max Attempts) unlocks nothing: the chain stops there and the training does not reach its end. The task system decides this itself, so there is no setting on the task to change it.