You need jQuery for this example. This example uses the extension t3jquery. Furthermore you need jqPlot from here: http://www.jqplot.com/tests/pie-donut-charts.php Download it and copy it to your fileadmin-folder. Test it with this TypoScript:
plugin.tx_myquizpoll_pi1 { isPoll = 1 useCookiesInDays = 7 tableAnswers = tx_myquizpoll_voting templateFile = EXT:myquizpoll/examples/template_poll_jquery_pie.html myVars.separator = | myVars.answers { input_id = 1 input_label = 1 } # customize this 2 lines: myVars.list.komma = ,|,|,|,| answerChoiceMax = 5 } page.includeCSS { jqplot = fileadmin/template/jqplot/jquery.jqplot.min.css } page.includeJS { jqplot = fileadmin/template/jqplot/jquery.jqplot.min.js pie = fileadmin/template/jqplot/plugins/jqplot.pieRenderer.min.js donut = fileadmin/template/jqplot/plugins/jqplot.donutRenderer.min.js } // And if you don“t always include jQuery: includeLibs.t3jquery = EXT:t3jquery/class.tx_t3jquery.php page.11 = USER page.11.userFunc = tx_t3jquery->addJqJS
Note: no breaks allowed in the answers. Breaks: JavaScript-Errors...
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### |
###NO_SUBMIT###
###DOUBLE_ENTRY###
###NOT_LOGGEDIN###
###CHEATING###
###POLLRESULT_URL###
###THANK_YOU### ###QUESTION_NAME### ###VAR_QUESTION_NAME###
###USER_ANSWER### ###VAR_USER_ANSWER###
You can use ###VAR_LINKTAG### too.
Email to admin (if email.send_admin > 0):
1. Reference to TEMPLATE_QUIZ_USER_SUBMITED or TEMPLATE_POLL_SUBMITED
Email to quiz taker (if email.send_user > 0):
1. Reference to TEMPLATE_QUIZ_USER_SUBMITED or TEMPLATE_POLL_SUBMITED