/** * get the HTML code for showing the card in a training */ function getCardForTrainingHTML() { require_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->tpl->addCss(ilObjStyleSheet::getContentStylePath(0)); // get the card pages to be displayed if ($this->card->getTermId()) { $pages = $this->getGlossaryTermPages(); } else { // TODO: corrently only glossary cards are supported $pages = array(); } require_once "./Services/Accordion/classes/class.ilAccordionGUI.php"; $question = new ilAccordionGUI(); $question->setBehaviour(ilAccordionGUI::FORCE_ALL_OPEN); $question->setContentClass("xflcFlashcardPage"); $question->addItem($pages[0]["title"], $pages[0]["html"]); $answers = new ilAccordionGUI(); //$answers->setBehaviour(ilAccordionGUI::FIRST_OPEN); $answers->setContentClass("xflcFlashcardPage"); for ($i = 1; $i < count($pages); $i++) { $answers->addItem($pages[$i]["title"], $pages[$i]["html"]); } return $question->getHTML() . $answers->getHTML(); }