*/ if (!defined('DOKU_INC')) die(); if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(dirname(__FILE__).'/core.php'); class syntax_plugin_mikioplugin_quizitem extends syntax_plugin_mikioplugin_core { public $tag = 'quiz-item'; public $hasEndTag = false; public $options = array( 'type' => array('type' => 'choice', 'data' => array('choice'), 'default' => ''), 'question' => array('type' => 'text', 'default' => ''), 'options' => array('type' => 'text', 'default' => ''), 'submit-text' => array('type' => 'text', 'default' => 'Submit'), 'answer' => array('type' => 'text', 'default' => ''), 'text' => array('type' => 'text', 'default' => ''), ); // public function getAllowedTypes() { return array(); } public function render_lexer_special(Doku_Renderer $renderer, $data) { $classes = $this->buildClass($data); $renderer->doc .= '
'; $renderer->doc .= '
' . $data['question'] . '
'; if($data['text'] != '') $renderer->doc .= '

' . $data['text'] . '

'; $renderer->doc .= '
'; switch(strtolower($data['type'])) { case 'choice': $name = rand(10000, 99999); $options = explode('|', $data['options']); foreach($options as $option) { $renderer->doc .= '
'; } break; } $renderer->doc .= '
'; $renderer->doc .= '
'; } } ?>