本文整理汇总了PHP中feedback_get_depend_candidates_for_item函数的典型用法代码示例。如果您正苦于以下问题:PHP feedback_get_depend_candidates_for_item函数的具体用法?PHP feedback_get_depend_candidates_for_item怎么用?PHP feedback_get_depend_candidates_for_item使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了feedback_get_depend_candidates_for_item函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_editform
function build_editform($item, $feedback, $cm)
{
global $DB, $CFG;
require_once 'label_form.php';
//get the lastposition number of the feedback_items
$position = $item->position;
$lastposition = $DB->count_records('feedback_item', array('feedback' => $feedback->id));
if ($position == -1) {
$i_formselect_last = $lastposition + 1;
$i_formselect_value = $lastposition + 1;
$item->position = $lastposition + 1;
} else {
$i_formselect_last = $lastposition;
$i_formselect_value = $item->position;
}
//the elements for position dropdownlist
$positionlist = array_slice(range(0, $i_formselect_last), 1, $i_formselect_last, true);
//all items for dependitem
$feedbackitems = feedback_get_depend_candidates_for_item($feedback, $item);
$commonparams = array('cmid' => $cm->id, 'id' => isset($item->id) ? $item->id : NULL, 'typ' => $item->typ, 'items' => $feedbackitems, 'feedback' => $feedback->id);
$this->context = get_context_instance(CONTEXT_MODULE, $cm->id);
//preparing the editor for new file-api
$item->presentationformat = FORMAT_HTML;
$item->presentationtrust = 1;
$item = file_prepare_standard_editor($item, 'presentation', $this->presentationoptions, $this->context, 'mod_feedback', 'item', $item->id);
//build the form
$this->item_form = new feedback_label_form('edit_item.php', array('item' => $item, 'common' => $commonparams, 'positionlist' => $positionlist, 'position' => $position, 'presentationoptions' => $this->presentationoptions));
}
示例2: build_editform
function build_editform($item, $feedback, $cm)
{
global $DB, $CFG;
require_once 'numeric_form.php';
//get the lastposition number of the feedback_items
$position = $item->position;
$lastposition = $DB->count_records('feedback_item', array('feedback' => $feedback->id));
if ($position == -1) {
$i_formselect_last = $lastposition + 1;
$i_formselect_value = $lastposition + 1;
$item->position = $lastposition + 1;
} else {
$i_formselect_last = $lastposition;
$i_formselect_value = $item->position;
}
//the elements for position dropdownlist
$positionlist = array_slice(range(0, $i_formselect_last), 1, $i_formselect_last, true);
$item->presentation = empty($item->presentation) ? '' : $item->presentation;
$range_from_to = explode('|', $item->presentation);
$range_from = (isset($range_from_to[0]) and is_numeric($range_from_to[0])) ? str_replace(FEEDBACK_DECIMAL, $this->sep_dec, floatval($range_from_to[0])) : '-';
$range_to = (isset($range_from_to[1]) and is_numeric($range_from_to[1])) ? str_replace(FEEDBACK_DECIMAL, $this->sep_dec, floatval($range_from_to[1])) : '-';
$item->rangefrom = $range_from;
$item->rangeto = $range_to;
//all items for dependitem
$feedbackitems = feedback_get_depend_candidates_for_item($feedback, $item);
$commonparams = array('cmid' => $cm->id, 'id' => isset($item->id) ? $item->id : NULL, 'typ' => $item->typ, 'items' => $feedbackitems, 'feedback' => $feedback->id);
//build the form
$this->item_form = new feedback_numeric_form('edit_item.php', array('item' => $item, 'common' => $commonparams, 'positionlist' => $positionlist, 'position' => $position));
}
示例3: build_editform
public function build_editform($item, $feedback, $cm)
{
global $DB, $CFG;
require_once 'info_form.php';
//get the lastposition number of the feedback_items
$position = $item->position;
$lastposition = $DB->count_records('feedback_item', array('feedback' => $feedback->id));
if ($position == -1) {
$i_formselect_last = $lastposition + 1;
$i_formselect_value = $lastposition + 1;
$item->position = $lastposition + 1;
} else {
$i_formselect_last = $lastposition;
$i_formselect_value = $item->position;
}
//the elements for position dropdownlist
$positionlist = array_slice(range(0, $i_formselect_last), 1, $i_formselect_last, true);
$item->presentation = empty($item->presentation) ? self::MODE_COURSE : $item->presentation;
$item->required = 0;
//all items for dependitem
$feedbackitems = feedback_get_depend_candidates_for_item($feedback, $item);
$commonparams = array('cmid' => $cm->id, 'id' => isset($item->id) ? $item->id : null, 'typ' => $item->typ, 'items' => $feedbackitems, 'feedback' => $feedback->id);
// Options for the 'presentation' select element.
$presentationoptions = array();
if ($feedback->anonymous == FEEDBACK_ANONYMOUS_NO || $item->presentation == self::MODE_RESPONSETIME) {
// "Response time" is hidden anyway in case of anonymous feedback, no reason to offer this option.
// However if it was already selected leave it in the dropdown.
$presentationoptions[self::MODE_RESPONSETIME] = get_string('responsetime', 'feedback');
}
$presentationoptions[self::MODE_COURSE] = get_string('course');
$presentationoptions[self::MODE_CATEGORY] = get_string('coursecategory');
//build the form
$this->item_form = new feedback_info_form('edit_item.php', array('item' => $item, 'common' => $commonparams, 'positionlist' => $positionlist, 'position' => $position, 'presentationoptions' => $presentationoptions));
}
示例4: build_editform
public function build_editform($item, $feedback, $cm) {
global $DB, $CFG;
require_once('label_form.php');
//get the lastposition number of the feedback_items
$position = $item->position;
$lastposition = $DB->count_records('feedback_item', array('feedback'=>$feedback->id));
if ($position == -1) {
$i_formselect_last = $lastposition + 1;
$i_formselect_value = $lastposition + 1;
$item->position = $lastposition + 1;
} else {
$i_formselect_last = $lastposition;
$i_formselect_value = $item->position;
}
//the elements for position dropdownlist
$positionlist = array_slice(range(0, $i_formselect_last), 1, $i_formselect_last, true);
//all items for dependitem
$feedbackitems = feedback_get_depend_candidates_for_item($feedback, $item);
$commonparams = array('cmid'=>$cm->id,
'id'=>isset($item->id) ? $item->id : null,
'typ'=>$item->typ,
'items'=>$feedbackitems,
'feedback'=>$feedback->id);
$this->context = context_module::instance($cm->id);
//preparing the editor for new file-api
$item->presentationformat = FORMAT_HTML;
$item->presentationtrust = 1;
// Append editor context to presentation options, giving preference to existing context.
$this->presentationoptions = array_merge(array('context' => $this->context),
$this->presentationoptions);
$item = file_prepare_standard_editor($item,
'presentation', //name of the form element
$this->presentationoptions,
$this->context,
'mod_feedback',
'item', //the filearea
$item->id);
//build the form
$customdata = array('item' => $item,
'common' => $commonparams,
'positionlist' => $positionlist,
'position' => $position,
'presentationoptions' => $this->presentationoptions);
$this->item_form = new feedback_label_form('edit_item.php', $customdata);
}