Masking answer options in Confirmit (jscript) -
I'm trying to mask the answer option which, using a background value, the 3DGrid question The items are shown in the variable
Example when displaying "Background 1" == 1, Answer Category 1. If "background 1" == 0, then do not display the answer category 1. If "background 2" == 1, display category 3, otherwise not. In any case, display the answer category 2.
Hope this is easy for someone (I'm a psychiatrist, not a sign word ... so it's not for me: /)
Thank you!
We can use the Confirmit function to access data inside a query / variable.
For example:
f ('my_question_id'). Get ();
While masking a question, we have to pass in a set object so that Confirmates knows that not to show and show for code
You will often mask using a set from the previous question. So you pass in question_id and do all the spell-bound magic.
Here we have a problem not having a set, so we have to make our own.
For this, there are 2 approaches (working with the work in the scripting manual> by adding a set object and by adding
and and working with the sets > User Defined Function.
)
I am going to stick for the first time because it is easy to use;) What will we do first, create a script node (It does not matter where you make it, all Somewhere in the moment, I often have a folder work with all my script nodes at the bottom of my survey)
In that script file we will have our functions which will box our set: < / P>
CreateMyAwesomeSet () {// Create a empty set var mySet = new set (); // If background 1 is equal to 1 then add 1 to our set (f ('background1'). Get () == '1') {mySet.add (1); } // return return code of mySet return return; }
Here we declare a function which we can now use anywhere.
Now, if we want to use this set, then we have a code mask in our grid:
CreateMyAwesomeSet ()
You can change the name of the function, and add additional statements. Hope this helps
Comments
Post a Comment