本文整理汇总了PHP中feedback_load_feedback_items函数的典型用法代码示例。如果您正苦于以下问题:PHP feedback_load_feedback_items函数的具体用法?PHP feedback_load_feedback_items怎么用?PHP feedback_load_feedback_items使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了feedback_load_feedback_items函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: feedback_load_feedback_items_options
/**
* load the available item plugins to use as dropdown-options
*
* @global object
* @return array pluginnames as string
*/
function feedback_load_feedback_items_options() {
global $CFG;
$feedback_options = array("pagebreak" => get_string('add_pagebreak', 'feedback'));
if (!$feedback_names = feedback_load_feedback_items('mod/feedback/item')) {
return array();
}
foreach ($feedback_names as $fn) {
$feedback_options[$fn] = get_string($fn, 'feedback');
}
asort($feedback_options);
$feedback_options = array_merge( array(' ' => get_string('select')), $feedback_options );
return $feedback_options;
}
开发者ID:numbas,项目名称:moodle,代码行数:22,代码来源:lib.php
示例2: feedback_import_loaded_data
function feedback_import_loaded_data(&$data, $feedbackid) {
global $CFG, $DB;
feedback_load_feedback_items();
$deleteolditems = optional_param('deleteolditems', 0, PARAM_INT);
$error = new stdClass();
$error->stat = true;
$error->msg = array();
if (!is_array($data)) {
$error->msg[] = get_string('data_is_not_an_array', 'feedback');
$error->stat = false;
return $error;
}
if ($deleteolditems) {
feedback_delete_all_items($feedbackid);
$position = 0;
} else {
//items will be add to the end of the existing items
$position = $DB->count_records('feedback_item', array('feedback'=>$feedbackid));
}
//depend items we are storing temporary in an mapping list array(new id => dependitem)
//we also store a mapping of all items array(oldid => newid)
$dependitemsmap = array();
$itembackup = array();
foreach ($data as $item) {
$position++;
//check the typ
$typ = $item['@']['TYPE'];
//check oldtypes first
switch($typ) {
case 'radio':
$typ = 'multichoice';
$oldtyp = 'radio';
break;
case 'dropdown':
$typ = 'multichoice';
$oldtyp = 'dropdown';
break;
case 'check':
$typ = 'multichoice';
$oldtyp = 'check';
break;
case 'radiorated':
$typ = 'multichoicerated';
$oldtyp = 'radiorated';
break;
case 'dropdownrated':
$typ = 'multichoicerated';
$oldtyp = 'dropdownrated';
break;
default:
$oldtyp = $typ;
}
$itemclass = 'feedback_item_'.$typ;
if ($typ != 'pagebreak' AND !class_exists($itemclass)) {
$error->stat = false;
$error->msg[] = 'type ('.$typ.') not found';
continue;
}
$itemobj = new $itemclass();
$newitem = new stdClass();
$newitem->feedback = $feedbackid;
$newitem->template = 0;
$newitem->typ = $typ;
$newitem->name = trim($item['#']['ITEMTEXT'][0]['#']);
$newitem->label = trim($item['#']['ITEMLABEL'][0]['#']);
$newitem->options = trim($item['#']['OPTIONS'][0]['#']);
$newitem->presentation = trim($item['#']['PRESENTATION'][0]['#']);
//check old types of radio, check, and so on
switch($oldtyp) {
case 'radio':
$newitem->presentation = 'r>>>>>'.$newitem->presentation;
break;
case 'dropdown':
$newitem->presentation = 'd>>>>>'.$newitem->presentation;
break;
case 'check':
$newitem->presentation = 'c>>>>>'.$newitem->presentation;
break;
case 'radiorated':
$newitem->presentation = 'r>>>>>'.$newitem->presentation;
break;
case 'dropdownrated':
$newitem->presentation = 'd>>>>>'.$newitem->presentation;
break;
}
if (isset($item['#']['DEPENDITEM'][0]['#'])) {
$newitem->dependitem = intval($item['#']['DEPENDITEM'][0]['#']);
} else {
$newitem->dependitem = 0;
}
//.........这里部分代码省略.........
开发者ID:raymondAntonio,项目名称:moodle,代码行数:101,代码来源:import.php
示例3: feedback_load_feedback_items
<?php
/**
* prints an analysed excel-spreadsheet of the feedback
*
* @author Andreas Grabs
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package feedback
*/
require_once "../../config.php";
require_once "lib.php";
// require_once('easy_excel.php');
require_once "{$CFG->libdir}/excellib.class.php";
feedback_load_feedback_items();
$id = required_param('id', PARAM_INT);
//the POST dominated the GET
$coursefilter = optional_param('coursefilter', '0', PARAM_INT);
$url = new moodle_url('/mod/feedback/analysis_to_excel.php', array('id' => $id));
if ($coursefilter !== '0') {
$url->param('coursefilter', $coursefilter);
}
$PAGE->set_url($url);
$formdata = data_submitted();
if (!($cm = get_coursemodule_from_id('feedback', $id))) {
print_error('invalidcoursemodule');
}
if (!($course = $DB->get_record("course", array("id" => $cm->course)))) {
print_error('coursemisconf');
}
if (!($feedback = $DB->get_record("feedback", array("id" => $cm->instance)))) {
print_error('invalidcoursemodule');
开发者ID:hatone,项目名称:moodle,代码行数:31,代码来源:analysis_to_excel.php
注:本文中的feedback_load_feedback_items函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论