本文整理汇总了PHP中AMA_DataHandler::course_instance_get_list方法的典型用法代码示例。如果您正苦于以下问题:PHP AMA_DataHandler::course_instance_get_list方法的具体用法?PHP AMA_DataHandler::course_instance_get_list怎么用?PHP AMA_DataHandler::course_instance_get_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMA_DataHandler
的用法示例。
在下文中一共展示了AMA_DataHandler::course_instance_get_list方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parameter_controlFN
//.........这里部分代码省略.........
if (AMA_DataHandler::isError($studentLevel)) {
$invalid_course_instance = TRUE;
}
break;
case AMA_TYPE_TUTOR:
if (!$sess_userObj->isSuper() && $course_instanceObj->getServiceLevel() != ADA_SERVICE_TUTORCOMMUNITY) {
$tutorsInstance = $dh->course_instance_tutor_get($id_course_instance, $number = 2);
if (AMA_DataHandler::isError($tutorsInstance)) {
$invalid_course_instance = TRUE;
} elseif (!in_array($sess_id_user, $tutorsInstance)) {
$invalid_course_instance = TRUE;
}
}
break;
default:
// $invalid_course_instance = TRUE;
break;
}
if (!$invalid_course_instance) {
$_SESSION['sess_id_course_instance'] = $id_course_instance;
$sess_id_course_instance = $_SESSION['sess_id_course_instance'];
}
}
} elseif ($sess_id_course_instance !== FALSE) {
$instanceIdRequired = array();
if (isset($_SESSION['sess_id_node']) && !$invalid_node) {
// if ($nodeObj instanceof Node) { // required a node
$instanceIdRequired[] = isset($dataHa['instance']) ? $dataHa['instance'] : null;
if ($instanceIdRequired[0] == 0) {
// the node is NOT a note
$field_list_ar = array();
if (isset($_SESSION['sess_id_course']) && !$invalid_course) {
$courseIdRequired = $_SESSION['sess_id_course'];
$InstanceIdList = $dh->course_instance_get_list($field_list_ar, $courseIdRequired);
if (AMA_DataHandler::isError($InstanceIdList) || count($InstanceIdList) == 0) {
$invalid_course_instance = TRUE;
}
} else {
$invalid_course_instance = TRUE;
}
$instanceIdRequired = array();
foreach ($InstanceIdList as $InstanceId) {
array_push($instanceIdRequired, $InstanceId[0]);
}
}
// end if NOTE
} elseif ($sess_courseObj instanceof Course) {
$courseIdRequired = $sess_courseObj->id;
$InstanceIdList = $dh->course_instance_get_list(array(), $courseIdRequired);
if (AMA_DataHandler::isError($InstanceIdList) || count($InstanceIdList) == 0) {
$invalid_course_instance = TRUE;
}
$instanceIdRequired = array();
foreach ($InstanceIdList as $InstanceId) {
array_push($instanceIdRequired, $InstanceId[0]);
}
}
// var_dump($instanceIdRequired,$sess_id_course_instance);
$UserType = $sess_userObj->getType();
switch ($UserType) {
case AMA_TYPE_STUDENT:
case AMA_TYPE_TUTOR:
if (!in_array($sess_id_course_instance, $instanceIdRequired)) {
$invalid_course_instance = TRUE;
}
break;