} echo $OUTPUT->box_start('evaluation_item_box_' . $align . $dependstyle); $value = ''; //get the value $frmvaluename = $evaluationitem->typ . '_' . $evaluationitem->id; if (isset($savereturn)) { $value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : null; $value = evaluation_clean_input_value($evaluationitem, $value); } else { if (isset($evaluationcompletedtmp->id)) { if($trainer_exist|| is_siteadmin()) $true = false; else $true = true; $value = evaluation_get_item_value($evaluationcompletedtmp->id, $evaluationitem->id, $true); } } if ($evaluationitem->hasvalue == 1 AND $evaluation->autonumbering) { $itemnr++; echo $OUTPUT->box_start('evaluation_item_number_' . $align); echo $itemnr; echo $OUTPUT->box_end(); } if ($evaluationitem->typ != 'pagebreak') { echo $OUTPUT->box_start('box generalbox boxalign_' . $align); evaluation_print_item_complete($evaluationitem, $value, $highlightrequired); echo $OUTPUT->box_end(); } echo $OUTPUT->box_end();
/** * 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 evaluation_compare_item_value($completedid, $itemid, $dependvalue, $tmp = false) { global $DB, $CFG; $dbvalue = evaluation_get_item_value($completedid, $itemid, $tmp); //get the class of the given item-typ $item = $DB->get_record('evaluation_item', array('id' => $itemid)); //get the instance of the item-class $itemobj = evaluation_get_item_class($item->typ); return $itemobj->compare_value($item, $dbvalue, $dependvalue); //true or false }