Manually add the rows in Data cloud then fetch the same value from storyline
Hi,
We have 15 questions in our assessment and add this data in DATA object like that [ { 'Learner name',' abc', 'Quiz1': 'this is my first question01', 'Answer1': 'Correct', 'Score1': '20' }, { 'Learner name',' abc', 'Quiz2': 'this is my first question02', 'Answer2': 'Correct', 'Score2': '10' }, { 'Learner name',' abc', 'Quiz3': 'this is my first question03', 'Answer3': 'Correct', 'Score3': '20' }, ] There is any way to create the row table dynamically in data cloud, Here we have to created all parameter in table then get the value in table . Quiz1, Quiz2, Quiz3 etc.
In google sheet we are able to create the table dynamically from storyline JS that is given below but in data cloud its not working.
var totalMarks = Math.round(Number(player.GetVar("GlobalScore")/28*100)) + '%'; const questionsNo = player.GetVar("Decision_Question_no"); var Decision_Question = 'Decision Question '+ questionsNo var Question_Score = 'Decision Question '+ questionsNo + ' Score:' var Question_Result = 'Decision Question '+ questionsNo + ' Result:' var learner_name_scorm = player.GetVar("learner_name");
SheetsSet('Student Name from LMS',learner_name_scorm); SheetsSet('Learner name',learnerName); SheetsSet('Date',myDate); SheetsSet(Decision_Question,QuizDescription); SheetsSet(Question_Score,Score); SheetsSet(Question_Result, QuizResult); SheetsSet('Total Marks', totalMarks)
Please suggest
Regards, Bipin
Reply
Posted on 9/9/2024
Please type your reply.
@support
If it works with Sheets, it has to work with Data Cloud as well. I would check your javascript to make sure there are no typos. Right away, looking at the code you posted: there's a semicolon missing on multiple lines (var Decision_Question, var Question_Score, var Question_Result, SheetsSet('Total Marks', totalMarks)) and there could be other issues too. If you want, post a link to your .story file, we'll check what's wrong.