1<?php 2/** 3 * Mikio Syntax Plugin: Quiz 4 * 5 * @link http://github.com/nomadjimbob/mikioplugin 6 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 7 * @author James Collins <james.collins@outlook.com.au> 8 */ 9if (!defined('DOKU_INC')) die(); 10if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 11require_once(dirname(__FILE__).'/core.php'); 12 13class syntax_plugin_mikioplugin_quiz extends syntax_plugin_mikioplugin_core { 14 public $tag = 'quiz'; 15 public $hasEndTag = true; 16 public $options = array( 17 ); 18 19 20 public function render_lexer_enter(Doku_Renderer $renderer, $data) { 21 $classes = $this->buildClass($data); 22 23 $renderer->doc .= '<div class="' . $this->elemClass . ' ' . $this->classPrefix . 'quiz ' . $classes . '" data-status="Question $1 of $2" data-result="You got $1 out of $2 correct">'; 24 } 25 26 27 public function render_lexer_exit(Doku_Renderer $renderer, $data) { 28 $renderer->doc .= '<div class="' . $this->elemClass . ' ' . $this->classPrefix . 'quiz-result"></div>'; 29 $renderer->doc .= '<div class="' . $this->elemClass . ' ' . $this->classPrefix . 'quiz-status">'; 30 $renderer->doc .= '<span class="' . $this->elemClass . ' ' . $this->classPrefix . 'quiz-status-text"></span>'; 31 $renderer->doc .= '<button class="' . $this->elemClass . ' ' . $this->classPrefix . 'button ' . $this->classPrefix . 'quiz-button-prev">« Prev</button>'; 32 $renderer->doc .= '<button class="' . $this->elemClass . ' ' . $this->classPrefix . 'button ' . $this->classPrefix . 'quiz-button-submit">Submit</button>'; 33 $renderer->doc .= '<button class="' . $this->elemClass . ' ' . $this->classPrefix . 'button ' . $this->classPrefix . 'quiz-button-next">Next »</button>'; 34 $renderer->doc .= '</div>'; 35 $renderer->doc .= '</div>'; 36 } 37} 38?>