Пример #1
0
$diff_date = 0;
$db = JFactory::getDBO();
$sql = "select open_target, lesson_window_size from #__guru_config";
$db->setQuery($sql);
$db->query();
$result = $db->loadAssocList();
$target = intval($result["0"]["open_target"]);
$lesson_size = $result["0"]["lesson_window_size"];
$lesson_size = explode("x", $lesson_size);
$lesson_height = $lesson_size["0"];
$lesson_width = $lesson_size["1"];
$document = JFactory::getDocument();
$document->addScript("components/com_guru/js/programs.js");
$guruModelguruTask = new guruModelguruTask();
$guruModelguruOrder = new guruModelguruOrder();
$configs = $guruModelguruTask->getConfig();
if (isset($step) && $step != false) {
    $skip_modules_course = $guruModelguruTask->getSkipAction($step->pid);
} else {
}
$module_pozition = "0";
$certificates = $guruModelguruTask->getCertificate();
$is_final = $guruModelguruTask->getIsFinal($step->id);
if ($is_final == "") {
    $is_final = 0;
}
$db = JFactory::getDBO();
$sql = "select avg_certc from #__guru_program where id=" . $step->pid;
$db->setQuery($sql);
$db->query();
$avg_certif = $db->loadResult();
Пример #2
0
$sql = "SELECT show_countdown, max_score, questions_per_page, time_quiz_taken, is_final FROM #__guru_quiz WHERE id=" . intval($quiz_id);
$database->setQuery($sql);
$result = $database->loadObject();
$sql = "SELECT  `score_quiz` FROM #__guru_quiz_question_taken_v3 WHERE user_id=" . intval($user_id) . " and quiz_id=" . intval($quiz_id) . " and pid=" . intval($course_id) . " ORDER BY id DESC LIMIT 0,1";
$database->setQuery($sql);
$result_calc = $database->loadObject();
$sql = "SELECT  count(id) as time_quiz_taken_per_user FROM #__guru_quiz_question_taken_v3 WHERE user_id=" . intval($user_id) . " and quiz_id=" . intval($quiz_id) . " and pid=" . intval($course_id) . " ORDER BY id DESC LIMIT 0,1";
$database->setQuery($sql);
$result_calct = $database->loadObject();
$time_quiz_taken_per_user = $result_calct->time_quiz_taken_per_user;
$sql = "SELECT `question_ids` FROM  #__guru_quiz_question_taken_v3 WHERE user_id=" . intval($user_id) . " and quiz_id=" . intval($quiz_id) . " and pid=" . intval($course_id) . " ORDER BY id DESC LIMIT 0,1 ";
$database->setQuery($sql);
$question_ids_taken_by_user = $database->loadColumn();
$question_ids_taken_by_user = $question_ids_taken_by_user["0"];
$number_of_questions = count(explode(",", $question_ids_taken_by_user));
$configs = guruModelguruTask::getConfig();
$q = "SELECT * FROM #__guru_questions_v3 WHERE id IN (" . $question_ids_taken_by_user . ")";
$database->setQuery($q);
$quiz_questions = $database->loadObjectList();
if ($result->time_quiz_taken < 11) {
    $time_user = $result->time_quiz_taken - $time_quiz_taken_per_user;
}
@($res = $result_calc->score_quiz);
$k = 0;
$quiz_id = intval($quiz_id);
$score = $res;
$essay_exists = FALSE;
$quiz_form_content .= '<div id="the_quiz">';
$per_page = $result->questions_per_page;
// questions per page
if ($per_page == 0) {