Hi Nadine,
Here’s how to do it:
newTrial(
newText("scaleValue", "NA").before( newText("Score: ") )
,
newScale("myScale", 7)
.slider()
.callback( getText("scaleValue").text(getScale("myScale")) )
.print()
,
getText("scaleValue").print()
,
newButton("Next").print().wait()
)
Note that values start with 0, so if you want to display a score starting with 1, you’ll need to use a Var element:
newTrial(
newVar("scaleVar", 0)
,
newText("scaleValue", "NA").before( newText("Score: ") )
,
newScale("myScale", 7)
.slider()
.callback(
getVar("scaleVar").set(getScale("myScale")).set(v=>parseInt(v)+1)
,
getText("scaleValue").text( getVar("scaleVar") )
)
.print()
,
getText("scaleValue").print()
,
newButton("Next").print().wait()
)
Jeremy