ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/course/report.php000064400000002530152266565060022222 0ustar00get_record('course', array('id'=>$id), '*', MUST_EXIST); $PAGE->set_pagelayout('standard'); require_login($course); $context = context_course::instance($course->id); require_capability('moodle/site:viewreports', $context); // basic capability for listing of reports $strreports = get_string('reports'); $PAGE->set_url(new moodle_url('/course/report.php', array('id'=>$id))); $PAGE->set_title($course->fullname.': '.$strreports); $PAGE->set_heading($course->fullname.': '.$strreports); echo $OUTPUT->header(); $reports = core_component::get_plugin_list('coursereport'); foreach ($reports as $report => $reportdirectory) { $pluginfile = $reportdirectory.'/mod.php'; if (file_exists($pluginfile)) { ob_start(); include($pluginfile); // Fragment for listing $html = ob_get_contents(); ob_end_clean(); // add div only if plugin accessible if ($html !== '') { echo '
'; echo $html; echo '
'; } } } echo $OUTPUT->footer(); home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/scorm/report.php000064400000010052152267012450022611 0ustar00. // This script uses installed report plugins to print scorm reports. require_once("../../config.php"); require_once($CFG->libdir.'/tablelib.php'); require_once($CFG->dirroot.'/mod/scorm/locallib.php'); require_once($CFG->dirroot.'/mod/scorm/reportsettings_form.php'); require_once($CFG->dirroot.'/mod/scorm/report/reportlib.php'); require_once($CFG->libdir.'/formslib.php'); define('SCORM_REPORT_DEFAULT_PAGE_SIZE', 20); define('SCORM_REPORT_ATTEMPTS_ALL_STUDENTS', 0); define('SCORM_REPORT_ATTEMPTS_STUDENTS_WITH', 1); define('SCORM_REPORT_ATTEMPTS_STUDENTS_WITH_NO', 2); $id = required_param('id', PARAM_INT);// Course Module ID, or ... $download = optional_param('download', '', PARAM_RAW); $mode = optional_param('mode', '', PARAM_ALPHA); // Report mode. $action = optional_param('action', '', PARAM_ALPHA); $attemptids = optional_param_array('attemptid', [], PARAM_RAW); $cm = get_coursemodule_from_id('scorm', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $scorm = $DB->get_record('scorm', array('id' => $cm->instance), '*', MUST_EXIST); $contextmodule = context_module::instance($cm->id); $reportlist = scorm_report_list($contextmodule); $url = new moodle_url('/mod/scorm/report.php'); $url->param('id', $id); if (empty($mode)) { $mode = reset($reportlist); } else if (!in_array($mode, $reportlist)) { throw new \moodle_exception('erroraccessingreport', 'scorm'); } $url->param('mode', $mode); $PAGE->set_url($url); require_login($course, false, $cm); $PAGE->set_pagelayout('report'); require_capability('mod/scorm:viewreport', $contextmodule); if ($action == 'delete' && has_capability('mod/scorm:deleteresponses', $contextmodule) && confirm_sesskey()) { if (scorm_delete_responses($attemptids, $scorm)) { // Delete responses. redirect($PAGE->url, get_string('scormresponsedeleted', 'scorm'), null, \core\output\notification::NOTIFY_SUCCESS); } } // Activate the secondary nav tab. navigation_node::override_active_url(new moodle_url('/mod/scorm/report.php', ['id' => $id])); if (count($reportlist) < 1) { throw new \moodle_exception('erroraccessingreport', 'scorm'); } // Trigger a report viewed event. $event = \mod_scorm\event\report_viewed::create(array( 'context' => $contextmodule, 'other' => array( 'scormid' => $scorm->id, 'mode' => $mode ) )); $event->add_record_snapshot('course_modules', $cm); $event->add_record_snapshot('scorm', $scorm); $event->trigger(); $userdata = null; if (!empty($download)) { $noheader = true; } // Print the page header. if (empty($noheader)) { $strreport = get_string('report', 'scorm'); $strattempt = get_string('attempt', 'scorm'); $PAGE->set_title("$course->shortname: ".format_string($scorm->name)); $PAGE->set_heading($course->fullname); $PAGE->activityheader->set_attrs([ 'hidecompletion' => true, 'description' => '' ]); $PAGE->navbar->add($strreport, new moodle_url('/mod/scorm/report.php', array('id' => $cm->id))); echo $OUTPUT->header(); } // Open the selected Scorm report and display it. $classname = "scormreport_{$mode}\\report"; $legacyclassname = "scorm_{$mode}_report"; $report = class_exists($classname) ? new $classname() : new $legacyclassname(); $report->display($scorm, $cm, $course, $download); // Run the report! // Print footer. if (empty($noheader)) { echo $OUTPUT->footer(); } home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/lesson/report.php000064400000041525152267036600023005 0ustar00. /** * Displays the lesson statistics. * * @package mod_lesson * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late **/ require_once('../../config.php'); require_once($CFG->dirroot.'/mod/lesson/locallib.php'); $id = required_param('id', PARAM_INT); // Course Module ID $pageid = optional_param('pageid', null, PARAM_INT); // Lesson Page ID $action = optional_param('action', 'reportoverview', PARAM_ALPHA); // action to take $nothingtodisplay = false; $cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST)); require_login($course, false, $cm); $currentgroup = groups_get_activity_group($cm, true); $context = context_module::instance($cm->id); require_capability('mod/lesson:viewreports', $context); $url = new moodle_url('/mod/lesson/report.php', array('id'=>$id)); $url->param('action', $action); if ($pageid !== null) { $url->param('pageid', $pageid); } $PAGE->set_url($url); if ($action == 'reportdetail') { $PAGE->navbar->add(get_string('report', 'lesson'), $url); } $lessonoutput = $PAGE->get_renderer('mod_lesson'); $PAGE->activityheader->set_description(''); $reportactionmenu = new \mod_lesson\output\report_action_menu($id, $url); $reportactionarea = $lessonoutput->render($reportactionmenu); if ($action === 'delete') { /// Process any form data before fetching attempts, grades and times if (has_capability('mod/lesson:edit', $context) and $form = data_submitted() and confirm_sesskey()) { /// Cycle through array of userids with nested arrays of tries if (!empty($form->attempts)) { foreach ($form->attempts as $userid => $tries) { // Modifier IS VERY IMPORTANT! What does it do? // Well, it is for when you delete multiple attempts for the same user. // If you delete try 1 and 3 for a user, then after deleting try 1, try 3 then // becomes try 2 (because try 1 is gone and all tries after try 1 get decremented). // So, the modifier makes sure that the submitted try refers to the current try in the // database - hope this all makes sense :) $modifier = 0; foreach ($tries as $try => $junk) { $try -= $modifier; /// Clean up the timer table by removing using the order - this is silly, it should be linked to specific attempt (skodak) $timers = $lesson->get_user_timers($userid, 'starttime', 'id', $try, 1); if ($timers) { $timer = reset($timers); $DB->delete_records('lesson_timer', array('id' => $timer->id)); } $params = array ("userid" => $userid, "lessonid" => $lesson->id); // Remove the grade from the grades tables - this is silly, it should be linked to specific attempt (skodak). $grades = $DB->get_records_sql("SELECT id FROM {lesson_grades} WHERE userid = :userid AND lessonid = :lessonid ORDER BY completed", $params, $try, 1); if ($grades) { $grade = reset($grades); $DB->delete_records('lesson_grades', array('id' => $grade->id)); } /// Remove attempts and update the retry number $DB->delete_records('lesson_attempts', array('userid' => $userid, 'lessonid' => $lesson->id, 'retry' => $try)); $DB->execute("UPDATE {lesson_attempts} SET retry = retry - 1 WHERE userid = ? AND lessonid = ? AND retry > ?", array($userid, $lesson->id, $try)); /// Remove seen branches and update the retry number $DB->delete_records('lesson_branch', array('userid' => $userid, 'lessonid' => $lesson->id, 'retry' => $try)); $DB->execute("UPDATE {lesson_branch} SET retry = retry - 1 WHERE userid = ? AND lessonid = ? AND retry > ?", array($userid, $lesson->id, $try)); /// update central gradebook lesson_update_grades($lesson, $userid); $modifier++; } } } } redirect(new moodle_url($PAGE->url, array('action'=>'reportoverview'))); } else if ($action === 'reportoverview') { /************************************************************************** this action is for default view and overview view **************************************************************************/ // Get the table and data for build statistics. list($table, $data) = lesson_get_overview_report_table_and_data($lesson, $currentgroup); if ($table === false) { echo $lessonoutput->header($lesson, $cm, $action, false, null, get_string('nolessonattempts', 'lesson')); echo $reportactionarea; if (!empty($currentgroup)) { $groupname = groups_get_group_name($currentgroup); echo $OUTPUT->notification(get_string('nolessonattemptsgroup', 'lesson', $groupname)); } else { echo $OUTPUT->notification(get_string('nolessonattempts', 'lesson')); } groups_print_activity_menu($cm, $url); echo $OUTPUT->footer(); exit(); } echo $lessonoutput->header($lesson, $cm, $action, false, null, get_string('overview', 'lesson')); echo $reportactionarea; groups_print_activity_menu($cm, $url); $course_context = context_course::instance($course->id); if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) { $seeallgradeslink = new moodle_url('/grade/report/grader/index.php', array('id'=>$course->id)); $seeallgradeslink = html_writer::link($seeallgradeslink, get_string('seeallcoursegrades', 'grades')); echo $OUTPUT->box($seeallgradeslink, 'allcoursegrades'); } // The attempts table. $attemptstable = html_writer::table($table); // The HTML that we will be displaying which includes the attempts table and bulk actions menu, if necessary. $attemptshtml = $attemptstable; // Show bulk actions when user has capability to edit the lesson. if (has_capability('mod/lesson:edit', $context)) { $reporturl = new moodle_url('/mod/lesson/report.php'); $formid = 'mod-lesson-report-form'; // Sesskey hidden input. $formcontents = html_writer::empty_tag('input', ['type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()]); // CMID hidden input. $formcontents .= html_writer::empty_tag('input', ['type' => 'hidden', 'name' => 'id', 'value' => $cm->id]); // Attempts table. $formcontents .= $attemptstable; // Bulk actions menu. $attemptsactions = [ 'delete' => get_string('deleteselected') ]; $bulkactions = new single_select($reporturl, 'action', $attemptsactions, '', ['' => 'choosedots'], $formid); $bulkactions->set_label(get_string('withselectedattempts', 'lesson')); $bulkactions->disabled = true; $bulkactions->attributes = [ 'data-action' => 'toggle', 'data-togglegroup' => 'lesson-attempts', 'data-toggle' => 'action', ]; $bulkactionshtml = $OUTPUT->render($bulkactions); $formcontents .= $OUTPUT->box($bulkactionshtml, 'center'); // Build the attempts form. $formattributes = [ 'id' => $formid, 'method' => 'post', ]; $attemptshtml = html_writer::tag('form', $formcontents, $formattributes); } // Show the attempts HTML. echo $attemptshtml; // Calculate the Statistics. if ($data->avetime == null) { $data->avetime = get_string("notcompleted", "lesson"); } else { $data->avetime = format_float($data->avetime / $data->numofattempts, 0); $data->avetime = format_time($data->avetime); } if ($data->hightime == null) { $data->hightime = get_string("notcompleted", "lesson"); } else { $data->hightime = format_time($data->hightime); } if ($data->lowtime == null) { $data->lowtime = get_string("notcompleted", "lesson"); } else { $data->lowtime = format_time($data->lowtime); } if ($data->lessonscored) { if ($data->numofattempts == 0) { $data->avescore = get_string("notcompleted", "lesson"); } else { $data->avescore = format_float($data->avescore, 2) . '%'; } if ($data->highscore === null) { $data->highscore = get_string("notcompleted", "lesson"); } else { $data->highscore .= '%'; } if ($data->lowscore === null) { $data->lowscore = get_string("notcompleted", "lesson"); } else { $data->lowscore .= '%'; } // Display the full stats for the lesson. echo $OUTPUT->heading(get_string('lessonstats', 'lesson'), 3); $stattable = new html_table(); $stattable->head = array(get_string('averagescore', 'lesson'), get_string('averagetime', 'lesson'), get_string('highscore', 'lesson'), get_string('lowscore', 'lesson'), get_string('hightime', 'lesson'), get_string('lowtime', 'lesson')); $stattable->align = array('center', 'center', 'center', 'center', 'center', 'center'); $stattable->attributes['class'] = 'standardtable generaltable table table-hover'; $stattable->data[] = array($data->avescore, $data->avetime, $data->highscore, $data->lowscore, $data->hightime, $data->lowtime); } else { // Display simple stats for the lesson. echo $OUTPUT->heading(get_string('lessonstats', 'lesson'), 3); $stattable = new html_table(); $stattable->head = array(get_string('averagetime', 'lesson'), get_string('hightime', 'lesson'), get_string('lowtime', 'lesson')); $stattable->align = array('center', 'center', 'center'); $stattable->attributes['class'] = 'standardtable generaltable table table-hover'; $stattable->data[] = array($data->avetime, $data->hightime, $data->lowtime); } echo html_writer::table($stattable); } else if ($action === 'reportdetail') { /************************************************************************** this action is for a student detailed view and for the general detailed view General flow of this section of the code 1. Generate a object which holds values for the statistics for each question/answer 2. Cycle through all the pages to create a object. Foreach page, see if the student actually answered the page. Then process the page appropriatly. Display all info about the question, Highlight correct answers, show how the user answered the question, and display statistics about each page 3. Print out info about the try (if needed) 4. Print out the object which contains all the try info **************************************************************************/ echo $lessonoutput->header($lesson, $cm, $action, false, null, get_string('detailedstats', 'lesson')); echo $reportactionarea; groups_print_activity_menu($cm, $url); $course_context = context_course::instance($course->id); if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) { $seeallgradeslink = new moodle_url('/grade/report/grader/index.php', array('id'=>$course->id)); $seeallgradeslink = html_writer::link($seeallgradeslink, get_string('seeallcoursegrades', 'grades')); echo $OUTPUT->box($seeallgradeslink, 'allcoursegrades'); } $formattextdefoptions = new stdClass; $formattextdefoptions->para = false; //I'll use it widely in this page $formattextdefoptions->overflowdiv = true; $userid = optional_param('userid', null, PARAM_INT); // if empty, then will display the general detailed view $try = optional_param('try', null, PARAM_INT); list($answerpages, $userstats) = lesson_get_user_detailed_report_data($lesson, $userid, $try); /// actually start printing something $table = new html_table(); $table->wrap = array(); $table->width = "60%"; if (!empty($userid)) { // if looking at a students try, print out some basic stats at the top // print out users name //$headingobject->lastname = $students[$userid]->lastname; //$headingobject->firstname = $students[$userid]->firstname; //$headingobject->attempt = $try + 1; //print_heading(get_string("studentattemptlesson", "lesson", $headingobject)); echo $OUTPUT->heading(get_string('attempt', 'lesson', $try+1), 3); $table->head = array(); $table->align = array('right', 'left'); $table->attributes['class'] = 'table table-striped'; if (empty($userstats->gradeinfo)) { $table->align = array("center"); $table->data[] = array(get_string("notcompleted", "lesson")); } else { $user = $DB->get_record('user', array('id' => $userid)); $gradeinfo = lesson_grade($lesson, $try, $user->id); $table->data[] = array(get_string('name').':', $OUTPUT->user_picture($user, array('courseid'=>$course->id)).fullname($user, true)); $table->data[] = array(get_string("timetaken", "lesson").":", format_time($userstats->timetotake)); $table->data[] = array(get_string("completed", "lesson").":", userdate($userstats->completed)); $table->data[] = array(get_string('rawgrade', 'lesson').':', $userstats->gradeinfo->earned.'/'.$userstats->gradeinfo->total); $table->data[] = array(get_string("gradenoun").":", $userstats->grade."%"); } echo html_writer::table($table); // Don't want this class for later tables $table->attributes['class'] = ''; } foreach ($answerpages as $page) { $table->align = array('left', 'left'); $table->size = array('70%', null); $table->attributes['class'] = 'table table-striped'; unset($table->data); if ($page->grayout) { // set the color of text $fontstart = html_writer::start_tag('span', array('class' => 'dimmed_text')); $fontend = html_writer::end_tag('span'); $fontstart2 = $fontstart; $fontend2 = $fontend; } else { $fontstart = ''; $fontend = ''; $fontstart2 = ''; $fontend2 = ''; } $table->head = array($fontstart2.$page->qtype.": ".format_string($page->title).$fontend2, $fontstart2.get_string("classstats", "lesson").$fontend2); $table->data[] = array($fontstart.get_string("question", "lesson").":
".$fontend.$fontstart2.$page->contents.$fontend2, " "); $table->data[] = array($fontstart.get_string("answer", "lesson").":".$fontend, ' '); // apply the font to each answer if (!empty($page->answerdata) && !empty($page->answerdata->answers)) { foreach ($page->answerdata->answers as $answer){ $modified = array(); foreach ($answer as $single) { // need to apply a font to each one $modified[] = $fontstart2.$single.$fontend2; } $table->data[] = $modified; } if (isset($page->answerdata->response)) { $table->data[] = array($fontstart.get_string("response", "lesson").":
".$fontend .$fontstart2.$page->answerdata->response.$fontend2, " "); } $table->data[] = array($page->answerdata->score, " "); } else { $table->data[] = array(get_string('didnotanswerquestion', 'lesson'), " "); } echo html_writer::table($table); } } else { throw new \moodle_exception('unknowaction'); } /// Finish the page echo $OUTPUT->footer(); home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/choice/report.php000064400000031304152267041650022727 0ustar00$id)); if ($download !== '') { $url->param('download', $download); } if ($action !== '') { $url->param('action', $action); } $PAGE->set_url($url); if (! $cm = get_coursemodule_from_id('choice', $id)) { throw new \moodle_exception("invalidcoursemodule"); } if (! $course = $DB->get_record("course", array("id" => $cm->course))) { throw new \moodle_exception("coursemisconf"); } require_login($course, false, $cm); $context = context_module::instance($cm->id); require_capability('mod/choice:readresponses', $context); if (!$choice = choice_get_choice($cm->instance)) { throw new \moodle_exception('invalidcoursemodule'); } $strchoice = get_string("modulename", "choice"); $strchoices = get_string("modulenameplural", "choice"); $strresponses = get_string("responses", "choice"); $eventdata = array(); $eventdata['objectid'] = $choice->id; $eventdata['context'] = $context; $eventdata['courseid'] = $course->id; $eventdata['other']['content'] = 'choicereportcontentviewed'; $event = \mod_choice\event\report_viewed::create($eventdata); $event->trigger(); if (data_submitted() && has_capability('mod/choice:deleteresponses', $context) && confirm_sesskey()) { if ($action === 'delete') { // Delete responses of other users. choice_delete_responses($attemptids, $choice, $cm, $course); redirect("report.php?id=$cm->id"); } if (preg_match('/^choose_(\d+)$/', $action, $actionmatch)) { // Modify responses of other users. $newoptionid = (int)$actionmatch[1]; choice_modify_responses($userids, $attemptids, $newoptionid, $choice, $cm, $course); redirect("report.php?id=$cm->id"); } } $groupmode = groups_get_activity_groupmode($cm); if (!$download) { $PAGE->set_title(format_string($choice->name).": $strresponses"); $PAGE->set_heading($course->fullname); $PAGE->activityheader->set_attrs([ 'hidecompletion' => true, 'description' => '' ]); echo $OUTPUT->header(); echo $OUTPUT->heading($strresponses); /// Check to see if groups are being used in this choice if ($groupmode) { groups_get_activity_group($cm, true); $groupsactivitymenu = groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/choice/report.php?id=' . $id, true); echo html_writer::div($groupsactivitymenu, 'mb-2'); } } else { // Trigger the report downloaded event. $eventdata = array(); $eventdata['context'] = $context; $eventdata['courseid'] = $course->id; $eventdata['other']['content'] = 'choicereportcontentviewed'; $eventdata['other']['format'] = $download; $eventdata['other']['choiceid'] = $choice->id; $event = \mod_choice\event\report_downloaded::create($eventdata); $event->trigger(); } // Check if we want to include responses from inactive users. $onlyactive = $choice->includeinactive ? false : true; $users = choice_get_response_data($choice, $cm, $groupmode, $onlyactive); // TODO Does not support custom user profile fields (MDL-70456). $extrafields = \core_user\fields::get_identity_fields($context, false); if ($download == "ods" && has_capability('mod/choice:downloadresponses', $context)) { require_once("$CFG->libdir/odslib.class.php"); /// Calculate file name $shortname = format_string($course->shortname, true, array('context' => $context)); $choicename = format_string($choice->name, true, array('context' => $context)); $filename = clean_filename("$shortname " . strip_tags($choicename)) . '.ods'; /// Creating a workbook $workbook = new MoodleODSWorkbook("-"); /// Send HTTP headers $workbook->send($filename); /// Creating the first worksheet $myxls = $workbook->add_worksheet($strresponses); /// Print names of all the fields $i = 0; $myxls->write_string(0, $i++, get_string("lastname")); $myxls->write_string(0, $i++, get_string("firstname")); // Add headers for extra user fields. foreach ($extrafields as $field) { $myxls->write_string(0, $i++, \core_user\fields::get_display_name($field)); } $myxls->write_string(0, $i++, get_string("group")); $myxls->write_string(0, $i++, get_string("choice", "choice")); // Generate the data for the body of the spreadsheet. $row = 1; if ($users) { foreach ($users as $option => $userid) { if (!($choice->showunanswered == 0 && $option == 0)) { $option_text = choice_get_option_text($choice, $option); foreach ($userid as $user) { $i = 0; $myxls->write_string($row, $i++, $user->lastname); $myxls->write_string($row, $i++, $user->firstname); foreach ($extrafields as $field) { $myxls->write_string($row, $i++, $user->$field); } $ug2 = ''; if ($usergrps = groups_get_all_groups($course->id, $user->id)) { foreach ($usergrps as $ug) { $ug2 = $ug2 . $ug->name; } } $myxls->write_string($row, $i++, $ug2); if (isset($option_text)) { $myxls->write_string($row, $i++, format_string($option_text, true)); } $row++; } } } } /// Close the workbook $workbook->close(); exit; } //print spreadsheet if one is asked for: if ($download == "xls" && has_capability('mod/choice:downloadresponses', $context)) { require_once("$CFG->libdir/excellib.class.php"); /// Calculate file name $shortname = format_string($course->shortname, true, array('context' => $context)); $choicename = format_string($choice->name, true, array('context' => $context)); $filename = clean_filename("$shortname " . strip_tags($choicename)) . '.xls'; /// Creating a workbook $workbook = new MoodleExcelWorkbook("-"); /// Send HTTP headers $workbook->send($filename); /// Creating the first worksheet $myxls = $workbook->add_worksheet($strresponses); /// Print names of all the fields $i = 0; $myxls->write_string(0, $i++, get_string("lastname")); $myxls->write_string(0, $i++, get_string("firstname")); // Add headers for extra user fields. foreach ($extrafields as $field) { $myxls->write_string(0, $i++, \core_user\fields::get_display_name($field)); } $myxls->write_string(0, $i++, get_string("group")); $myxls->write_string(0, $i++, get_string("choice", "choice")); // Generate the data for the body of the spreadsheet. $row = 1; if ($users) { foreach ($users as $option => $userid) { $i = 0; if (!($choice->showunanswered == 0 && $option == 0)) { $option_text = choice_get_option_text($choice, $option); foreach($userid as $user) { $i = 0; $myxls->write_string($row, $i++, $user->lastname); $myxls->write_string($row, $i++, $user->firstname); foreach ($extrafields as $field) { $myxls->write_string($row, $i++, $user->$field); } $ug2 = ''; if ($usergrps = groups_get_all_groups($course->id, $user->id)) { foreach ($usergrps as $ug) { $ug2 = $ug2 . $ug->name; } } $myxls->write_string($row, $i++, $ug2); if (isset($option_text)) { $myxls->write_string($row, $i++, format_string($option_text, true)); } $row++; } } } } /// Close the workbook $workbook->close(); exit; } // print text file if ($download == "txt" && has_capability('mod/choice:downloadresponses', $context)) { $shortname = format_string($course->shortname, true, array('context' => $context)); $choicename = format_string($choice->name, true, array('context' => $context)); $filename = clean_filename("$shortname " . strip_tags($choicename)) . '.txt'; header("Content-Type: application/download\n"); header("Content-Disposition: attachment; filename=\"$filename\""); header("Expires: 0"); header("Cache-Control: must-revalidate,post-check=0,pre-check=0"); header("Pragma: public"); /// Print names of all the fields echo get_string("lastname") . "\t" . get_string("firstname") . "\t"; // Add headers for extra user fields. foreach ($extrafields as $field) { echo \core_user\fields::get_display_name($field) . "\t"; } echo get_string("group"). "\t"; echo get_string("choice","choice"). "\n"; /// generate the data for the body of the spreadsheet $i=0; if ($users) { foreach ($users as $option => $userid) { if (!($choice->showunanswered == 0 && $option == 0)) { $option_text = choice_get_option_text($choice, $option); foreach($userid as $user) { echo $user->lastname . "\t"; echo $user->firstname . "\t"; foreach ($extrafields as $field) { echo $user->$field . "\t"; } $ug2 = ''; if ($usergrps = groups_get_all_groups($course->id, $user->id)) { foreach ($usergrps as $ug) { $ug2 = $ug2. $ug->name; } } echo $ug2. "\t"; if (isset($option_text)) { echo format_string($option_text,true); } echo "\n"; } } } } exit; } $results = prepare_choice_show_results($choice, $course, $cm, $users); $renderer = $PAGE->get_renderer('mod_choice'); echo $renderer->display_result($results, true); //now give links for downloading spreadsheets. if (!empty($users) && has_capability('mod/choice:downloadresponses',$context)) { $downloadoptions = array(); $options = array(); $options["id"] = "$cm->id"; $options["download"] = "ods"; $button = $OUTPUT->single_button(new moodle_url("report.php", $options), get_string("downloadods")); $downloadoptions[] = html_writer::tag('li', $button, array('class' => 'reportoption list-inline-item')); $options["download"] = "xls"; $button = $OUTPUT->single_button(new moodle_url("report.php", $options), get_string("downloadexcel")); $downloadoptions[] = html_writer::tag('li', $button, array('class' => 'reportoption list-inline-item')); $options["download"] = "txt"; $button = $OUTPUT->single_button(new moodle_url("report.php", $options), get_string("downloadtext")); $downloadoptions[] = html_writer::tag('li', $button, array('class' => 'reportoption list-inline-item')); $downloadlist = html_writer::tag('ul', implode('', $downloadoptions), array('class' => 'list-inline inline')); $downloadlist .= html_writer::tag('div', '', array('class' => 'clearfloat')); echo html_writer::tag('div',$downloadlist, array('class' => 'downloadreport mt-1')); } echo $OUTPUT->footer(); home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/h5pactivity/report.php000064400000010262152267120140023736 0ustar00. /** * Prints an instance of mod_h5pactivity. * * @package mod_h5pactivity * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ use mod_h5pactivity\local\manager; use mod_h5pactivity\event\report_viewed; require(__DIR__.'/../../config.php'); require_once(__DIR__.'/lib.php'); $userid = optional_param('userid', null, PARAM_INT); $attemptid = optional_param('attemptid', null, PARAM_INT); // Attempts have only the instance id information but system events // have only cmid. To prevent unnecesary db queries, this page accept both. $id = optional_param('id', null, PARAM_INT); if (empty($id)) { $a = required_param('a', PARAM_INT); list ($course, $cm) = get_course_and_cm_from_instance($a, 'h5pactivity'); } else { list ($course, $cm) = get_course_and_cm_from_cmid($id, 'h5pactivity'); } require_login($course, true, $cm); $currentgroup = groups_get_activity_group($cm, true); $manager = manager::create_from_coursemodule($cm); $report = $manager->get_report($userid, $attemptid, $currentgroup); if (!$report) { throw new \moodle_exception('permissiondenied'); } $user = $report->get_user(); $attempt = $report->get_attempt(); $moduleinstance = $manager->get_instance(); $context = $manager->get_context(); $params = ['a' => $cm->instance]; if ($user) { $params['userid'] = $user->id; } if ($attempt) { $params['attemptid'] = $attempt->get_id(); } $PAGE->set_url('/mod/h5pactivity/report.php', $params); // Trigger event. $other = [ 'instanceid' => $params['a'], 'userid' => $params['userid'] ?? null, 'attemptid' => $params['attemptid'] ?? null, ]; $event = report_viewed::create([ 'objectid' => $moduleinstance->id, 'context' => $context, 'other' => $other, ]); $event->add_record_snapshot('course', $course); $event->add_record_snapshot('h5pactivity', $moduleinstance); $event->trigger(); $shortname = format_string($course->shortname, true, ['context' => $context]); $pagetitle = strip_tags($shortname.': '.format_string($moduleinstance->name)); $PAGE->set_title(format_string($pagetitle)); $PAGE->activityheader->disable(); $navbar = []; if ($manager->can_view_all_attempts()) { // Report navbar have 3 levels for teachers: // - Participants list // - Participant attempts list // - Individual attempt details. $nav = [get_string('attempts', 'mod_h5pactivity'), null]; if ($user) { $nav[1] = new moodle_url('/mod/h5pactivity/report.php', ['a' => $cm->instance]); $navbar[] = $nav; $nav = [fullname($user), null]; if ($attempt) { $nav[1] = new moodle_url('/mod/h5pactivity/report.php', ['a' => $cm->instance, 'userid' => $user->id]); } } $navbar[] = $nav; } else { // Report navbar have 2 levels for a regular participant: // - My attempts // - Individual attempt details. $nav = [get_string('myattempts', 'mod_h5pactivity'), null]; if ($attempt) { $nav[1] = new moodle_url('/mod/h5pactivity/report.php', ['a' => $cm->instance]); } $navbar[] = $nav; } if ($attempt) { $navbar[] = [get_string('attempt_number', 'mod_h5pactivity', $attempt->get_attempt()), null]; } foreach ($navbar as $nav) { $PAGE->navbar->add($nav[0], $nav[1]); } $PAGE->set_heading(format_string($course->fullname)); $PAGE->set_context($context); echo $OUTPUT->header(); groups_print_activity_menu($cm, $PAGE->url); echo html_writer::start_div('mt-4'); echo $report->print(); echo html_writer::end_div(); echo $OUTPUT->footer(); home/smkb8269/moodledata/lang/id/report.php000066600000002054152267661300014450 0ustar00. /** * Strings for component 'report', language 'id', version '5.0'. * * @package report * @category string * @copyright 1999 Martin Dougiamas and contributors * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $string['privacy:metadata'] = 'Sistem Laporan tidak menyimpan data pribadi apa pun.';