Forum Discussion
Built-in scene title variable?
Where is the built-in scene title (text) variable?
10 Replies
- KendalRasnake-1Community Member
Thank you, Nedim.
- KendalRasnake-1Community Member
Thank you, Nathan.
- KendalRasnake-1Community Member
I may not understand how everything works, but it seems to me that the SCORM module can communicate scene information to the LMS, at least when it comes to question slides. It may not be one of the built-in variables to which Nedim refers, but the information is there.
When running a SCORM module in troubleshooting mode, something called "strID" seems to capture the Scene number and Slide number. That information can then be seen in an LMS report.
Using some code written by Sam Hammond that I modified, I was able to move the Scene and Slide number info to the Course Objective column and replace the missing Question ID column information with the Question Stem text.
Again, I may not understand how everything works, but is the "strID" something that can be tapped into as the recorder of Scene and Slide # information? Even if it is not a built-in variable, could it be accessed within the Storyline project with a trigger, or with JavaScript and a trigger?
(Images are also attached if the posted ones are too small to see.)
- NedimCommunity Member
The "strID" parameter in the SCORM2004_RecordInteraction() function is a unique identifier for a learner interaction or question within a SCORM course. It is SCORM 2004 cmi.interactions.n.id data model and it tells the LMS exactly which specific interaction is being recorded, allowing it to track responses, determine correctness, and report analytics.
This parameter is only meaningful and used when:
- The project is published to SCORM 2004
- A quiz or assessment is selected under tracking options during the publish process.
If you don’t publish to SCORM or don’t enable tracking via quiz results, the LMS won’t expect or use this data, and the SCORM2004_RecordInteraction() function, along with its strID, will have no effect.
Example:
function SCORM2004_RecordInteraction(strID, strResponse, blnCorrect, strCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime, SCORM2004InteractionType)
So, if I have a quiz question on Scene 2, the strID parameter in the SCORM2004_RecordInteraction() function will typically be set automatically by Storyline when the interaction is tracked. Under the hood, Storyline calls another SCORM function:
SCORM2004_CallSetValue("cmi.interactions." + intInteractionIndex + ".id", strID);
In this particular case "SetValue('cmi.interactions.0.id', 'Scene2_Slide2_TrueFalse_0_0');"
The bottom line, the strID can’t be referenced or displayed on the slide until it becomes available at runtime, which only happens when the first interaction is recorded and the course is running in a SCORM-compatible LMS.
To display a generic scene name, JavaScript isn't necessary. You can simply use a text box with a reference to the built-in project variable, like this: "Scene %Project.SceneNumber%". - Nathan_HilliardCommunity Member
There is some additional information about your published project available in the DS object (accessed in JavaScript like a variable as window.DS). Information such as the scene number and the generic scene name (e.g., 'Scene1', 'Scene2', etc.) can be accessed there. It is available with or without the side menu being included as part of the project. The scene title text however does not seem to be stored in there anywhere I could locate.
To access the current scene number or generic scene name as Kendal suggested, you can use these JavaScript lines
let sceneGenericName = window.DS.windowManager.getCurrentWindowSlide().parent.attributes.lmsId let sceneNumber = window.DS.windowManager.getCurrentWindowSlide().parent.attributes.sceneNumber
- BarbaraJacobs-1Community Member
Thank you, Nadim, but I need the scene title. We work with scenes in so many ways, particularly as they apply to accessibility. I need that variable.
- NedimCommunity Member
I understand, but this built-in variable doesn't exist — and it never has. In my previous post, I included a link to the official list of built-in variables currently available in Storyline. If using JavaScript isn't an issue, I’d go with what Nathan suggested in his post. Here's another snippet you can use on your master slide — it essentially does the same thing. Other than that, I don't see another solution but to create a custom text variable for the scene name.
const Sidebar = document.querySelector("#sidebar-panels .cs-selected"); const currentSceneName = Sidebar ?.parentNode?.parentNode?.parentNode ?.querySelector(".cs-listitem span:nth-of-type(2)") ?.innerText; setVar("currentSceneName", currentSceneName);