当前位置: 首页>>代码示例>>PHP>>正文


PHP grade_grade::set_locktime方法代码示例

本文整理汇总了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();
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:31,代码来源:grade.php

示例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();
开发者ID:ncsu-delta,项目名称:moodle,代码行数:31,代码来源:grade.php


注:本文中的grade_grade::set_locktime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。