本文整理汇总了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));
}
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:28,代码来源:lib.php
示例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));
}
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:29,代码来源:lib.php
示例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));
}
开发者ID:IFPBMoodle,项目名称:moodle,代码行数:34,代码来源:lib.php
示例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);
}
开发者ID:JP-Git,项目名称:moodle,代码行数:53,代码来源:lib.php
注:本文中的feedback_get_depend_candidates_for_item函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论