<?php include_once "../../config.php"; if (isset($_SESSION['apps']['vocabulary'])) { $id = optional_param('id', NULL, PARAM_INT); $appsfolder = browser_detect(); $list = json_decode($_SESSION['apps']['vocabulary']); $idc = $list[$id]; if (isset($list[$id + 1])) { $idnext = $id + 1; } else { $idnext = 0; } $data = get_record("apps_vocabulary", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 2); if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } add_log($_SESSION['userid'], 2, time()); mobilehtmlheader('Vocabulary'); include_once $CFG['dirroot'] . "/apps/vocabulary/" . $appsfolder . "/i.php"; }
include_once "../../config.php"; if (isset($_SESSION['apps']['ordering'])) { $id = optional_param('id', NULL, PARAM_INT); $appsfolder = browser_detect(); $list = json_decode($_SESSION['apps']['ordering']); $idc = $list[$id]; if (isset($list[$id + 1])) { $idnext = $id + 1; } else { $idnext = 0; } $data = get_record("apps_ordering", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 9); $c = 0; $words = array(); for ($i = 1; $i <= 10; $i++) { $var = "var" . $i; if (!empty($data->{$var})) { $words[$i] = $data->{$var}; } } //$words = shuffle_assoc ($words); if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } add_log($_SESSION['userid'], 9, time()); mobilehtmlheader('ordering activity'); include_once $CFG['dirroot'] . "/apps/ordering/" . $appsfolder . "/i.php"; }
} $data = get_record("apps_choice", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 1); $c = 0; $correctchoices = ""; $correctchoicesstring = ""; for ($i = 1; $i <= 12; $i++) { $cor = "cor" . $i; $var = "var" . $i; if ($data->{$cor} == 1) { $c++; $correctchoices .= $i . ","; $correctchoicesstring .= $data->{$var} . ","; } } $correctchoices = substr($correctchoices, 0, -1); $correctchoicesstring = substr($correctchoicesstring, 0, -1); if ($c > 1) { $multichoice = true; } else { $multichoice = false; } if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } add_log($_SESSION['userid'], 1, time()); mobilehtmlheader('Choice'); include_once $CFG['dirroot'] . "/apps/choice/" . $appsfolder . "/i.php"; }
<?php include_once "../../config.php"; if (isset($_SESSION['apps']['reading'])) { $id = optional_param('id', NULL, PARAM_INT); $appsfolder = browser_detect(); $list = json_decode($_SESSION['apps']['reading']); $idc = $list[$id]; if (isset($list[$id + 1])) { $idnext = $id + 1; } else { $idnext = 0; } $data = get_record("apps_reading", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 3); if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } add_log($_SESSION['userid'], 3, time()); mobilehtmlheader('Reading'); include_once $CFG['dirroot'] . "/apps/reading/" . $appsfolder . "/i.php"; }
<?php include_once "../../config.php"; if (isset($_SESSION['apps']['listening'])) { $id = optional_param('id', NULL, PARAM_INT); $appsfolder = browser_detect(); $list = json_decode($_SESSION['apps']['listening']); $idc = $list[$id]; if (isset($list[$id + 1])) { $idnext = $id + 1; } else { $idnext = 0; } $data = get_record("apps_listening", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 4); if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } mobilehtmlheader('Listening'); add_log($_SESSION['userid'], 4, time()); include_once $CFG['dirroot'] . "/apps/listening/" . $appsfolder . "/i.php"; }
if (isset($_SESSION['apps']['groupquiz'])) { $id = optional_param('id', NULL, PARAM_INT); $appsfolder = browser_detect(); $list = json_decode($_SESSION['apps']['groupquiz']); $idc = $list[$id]; if (isset($list[$id + 1])) { $idnext = $id + 1; } else { $idnext = 0; } $data = get_record("apps_groupquiz", array("id" => $idc)); //$score = get_user_score($_SESSION['userid'], 11); $quizs = get_records("apps_quizzes", array("apps_quizzes" => $data->category)); if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } mobilehtmlheader('Group Quiz'); add_log($_SESSION['userid'], 11, time()); if ($_SESSION['userid'] == 2) { //disable guest login echo 'Location: ' . $CFG['wwwroot'] . '/index.php/c/' . $course->id; die; } if (get_record("apps_groupquiz_list", array("uid1" => $_SESSION['userid'])) || get_record("apps_groupquiz_list", array("uid2" => $_SESSION['userid'])) || get_record("apps_groupquiz_list", array("uid3" => $_SESSION['userid'])) || get_record("apps_groupquiz_list", array("uid4" => $_SESSION['userid'])) || get_record("apps_groupquiz_list", array("uid5" => $_SESSION['userid']))) { include_once $CFG['dirroot'] . "/apps/groupquiz/" . $appsfolder . "/i2.php"; } else { include_once $CFG['dirroot'] . "/apps/groupquiz/" . $appsfolder . "/i.php"; } }
<?php include_once "../../config.php"; if (isset($_SESSION['apps']['quiz'])) { $id = optional_param('id', NULL, PARAM_INT); $appsfolder = browser_detect(); $list = json_decode($_SESSION['apps']['quiz']); $idc = $list[$id]; if (isset($list[$id + 1])) { $idnext = $id + 1; } else { $idnext = 0; } $data = get_record("apps_quizzes", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 5); if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } mobilehtmlheader('Quiz'); add_log($_SESSION['userid'], 5, time()); include_once $CFG['dirroot'] . "/apps/quiz/" . $appsfolder . "/i.php"; }
<?php include_once "../../config.php"; if (isset($_SESSION['apps']['resource'])) { $id = optional_param('id', NULL, PARAM_INT); $appsfolder = browser_detect(); $list = json_decode($_SESSION['apps']['resource']); $idc = $list[$id]; if (isset($list[$id + 1])) { $idnext = $id + 1; } else { $idnext = 0; } $data = get_record("apps_resource", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 6); if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } add_log($_SESSION['userid'], 6, time()); mobilehtmlheader('resource'); include_once $CFG['dirroot'] . "/apps/resource/" . $appsfolder . "/i.php"; }
} else { $idnext = 0; } $data = get_record("apps_dragdrope", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 8); $c = 0; $questions = array(); for ($i = 1; $i <= 5; $i++) { $var = "var" . $i; if (!empty($data->{$var})) { $questions[$i] = $data->{$var}; } } $questions = shuffle_assoc($questions); $answers = array(); for ($i = 1; $i <= 5; $i++) { $var = "a" . $i; if (!empty($data->{$var})) { $answers[$i] = $data->{$var}; } } $answers = shuffle_assoc($answers); if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } add_log($_SESSION['userid'], 8, time()); mobilehtmlheader('DragDrope activity'); include_once $CFG['dirroot'] . "/apps/dragdrope/" . $appsfolder . "/i.php"; }
<?php include_once "../../config.php"; if (isset($_SESSION['apps']['clozeactivity'])) { $id = optional_param('id', NULL, PARAM_INT); $appsfolder = browser_detect(); $list = json_decode($_SESSION['apps']['clozeactivity']); $idc = $list[$id]; if (isset($list[$id + 1])) { $idnext = $id + 1; } else { $idnext = 0; } $data = get_record("apps_clozeactivity", array("id" => $idc)); $score = get_user_score($_SESSION['userid'], 7); $c = 0; $correctchoices = array(); for ($i = 1; $i <= 10; $i++) { $var = "var" . $i; if (!empty($data->{$var})) { $correctchoices[$i] = $data->{$var}; } } if (isset($_SESSION['currentcourse'])) { $course = get_record("course", array("id" => $_SESSION['currentcourse'])); } else { $course = get_record("course", array("id" => $_COOKIE['mcm_course'])); } add_log($_SESSION['userid'], 7, time()); mobilehtmlheader('Cloze activity'); include_once $CFG['dirroot'] . "/apps/clozeactivity/" . $appsfolder . "/i.php"; }
shuffle($listofresource); $_SESSION['apps']['groupquiz'] = json_encode($listofresource); header("Location: " . $CFG['wwwroot'] . "/apps/groupquiz/index.php?id=0"); } } } } } } } } } } } } else { mobilehtmlheader($pagetitle); if ($la[1] == "c") { $selectors['courselist'] = ""; $selectors['course-' . $la[2]] = 'selected="true"'; } else { $selectors['courselist'] = 'selected="true"'; } ?> <script> $(document).ready(function() { $('.coursewasselect').click(function() { var currentId = $(this).attr('href'); currentId = currentId.replace("#courses-", ""); $.post('<?php echo $CFG['wwwroot'] . "/save.php"; ?>