(?=.*?)'; protected $pattern_end = ''; protected $quizattributes = array(); public function getType(){ return 'container'; } public function getAllowedTypes() {return array();} //array('formatting', 'substition', 'disabled') public function getPType(){return 'block';} public function getSort(){ return 158; } public function connectTo($mode) { $this->Lexer->addEntryPattern($this->pattern_start, $mode, 'plugin_quizlib'); } public function postConnect() { $this->Lexer->addExitPattern($this->pattern_end, 'plugin_quizlib'); //$this->Lexer->addPattern($this->header_pattern, 'plugin_quizlib'); } /** * Handle the match */ public function handle($match, $state, $pos, Doku_Handler $handler){ switch ($state) { case DOKU_LEXER_ENTER : $attributes = array(); $xml = simplexml_load_string(str_replace('>', '/>', $match)); foreach ($xml->attributes() as $key => $value) { $attributes[$key] = (string) $value; } $this->quizattributes = $attributes; // saved for DOKU_LEXER_EXIT return array($state, $attributes); case DOKU_LEXER_UNMATCHED : return array($state, $match); case DOKU_LEXER_EXIT : return array($state, $this->quizattributes); } return array(); } /** * Create output */ public function render($mode, Doku_Renderer $renderer, $data) { // $data is what the function handle() return'ed. if($mode == 'xhtml'){ /** @var Doku_Renderer_xhtml $renderer */ list($state,$match) = $data; switch ($state) { case DOKU_LEXER_ENTER : if(!isset($match['id'])) return false; $renderer->doc .= sprintf('