本文整理匯總了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());