本文整理汇总了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;
}