本文整理汇总了PHP中grade_outcome::use_in方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_outcome::use_in方法的具体用法?PHP grade_outcome::use_in怎么用?PHP grade_outcome::use_in使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grade_outcome
的用法示例。
在下文中一共展示了grade_outcome::use_in方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restore_create_gradebook
//.........这里部分代码省略.........
}
}
$dbrec->itemname = backup_todb($info['GRADE_ITEM']['#']['ITEMNAME']['0']['#'], false);
$dbrec->itemtype = backup_todb($info['GRADE_ITEM']['#']['ITEMTYPE']['0']['#'], false);
$dbrec->itemmodule = backup_todb($info['GRADE_ITEM']['#']['ITEMMODULE']['0']['#'], false);
$dbrec->itemnumber = backup_todb($info['GRADE_ITEM']['#']['ITEMNUMBER']['0']['#'], false);
$dbrec->iteminfo = backup_todb($info['GRADE_ITEM']['#']['ITEMINFO']['0']['#'], false);
$dbrec->gradetype = backup_todb($info['GRADE_ITEM']['#']['GRADETYPE']['0']['#'], false);
$dbrec->calculation = backup_todb($info['GRADE_ITEM']['#']['CALCULATION']['0']['#'], false);
$dbrec->grademax = backup_todb($info['GRADE_ITEM']['#']['GRADEMAX']['0']['#'], false);
$dbrec->grademin = backup_todb($info['GRADE_ITEM']['#']['GRADEMIN']['0']['#'], false);
$dbrec->gradepass = backup_todb($info['GRADE_ITEM']['#']['GRADEPASS']['0']['#'], false);
$dbrec->multfactor = backup_todb($info['GRADE_ITEM']['#']['MULTFACTOR']['0']['#'], false);
$dbrec->plusfactor = backup_todb($info['GRADE_ITEM']['#']['PLUSFACTOR']['0']['#'], false);
$dbrec->aggregationcoef = backup_todb($info['GRADE_ITEM']['#']['AGGREGATIONCOEF']['0']['#'], false);
$dbrec->display = backup_todb($info['GRADE_ITEM']['#']['DISPLAY']['0']['#'], false);
$dbrec->decimals = backup_todb($info['GRADE_ITEM']['#']['DECIMALS']['0']['#'], false);
$dbrec->hidden = backup_todb($info['GRADE_ITEM']['#']['HIDDEN']['0']['#'], false);
$dbrec->locked = backup_todb($info['GRADE_ITEM']['#']['LOCKED']['0']['#'], false);
$dbrec->locktime = backup_todb($info['GRADE_ITEM']['#']['LOCKTIME']['0']['#'], false);
$dbrec->timecreated = backup_todb($info['GRADE_ITEM']['#']['TIMECREATED']['0']['#'], false);
if (backup_todb($info['GRADE_ITEM']['#']['SCALEID']['0']['#'], false)) {
$scale = backup_getid($restore->backup_unique_code, "scale", backup_todb($info['GRADE_ITEM']['#']['SCALEID']['0']['#'], false));
$dbrec->scaleid = $scale->new_id;
}
if (backup_todb($info['GRADE_ITEM']['#']['OUTCOMEID']['0']['#'])) {
$oldoutcome = backup_todb($info['GRADE_ITEM']['#']['OUTCOMEID']['0']['#']);
if (empty($outcomes[$oldoutcome])) {
continue;
// error!
}
if (empty($outcomes[$oldoutcome]->id)) {
$outcomes[$oldoutcome]->insert('restore');
$outcomes[$oldoutcome]->use_in($restore->course_id);
backup_putid($restore->backup_unique_code, "grade_outcomes", $oldoutcome, $outcomes[$oldoutcome]->id);
}
$dbrec->outcomeid = $outcomes[$oldoutcome]->id;
}
$grade_item = new grade_item($dbrec, false);
$grade_item->insert('restore');
if ($restoreall) {
// set original parent if restored
$oldcat = $info['GRADE_ITEM']['#']['CATEGORYID']['0']['#'];
if (!empty($cached_categories[$oldcat])) {
$grade_item->set_parent($cached_categories[$oldcat]->id);
}
}
$status = backup_putid($restore->backup_unique_code, "grade_items", $rec->old_id, $grade_item->id) && $status;
}
// no need to restore grades if user data is not selected or importing activities
if ($importing or $grade_item->itemtype == 'mod' and !restore_userdata_selected($restore, $grade_item->itemmodule, $olditeminstance)) {
// module instance not selected when restored using granular
// skip this item
continue;
}
/// now, restore grade_grades
if (!empty($info['GRADE_ITEM']['#']['GRADE_GRADES']['0']['#']['GRADE'])) {
//Iterate over items
foreach ($info['GRADE_ITEM']['#']['GRADE_GRADES']['0']['#']['GRADE'] as $g_info) {
$grade = new grade_grade();
$grade->itemid = $grade_item->id;
$olduser = backup_todb($g_info['#']['USERID']['0']['#'], false);
$user = backup_getid($restore->backup_unique_code, "user", $olduser);
$grade->userid = $user->new_id;
$grade->rawgrade = backup_todb($g_info['#']['RAWGRADE']['0']['#'], false);
$grade->rawgrademax = backup_todb($g_info['#']['RAWGRADEMAX']['0']['#'], false);