1 Reply Latest reply on Nov 17, 2008 7:55 AM by matthewmaday

    Uing check boxes

    Almudever
      Hello,

      I am searching information about check boxes for create test quetions. If need to have some examples.
      I would like one page to looking for them.

      Thank's
        • 1. Re: Uing check boxes
          matthewmaday Level 1
          I am not sure if you posted the other question as well but the answer is the same.

          -- To detect the state of a check box
          sprite(1).selected -- this will return boolean values (1 selected, 0 not selected)

          I created 3 functions for you which will show you how to work with check boxes.

          on QUESTION_multipleChoice pSelect, pStartSN, pEndSN

          -- this function will only allow the selection of one check box

          -- pSelect [INT] the number of the sprite that was just selected
          -- pStartSN [INT] the number of the first sprite in the range of check boxes
          -- pEndSN [INT] the number of the last sprite in the range of check boxes

          repeat with i = pStartSN to pEndSN

          sprite(i).selected = (i=pSelect)

          end repeat

          end
          --------
          on QUESTION_returnSelectedCheckboxes pStartSN, pEndSN

          -- this function will return all of the check boxes that are selected between the defined range

          -- pStartSN [INT] the number of the first sprite in the range of check boxes
          -- pEndSN [INT] the number of the last sprite in the range of check boxes

          pList = []

          repeat with i = pStartSN to pEndSN
          if sprite(i).selected then append pList, i
          end repeat

          return pList

          end
          --------
          on QUESTION_clearSelectionBoxes pStartSN, pEndSN

          -- this function will set all of the check boxes, within a defined range, to not selected

          -- pStartSN [INT] the number of the first sprite in the range of check boxes
          -- pEndSN [INT] the number of the last sprite in the range of check boxes

          repeat with i = pStartSN to pEndSN
          sprite(i).selected = 0
          end repeat

          end