6 Replies Latest reply on Feb 15, 2008 2:10 AM by (maleck_kcelam)

    Radiobuttons + give corrected answers + print total points

      Hi folks,

      Does anyone know how to do use javascript to create a Text Field that contains the answers from radiobuttons over several pages of an exam ? Here is the problem :

      page 1 = A Geography question with 5 radiobuttons which can correspond to 5 answers (a,b,c,d,e) ---> the correct answer for this question earns 2 marks

      page 2 = A Math question with 5 radiobuttons which can correspond to 5 answers (a1,b1,c1,d1,e1) ---> the correct answer for this question earns 3 marks

      (...)

      I would be grateful if you could tell me how to create a button which will write me on a Text Field (placed on the last page) the following :

      1-The canditate's answer for EACH question throughout the exam
      2-Next to it, the correct answers I have in my possesion for EACH question
      3-Finally, the mean value of the total candidate's correct answers and his final mark.

      Merry Christmas by the way !!
      Cheers,
      Maleck
        • 2. Re: Radiobuttons + give corrected answers + print total points
          gkaiseril MVP & Adobe Community Professional
          The answer will depend upon what program you are creating the form in since AcroForms and LiveCycle Designer use different syntax and offer different capabilities.

          You also should consider a different approach to your solution. One field for the results requires additional formatting. You also may have a security issue if you include the answers within the form.
          • 3. Re: Radiobuttons + give corrected answers + print total points
            Level 1
            Thank you for your interest, I am really in need to apply the JavaScripts to my documents and I think that I will learn a lot from your programming help. In fact, I am using Adobe Acrobat 7 professional to make these pages (AcroForms).

            I (and the other members who are new to Acrobat JavaScript Programming) would be really grateful if you could also explain the places where we should insert the codes after releasing them here in the forum. Feel free to add any security measures that you think are worth implementing for this exercise.

            Your help with the JavaScripts will make this article a reference for future use of Radio Buttons and it is going to inspire us to make further complex projects by our own.

            We are anxiously waiting,
            Thanks !!
            • 5. Re: Radiobuttons + give corrected answers + print total points
              gkaiseril MVP & Adobe Community Professional
              With Acrobat, Radio Buttons and check boxes have a value of "Off" when not selected so you will need to provide for this value.

              Arrays can be automatically incremented starting at zer0, have their elements named or a combination. So with careful naming of the fields or array elements, one should be able to programatically match the answer to the question.

              For more information on creating forms:

              Documentation available from Adobe:

              Acrobat SDK; http://www.adobe.com/devnet/acrobat/
              Acrobat JavaScript Documentation: http://www.adobe.com/devnet/acrobat/javascript.html
              Acrobat FDF Toolkit: http://www.adobe.com/devnet/acrobat/fdftoolkit.html
              PDF Reference: http://www.adobe.com/devnet/pdf/pdf_reference.html

              The above sites include additional links to other PDF information.

              Books:
              Adobe Acrobat Bible series by Ted Padova
              Adobe Arcobat Tips and Tricks by Donna L. Baker
              Extending Acrobat Forms with JavaScirpt by John Deubert
              Creating Dynamic Forms with Adobe LiveCycle Designer by J. P. Terry

              Adobe Sponsored forums:
              Acrobat User-to-User forums: http://www.adobeforums.com/cgi-bin/webx/.3bbeda8b/
              Acrobat User Community: http://www.acrobatusers.com/

              Other Forums:
              Planet PDF Forums: http://forum.planetpdf.com/wb/default.asp

              Other PDF Sites:
              Planet PDF: http://www.planetpdf.com/
              Windjack Solutions: http://www.windjack.com/
              Ted's Homepage: http://www.west.net/~ted/index.html
              Abracadabra PDF: http://www.abracadabrapdf.net/index.php?lng=en
              NitroPDF: http://www.nitropdf.com/index.asp
              D. P. Story (Acrotex): http://www.acrotex.net.
              PDF Zone: http://www.pdfzone.com/

              JavaScirpt:
              JavaScript Central: http://devedge-temp.mozilla.org/central/javascript/index_en.html