本文整理汇总了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}&action=student&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 {
示例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;
}
}
示例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;
}