QUIZ EXAMPLE TEMPLATE

You need jQuery for this example. This example uses the extension t3jquery. Note: this example works only with radio-buttons, checkboxes and select-options questions! Test it with this TypoScript:

plugin.tx_myquizpoll_pi1.isPoll = 0
plugin.tx_myquizpoll_pi1.templateFile = EXT:myquizpoll/examples/template_quiz_jquery2.html
plugin.tx_myquizpoll_pi1.myVars.answers {
  input_radio = id="answer1",id="answer2",id="answer3",id="answer4",id="answer5",id="answer6"
  input_checkbox = id="answer1",id="answer2",id="answer3",id="answer4",id="answer5",id="answer6"
  input_wrap = ,,,,,
}
plugin.tx_myquizpoll_pi1.userData.askAtQuestion = 0
plugin.tx_myquizpoll_pi1.pageQuestions = 1

# if you dont always include jQuery:
includeLibs.t3jquery = EXT:t3jquery/class.tx_t3jquery.php
page.11 = USER
page.11.userFunc = tx_t3jquery->addJqJS

Templates for whole sites

###REF_ERRORS###
###REF_QUESTIONS### ###REF_JOKERS### ###REF_SUBMIT_FIELDS### ###HIDDENFIELDS###
not in use ###REF_ERRORS###
###REF_NO_MORE### ###REF_INTRODUCTION### ###REF_QUIZ_ANALYSIS### ###REF_SUBMIT_FIELDS### ###HIDDENFIELDS###
###REF_HIGHSCORE### ###REF_HIGHSCORE_URL###

Template-Snippets

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

You can use this marker too: ###REF_QR_ANSWER_CORR### If user results should be hidden, set hidden = 1. Example: see template_statistics.html.
###NAME###:
###EMAIL###:
###HOMEPAGE###:
###SR_FREECAP_NOTICE###
###SR_FREECAP_CANT_READ###

###SR_FREECAP_IMAGE### ###SR_FREECAP_ACCESSIBLE###
 

###RESULT_FOR###:
###NAME###: ###REAL_NAME###
###EMAIL###: ###REAL_EMAIL###
###HOMEPAGE###: ###REAL_HOMEPAGE###

 

###NO_SUBMIT###

###DOUBLE_ENTRY###

###NOT_LOGGEDIN###

###CHEATING###

###USE_JOKERS###: - ###JOKER_50### - ###JOKER_PHONE### - ###JOKER_AUDIENCE###

###ANSWER_JOKER###: none :-(


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

###VAR_QUESTION_TITLE###
###VAR_QUESTION_NAME###
###REF_QR_ANSWER_CORR### ###REF_QR_EXPLANATION### ###REF_DELIMITER###

Highscore-list. You can use this markers too in TEMPLATE_HIGHSCORE_ENTRY: ###VAR_PERCENT###, ###VAR_MAX###, ###VAR_O_MAX###, ###VAR_TIME###, ###VAR_FE_UID###, ###VAR_PAGE_NAME### (page with plugin) and ###VAR_FOLDER_NAME### (page of result records).

And if you use groupBy: ###VAR_NUM_QUIZ### (num. of solved quizes).

###REF_HIGHSCORE_CAPTION###
###NUMBER### ###POINTS### ###PERCENT### ###NAME### ###DATE###
###VAR_COUNT### ###VAR_POINTS### ###VAR_O_PERCENT### ###REF_HIGHSCORE_QUIZ_TAKER### ###VAR_DATE###
###HIGHSCORE_CAPTION### ###VAR_HIGHSCORE_LIMIT### Allowed Markers here: ###VAR_NAME###, ###VAR_EMAIL###, ###VAR_HOMEPAGE###, ###VAR_TO_HOMEPAGE###, ###VAR_NAME_AND_EMAIL###

And if you use groupBy: ###LINK_DETAIL### (link to a detailed highscore).

###VAR_NAME_AND_EMAIL### ###VAR_TO_HOMEPAGE###

###HIGHSCORE_URL###

Show all questions and correct answers in the email. (You can use ###REF_QR_ANSWER_ALL### instead of ###REF_QR_ANSWER_CORR### and you can use ###VAR_QUESTION### and ###VAR_QUESTIONS###) ###REF_QUESTION_IMAGE_BEGIN###
###VAR_QUESTION_TITLE###: ###VAR_QUESTION_NAME###
###REF_QR_ANSWER_CORR### ###REF_QR_EXPLANATION### ###REF_QUESTION_IMAGE_END### ###REF_DELIMITER###

Email to admin (if email.send_admin > 0):
1. Reference to TEMPLATE_QUIZ_USER_SUBMITED or TEMPLATE_POLL_SUBMITED
2. Reference to TEMPLATE_QUIZ_ANALYSIS_x. x depends on "showAnalysis". REF_QUIZ_ANALYSIS will be empty if showAnalysis and showEvaluation = 0 !
3. Reference to TEMPLATE_EMAIL_ALLANSWERS if "showAllCorrectAnswers = 1".

###SUBJECT### ###EMAIL_TAKEN### ###QUIZ_NAME### ###REF_INTRODUCTION### ###REF_QUIZ_ANALYSIS### ###REF_EMAIL_ALLANSWERS###

Email to quiz taker (if email.send_user > 0):
1. Reference to TEMPLATE_QUIZ_USER_SUBMITED or TEMPLATE_POLL_SUBMITED
2. Reference to TEMPLATE_QUIZ_ANALYSIS_x. x depends on "showAnalysis". REF_QUIZ_ANALYSIS will be empty if showAnalysis and showEvaluation = 0 !
3. Reference to TEMPLATE_EMAIL_ALLANSWERS if "showAllCorrectAnswers = 1".

###SUBJECT### ###REF_INTRODUCTION### ###REF_QUIZ_ANALYSIS### ###REF_EMAIL_ALLANSWERS###