require_once("util/fns.inc"); require_once("html/study.inc"); require_once("html/comment.inc"); require_once ("dal/Basic_Exam.inc"); require_once("html/package.inc"); limited_access(6); $show_pay_info = true; $include_social = true; $lock_copy = true; //used for adding a comment. don't need to click show answer button again. $show_answer = $_REQUEST['show'] == 'T'; $custom_js = get_show_answer_js();//for check answer and show comments. $subid = $_REQUEST['subid'];//required. if(!validate_id($subid) || !cross_level_check(3, $subid)) { show_restricted_access();//"Userid: " . $_SESSION['user']['id'] . ", Subid: $subid" exit; } $exam_guide_id = get_exam_guide_id_by_sub_id($subid); set_up_exam_guide_id_for_guest($exam_guide_id); $row = get_subject_info_from_subid($subid); if($row['substatus'] == 1) { if(is_restricted_user()) { show_restricted_access(); return; } else if (is_paid_user_qb()) { show_restricted_access();//temporary. //show_upgrade_access(); return; } } increment_access_score(1); //either 1 should exists, but not both. $action = $_REQUEST['action'];//only available if starting the basic exam. $id = $_REQUEST['id'];//bqid, optional if(isset($id) && !is_numeric($id)) {//if it exists, it must be numeric. show_restricted_access(); return; } //don't redirect when starting the exam. if(!isset($action) && should_redirect_to_payment()) { print_package("basic_question.php?subid=$subid&id=$id"); exit; } //1-start; //insert into basic_user_assgnmt ONLY when checking answer: if(isset($action) && ($action == 1)) { $exam = new Basic_Exam(); $exam->initialize($subid); if($exam->get_number_of_questions() == 0) { show_restricted_access(); return; } $_SESSION['user']['bqexam'] = $exam; } //now we should have exam object. $user = $_SESSION['user']; $exam = $user['bqexam']; if(!$exam) {//first time machine visit $exam = new Basic_Exam(); $exam->initialize($subid); if($exam->get_number_of_questions() == 0) { show_restricted_access("No basic question for subject $subid"); return; } $_SESSION['user']['bqexam'] = $exam; } if(!isset($id) || $id == 0 || !is_numeric($id)) { $id = $exam->get_first_bqid(); } $query = "select subid, value, answer from basic_question where bqid = " . $id; $result = do_mysqli_query($query); if(mysqli_num_rows($result) == 0) { show_restricted_access("No basic question for subject $subid"); return; } $bq_row = mysqli_fetch_array($result); //need to have the valid basic_question first, before adding comment or getting canonical_link. if(isset($_REQUEST['comment'])) { add_user_comment($id, 2, $_REQUEST['comment']); } $canonical_link = get_canonical_link($id, 2); //links: $link_study_all = build_study_all_link(); $link_topic = build_topic_link_title($row['ssid']); $link_module = build_module_link_title($row['rid']); $link_subject = build_subject_link_title_from_subid($subid); $show_los = can_show_los(); $year = $user['exam_year']; $level_label = get_exam_name_for_user(); $los_result = do_mysqli_query("select l.value, l.notes from los_main l, los_subject ls where ls.losid = l.id and ls.subid = " . $subid); if($los_row = mysqli_fetch_array($los_result)) { $los_value = $los_row['value']; $los_notes = "CFA® $level_label Curriculum, " . $los_row['notes'] . ", Module " . $row['rnumber'] . "."; } if(is_logged_on()) { do_mysqli_query("insert ignore into basic_user_assgnmt (bqid, userId, subid) values (" . $id . ", " . $user['id'] . ", $subid)"); } $current_question_index = $exam->get_current_index_by_id($id); $prevId = $exam->get_previous_questionid_by_id($id); $nextId = $exam->get_next_questionid_by_id($id); $tweeter_text = "CFA quiz question for " . $los_row['lvalue'] . " Topic " . $row['ssnumber'] . ". Module " . $row['rnumber'] . "."; $breadcrumb = array(array($link_study_all, $level_label), array($link_topic, "Topic " . $row['ssnumber'] . ". " . $row['ssvalue']), array($link_module, "Learning Module " . $row['rnumber'] . ". " . $row['rvalue']), array($link_subject, "Subject " . $row['subnumber'] . ". " . $row['subvalue']), array("", "Basic Question") ); print_page_header("CFA Study Preparation", $canonical_link); print_breadcrumb($breadcrumb); print_container_start(); print_main_section_start(); print_basic_question_card(); print_section_end(); print_basic_question_side_column(); print_container_end(); print_footer(); function print_basic_question_side_column() { global $row, $show_los, $los_value, $los_notes; print_side_section_start(); print_rotating_image(); if(!is_cellphone()) { print_testimonial(); ?>
Learning Outcome Statements
"; echo "" . cleanup_notes_html($los_value) . "
"; echo "$los_notes
"; } else { echo "Subject " . $row['subnumber'] . ". " . $row['subvalue'] . "
"; } } ?>