private function create_node_course_modules_mod_forum($instance) { $sheet_mod_forum = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_FORUM); $topic_data = $this->get_topic_data($instance); $result = ''; if (!empty($topic_data)) { $find_tags = array('[#mod_instance#]', '[#mod_forum_title#]', '[#mod_forum_intro#]', '[#date_now#]'); $replace_values = array($instance['instance'], self::safexml($topic_data['title']), self::safexml($topic_data['description']), time()); $result = str_replace($find_tags, $replace_values, $sheet_mod_forum); } return $result; }
public function generate_node() { cc112moodle::log_action('Creating Resource mods'); $response = ''; $sheet_mod_resource = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_RESOURCE); if (!empty(cc112moodle::$instances['instances'][MOODLE_TYPE_RESOURCE])) { foreach (cc112moodle::$instances['instances'][MOODLE_TYPE_RESOURCE] as $instance) { $response .= $this->create_node_course_modules_mod_resource($sheet_mod_resource, $instance); } } return $response; }
private function create_node_course_modules_mod_basiclti($instance) { $sheet_mod_basiclti = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_BASICLTI); $topic_data = $this->get_basiclti_data($instance); $result = ''; if (!empty($topic_data)) { $find_tags = array('[#mod_instance#]', '[#mod_basiclti_name#]', '[#mod_basiclti_intro#]', '[#mod_basiclti_timec#]', '[#mod_basiclti_timem#]', '[#mod_basiclti_toolurl#]', '[#mod_basiclti_orgid#]', '[#mod_basiclti_orgurl#]', '[#mod_basiclti_orgdesc#]'); $replace_values = array($instance['instance'], $topic_data['title'], $topic_data['description'], time(), time(), $topic_data['launchurl'], $topic_data['orgid'], $topic_data['orgurl'], $topic_data['orgdesc']); $result = str_replace($find_tags, $replace_values, $sheet_mod_basiclti); } return $result; }
private function create_node_course_question_categories_question_category_question_answer($answer) { $sheet_question_categories_question_answer = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_ANSWER); $find_tags = array('[#answer_id#]', '[#answer_text#]', '[#answer_score#]', '[#answer_feedback#]'); $replace_values = array($answer['id'], self::safexml($answer['title']), $answer['score'], self::safexml($answer['feedback'])); $node_question_categories_question_answer = str_replace($find_tags, $replace_values, $sheet_question_categories_question_answer); return $node_question_categories_question_answer; }