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


PHP grade_force_full_regrading函数代码示例

本文整理汇总了PHP中grade_force_full_regrading函数的典型用法代码示例。如果您正苦于以下问题:PHP grade_force_full_regrading函数的具体用法?PHP grade_force_full_regrading怎么用?PHP grade_force_full_regrading使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: grade_course_reset

/**
 * Reset all course grades, refetch from the activities and recalculate
 *
 * @param int $courseid The course to reset
 * @return bool success
 */
function grade_course_reset($courseid)
{
    // no recalculations
    grade_force_full_regrading($courseid);
    $grade_items = grade_item::fetch_all(array('courseid' => $courseid));
    foreach ($grade_items as $gid => $grade_item) {
        $grade_item->delete_all_grades('reset');
    }
    //refetch all grades
    grade_grab_course_grades($courseid);
    // recalculate all grades
    grade_regrade_final_grades($courseid);
    return true;
}
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:20,代码来源:gradelib.php

示例2: grade_upgrade_use_min_max_from_grade_item

/**
 * Use the grade min and max from the grade_item.
 *
 * This is reserved for core use after an upgrade.
 *
 * @param int $courseid The current course id.
 */
function grade_upgrade_use_min_max_from_grade_item($courseid)
{
    grade_set_setting($courseid, 'minmaxtouse', GRADE_MIN_MAX_FROM_GRADE_ITEM);
    grade_force_full_regrading($courseid);
    // Do this now, because it probably happened to late in the page load to be happen automatically.
    grade_regrade_final_grades($courseid);
}
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:14,代码来源:lib.php

示例3: restore_execute


//.........这里部分代码省略.........
                echo "<li>" . get_string("creatinggradebook");
            }
            if (!($status = restore_create_gradebook($restore, $xml_file))) {
                if (!defined('RESTORE_SILENTLY')) {
                    notify("Could not restore gradebook!");
                } else {
                    $errorstr = "Could not restore gradebook!";
                    return false;
                }
            }
            if (!defined('RESTORE_SILENTLY')) {
                echo '</li>';
            }
        } else {
            // for moodle versions before 1.9, those grades need to be converted to use the new gradebook
            // this code needs to execute *after* the course_modules are sorted out
            if (!defined('RESTORE_SILENTLY')) {
                echo "<li>" . get_string("migratinggrades");
            }
            /// force full refresh of grading data before migration == crete all items first
            if (!($status = restore_migrate_old_gradebook($restore, $xml_file))) {
                if (!defined('RESTORE_SILENTLY')) {
                    notify("Could not migrate gradebook!");
                } else {
                    $errorstr = "Could not migrade gradebook!";
                    return false;
                }
            }
            if (!defined('RESTORE_SILENTLY')) {
                echo '</li>';
            }
        }
        /// force full refresh of grading data after all items are created
        grade_force_full_regrading($restore->course_id);
        grade_grab_course_grades($restore->course_id);
    }
    /*******************************************************************************
     ************* Restore of Roles and Capabilities happens here ******************
     *******************************************************************************/
    // try to restore roles even when restore is going to fail - teachers might have
    // at least some role assigned - this is not correct though
    $status = restore_create_roles($restore, $xml_file) && $status;
    $status = restore_roles_settings($restore, $xml_file) && $status;
    //Now if all is OK, update:
    //   - course modinfo field
    //   - categories table
    //   - add user as teacher
    if ($status) {
        if (!defined('RESTORE_SILENTLY')) {
            echo "<li>" . get_string("checkingcourse");
        }
        //categories table
        $course = get_record("course", "id", $restore->course_id);
        fix_course_sortorder();
        // Check if the user has course update capability in the newly restored course
        // there is no need to load his capabilities again, because restore_roles_settings
        // would have loaded it anyway, if there is any assignments.
        // fix for MDL-6831
        $newcontext = get_context_instance(CONTEXT_COURSE, $restore->course_id);
        if (!has_capability('moodle/course:manageactivities', $newcontext)) {
            // fix for MDL-9065, use the new config setting if exists
            if ($CFG->creatornewroleid) {
                role_assign($CFG->creatornewroleid, $USER->id, 0, $newcontext->id);
            } else {
                if ($legacyteachers = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM))) {
                    if ($legacyteacher = array_shift($legacyteachers)) {
开发者ID:kai707,项目名称:ITSA-backup,代码行数:67,代码来源:restorelib.php

示例4: redirect

    redirect($returnurl);
} else {
    if ($data = $mform->get_data()) {
        $data = (array) $data;
        $general = array('displaytype', 'decimalpoints', 'aggregationposition', 'minmaxtouse');
        foreach ($data as $key => $value) {
            if (!in_array($key, $general) and strpos($key, 'report_') !== 0 and strpos($key, 'import_') !== 0 and strpos($key, 'export_') !== 0) {
                continue;
            }
            if ($value == -1) {
                $value = null;
            }
            grade_set_setting($course->id, $key, $value);
            $previousvalue = isset($settings->{$key}) ? $settings->{$key} : null;
            if ($key == 'minmaxtouse' && $previousvalue != $value) {
                // The min max has changed, we need to regrade the grades.
                grade_force_full_regrading($courseid);
            }
        }
        redirect($returnurl);
    }
}
print_grade_page_head($courseid, 'settings', 'coursesettings', get_string('coursegradesettings', 'grades'));
// The settings could have been changed due to a notice shown in print_grade_page_head, we need to refresh them.
$settings = grade_get_settings($course->id);
$mform->set_data($settings);
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal centerpara');
echo get_string('coursesettingsexplanation', 'grades');
echo $OUTPUT->box_end();
$mform->display();
echo $OUTPUT->footer();
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:index.php


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