本文整理匯總了PHP中scorm_grade_item_delete函數的典型用法代碼示例。如果您正苦於以下問題:PHP scorm_grade_item_delete函數的具體用法?PHP scorm_grade_item_delete怎麽用?PHP scorm_grade_item_delete使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了scorm_grade_item_delete函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: scorm_delete_instance
/**
* Given an ID of an instance of this module,
* this function will permanently delete the instance
* and any data that depends on it.
*
* @param int $id Scorm instance id
* @return boolean
*/
function scorm_delete_instance($id)
{
global $CFG;
if (!($scorm = get_record('scorm', 'id', $id))) {
return false;
}
$result = true;
$scorm->dir = $CFG->dataroot . '/' . $scorm->course . '/moddata/scorm';
if (is_dir($scorm->dir . '/' . $scorm->id)) {
// Delete any dependent files
require_once 'locallib.php';
scorm_delete_files($scorm->dir . '/' . $scorm->id);
}
// Delete any dependent records
if (!delete_records('scorm_scoes_track', 'scormid', $scorm->id)) {
$result = false;
}
if ($scoes = get_records('scorm_scoes', 'scorm', $scorm->id)) {
foreach ($scoes as $sco) {
if (!delete_records('scorm_scoes_data', 'scoid', $sco->id)) {
$result = false;
}
}
delete_records('scorm_scoes', 'scorm', $scorm->id);
} else {
$result = false;
}
if (!delete_records('scorm', 'id', $scorm->id)) {
$result = false;
}
/*if (! delete_records('scorm_sequencing_controlmode', 'scormid', $scorm->id)) {
$result = false;
}
if (! delete_records('scorm_sequencing_rolluprules', 'scormid', $scorm->id)) {
$result = false;
}
if (! delete_records('scorm_sequencing_rolluprule', 'scormid', $scorm->id)) {
$result = false;
}
if (! delete_records('scorm_sequencing_rollupruleconditions', 'scormid', $scorm->id)) {
$result = false;
}
if (! delete_records('scorm_sequencing_rolluprulecondition', 'scormid', $scorm->id)) {
$result = false;
}
if (! delete_records('scorm_sequencing_rulecondition', 'scormid', $scorm->id)) {
$result = false;
}
if (! delete_records('scorm_sequencing_ruleconditions', 'scormid', $scorm->id)) {
$result = false;
}*/
scorm_grade_item_delete(stripslashes_recursive($scorm));
return $result;
}
示例2: scorm_delete_instance
/**
* Given an ID of an instance of this module,
* this function will permanently delete the instance
* and any data that depends on it.
*
* @global stdClass
* @global object
* @param int $id Scorm instance id
* @return boolean
*/
function scorm_delete_instance($id) {
global $CFG, $DB;
if (! $scorm = $DB->get_record('scorm', array('id' => $id))) {
return false;
}
$result = true;
// Delete any dependent records.
if (! $DB->delete_records('scorm_scoes_track', array('scormid' => $scorm->id))) {
$result = false;
}
if ($scoes = $DB->get_records('scorm_scoes', array('scorm' => $scorm->id))) {
foreach ($scoes as $sco) {
if (! $DB->delete_records('scorm_scoes_data', array('scoid' => $sco->id))) {
$result = false;
}
}
$DB->delete_records('scorm_scoes', array('scorm' => $scorm->id));
}
if (! $DB->delete_records('scorm', array('id' => $scorm->id))) {
$result = false;
}
/*if (! $DB->delete_records('scorm_sequencing_controlmode', array('scormid'=>$scorm->id))) {
$result = false;
}
if (! $DB->delete_records('scorm_sequencing_rolluprules', array('scormid'=>$scorm->id))) {
$result = false;
}
if (! $DB->delete_records('scorm_sequencing_rolluprule', array('scormid'=>$scorm->id))) {
$result = false;
}
if (! $DB->delete_records('scorm_sequencing_rollupruleconditions', array('scormid'=>$scorm->id))) {
$result = false;
}
if (! $DB->delete_records('scorm_sequencing_rolluprulecondition', array('scormid'=>$scorm->id))) {
$result = false;
}
if (! $DB->delete_records('scorm_sequencing_rulecondition', array('scormid'=>$scorm->id))) {
$result = false;
}
if (! $DB->delete_records('scorm_sequencing_ruleconditions', array('scormid'=>$scorm->id))) {
$result = false;
}*/
scorm_grade_item_delete($scorm);
return $result;
}