Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

How To do a quiz
Last Post 04-05-2010 11:21 AM by David To. 8 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Thomas BornUser is Offline
going with the flow
going with the flow
Posts:78
Avatar

--
04-01-2009 01:12 AM

    Hi, I am sure this can be done somehow and I would appreciate some tips how to implement this:

    I would like to configure a quiz that contains 15 questions, each will have two radio buttons for the answer. Depending on the answer I need a counter that counts the answers given. Overall there are five different types of answers:

    A, B, C, D, F

    If the user selects radio button 1 of the first question counter A is incremented, button 2 increments counter B. radio button 1 of second question increments counter A, radio button 2 increments counter F, etc.

    In the end I would like to know the counters and send the user an email saying 4 A answers, 2 B answers etc.

    I was thinking of using the question event behind each radio button question to trigger incrementing a hidden field, but I am not sure how this can be done?

    One option I was thinking is to use an SQL Statement in the Form Completion to update the database directly, I would need some information though that identifies the instance of the form the user is working on.

    I appreciate any tips I can get

    Thanks

    Thomas

    Thomas BornUser is Offline
    going with the flow
    going with the flow
    Posts:78
    Avatar

    --
    04-01-2009 03:19 AM
    Ok, I am closer but I still have a problem. I tried it with JavaSript and wrote a function which to add all the results when the form is submitted. I placed the function into the JavaScript file under Custom JavaScript File in the Module Configuration.

    I then call the function inside the Submit/Save javascript like this:
    CalculateQuiz($(CountA_FieldID),$(CountB_FieldID),$(CountC_FieldID))

    CountA, CountB, CountC are hidden fields. However when I look at the source of the page and debug the JavaScript, the value $(CountA_FieldID) is not replaced by the actual ID of the hidden field and returns an error -> therefore not executing the script.

    Am I missing something here?

    Thomas
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-01-2009 06:50 AM

    Thomas, radiobutton is done usin g the funcradiocalc($(fieldname_id)). You should already have this function available to call in your javascript file. What you need to do is javascript of something like this:

    $(CountA) is a hidden textbox field; default value of 0
    $(CountB) is a hidden textbox field; default value of 0

    switch (funcradiocalc($(RadioA_fieldID)))
    {
    case 'A':
    $(CountA) = $(CountA) + 1
    break;
    case 'B':
    $(CountB) = $(CountB) + 1
    break;
    }

    switch (funcradiocalc($(RadioB_fieldID)))
    {
    case 'A':
    $(CountA) = $(CountA) + 1
    break;
    case 'B':
    $(CountB) = $(CountB) + 1
    break;
    }

    Try this simple method of having only two radio buttons with A/B choices and see if this works out first and then you can append everything else. -- David

    Thomas BornUser is Offline
    going with the flow
    going with the flow
    Posts:78
    Avatar

    --
    04-01-2009 02:09 PM

    Thanks David;

    I am just wondering where would I place this script that you wrote above?

    Also I am wondering why the code that I placed in the Submit / JavaScript isn't working?

    Thomas

     

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-01-2009 03:28 PM
    HI Thomas, you place the entire javascript in the module configuration / Custom Javascript / Initial Javascript. Also place each switch block javascript above in their corresponding client side event of each radio box button. -- david
    Thomas BornUser is Offline
    going with the flow
    going with the flow
    Posts:78
    Avatar

    --
    04-01-2009 03:52 PM
    Thanks David, I just got that far, the problem with this is when a user changes their answer I keep incrementing. This means I need to subtract from the other counter. Obviously I need to know first if this is the first selection or if the user just toggles.

    It would be much easier if I can place a function call like:
    CalculateQuiz($(CountA_FieldID),$(CountB_FieldID),$(CountC_FieldID))
    into the Submit/Save javascript part of the module. My problem here is that the variables $(CountA_FieldID) don't get replaced with their actual ID. Is this a bug or is this functionality not available in this section?

    Thomas
    Thomas BornUser is Offline
    going with the flow
    going with the flow
    Posts:78
    Avatar

    --
    04-01-2009 04:33 PM
    Ok, what I did now is placing the call CalculateQuiz($(CountA_FieldID),$(CountB_FieldID),$(CountC_FieldID)) in the Question JavaScript. This means the whole calculation happens with every answer. Not ideal but it works.

    Still wondering about the Submit/Save javascript question as this seems to be the logical place for the code to go.

    Thanks
    Thomas
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-02-2009 07:30 AM
    HI Thomas, yes the feature of rendering the tokens on "Submit/Save" javascript is not available in the current version of DF. We will add this as a feature request and hope to include in a future release. -- David
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-05-2010 11:21 AM
    Hi, yes the tokens are available under “Save Javascript” area now. However, on each of those tokens, you need to place some dummy client side javascript on them under “Advance Field Options”, such as “var nothing;”.
    -- David
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi