jQuery Poll EXAMPLE TEMPLATE

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...

Templates for whole sites

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 !!!

###REF_ERRORS### ###REF_QUIZ_LIMIT### ###REF_PAGE_LIMIT###
###REF_QUESTIONS### ###REF_SUBMIT_FIELDS### ###HIDDENFIELDS###

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 !!!

###REF_RES_ERRORS### ###REF_INTRODUCTION### ###REF_QRESULT### ###REF_QPOINTS### ###REF_NEXT### ###REF_POLLRESULT###

Template-Snippets

###REF_QUESTION_IMAGE_BEGIN###
###VAR_QUESTION_TITLE###
###VAR_QUESTION_NAME### ###P1######VAR_ANSWER_POINTS######P2###
###VAR_QUESTION_ANSWER###
###REF_QUESTION_IMAGE_END### ###REF_DELIMITER###
###VAR_QUESTION_IMAGE###  

You can use this marker too: ###REF_QR_ANSWER_CORR###
###VAR_QUESTION_TITLE###
###VAR_QUESTION_NAME###
###REF_QR_ANSWER_CORR_ANSW### ###REF_QR_ANSWER_CORR_NOTANSW### ###REF_QR_ANSWER_NOTCORR_NOTANSW### ###REF_QR_ANSWER_NOTCORR_ANSW### ###REF_QR_EXPLANATION### ###REF_QR_POINTS### ###REF_DELIMITER###

###NO_SUBMIT###

###DOUBLE_ENTRY###

###NOT_LOGGEDIN###

###CHEATING###

###POLLRESULT_URL###

###THANK_YOU### ###QUESTION_NAME### ###VAR_QUESTION_NAME###
###USER_ANSWER### ###VAR_USER_ANSWER###

 
Insgesamt haben bisher ###VAR_VOTES### Leute ihre Stimme abgegeben.

You can use ###VAR_LINKTAG### too.

###VAR_TITLE###

Email to admin (if email.send_admin > 0):
1. Reference to TEMPLATE_QUIZ_USER_SUBMITED or TEMPLATE_POLL_SUBMITED

###SUBJECT### ###EMAIL_TAKEN### ###QUIZ_NAME### ###REF_INTRODUCTION###

Email to quiz taker (if email.send_user > 0):
1. Reference to TEMPLATE_QUIZ_USER_SUBMITED or TEMPLATE_POLL_SUBMITED

###SUBJECT### ###REF_INTRODUCTION###