本文整理汇总了PHP中feedback_get_item_value函数的典型用法代码示例。如果您正苦于以下问题:PHP feedback_get_item_value函数的具体用法?PHP feedback_get_item_value怎么用?PHP feedback_get_item_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了feedback_get_item_value函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feedback_compare_item_value
/**
* compares the value of the itemid related to the completedid with the dependvalue.
* this is used if a depend item is set.
* the value can come as temporary or as permanently value. the deciding is done by $tmp.
*
* @global object
* @global object
* @param int $completeid
* @param int $itemid
* @param mixed $dependvalue
* @param boolean $tmp
* @return bool
*/
function feedback_compare_item_value($completedid, $itemid, $dependvalue, $tmp = false) {
global $DB, $CFG;
$dbvalue = feedback_get_item_value($completedid, $itemid, $tmp);
//get the class of the given item-typ
$item = $DB->get_record('feedback_item', array('id'=>$itemid));
//get the instance of the item-class
$itemobj = feedback_get_item_class($item->typ);
return $itemobj->compare_value($item, $dbvalue, $dependvalue); //true or false
}
示例2: foreach
foreach ($feedbackitems as $feedbackitem) {
if (!isset($startitem)) {
//avoid showing double pagebreaks
if ($feedbackitem->typ == 'pagebreak') {
continue;
}
$startitem = $feedbackitem;
}
$value = '';
//get the value
$frmvaluename = $feedbackitem->typ . '_' . $feedbackitem->id;
if (isset($savereturn)) {
$value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : NULL;
} else {
if (isset($feedbackcompletedtmp->id)) {
$value = feedback_get_item_value($feedbackcompletedtmp->id, $feedbackitem->id, true);
}
}
echo '<tr>';
if ($feedbackitem->hasvalue == 1 and $feedback->autonumbering) {
$itemnr++;
echo '<td valign="top">' . $itemnr . '. </td>';
} else {
echo '<td> </td>';
}
if ($feedbackitem->typ != 'pagebreak') {
feedback_print_item($feedbackitem, $value, false, false, $highlightrequired);
}
echo '</tr>';
echo '<tr><td> </td></tr>';
$lastbreakposition = $feedbackitem->position;
示例3: foreach
foreach ($feedbackitems as $feedbackitem) {
if (!isset($startitem)) {
//avoid showing double pagebreaks
if ($feedbackitem->typ == 'pagebreak') {
continue;
}
$startitem = $feedbackitem;
}
$value = '';
//get the value
$frmvaluename = $feedbackitem->typ . '_' . $feedbackitem->id;
if (isset($savereturn)) {
$value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : NULL;
} else {
if (isset($feedbackcompletedtmp->id)) {
$value = feedback_get_item_value($feedbackcompletedtmp->id, $feedbackitem->id, $USER->sesskey);
}
}
echo '<tr>';
if ($feedbackitem->hasvalue == 1 and $feedback->autonumbering) {
$itemnr++;
echo '<td valign="top">' . $itemnr . '. </td>';
} else {
echo '<td> </td>';
}
if ($feedbackitem->typ != 'pagebreak') {
feedback_print_item($feedbackitem, $value, false, false, $highlightrequired);
}
echo '</tr>';
echo '<tr><td> </td></tr>';
$lastbreakposition = $feedbackitem->position;
示例4: isset
}
}
if ($feedbackitem->dependitem > 0) {
$dependstyle = ' feedback_complete_depend';
} else {
$dependstyle = '';
}
echo $OUTPUT->box_start('feedback_item_box_' . $align . $dependstyle);
$value = '';
//get the value
$frmvaluename = $feedbackitem->typ . '_' . $feedbackitem->id;
if (isset($savereturn)) {
$value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : NULL;
} else {
if (isset($feedbackcompletedtmp->id)) {
$value = feedback_get_item_value($feedbackcompletedtmp->id, $feedbackitem->id, sesskey());
}
}
if ($feedbackitem->hasvalue == 1 and $feedback->autonumbering) {
$itemnr++;
echo $OUTPUT->box_start('feedback_item_number_' . $align);
echo $itemnr;
echo $OUTPUT->box_end();
}
if ($feedbackitem->typ != 'pagebreak') {
echo $OUTPUT->box_start('box generalbox boxalign_' . $align);
feedback_print_item_complete($feedbackitem, $value, $highlightrequired);
echo $OUTPUT->box_end();
}
echo $OUTPUT->box_end();
$lastbreakposition = $feedbackitem->position;
示例5: feedback_compare_item_value
/**
* compares the value of the itemid related to the completedid with the dependvalue.
* this is used if a depend item is set.
* the value can come as temporary or as permanently value. the deciding is done by $tmp.
*
* @param int $completedid
* @param stdClass|int $item
* @param mixed $dependvalue
* @param bool $tmp
* @return bool
*/
function feedback_compare_item_value($completedid, $item, $dependvalue, $tmp = false)
{
global $DB;
if (is_int($item)) {
$item = $DB->get_record('feedback_item', array('id' => $item));
}
$dbvalue = feedback_get_item_value($completedid, $item->id, $tmp);
$itemobj = feedback_get_item_class($item->typ);
return $itemobj->compare_value($item, $dbvalue, $dependvalue);
//true or false
}