Joined: 27 Jun 2012
|Posted: Wed Jun 27, 2012 2:42 am Post subject: checkbox add +1 to variable
I have a questionaire (quiz) made in OO writer made in a simple format
Question 1 Bla bla
checkbox Answer 1
checkbox Answer 2
checkbox Answer 3
Question n Bla bla
checkbox Answer n1
checkbox Answer n2
checkbox Answer n3
And a score summary table at the end of the file.
I usually print the document and the users fill the answers with the pen.
I am wondering if I could use this OOwriter document as a digital form.
I would like the macro to check the state of the answer (checkbox) for each question and if the correct checkbox is thicked to add a point to the final score.
I have no clue when it comes to Basic or OO macro API so it is a task that I do not know how to even start with. From what I think I figured out it seems to be possible (checkboxes have the Name and the On/Off state value and can have a macro attached to thick action).
So the question is how the macro looks like, to add a point to Score variable and how to place and refresh that variable in the Score table cell (as a number)?
As a final question: would a OOwriter document with everything working as explained still work if I export it to the PDF (as an example I 've seen that exported Option button controls work the same as in writer, but would the macro be preserved as well)?
Thank you in advance for all the help you can give me.