Screen script button

There’s a script button on the screen (it’s at the upper left) that’s not associated with any of the parts (the note, the responses, etc.). If you click it you get an empty script editor.

What’s that for? It seems like it would be a good place to put shared variables, but I can’t seem to access it. Not knowing what it’s called, I don’t seem to find it in the docs.

Thanks,

g.

They are undocumented, but some sinks that can be used are title:, subtitle:, and coverText:.

Interesting. And subtitle and coverText aren’t available using the UI, it seems? Are there other uses for that screen-level code block?

Graham_Charles, like you I’m curious about the screen script button. As a general approach, I was hoping to placing a Boolean there for the next screen to check that any necessary conditions for progression have been met and, if not, sending the use back to complete whatever is missing. It seems odd that there is no way to refer to this script?

Does anyone know of any updates or discussion since May?

Your coverText is generally conditionally dependent on another component, so set your Boolean there and refer to that.

Sorry Daniel, I don’t understand your answer which probably means I didn’t explain what I was trying to do adequately!
Here is a 2-slide example with comments. I don’t want the student to advance until whatever is on screen 1 has been completed.Ideally, I’d like to disable the ‘next’ button but failing that I want to send the student back from screen 2 if they arrive there before all screen 1 conditions are met. Is this clearer?

I tried using coverText but the alert isn’t repeated if the student returns to screen 2 a second time without screen 1 being completed?

Here’s an example of what @Daniel_Grubbs was referring to:

1 Like

Thanks @cwinske, I now understand what @Daniel_Grubbs was saying, and see that that is a very effective way of hiding what is on the second screen. I think the approach could be made even more general if there was some way to refer to the screen script on the preceding screen, using code of the form:

coverText: when not(previous.script.OK) “Please finish the last slide.” otherwise “”
coverButtonLabel: “”

where ‘previous’ refers to the preceding screen and OK is variable defined in that screen script. In this way, the second screen doesn’t need to know anything specific about the preceding screen. It doesn’t look like it is achievable at present but is perhaps something for the developers to consider.

Are you trying to say everything intended on the previous screen needs to be attempted before moving forward? Maybe a feature request. For now, your only option is to give those specifics, although you could define them in one component in the previous slide to get similar functionality.

No. I’m trying to say that the condition for moving forward be consolidated into a screen script to avoid the following screen needing to know about the specifics of the condition.

So, you’d still need to define those conditions in the previous slide, which you can do in another component as an alternative.

Actually, going back to the beginning of this thread, on the problem of an anonymous script for the screen, that would clearly be solved by having a screen label. I see that is discussed in

Hopefully this will be a general feature in due course.

1 Like