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


PHP grade_object::update方法代码示例

本文整理汇总了PHP中grade_object::update方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_object::update方法的具体用法?PHP grade_object::update怎么用?PHP grade_object::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grade_object的用法示例。


在下文中一共展示了grade_object::update方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 /**
  * In addition to update() it also updates grade_outcomes_courses if needed
  * @param string $source from where was the object inserted
  * @return boolean success
  */
 function update($source = null)
 {
     $this->timemodified = time();
     return parent::update($source);
 }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:10,代码来源:grade_scale.php

示例2: update

 /**
  * In addition to update() as defined in grade_object, call force_regrading of parent categories, if applicable.
  *
  * @param string $source from where was the object updated (mod/forum, manual, etc.)
  * @return bool success
  */
 public function update($source = null)
 {
     // load the grade item or create a new one
     $this->load_grade_item();
     // force recalculation of path;
     if (empty($this->path)) {
         $this->path = grade_category::build_path($this);
         $this->depth = substr_count($this->path, '/') - 1;
         $updatechildren = true;
     } else {
         $updatechildren = false;
     }
     $this->apply_forced_settings();
     // these are exclusive
     if ($this->droplow > 0) {
         $this->keephigh = 0;
     } else {
         if ($this->keephigh > 0) {
             $this->droplow = 0;
         }
     }
     // Recalculate grades if needed
     if ($this->qualifies_for_regrading()) {
         $this->force_regrading();
     }
     $this->timemodified = time();
     $result = parent::update($source);
     // now update paths in all child categories
     if ($result and $updatechildren) {
         if ($children = grade_category::fetch_all(array('parent' => $this->id))) {
             foreach ($children as $child) {
                 $child->path = null;
                 $child->depth = 0;
                 $child->update($source);
             }
         }
     }
     return $result;
 }
开发者ID:covex-nn,项目名称:moodle,代码行数:45,代码来源:grade_category.php

示例3: update

 /**
  * In addition to update() as defined in grade_object, handle the grade_outcome and grade_scale objects.
  * Force regrading if necessary, rounds the float numbers using php function,
  * the reason is we need to compare the db value with computed number to skip regrading if possible.
  * @param string $source from where was the object inserted (mod/forum, manual, etc.)
  * @return boolean success
  */
 function update($source = null)
 {
     // reset caches
     $this->dependson_cache = null;
     // Retrieve scale and infer grademax/min from it if needed
     $this->load_scale();
     // make sure there is not 0 in outcomeid
     if (empty($this->outcomeid)) {
         $this->outcomeid = null;
     }
     if ($this->qualifies_for_regrading()) {
         $this->force_regrading();
     }
     $this->timemodified = time();
     $this->grademin = grade_floatval($this->grademin);
     $this->grademax = grade_floatval($this->grademax);
     $this->multfactor = grade_floatval($this->multfactor);
     $this->plusfactor = grade_floatval($this->plusfactor);
     $this->aggregationcoef = grade_floatval($this->aggregationcoef);
     return parent::update($source);
 }
开发者ID:r007,项目名称:PMoodle,代码行数:28,代码来源:grade_item.php

示例4: update

 /**
  * In addition to update() it also updates grade_outcomes_courses if needed
  * @param string $source from where was the object inserted
  * @return boolean success
  */
 function update($source = null)
 {
     $this->timemodified = time();
     if ($result = parent::update($source)) {
         if (!empty($this->courseid)) {
             $this->use_in($this->courseid);
         }
     }
     return $result;
 }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:15,代码来源:grade_outcome.php

示例5: update

 /**
  * In addition to update() as defined in grade_object rounds the float numbers using php function,
  * the reason is we need to compare the db value with computed number to skip updates if possible.
  *
  * @param string $source from where was the object inserted (mod/forum, manual, etc.)
  * @return bool success
  */
 public function update($source = null)
 {
     $this->rawgrade = grade_floatval($this->rawgrade);
     $this->finalgrade = grade_floatval($this->finalgrade);
     $this->rawgrademin = grade_floatval($this->rawgrademin);
     $this->rawgrademax = grade_floatval($this->rawgrademax);
     return parent::update($source);
 }
开发者ID:sriysk,项目名称:moodle-integration,代码行数:15,代码来源:grade_grade.php

示例6: update

 /**
  * In addition to update() it also updates grade_outcomes_courses if needed
  * @param string $source from where was the object inserted
  * @return boolean success
  */
 function update($source = null)
 {
     if ($result = parent::update($source)) {
         if (!empty($this->courseid)) {
             if (!get_records('grade_outcomes_courses', 'courseid', $this->courseid, 'outcomeid', $this->id)) {
                 $goc = new object();
                 $goc->courseid = $this->courseid;
                 $goc->outcomeid = $this->id;
                 insert_record('grade_outcomes_courses', $goc);
             }
         }
     }
     return $result;
 }
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:19,代码来源:grade_outcome.php

示例7: update

 /**
  * In addition to update() as defined in grade_object, handle the grade_outcome and grade_scale objects.
  * Force regrading if necessary
  * @param string $source from where was the object inserted (mod/forum, manual, etc.)
  * @return boolean success
  */
 function update($source = null)
 {
     // Retrieve scale and infer grademax/min from it if needed
     $this->load_scale();
     // make sure there is not 0 in outcomeid
     if (empty($this->outcomeid)) {
         $this->outcomeid = null;
     }
     if ($this->qualifies_for_regrading()) {
         $this->force_regrading();
     }
     return parent::update($source);
 }
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:19,代码来源:grade_item.php

示例8: update

 /**
  * In addition to update() as defined in grade_object, call force_regrading of parent categories, if applicable.
  * @param string $source from where was the object updated (mod/forum, manual, etc.)
  * @return boolean success
  */
 function update($source = null)
 {
     // load the grade item or create a new one
     $this->load_grade_item();
     // force recalculation of path;
     if (empty($this->path)) {
         $this->path = grade_category::build_path($this);
         $this->depth = substr_count($this->path, '/') - 1;
     }
     // Recalculate grades if needed
     if ($this->qualifies_for_regrading()) {
         $this->force_regrading();
     }
     return parent::update($source);
 }
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:20,代码来源:grade_category.php


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