Building a notebook with Javascript

May 04, 2021

Hi, I'm testing a learner and then building a notebook with javascript, appreciate any help.

I have three numeric variables, any variable that = 1 is used to build the notebook i.e. text variable (var Journal). JS newbiew, I'm doing some thing wrong.

var player=GetPlayer();
var M1NuQ1t=player.GetVar("M1NuQ1");
var M1NuQ2t=player.GetVar("M1NuQ2");
var M1NuQ3t=player.GetVar("M1NuQ3");
var newJournal=player.GetVar("Journal");

if (M1NuQ1t == 1) {
player.SetVar("Journal") + "M1NuQ1 comment");
}
if (M1NuQ2t == 1) {
var newJournal2 = player.GetVar("Journal") + "M1NuQ2 comment");
player.SetVar("Journal", newJournal2);
}
if (M1NuQ3t == 1) {
var newJournal3 = player.GetVar("Journal") + "M1NuQ3 comment");
player.SetVar("Journal", newJournal3);
}

1 Reply