⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coursebuilder.class.php

📁 完美的在线教育系统
💻 PHP
📖 第 1 页 / 共 2 页
字号:
		{			$link_category = new LinkCategory($obj->id, $obj->category_title, $obj->description, $obj->display_order);			$this->course->add_resource($link_category);			return $id;		}		return 0;	}	/**	 * Build the Quizzes	 */	function build_quizzes()	{		$table_qui = Database :: get_course_table(TABLE_QUIZ_TEST);		$table_rel = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);		$table_doc = Database :: get_course_table(TABLE_DOCUMENT);		$sql = 'SELECT * FROM '.$table_qui.' WHERE active >=0'; //select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes)		$db_result = api_sql_query($sql, __FILE__, __LINE__);		while ($obj = Database::fetch_object($db_result))		{			if (strlen($obj->sound) > 0)			{				$doc = Database::fetch_object(api_sql_query("SELECT id FROM ".$table_doc." WHERE path = '/audio/".$obj->sound."'"));				$obj->sound = $doc->id;			}			$quiz = new Quiz($obj->id, $obj->title, $obj->description, $obj->random, $obj->type, $obj->active, $obj->sound);			$sql = 'SELECT * FROM '.$table_rel.' WHERE exercice_id = '.$obj->id;			$db_result2 = api_sql_query($sql, __FILE__, __LINE__);			while ($obj2 = Database::fetch_object($db_result2))			{				$quiz->add_question($obj2->question_id);			}			$this->course->add_resource($quiz);		}		$this->build_quiz_questions();	}	/**	 * Build the Quiz-Questions	 */	function build_quiz_questions()	{		$table_que = Database :: get_course_table(TABLE_QUIZ_QUESTION);		$table_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER);		$sql = 'SELECT * FROM '.$table_que;		$db_result = api_sql_query($sql, __FILE__, __LINE__);		while ($obj = Database::fetch_object($db_result))		{			$question = new QuizQuestion($obj->id, $obj->question, $obj->description, $obj->ponderation, $obj->type, $obj->position, $obj->picture);			$sql = 'SELECT * FROM '.$table_ans.' WHERE question_id = '.$obj->id;			$db_result2 = api_sql_query($sql, __FILE__, __LINE__);			while ($obj2 = Database::fetch_object($db_result2))			{				$question->add_answer($obj2->answer, $obj2->correct, $obj2->comment, $obj2->ponderation, $obj2->position, $obj2->hotspot_coordinates, $obj2->hotspot_type);			}			$this->course->add_resource($question);		}	}	/**	 * Build the Surveys	 */	function build_surveys()	{		$table_survey = Database :: get_course_table(TABLE_SURVEY);		$table_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);		$sql = 'SELECT * FROM '.$table_survey;		$db_result = api_sql_query($sql, __FILE__, __LINE__);		while ($obj = Database::fetch_object($db_result))		{			$survey = new Survey($obj->survey_id, $obj->code,$obj->title,								$obj->subtitle, $obj->author, $obj->lang,								$obj->avail_from, $obj->avail_till, $obj->is_shared,								$obj->template, $obj->intro, $obj->surveythanks,								$obj->creation_date, $obj->invited, $obj->answered,								$obj->invite_mail, $obj->reminder_mail);			$sql = 'SELECT * FROM '.$table_question.' WHERE survey_id = '.$obj->survey_id;			$db_result2 = api_sql_query($sql, __FILE__, __LINE__);			while ($obj2 = Database::fetch_object($db_result2))			{				$survey->add_question($obj2->question_id);			}			$this->course->add_resource($survey);		}		$this->build_survey_questions();	}	/**	 * Build the Survey Questions	 */	function build_survey_questions()	{		$table_que = Database :: get_course_table(TABLE_SURVEY_QUESTION);		$table_opt = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);		$sql = 'SELECT * FROM '.$table_que;		$db_result = api_sql_query($sql, __FILE__, __LINE__);		while ($obj = Database::fetch_object($db_result))		{			$question = new SurveyQuestion($obj->question_id, $obj->survey_id,											$obj->survey_question, $obj->survey_question_comment,											$obj->type, $obj->display, $obj->sort,											$obj->shared_question_id, $obj->max_value);			$sql = 'SELECT * FROM '.$table_opt.' WHERE question_id = '."'".$obj->question_id."'";			$db_result2 = api_sql_query($sql, __FILE__, __LINE__);			while ($obj2 = Database::fetch_object($db_result2))			{				$question->add_answer($obj2->option_text, $obj2->sort);			}			$this->course->add_resource($question);		}	}	/**	 * Build the announcements	 */	function build_announcements()	{		$table = Database :: get_course_table(TABLE_ANNOUNCEMENT);		$sql = 'SELECT * FROM '.$table;		$db_result = api_sql_query($sql, __FILE__, __LINE__);		while ($obj = Database::fetch_object($db_result))		{			$announcement = new Announcement($obj->id, $obj->title, $obj->content, $obj->end_date,$obj->display_order,$obj->email_sent);			$this->course->add_resource($announcement);		}	}	/**	 * Build the events	 */	function build_events()	{		$table = Database :: get_course_table(TABLE_AGENDA);		$sql = 'SELECT * FROM '.$table;		$db_result = api_sql_query($sql, __FILE__, __LINE__);		while ($obj = Database::fetch_object($db_result))		{			$event = new Event($obj->id, $obj->title, $obj->content, $obj->start_date, $obj->end_date);			$this->course->add_resource($event);		}	}	/**	 * Build the course-descriptions	 */	function build_course_descriptions()	{		$table = Database :: get_course_table(TABLE_COURSE_DESCRIPTION);		$sql = 'SELECT * FROM '.$table;		$db_result = api_sql_query($sql, __FILE__, __LINE__);		while ($obj = Database::fetch_object($db_result))		{			$cd = new CourseDescription($obj->id, $obj->title, $obj->content);			$this->course->add_resource($cd);		}	}	/**	 * Build the learnpaths	 */	function build_learnpaths()	{		$table_main 	= Database :: get_course_table(TABLE_LP_MAIN);		$table_item 	= Database :: get_course_table(TABLE_LP_ITEM);		$table_tool 	= Database::get_course_table(TABLE_TOOL_LIST);		$sql = 'SELECT * FROM '.$table_main;		$db_result = api_sql_query($sql, __FILE__, __LINE__);		while ($obj = Database::fetch_object($db_result))		{			$items = array();			$sql_items = "SELECT * FROM ".$table_item." WHERE lp_id = ".$obj->id."";			$db_items = api_sql_query($sql_items);			while ($obj_item = Database::fetch_object($db_items))			{				$item['id'] = $obj_item->id;				$item['item_type'] = $obj_item->item_type;				$item['ref'] = $obj_item->ref;				$item['title'] = $obj_item->title;				$item['description'] = $obj_item->description;				$item['path'] = $obj_item->path;				$item['min_score'] = $obj_item->min_score;				$item['max_score'] = $obj_item->max_score;				$item['mastery_score'] = $obj_item->mastery_score;				$item['parent_item_id'] = $obj_item->parent_item_id;				$item['previous_item_id'] = $obj_item->previous_item_id;				$item['next_item_id'] = $obj_item->next_item_id;				$item['display_order'] = $obj_item->display_order;				$item['prerequisite'] = $obj_item->prerequisite;				$item['parameters'] = $obj_item->parameters;				$item['launch_data'] = $obj_item->launch_data;				$items[] = $item;			}			$sql_tool = "SELECT id FROM ".$table_tool." WHERE (link LIKE '%lp_controller.php%lp_id=".$obj->id."%' and image='scormbuilder.gif') AND visibility='1'";			$db_tool = api_sql_query($sql_tool);			if(Database::num_rows($db_tool))			{				$visibility='1';			}			else			{				$visibility='0';			}			$lp = new Learnpath($obj->id,								$obj->lp_type,								$obj->name,								$obj->path,								$obj->ref,								$obj->description,								$obj->content_local,								$obj->default_encoding,								$obj->default_view_mod,								$obj->prevent_reinit,								$obj->force_commit,								$obj->content_maker,								$obj->display_order,								$obj->js_lib,								$obj->content_license,								$obj->debug,								$visibility,								$items);			$this->course->add_resource($lp);		}		//save scorm directory (previously build_scorm_documents())		$i = 1;		if($dir=@opendir($this->course->backup_path.'/scorm'))		{			while($file=readdir($dir))			{				if(is_dir($this->course->backup_path.'/scorm/'.$file) && !in_array($file,array('.','..')))				{					$doc = new ScormDocument($i++, '/'.$file, $file);					$this->course->add_resource($doc);				}			}			closedir($dir);		}	}}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -