本文整理汇总了PHP中workshop::clear_grading_grades方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::clear_grading_grades方法的具体用法?PHP workshop::clear_grading_grades怎么用?PHP workshop::clear_grading_grades使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::clear_grading_grades方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
*
* @package mod
* @subpackage workshop
* @copyright 2010 David Mudrak <david.mudrak@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once dirname(__FILE__) . '/locallib.php';
$id = required_param('id', PARAM_INT);
// course_module ID
$tool = required_param('tool', PARAM_ALPHA);
$cm = get_coursemodule_from_id('workshop', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
require_login($course, false, $cm);
$workshop = new workshop($workshop, $cm, $course);
require_sesskey();
switch ($tool) {
case 'clearaggregatedgrades':
require_capability('mod/workshop:overridegrades', $workshop->context);
$workshop->log('update clear aggregated grades');
$workshop->clear_submission_grades();
$workshop->clear_grading_grades();
break;
case 'clearassessments':
require_capability('mod/workshop:overridegrades', $workshop->context);
$workshop->log('update clear assessments');
$workshop->clear_assessments();
break;
}
redirect($workshop->view_url());