• Модуль: learning
  • Путь к файлу: ~/bitrix/modules/learning/classes/general/scorm.php
  • Класс: CCourseSCORM
  • Вызов: CCourseSCORM::CreateCourse
protected function CreateCourse()
{
	global $APPLICATION;

	if ($this->LAST_ERROR <> '')
		return false;

	if (!$title = $this->objXML->SelectNodes("/manifest/organizations/organization/title"))
	{
		$this->LAST_ERROR = GetMessage("LEARNING_BAD_NAME");
		return false;
	}

	$arFields = Array(
		"NAME" => $title->content,
		"SITE_ID" => $this->arSITE_ID,
		"SCORM" => "Y",
	);

	$course = new CCourse;
	$this->COURSE_ID = $course->Add($arFields);

	if ($this->COURSE_ID === false)
	{
		if($err = $APPLICATION->GetException())
			$this->LAST_ERROR = $err->GetString();
		return false;
	}

	return true;
}