當前位置: 首頁>>代碼示例>>PHP>>正文


PHP survey_count_responses函數代碼示例

本文整理匯總了PHP中survey_count_responses函數的典型用法代碼示例。如果您正苦於以下問題:PHP survey_count_responses函數的具體用法?PHP survey_count_responses怎麽用?PHP survey_count_responses使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了survey_count_responses函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: switch

    if (has_capability('mod/survey:download', $context)) {
        echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=download&amp;id={$id}\">{$strdownload}</a>";
    }
    if (empty($action)) {
        $action = "questions";
    }
}
echo $OUTPUT->box_end();
echo $OUTPUT->spacer(array('height' => 30, 'width' => 30, 'br' => true));
// should be done with CSS instead
/// Print the menu across the top
$virtualscales = false;
switch ($action) {
    case "summary":
        echo $OUTPUT->heading($strsummary);
        if (survey_count_responses($survey->id, $currentgroup, $groupingid)) {
            echo "<div class='reportsummary'><a href=\"report.php?action=scales&amp;id={$id}\">";
            survey_print_graph("id={$id}&amp;group={$currentgroup}&amp;type=overall.png");
            echo "</a></div>";
        } else {
            echo $OUTPUT->notification(get_string("nobodyyet", "survey"));
        }
        break;
    case "scales":
        echo $OUTPUT->heading($strscales);
        if (!($results = survey_get_responses($survey->id, $currentgroup, $groupingid))) {
            echo $OUTPUT->notification(get_string("nobodyyet", "survey"));
        } else {
            $questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions));
            $questionorder = explode(",", $survey->questions);
            foreach ($questionorder as $key => $val) {
開發者ID:saurabh947,項目名稱:MoodleLearning,代碼行數:31,代碼來源:report.php

示例2: survey_count_responses

if (has_capability('mod/survey:readresponses', $context) or $groupmode == VISIBLEGROUPS) {
    $currentgroup = 0;
}
if (has_capability('mod/survey:readresponses', $context)) {
    $numusers = survey_count_responses($survey->id, $currentgroup, $groupingid);
    echo "<div class=\"reportlink\"><a href=\"report.php?id={$cm->id}\">" . get_string("viewsurveyresponses", "survey", $numusers) . "</a></div>";
} else {
    if (!$cm->visible) {
        notice(get_string("activityiscurrentlyhidden"));
    }
}
if (!is_enrolled($context)) {
    echo $OUTPUT->notification(get_string("guestsnotallowed", "survey"));
}
if ($surveyalreadydone) {
    $numusers = survey_count_responses($survey->id, $currentgroup, $groupingid);
    if ($showscales) {
        // Ensure that graph.php will allow the user to see the graph.
        if (has_capability('mod/survey:readresponses', $context) || !$groupmode || groups_is_member($currentgroup)) {
            echo $OUTPUT->box(get_string("surveycompleted", "survey"));
            echo $OUTPUT->box(get_string("peoplecompleted", "survey", $numusers));
            echo '<div class="resultgraph">';
            survey_print_graph("id={$cm->id}&amp;sid={$USER->id}&amp;group={$currentgroup}&amp;type=student.png");
            echo '</div>';
        } else {
            echo $OUTPUT->box(get_string("surveycompletednograph", "survey"));
            echo $OUTPUT->box(get_string("peoplecompleted", "survey", $numusers));
        }
    } else {
        echo $OUTPUT->box(format_module_intro('survey', $survey, $cm->id), 'generalbox', 'intro');
        echo $OUTPUT->spacer(array('height' => 30, 'width' => 1), true);
開發者ID:evltuma,項目名稱:moodle,代碼行數:31,代碼來源:view.php

示例3: print_simple_box_end

    echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=students&amp;id={$id}\">{$course->students}</a>";
    if (has_capability('mod/survey:download', $context)) {
        echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=download&amp;id={$id}\">{$strdownload}</a>";
    }
    if (empty($action)) {
        $action = "questions";
    }
}
print_simple_box_end();
print_spacer(30, 30);
/// Print the menu across the top
$virtualscales = false;
switch ($action) {
    case "summary":
        print_heading($strsummary);
        if (survey_count_responses($survey->id, $currentgroup)) {
            echo "<div class='reportsummary'><a href=\"report.php?action=scales&amp;id={$id}\">";
            survey_print_graph("id={$id}&amp;group={$currentgroup}&amp;type=overall.png");
            echo "</a></div>";
        } else {
            notify(get_string("nobodyyet", "survey"));
        }
        break;
    case "scales":
        print_heading($strscales);
        if (!($results = survey_get_responses($survey->id, $currentgroup))) {
            notify(get_string("nobodyyet", "survey"));
        } else {
            $questions = get_records_list("survey_questions", "id", $survey->questions);
            $questionorder = explode(",", $survey->questions);
            foreach ($questionorder as $key => $val) {
開發者ID:veritech,項目名稱:pare-project,代碼行數:31,代碼來源:report.php


注:本文中的survey_count_responses函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。