You need jQuery for this example. This example uses the extension t3jquery. The design of this example is from here: http://net.tutsplus.com/demos/test_poll/ http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-dynamic-poll-with-jquery-and-php/ Test it with this TypoScript:
plugin.tx_myquizpoll_pi1.isPoll = 1 plugin.tx_myquizpoll_pi1.templateFile = EXT:myquizpoll/examples/template_poll_jquery.html plugin.tx_myquizpoll_pi1.myVars.answers { input_id = 1 input_label = 1 } includeLibs.t3jquery = EXT:t3jquery/class.tx_t3jquery.php page.11 = USER page.11.userFunc = tx_t3jquery->addJqJS
Note: no breaks allowed in the question. Breaks: JavaScript-Errors...
And use this CSS:
.graph { width: 600px; position: relative; } .bar-title { clear:both; position: relative; float: left; width: 150px; line-height: 20px; margin-right: 17px; font-weight: bold; text-align: right; } .bar-container { position: relative; float: left; width: 250px; height: 20px; margin: 0px 0px 15px; } .bar-container div { background-color:#006B04; height: 20px; } .bar-container strong { position: absolute; right: -2px; top: 0px; overflow: hidden; }
Questions page:
1. Empty or reference to TEMPLATE_CAPTCHA_NOT_OK.
2. Reference to TEMPLATE_QUIZ_TIME_LIMIT. REF_QUIZ_LIMIT will be empty if "quizTimeMinutes = 0".
3. Reference to TEMPLATE_PAGE_TIME_LIMIT. REF_PAGE_LIMIT will be empty if "pageTimeSeconds = 0".
4. Multiple reference to TEMPLATE_QUESTION.
5. Reference to TEMPLATE_QUIZ_USER_TO_SUBMIT (dontShowUserData = 0), to TEMPLATE_SUBMIT (dontShowUserData = 1) or to TEMPLATE_NO_SUBMIT (if no rights)
6. Dont delete the marker HIDDENFIELDS !!!!!!!
7. Reference to TEMPLATE_HIGHSCORE_URL. REF_HIGHSCORE_URL will be empty if is poll or dontShowHighscoreLink = 1 !!!
Optional: ###REF_POLLRESULT_URL### = Reference to TEMPLATE_POLLRESULT_URL. REF_POLLRESULT_URL will be empty if is quiz or showPollResultLink = 0 !!!
Result page:
1. Empty or reference to TEMPLATE_CHEATING.
2. Reference to TEMPLATE_POLL_SUBMITED (poll) or to TEMPLATE_QUIZ_USER_SUBMITED (quiz; if "dontShowUserData=0" and "dontShowUserResult=0", else empty).
3. Multiple reference to TEMPLATE_QRESULT (empty if is poll or "dontShowCorrectAnswers=1").
4. Reference to TEMPLATE_RESULT_POINTS or TEMPLATE_RESULT_POINTS_TOTAL (if is quiz and "dontShowPoints=0", else empty)
5. Reference to TEMPLATE_NEXT (if "showAnswersSeparate=1" and is quiz, else empty)
6. Reference to TEMPLATE_POLLRESULT (if is poll and "dontShowPollResult=0", else empty)
Optional: Reference to TEMPLATE_POLLRESULT_URL. REF_POLLRESULT_URL will be empty if is quiz or showPollResultLink = 0 !!!
###VAR_QUESTION_IMAGE### |
###RESULT_POINTS###: ###VAR_RESULT_POINTS### / ###VAR_MAX_POINTS###
###RESULT_POINTS###: ###VAR_RESULT_POINTS### / ###VAR_MAX_POINTS### (###TOTAL_POINTS###: ###VAR_TOTAL_POINTS### / ###VAR_TMAX_POINTS###)
###NO_SUBMIT###
###DOUBLE_ENTRY###
###NOT_LOGGEDIN###
###CHEATING###
No more questions. You can use here these Markers too: ###RESTART_QUIZ###, ###RESULT_POINTS###: ###VAR_RESULT_POINTS### / ###VAR_MAX_POINTS### (###TOTAL_POINTS###: ###VAR_TOTAL_POINTS### / ###VAR_TMAX_POINTS###)###NO_MORE###
###POLLRESULT_URL###
###THANK_YOU### ###QUESTION_NAME### ###VAR_QUESTION_NAME###
###USER_ANSWER### ###VAR_USER_ANSWER###
You can use ###VAR_LINKTAG### too.