// Branching Diagnostic Coach starter logic for Articulate Storyline
// Suggested trigger: Execute JavaScript after learner selects a response path
const player = GetPlayer();
const selectedSignal = player.GetVar("selectedSignal");
const selectedResponse = player.GetVar("selectedResponse");
const profiles = {
"transfer_support": {
signalClarity: 95,
responseFit: 94,
fieldUsefulness: 96,
tone: "Exactly",
pathLabel: "Transfer gap → Field-ready support",
title: "Strong diagnosis, strong response",
body: "This is the most useful path. The learner is not saying the content was impossible to understand. They are saying the real-world moment still feels uncertain. A field-ready support aid helps bridge the gap between knowing and doing.",
nextMove: "Provide a short decision guide that supports first-route judgment in context."
},
"transfer_repeat": {
signalClarity: 90,
responseFit: 45,
fieldUsefulness: 42,
tone: "Not exactly",
pathLabel: "Transfer gap → Repeat content",
title: "Good diagnosis, weak response fit",
body: "You identified the right type of gap, but repeating the same content may not solve the problem. The learner needs help applying the content in the field, not necessarily more exposure to the original module.",
nextMove: "Add a practice aid, checklist, or scenario-based reinforcement moment."
},
"transfer_escalate": {
signalClarity: 90,
responseFit: 62,
fieldUsefulness: 58,
tone: "Cautious",
pathLabel: "Transfer gap → Escalation",
title: "Useful only if the risk is high",
body: "Escalation can help when the situation is unusual or risky. For a common first-route uncertainty, though, escalation may create friction. A lightweight support aid is likely more scalable.",
nextMove: "Use escalation for exceptions, but design support for repeatable moments."
},
"knowledge_repeat": {
signalClarity: 55,
responseFit: 72,
fieldUsefulness: 54,
tone: "Partial",
pathLabel: "Knowledge gap → Repeat content",
title: "Reasonable, but check the assumption",
body: "Repeating content can help when the issue is retention. In this case, the learner said the content was easy to follow. That suggests the bigger issue may be transfer, confidence, or real-world application.",
nextMove: "Ask what part feels uncertain before assigning more content."
},
"knowledge_support": {
signalClarity: 58,
responseFit: 82,
fieldUsefulness: 88,
tone: "Useful redirect",
pathLabel: "Knowledge gap → Field-ready support",
title: "The response may work even if the diagnosis is off",
body: "You may have misread the signal as a knowledge gap, but the support aid still helps the learner apply what they know. This is a good reminder that useful support can sometimes rescue an imperfect diagnosis.",
nextMove: "Pair the aid with one question that confirms what the learner is unsure about."
},
"knowledge_escalate": {
signalClarity: 50,
responseFit: 38,
fieldUsefulness: 35,
tone: "Redirect",
pathLabel: "Knowledge gap → Escalation",
title: "This may overcomplicate the moment",
body: "Escalation is probably too heavy for this signal. If the issue is knowledge or application, the learner needs clarity and usable support before the process gets handed off.",
nextMove: "Clarify the gap, then provide either reinforcement or a field support aid."
},
"motivation_repeat": {
signalClarity: 42,
responseFit: 35,
fieldUsefulness: 30,
tone: "Redirect",
pathLabel: "Motivation gap → Repeat content",
title: "This path misses the main need",
body: "The learner is not simply asking to be encouraged or sent back through content. The concern is about applying instructions when reality gets messy. Repeating the module may feel dismissive.",
nextMove: "Focus on context, support, and practical first-route confidence."
},
"motivation_support": {
signalClarity: 48,
responseFit: 78,
fieldUsefulness: 86,
tone: "Useful redirect",
pathLabel: "Motivation gap → Field-ready support",
title: "Helpful response, but sharpen the diagnosis",
body: "A support aid is still a useful move, but the signal is more specific than motivation. The learner needs help transferring knowledge into real-world action, especially when app guidance and field conditions feel mismatched.",
nextMove: "Name the application gap and provide a simple decision aid."
},
"motivation_escalate": {
signalClarity: 40,
responseFit: 42,
fieldUsefulness: 38,
tone: "Redirect",
pathLabel: "Motivation gap → Escalation",
title: "This creates distance instead of clarity",
body: "Escalating a general confidence concern may slow the learner down and make the support feel less immediate. Start with a practical aid unless there is a clear safety, policy, or technical risk.",
nextMove: "Give immediate support first, then escalate only if the issue remains unresolved."
}
};
const key = `${selectedSignal}_${selectedResponse}`;
const fallback = profiles["transfer_support"];
const profile = profiles[key] || fallback;
player.SetVar("signalClarityScore", profile.signalClarity);
player.SetVar("responseFitScore", profile.responseFit);
player.SetVar("fieldUsefulnessScore", profile.fieldUsefulness);
player.SetVar("coachTone", profile.tone);
player.SetVar("pathLabel", profile.pathLabel);
player.SetVar("coachTitle", profile.title);
player.SetVar("coachBody", profile.body);
player.SetVar("recommendedNextMove", profile.nextMove);