I’m working on a scene where I have to answer questions that have multiple correct answers and when I answer correctly (or incorrectly) I need to disable further answering of the offered answers.
How to disable mouse clicking on elements?
Can I have an example with a quiz scene?
doc.getElement("Text_Pol").dom.style.pointerEvents = "none"; //not working
switch (e.target.name) {
case 'Text_D':
doc.N_odg = doc.N_odg +1 ;
doc.getElement("Text_P").dom.style.opacity = "0.5";
doc.getElement("Text_P").dom.style.pointerEvents = "none"; //not working
doc.getElement("Text_L").dom.style.opacity = "0.5";
doc.getElement("Text_L").dom.style.pointerEvents = "none"; //not working
doc.getElement("Text_Pol").dom.style.opacity = "0.5";
doc.getElement("Text_L").dom.style.pointerEvents = "none"; //not working
break;
case 'Text_P':
doc.N_odg = doc.N_odg +1 ;
doc.getElement("Text_D").dom.style.opacity = "0.5";
doc.getElement("Text_D").dom.style.pointerEvents = "none"; //not working
doc.getElement("Text_L").dom.style.opacity = "0.5";
doc.getElement("Text_L").dom.style.pointerEvents = "none"; //not working
doc.getElement("Text_Pol").dom.style.opacity = "0.5";
doc.getElement("Text_L").dom.style.pointerEvents = "none"; //not working
break;
case 'Text_L':
doc.T_odg = doc.T_odg + 1;
if (doc.T_odg == 2) {
doc.getElement('Shape_T').show(true);
doc.getElement("Text_D").dom.style.opacity = "0.5";
doc.getElement("Text_D").dom.style.pointerEvents = "none"; //not working
doc.getElement("Text_P").dom.style.opacity = "0.5";
doc.getElement("Text_P").dom.style.pointerEvents = "none"; //not working
}
break;
case 'Text_Pol':
doc.T_odg = doc.T_odg + 1;
if (doc.T_odg == 2) {
doc.getElement('Shape_T').show(true);
doc.getElement("Text_D").dom.style.opacity = "0.5";
doc.getElement("Text_D").dom.style.pointerEvents = "none"; //not working
doc.getElement("Text_P").dom.style.opacity = "0.5";
doc.getElement("Text_P").dom.style.pointerEvents = "none"; //not working
}
break;
}