本文整理汇总了PHP中grade_grade::set_locktime方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_grade::set_locktime方法的具体用法?PHP grade_grade::set_locktime怎么用?PHP grade_grade::set_locktime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grade_grade
的用法示例。
在下文中一共展示了grade_grade::set_locktime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if ($hiddenuntil) {
$grade_grade->set_hidden($hiddenuntil);
} else {
$grade_grade->set_hidden($hidden);
// checkbox data might be undefined
}
}
}
if (isset($data->locked) and !$grade_item->is_locked()) {
if (($old_grade_grade->locked or $old_grade_grade->locktime) and (!has_capability('moodle/grade:manage', $context) and !has_capability('moodle/grade:unlock', $context))) {
//ignore data
} else {
if (!$old_grade_grade->locked and !$old_grade_grade->locktime and (!has_capability('moodle/grade:manage', $context) and !has_capability('moodle/grade:lock', $context))) {
//ignore data
} else {
$grade_grade->set_locktime($data->locktime);
//set_lock may reset locktime
$grade_grade->set_locked($data->locked, false, true);
// reload grade in case it was regraded from activity
$grade_grade = new grade_grade(array('userid' => $data->userid, 'itemid' => $grade_item->id), true);
$grade_grade->grade_item =& $grade_item;
// no db fetching
}
}
}
if (isset($data->excluded) and has_capability('moodle/grade:manage', $context)) {
$grade_grade->set_excluded($data->excluded);
}
// detect cases when we need to do full regrading
if ($old_grade_grade->excluded != $grade_grade->excluded) {
$parent = $grade_item->get_parent_category();
示例2: and
$grade_grade->set_hidden($hidden); // checkbox data might be undefined
}
}
}
if (isset($data->locked) and !$grade_item->is_locked()) {
if (($old_grade_grade->locked or $old_grade_grade->locktime)
and (!has_capability('moodle/grade:manage', $context) and !has_capability('moodle/grade:unlock', $context))) {
//ignore data
} else if ((!$old_grade_grade->locked and !$old_grade_grade->locktime)
and (!has_capability('moodle/grade:manage', $context) and !has_capability('moodle/grade:lock', $context))) {
//ignore data
} else {
$grade_grade->set_locktime($data->locktime); //set_lock may reset locktime
$grade_grade->set_locked($data->locked, false, true);
// reload grade in case it was regraded from activity
$grade_grade = new grade_grade(array('userid'=>$data->userid, 'itemid'=>$grade_item->id), true);
$grade_grade->grade_item =& $grade_item; // no db fetching
}
}
if (isset($data->excluded) and has_capability('moodle/grade:manage', $context)) {
$grade_grade->set_excluded($data->excluded);
}
// detect cases when we need to do full regrading
if ($old_grade_grade->excluded != $grade_grade->excluded) {
$parent = $grade_item->get_parent_category();
$parent->force_regrading();