コード例 #1
0
                    $i++;
                }
            } else {
                $i = 0;
                foreach ($quiz->getQuestions() as $question) {
                    $content = $question->getContentSlide();
                    $name = "Question N°" . ($i + 1);
                    $owl['items'][] = array('name' => $name, 'content' => $content);
                    $i++;
                }
                $resultContent = "<div class='sp-result'><div class='loading hide'></div><button type='button' id='sp-validate'>" . $tr->__("Validate") . "</button> </div>";
            }
            $owl['items'][] = array('name' => "Validation", 'content' => $resultContent);
            if ($spConfiguration['showRate'] === 'true') {
                $owl['items'][] = array('name' => "", 'content' => "");
            }
            $owl['title'] = $quiz->getName();
            $owl['authorName'] = $sp_userName;
            $owl['authorImg'] = StudyPressUserWP::getAvatar($quiz->getAuthorId(), 30);
            $owl['authorLink'] = StudyPressUserWP::getUserPostsLink($quiz->getAuthorId());
            $fp = fopen($json_file, 'w');
            fwrite($fp, json_encode($owl));
            fclose($fp);
            require_once __ROOT_PLUGIN__ . "Views/player/player-quiz.php";
        } else {
            $tr->_e("The value of the identifier of the shortcode is incorrect");
        }
    }
} else {
    $tr->_e("Please indicate the identifier of the shortcode");
}