{"id":966,"date":"2024-08-19T23:41:47","date_gmt":"2024-08-19T23:41:47","guid":{"rendered":"https:\/\/cluelabs.com\/blog\/?p=966"},"modified":"2024-08-20T00:40:18","modified_gmt":"2024-08-20T00:40:18","slug":"using-ai-to-generate-scenarios-and-score-typed-responses-in-articulate-storyline-elearning","status":"publish","type":"post","link":"https:\/\/cluelabs.com\/blog\/using-ai-to-generate-scenarios-and-score-typed-responses-in-articulate-storyline-elearning\/","title":{"rendered":"Using AI to Generate Scenarios and Score Typed Responses in Articulate Storyline eLearning"},"content":{"rendered":"\n<p><strong>Before we begin:<\/strong><\/p>\n\n\n\n<p>The published (and slightly improved) project is posted as a demo at <a href=\"https:\/\/cluelabs.com\/ai-chatbot-elearning-widget#section-ai-chatbot-demos\">https:\/\/cluelabs.com\/ai-chatbot-elearning-widget#section-ai-chatbot-demos<\/a> (demo #2)<\/p>\n\n\n\n<p>You can also download the .story file at <a href=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/AI%20LLM%20scenarios%20starter.story\">https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/AI%20LLM%20scenarios%20starter.story<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using AI LLMs to generate dynamic learning content, feedback, etc.<\/h2>\n\n\n\n<p>It\u2019s easy to use AI tools like ChatGPT to generate a text paragraph and then use this text in a course authoring tool like Articulate Storyline. But this is just the tip of the iceberg of what AI can really do for elearning. This page provides a step-by-step guide on integrating and using AI LLM (Large Language Model) to do much more\u2026<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>What can you do?<\/strong><\/td><td><strong>Why should you do it?<\/strong><\/td><\/tr><tr><td>Dynamically generate a new and unique scenario\/assignment every time a learner accesses a slide.<\/td><td>You can give learners access to unlimited ever-changing scenarios to practice valuable skills multiple times and as often as they want.<\/td><\/tr><tr><td>Use AI to score learners\u2019 submissions and provide instant feedback.<\/td><td>When a learner submits a typed response, an essay, or another type of unstructured submission, they can get instant feedback and recommendations.<\/td><\/tr><tr><td>Keep track of everything that both AI and your learners generate throughout the course.<\/td><td>As a learning administrator, you want to keep your hand on the pulse and be able to see what AI generates and how your learners respond to AI-generated scenarios.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Dynamically generate a new and unique scenario\/assignment every time a learner accesses a slide.<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Creating an AI LLM connection for your Articulate Storyline project:<\/h3>\n\n\n\n<p>1. Go to <a href=\"https:\/\/cluelabs.com\/\">cluelabs.com<\/a><\/p>\n\n\n\n<p>2. Sign in or create a free account<\/p>\n\n\n\n<p>3. Click the <strong>Chatbot<\/strong> tile<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/03.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>4. Click <strong>New Chatbot<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/04.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>5. Under <strong>Supported Interactions<\/strong>, select <strong>Articulate Storyline<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/05.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>6. In the <strong>Knowledge Base<\/strong> section, click <strong>Select a Different Source<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/06.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>7. Select the third option to use <strong>ChatGPT<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/07.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>8. Make sure that the <strong>Optional Instructions<\/strong> field is empty and that the character count is <strong>zero<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/08.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>9. Click the <strong>Use the Chatbot<\/strong> tab<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/09.png\" alt=\"A close up of a screen\n\nDescription automatically generated\"\/><\/figure>\n\n\n\n<p>10. In the <strong>Storyline Widget<\/strong> section, grab the <strong>Widget ID<\/strong> and download the starter .story file<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/10.png\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up the AI LLM connection in Articulate Storyline:<\/h3>\n\n\n\n<p>11. Open the starter .story file you downloaded and copy the <strong>JavaScript trigger on slide start<\/strong>; this code loads the LLM connection<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/11.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>12. Recreate this trigger on slide Master \u2013 you need to ensure that this script completes before you attempt to use AI<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/12.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>13. Create a variable <strong>clabsAnswersWidgetID<\/strong> and set the default value to the widget ID you received when you were setting up the AI connection <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/13.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>14. Create a variable <strong>clabsAnswersUserMessage<\/strong><\/p>\n\n\n\n<p>15. Create a variable <strong>clabsAnswersResponseMessage<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/15.png\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Using AI to generate a new scenario on slide start:<\/h3>\n\n\n\n<p>16. Create a new layer (we\u2019ll call it <strong>generate<\/strong>) and make sure that it\u2019s set to hide other layers and to reset to initial state when revisiting<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/16.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>17. Create a new text variable and call it <strong>action<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/17.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>18. On the <strong>generate<\/strong> layer, create a trigger to set <strong>action<\/strong> to value <strong>generate<\/strong> when the layer starts<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/18.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>19. We will use the following prompt for AI to generate a new scenario<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>You are writing mock product reviews for customer service training. Come up with the following information:<br>&#8211; A customer name;<br>&#8211; A one-paragraph review the customer wrote after purchasing a consumer electronics product (must include at least one issue).<br>Respond with a valid JavaScript JSON object in the following format: {&#8220;name&#8221;:&#8221;&#8221;, &#8220;review&#8221;:&#8221;&#8221;}<\/p>\n<\/blockquote>\n\n\n\n<p>20. Create a trigger to set the variable <strong>clabsAnswersResponseMessage<\/strong> to blank when the layer starts<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/20.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>21. Create a JavaScript trigger to execute when the layer starts<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>let player=GetPlayer();<br>let usermessage = 'You are writing mock product reviews for a customer service training. Come up with the following information: \\n- A customer name; \\n - A one-paragraph review the customer wrote after purchasing a consumer electronics product (must include at least one issue).\\nRespond with a valid JavaScript JSON object in the following format: {\"name\":\"\", \"review\":\"\"}';<br>player.SetVar('clabsAnswersUserMessage',usermessage);<br>clabsAnswersGetAnswer();<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/21.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>22. Create two new text variables \u2013 <strong>review_name<\/strong> and <strong>review_text<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/22.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>23. Create a trigger to execute when the variable <strong>clabsAnswersResponseMessage<\/strong> changes if the variable action is set to generate and <strong>clabsAnswersResponseMessage<\/strong> is not equal to blank (it will execute when the scenario generation completes)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/23.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>let player=GetPlayer();<br>let resp = player.GetVar('clabsAnswersResponseMessage');<br>let regex = \/\\{.*?\\}\/s;<br>const match = resp.match(regex);<br>resp = resp.replaceAll(\"\\n\",'');<br>let extractedJson = resp.match(regex) ? resp.match(regex)&#91;0] : '{}';<br>let review = JSON.parse(extractedJson);<br>player.SetVar('review_name', review.name);<br>player.SetVar('review_text', review.review);<\/code><\/pre>\n\n\n\n<p>24. Create a trigger to hide this layer when the variable <strong>clabsAnswersResponseMessage<\/strong> changes if the variable action is set to generate and <strong>clabsAnswersResponseMessage<\/strong> is not equal to blank (it will execute when the scenario generation completes)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/24.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>25. Return to the base layer of the slide and add variable references <strong>review_name<\/strong> and <strong>review_text<\/strong> where you would like to display the name of the customer and the product review<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/25.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>26. Create a trigger to show layer <strong>generate<\/strong> when the slide timeline on the base layer starts<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/26.png\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Using AI to evaluate responses submitted by the learners:<\/h3>\n\n\n\n<p>27. Add a text entry field for the users to type their responses and a <strong>Submit<\/strong> button<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/27.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>28. Add a new layer, we\u2019ll call it <strong>score<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/28.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>29. Add a trigger to show layer <strong>score<\/strong> when <strong>Submit<\/strong> is clicked<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/29.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>30. Add a trigger to set the variable <strong>action<\/strong> to <strong>score<\/strong> when the timeline starts on the layer<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/30.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>31. Add a trigger to set the variable <strong>clabsAnswersResponseMessage<\/strong> to a blank value when the layer timeline starts<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/31.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>32. Add three new text variables \u2013 <strong>score_greeting<\/strong>, <strong>score_ack<\/strong>, <strong>score_solution<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/32.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>33. Add a trigger to execute JavaScript when the timeline starts on this layer<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/33.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>let player = GetPlayer();<br>let review_text = player.GetVar('review_text');<br>let response_text = player.GetVar('TextEntry');<br>let prompt = 'You are evaluating a message provided by customer service in response to this customer complaint: '+review_text+' \\nAnswer Y for \"yes\" or N for \"no\": \\nDoes the customer service message include a greeting?\\nDoes the customer service message include an acknowledgment of the issue?\\nDoes the customer service message offer a solution to address the issue?\\nRespond with a JSON object in the following format {\"greeting\":\"\", \"acknowledgment\":\"\", \"solution\":\"\"}\\nResponse message to evaluate: '+response_text;<br>player.SetVar('clabsAnswersUserMessage',prompt);<br>clabsAnswersGetAnswer();<\/code><\/pre>\n\n\n\n<p>34. Create a trigger to execute when the variable <strong>clabsAnswersResponseMessage<\/strong> changes if the variable action is set to score and <strong>clabsAnswersResponseMessage<\/strong> is not equal to blank (it will execute when response evaluation completes)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/34.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>let player=GetPlayer();<br>let resp = player.GetVar('clabsAnswersResponseMessage');<br>let regex = \/\\{.*?\\}\/s;<br>const match = resp.match(regex);<br>resp = resp.replaceAll(\"\\n\",'');<br>let extractedJson = resp.match(regex) ? resp.match(regex)&#91;0] : '{}';<br>let score = JSON.parse(extractedJson);<br>player.SetVar('score_greeting', score.greeting.toUpperCase());<br>player.SetVar('score_ack', score.acknowledgment.toUpperCase());<br>player.SetVar('score_solution', score.solution.toUpperCase());<\/code><\/pre>\n\n\n\n<p>35. The variables <strong>score_greeting<\/strong>, <strong>score_ack<\/strong>, <strong>score_solution<\/strong> will each contain one letter (\u201cY\u201d or \u201cN\u201d) depending on the submitted response (whether the response included a greeting, whether it included an acknowledgment of the issue, whether it included a solution proposal)<\/p>\n\n\n\n<p>36. You can add more objects to display on the layer in order to provide feedback to the learner based on the evaluation<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/36.png\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Logging the text of the scenarios and responses to keep track of the performance of both AI engine and the learners who interact with the scenarios:<\/h3>\n\n\n\n<p>37. Return to <a href=\"https:\/\/cluelabs.com\/\">cluelabs.com<\/a> and log in<\/p>\n\n\n\n<p>38. Select the <strong>Data Cloud<\/strong> tile on the dashboard<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/38.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>39. Click <strong>New Data Cloud Table<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/39.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>40. Leave the authoring tool as <strong>Articulate Storyline<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/40.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>41. Under <strong>Data Fields<\/strong>, add fields <strong>review<\/strong> (text), <strong>response<\/strong> (text), <strong>greeting<\/strong> (true\/false), <strong>acknowledgment<\/strong> (true\/false), <strong>solution<\/strong> (true\/false)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/41.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>42. Click <strong>Save<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/42.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>43. Click <strong>See the Complete List of Triggers<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/43.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>44. Return to Storyline and create a variable <strong>stencilusertoken<\/strong> as instructed in step 1<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/44.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>45. Copy the code shown in step 3<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/45.png\" alt=\"A screenshot of a computer code\n\nDescription automatically generated\"\/><\/figure>\n\n\n\n<p>46. Create a new JavaScript trigger on the slide Master to execute when the timeline starts, and paste the code you just copied<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/46.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\"\/><\/figure>\n\n\n\n<p>47. On the layer score locate the trigger that executes when the variable <strong>clabsAnswersResponseMessage<\/strong> changes (the trigger that you created earlier)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/47.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\"\/><\/figure>\n\n\n\n<p>48. Add the following code to the end of the JavaScript code in this trigger<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>player.SetVar('stencilusertoken', '');<br>CloudSet('review', player.GetVar('review_text'));<br>CloudSet('response', player.GetVar('TextEntry'));<br><br>if (score.greeting.toUpperCase()==='Y') {&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;CloudSet('greeting', true);<br>} else {<br>&nbsp;&nbsp;&nbsp;&nbsp;CloudSet('greeting', false);<br>}<br><br>if (score.acknowledgment.toUpperCase()==='Y') {&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;CloudSet('acknowledgment', true);<br>} else {<br>&nbsp;&nbsp;&nbsp;&nbsp;CloudSet('acknowledgment', false);<br>}<br><br>if (score.solution.toUpperCase()==='Y') {&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;CloudSet('solution', true);<br>} else {<br>&nbsp;&nbsp;&nbsp;&nbsp;CloudSet('solution', false);<br>}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/48.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\"\/><\/figure>\n\n\n\n<p>You are all set! You can now publish your project and test the scenario generation as well as response evaluation features powered by an AI large language model.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before we begin: The published (and slightly improved) project is posted as a demo at https:\/\/cluelabs.com\/ai-chatbot-elearning-widget#section-ai-chatbot-demos (demo #2) You can also download the .story file at https:\/\/storage.googleapis.com\/us-east1-clabs-blog-images\/0other\/using-ai-to-generate-scenarios\/AI%20LLM%20scenarios%20starter.story Using AI LLMs to generate dynamic learning content, feedback, etc. It\u2019s easy to use AI tools like ChatGPT to generate a text paragraph and then use this text [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[24],"_links":{"self":[{"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/posts\/966"}],"collection":[{"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/comments?post=966"}],"version-history":[{"count":0,"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/posts\/966\/revisions"}],"wp:attachment":[{"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/media?parent=966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/categories?post=966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cluelabs.com\/blog\/wp-json\/wp\/v2\/tags?post=966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}