本文整理汇总了PHP中Navigation::get_quiz_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::get_quiz_id方法的具体用法?PHP Navigation::get_quiz_id怎么用?PHP Navigation::get_quiz_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::get_quiz_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: grade_extend_settings
/**
* This method adds settings to the settings block for the grade system and its
* plugins
*
* @global moodle_page $PAGE
*/
function grade_extend_settings($plugininfo, $courseid)
{
global $PAGE;
$nav = new Navigation();
$roleid = $nav->get_user_role();
$gradenode = $PAGE->settingsnav->prepend(get_string('gradeadministration', 'grades'), null, navigation_node::TYPE_CONTAINER);
$strings = array_shift($plugininfo);
if ($reports = grade_helper::get_plugins_reports($courseid)) {
foreach ($reports as $report) {
if ($roleid == 4) {
//echo "Report link: ". $report->link."<br>";
if ($report->id != 'history' && $report->id != 'outcomes' && $report->id != 'user') {
$gradenode->add($report->string, $report->link, navigation_node::TYPE_SETTING, null, $report->id, new pix_icon('i/report', ''));
}
// end if
} else {
$gradenode->add($report->string, $report->link, navigation_node::TYPE_SETTING, null, $report->id, new pix_icon('i/report', ''));
}
// end else
}
// end foreach
}
if ($settings = grade_helper::get_info_manage_settings($courseid)) {
$settingsnode = $gradenode->add($strings['settings'], null, navigation_node::TYPE_CONTAINER);
foreach ($settings as $setting) {
$settingsnode->add($setting->string, $setting->link, navigation_node::TYPE_SETTING, null, $setting->id, new pix_icon('i/settings', ''));
}
}
if ($imports = grade_helper::get_plugins_import($courseid)) {
$importnode = $gradenode->add($strings['import'], null, navigation_node::TYPE_CONTAINER);
foreach ($imports as $import) {
$importnode->add($import->string, $import->link, navigation_node::TYPE_SETTING, null, $import->id, new pix_icon('i/import', ''));
}
}
if ($exports = grade_helper::get_plugins_export($courseid)) {
$exportnode = $gradenode->add($strings['export'], null, navigation_node::TYPE_CONTAINER);
foreach ($exports as $export) {
if ($roleid == 4) {
if ($export->id != 'ods' && $export->id != 'xml') {
$exportnode->add($export->string, $export->link, navigation_node::TYPE_SETTING, null, $export->id, new pix_icon('i/export', ''));
}
// end if
} else {
$exportnode->add($export->string, $export->link, navigation_node::TYPE_SETTING, null, $export->id, new pix_icon('i/export', ''));
}
// end else
}
// end foreach
}
if ($letters = grade_helper::get_info_letters($courseid)) {
$letters = array_shift($letters);
$gradenode->add($strings['letter'], $letters->link, navigation_node::TYPE_SETTING, null, $letters->id, new pix_icon('i/settings', ''));
}
if ($outcomes = grade_helper::get_info_outcomes($courseid)) {
$outcomes = array_shift($outcomes);
$gradenode->add($strings['outcome'], $outcomes->link, navigation_node::TYPE_SETTING, null, $outcomes->id, new pix_icon('i/outcomes', ''));
}
if ($scales = grade_helper::get_info_scales($courseid)) {
$gradenode->add($strings['scale'], $scales->link, navigation_node::TYPE_SETTING, null, $scales->id, new pix_icon('i/scales', ''));
}
if ($gradenode->contains_active_node()) {
// If the gradenode is active include the settings base node (gradeadministration) in
// the navbar, typcially this is ignored.
$PAGE->navbar->includesettingsbase = true;
// If we can get the course admin node make sure it is closed by default
// as in this case the gradenode will be opened
if ($coursenode = $PAGE->settingsnav->get('courseadmin', navigation_node::TYPE_COURSE)) {
$coursenode->make_inactive();
$coursenode->forceopen = false;
}
// end if
}
$setionsnode = $PAGE->settingsnav->prepend('Navigation', null, navigation_node::TYPE_CONTAINER);
$pageid = $nav->get_page_id();
if ($pageid > 0) {
$link = "http://" . $_SERVER['SERVER_NAME'] . "/lms/mod/page/view.php?id={$pageid}";
$setionsnode->add('Assignment', $link, navigation_node::TYPE_SETTING, null, 2, new pix_icon('i/report', ''));
}
$forumid = $nav->get_forum_id();
if ($forumid > 0) {
$link = "http://" . $_SERVER['SERVER_NAME'] . "/lms/mod/forum/view.php?id={$forumid}";
$setionsnode->add('Discussion board', $link, navigation_node::TYPE_SETTING, null, 2, new pix_icon('i/report', ''));
}
$quizid = $nav->get_quiz_id();
if ($quizid > 0) {
$link = "http://" . $_SERVER['SERVER_NAME'] . "/lms/mod/quiz/view.php?id={$quizid}";
$setionsnode->add('Quiz', $link, navigation_node::TYPE_SETTING, null, 2, new pix_icon('i/report', ''));
}
}
示例2: array
page_view($page, $course, $cm, $context);
$PAGE->set_url('/mod/page/view.php', array('id' => $cm->id));
$options = empty($page->displayoptions) ? array() : unserialize($page->displayoptions);
if ($inpopup and $page->display == RESOURCELIB_DISPLAY_POPUP) {
$PAGE->set_pagelayout('popup');
$PAGE->set_title($course->shortname . ': ' . $page->name);
$PAGE->set_heading($course->fullname);
} else {
$PAGE->set_title($course->shortname . ': ' . $page->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($page);
}
echo $OUTPUT->header();
if ($roleid == 5) {
echo "<br><div class='row-fluid' style='text-align:center;'>";
$quizid = $nav->get_quiz_id();
if ($quizid > 0) {
$quizurl = "http://globalizationplus.com/lms/mod/quiz/view.php?id={$quizid}";
echo "<div class='span4' style='padding-left:12px;font-weight:bold;font-size:20px;color:black;'><img src='http://" . $_SERVER['SERVER_NAME'] . "/assets/images/checkmark.png' width='20' height='20' valign='middle'> <a href='{$quizurl}' target='_blank'>News Quiz</a></div>";
}
// end if $quizid>0
$forumid = $nav->get_forum_id();
if ($forumid > 0) {
$forumurl = "http://globalizationplus.com/lms/mod/forum/view.php?id={$forumid}";
echo "<div class='span4' style='padding-left:12px;font-weight:bold;font-size:20px;color:black;'><img src='http://" . $_SERVER['SERVER_NAME'] . "/assets/images/checkmark.png' width='20' height='20' valign='middle'> </span><a href='{$forumurl}' target='_blank'>Discussion Board</a></div>";
}
// end if $forumid>0
$glossaryid = $nav->get_glossary_id();
if ($glossaryid > 0) {
$glossaryurl = "http://globalizationplus.com/lms/mod/glossary/view.php?id={$glossaryid}";
echo "<div class='span4' style='padding-left:12px;font-weight:bold;font-size:20px;color:black;'><img src='http://" . $_SERVER['SERVER_NAME'] . "/assets/images/search.png' width='20' height='20' valign='middle'> <a href='{$glossaryurl}' target='_blank'>Political Dictionary</a></div>";