本文整理汇总了PHP中forum_grade_item_update函数的典型用法代码示例。如果您正苦于以下问题:PHP forum_grade_item_update函数的具体用法?PHP forum_grade_item_update怎么用?PHP forum_grade_item_update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了forum_grade_item_update函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: forum_reset_gradebook
/**
* Removes all grades from gradebook
* @param int $courseid
* @param string optional type
*/
function forum_reset_gradebook($courseid, $type = '')
{
global $CFG;
$type = $type ? "AND f.type='{$type}'" : '';
$sql = "SELECT f.*, cm.idnumber as cmidnumber, f.course as courseid\n FROM {$CFG->prefix}forum f, {$CFG->prefix}course_modules cm, {$CFG->prefix}modules m\n WHERE m.name='forum' AND m.id=cm.module AND cm.instance=f.id AND f.course={$courseid} {$type}";
if ($forums = get_records_sql($sql)) {
foreach ($forums as $forum) {
forum_grade_item_update($forum, 'reset');
}
}
}
开发者ID:r007,项目名称:PMoodle,代码行数:16,代码来源:lib.php
示例2: forum_reset_gradebook
/**
* Removes all grades from gradebook
*
* @global object
* @global object
* @param int $courseid
* @param string $type optional
*/
function forum_reset_gradebook($courseid, $type='') {
global $CFG, $DB;
$wheresql = '';
$params = array($courseid);
if ($type) {
$wheresql = "AND f.type=?";
$params[] = $type;
}
$sql = "SELECT f.*, cm.idnumber as cmidnumber, f.course as courseid
FROM {forum} f, {course_modules} cm, {modules} m
WHERE m.name='forum' AND m.id=cm.module AND cm.instance=f.id AND f.course=? $wheresql";
if ($forums = $DB->get_records_sql($sql, $params)) {
foreach ($forums as $forum) {
forum_grade_item_update($forum, 'reset');
}
}
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:28,代码来源:lib.php
示例3: forum_update_grades
/**
* Update grades by firing grade_updated event
*
* @param object $forum null means all forums
* @param int $userid specific user only, 0 mean all
*/
function forum_update_grades($forum = null, $userid = 0, $nullifnone = true)
{
global $CFG;
if ($forum != null) {
require_once $CFG->libdir . '/gradelib.php';
if ($grades = forum_get_user_grades($forum, $userid)) {
grade_update('mod/forum', $forum->course, 'mod', 'forum', $forum->id, 0, $grades);
} else {
if ($userid and $nullifnone) {
$grade = new object();
$grade->userid = $userid;
$grade->rawgrade = NULL;
grade_update('mod/forum', $data->course, 'mod', 'forum', $forum->id, 0, $grade);
}
}
} else {
$sql = "SELECT f.*, cm.idnumber as cmidnumber\n FROM {$CFG->prefix}forum f, {$CFG->prefix}course_modules cm, {$CFG->prefix}modules m\n WHERE m.name='forum' AND m.id=cm.module AND cm.instance=f.id";
if ($rs = get_recordset_sql($sql)) {
if ($rs->RecordCount() > 0) {
while ($forum = rs_fetch_next_record($rs)) {
forum_grade_item_update($forum);
if ($forum->assessed) {
forum_update_grades($forum, 0, false);
}
}
}
rs_close($rs);
}
}
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:36,代码来源:lib.php
注:本文中的forum_grade_item_update函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论