Inline variable replacement with “VAR(mytest)” has been designed to insert the page name into a textfield so fast, a user cannot see the default text of the field. So this is what happens first when the page is loaded and it happens only once.
All actions to modify that variable are executed later, i.e. the action to set the variable to “8” is working but it happens after the variable has been inserted into the textfield, when its value is still equal to “0”. It should work if you modify the variable on a previous page.
For testing you can add it to your function updateQuestion1()
Be aware that you need a Lectora action that uses the variable “mytest” on the question page. Otherwise it won’t exist. The easiest way to achieve it is to add a Group on Chapter level with one action to “Reset all variables”.