当前位置: 首页>>代码示例>>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;未经允许,请勿转载。