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


PHP survey_get_responses函數代碼示例

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


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

示例1: array

             } else {
                 $answer1 = " ";
             }
             if ($a->answer2) {
                 $answer2 = "{$a->answer2} - " . $answers[$a->answer2 - 1];
             } else {
                 $answer2 = " ";
             }
             $table->data[] = array($OUTPUT->user_picture($a, array('courseid' => $course->id)), "<a href=\"report.php?id={$id}&amp;action=student&amp;student={$a->userid}\">" . fullname($a) . "</a>", userdate($a->time), $answer1, $answer2);
         }
     }
     echo html_writer::table($table);
     break;
 case "students":
     echo $OUTPUT->heading(get_string("analysisof", "survey", get_string('participants')));
     if (!($results = survey_get_responses($survey->id, $currentgroup, $groupingid))) {
         echo $OUTPUT->notification(get_string("nobodyyet", "survey"));
     } else {
         survey_print_all_responses($cm->id, $results, $course->id);
     }
     break;
 case "student":
     if (!($user = $DB->get_record("user", array("id" => $student)))) {
         print_error('invaliduserid');
     }
     echo $OUTPUT->heading(get_string("analysisof", "survey", fullname($user)));
     if ($notes != '' and confirm_sesskey()) {
         if (survey_get_analysis($survey->id, $user->id)) {
             if (!survey_update_analysis($survey->id, $user->id, $notes)) {
                 echo $OUTPUT->notification("An error occurred while saving your notes.  Sorry.");
             } else {
開發者ID:saurabh947,項目名稱:MoodleLearning,代碼行數:31,代碼來源:report.php

示例2: survey_count_responses

/**
 * @param int $surveyid
 * @param int $groupid
 * @param int $groupingid
 * @return int
 */
function survey_count_responses($surveyid, $groupid, $groupingid) {
    if ($responses = survey_get_responses($surveyid, $groupid, $groupingid)) {
        return count($responses);
    } else {
        return 0;
    }
}
開發者ID:nitinnagaraja,項目名稱:moodle,代碼行數:13,代碼來源:lib.php

示例3: get_survey_info

function get_survey_info(&$surveys, &$responses, &$accessibility)
{
    // initialize return values
    $surveys = array();
    $responses = array();
    $accessibility = array();
    // everybody gets the public surveys
    esp_require_once('/lib/espsurvey');
    survey_get_public($surveys);
    $sids = array_keys($surveys);
    // if we have a current (authenticated) respondent
    $ok = get_current_respondent($respondent);
    if ($ok && array_key_exists('realm', $respondent)) {
        // get the surveys available to that user
        survey_get_in_realm($respondent['realm'], $private);
        survey_merge_sets($surveys, $private);
        $sids = array_keys($surveys);
        // get the responses and accessibility for those surveys
        survey_get_responses($responses, $sids, $respondent['username']);
        survey_get_accessibility($accessibility, $sids, $respondent['username'], $respondent['realm']);
    } else {
        // get the accessibility of those surveys
        survey_get_accessibility($accessibility, $sids);
    }
    return true;
}
開發者ID:idolcemia,項目名稱:phpESP,代碼行數:26,代碼來源:dashboard.php


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