本文整理匯總了PHP中grade_outcome::fetch_all方法的典型用法代碼示例。如果您正苦於以下問題:PHP grade_outcome::fetch_all方法的具體用法?PHP grade_outcome::fetch_all怎麽用?PHP grade_outcome::fetch_all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類grade_outcome
的用法示例。
在下文中一共展示了grade_outcome::fetch_all方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: remove_course_grades
/**
* Remove all grade related course data - history is kept
* @param int $courseid
* @param bool @showfeedback print feedback
*/
function remove_course_grades($courseid, $showfeedback)
{
$strdeleted = get_string('deleted');
$course_category = grade_category::fetch_course_category($courseid);
$course_category->delete('coursedelete');
if ($showfeedback) {
notify($strdeleted . ' - ' . get_string('grades', 'grades') . ', ' . get_string('items', 'grades') . ', ' . get_string('categories', 'grades'));
}
if ($outcomes = grade_outcome::fetch_all(array('courseid' => $courseid))) {
foreach ($outcomes as $outcome) {
$outcome->delete('coursedelete');
}
}
delete_records('grade_outcomes_courses', 'courseid', $courseid);
if ($showfeedback) {
notify($strdeleted . ' - ' . get_string('outcomes', 'grades'));
}
if ($scales = grade_scale::fetch_all(array('courseid' => $courseid))) {
foreach ($scales as $scale) {
$scale->delete('coursedelete');
}
}
if ($showfeedback) {
notify($strdeleted . ' - ' . get_string('scales'));
}
}
示例2: remove_course_grades
/**
* Remove all grade related course data
* Grade history is kept
*
* @param int $courseid The course ID
* @param bool $showfeedback If true success notifications will be displayed
*/
function remove_course_grades($courseid, $showfeedback)
{
global $DB, $OUTPUT;
$fs = get_file_storage();
$strdeleted = get_string('deleted');
$course_category = grade_category::fetch_course_category($courseid);
$course_category->delete('coursedelete');
$fs->delete_area_files(get_context_instance(CONTEXT_COURSE, $courseid)->id, 'grade', 'feedback');
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted . ' - ' . get_string('grades', 'grades') . ', ' . get_string('items', 'grades') . ', ' . get_string('categories', 'grades'), 'notifysuccess');
}
if ($outcomes = grade_outcome::fetch_all(array('courseid' => $courseid))) {
foreach ($outcomes as $outcome) {
$outcome->delete('coursedelete');
}
}
$DB->delete_records('grade_outcomes_courses', array('courseid' => $courseid));
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted . ' - ' . get_string('outcomes', 'grades'), 'notifysuccess');
}
if ($scales = grade_scale::fetch_all(array('courseid' => $courseid))) {
foreach ($scales as $scale) {
$scale->delete('coursedelete');
}
}
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted . ' - ' . get_string('scales'), 'notifysuccess');
}
$DB->delete_records('grade_settings', array('courseid' => $courseid));
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted . ' - ' . get_string('settings', 'grades'), 'notifysuccess');
}
}
示例3: test_grade_outcome_fetch_all
function test_grade_outcome_fetch_all()
{
$grade_outcome = new grade_outcome();
$this->assertTrue(method_exists($grade_outcome, 'fetch_all'));
$grade_outcomes = grade_outcome::fetch_all(array());
$this->assertEqual(count($this->grade_outcomes), count($grade_outcomes));
}
示例4: fetch_all_local
/**
* Static function returning all local course outcomes
* @static
* @param int $courseid
* @return object
*/
function fetch_all_local($courseid)
{
if (!($outcomes = grade_outcome::fetch_all(array('courseid' => $courseid)))) {
$outcomes = array();
}
return $outcomes;
}
示例5: remove_course_grades
/**
* Remove all grade related course data - history is kept
*
* @global object
* @param int $courseid
* @param bool $showfeedback print feedback
*/
function remove_course_grades($courseid, $showfeedback) {
global $DB, $OUTPUT;
$strdeleted = get_string('deleted');
$course_category = grade_category::fetch_course_category($courseid);
$course_category->delete('coursedelete');
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted.' - '.get_string('grades', 'grades').', '.get_string('items', 'grades').', '.get_string('categories', 'grades'));
}
if ($outcomes = grade_outcome::fetch_all(array('courseid'=>$courseid))) {
foreach ($outcomes as $outcome) {
$outcome->delete('coursedelete');
}
}
$DB->delete_records('grade_outcomes_courses', array('courseid'=>$courseid));
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted.' - '.get_string('outcomes', 'grades'));
}
if ($scales = grade_scale::fetch_all(array('courseid'=>$courseid))) {
foreach ($scales as $scale) {
$scale->delete('coursedelete');
}
}
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted.' - '.get_string('scales'));
}
$DB->delete_records('grade_settings', array('courseid'=>$courseid));
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted.' - '.get_string('settings', 'grades'));
}
}