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mٛIDV=f-H}U]HA*vԶ3\Wh*I#$@6x^OZC&JU 16 XD*if&BDGFYYP[KLX uX .Z hq Ghb8M#Mqt\c> aT 00=㎨ʕGQԪR,ĜI9zӦJO3Rn`C5܊@QO1N.ؔ"I\YÖĐHdL\}IP~jm$ y; :ZGZVJv =&*UF#``R`*S+p\=) ҭ9k̮Ršx0'**ԑLkɺk+zJb#:|MZ ?j$ݼ &X)$6FY6ѕ/; J*nlC*ų_ ԕ{_6:\47ڷs4RmĊ=z *ʪXT[]5Bl#a-˙bv8@H|Rwe9A%5&M%Z02TN)&&GfM 儀oŒM;=.//k~ E"a9/3y,>lj>ZXy&εYP&h gec<``]!}i'c KQulFIʓ_\T58(+cJq~ [dgmm/`Xڙhtkq ו$"c[PVY[uɜ&#몵"ȾqC"ÜȔ!<Mj8u-dx*gϫtTLdKlaWڭ\~|7u`h(w֋cL=˼=FvcGs}зUBSМ;FI;Q$8+V|[CS쮙1%YP Q% LVVK+&,cIb]Vyi ~h?yF4"5As-F ݆x55P&E:W@f;}Gy^]U ITki 1 d﫠*cNh' cؗYnsL:b?H :kM~@8#Iqɔ~:f]P*i]H'fjhxTҗ1O:^t$1]UXz&tODT>(^s&3#N_/x-䬦? ~vU-W$4'ӎvRG|jySW?u4(1 G[ِ22jʎhrmoյشgRͮ%ϟѬ9 oR  n-&F-@hgY_qN;"2 !KJ  šA^, "aG8`=14=5Mqk>U@UT :RgjrKF.O$I9'=i}._ Default page
  • Your IP: 216.73.217.122
  • Server IP: 36.95.219.150
  • Server: Linux unisda-1 6.8.4-2-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-2 (2024-04-10T17:36Z) x86_64
  • Server Software: Apache/2.4.52 (Ubuntu)
  • PHP Version: 7.4.33
  • Buat File | Buat Folder
Edit File: lib.php
"; } else if ($question->type > 0) { // Choose one of a number $strchoose = get_string("choose"); echo ""; } else if ($question->type < 0) { // Choose several of a number $options = explode( ",", $question->options); echo $OUTPUT->notification("This question type not supported yet"); } echo ""; } /** * * @param int $qnum * @return string */ function survey_question_rowclass($qnum) { if ($qnum) { return $qnum % 2 ? 'r0' : 'r1'; } else { return 'r0'; } } /** * @global object * @global int * @global int * @param string $url */ function survey_print_graph($url) { global $CFG, $SURVEY_GHEIGHT, $SURVEY_GWIDTH; echo "wwwroot/mod/survey/graph.php?$url\" alt=\"".get_string("surveygraph", "survey")."\" />"; } /** * List the actions that correspond to a view of this module. * This is used by the participation report. * * Note: This is not used by new logging system. Event with * crud = 'r' and edulevel = LEVEL_PARTICIPATING will * be considered as view action. * * @return array */ function survey_get_view_actions() { return array('download','view all','view form','view graph','view report'); } /** * List the actions that correspond to a post of this module. * This is used by the participation report. * * Note: This is not used by new logging system. Event with * crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING * will be considered as post action. * * @return array */ function survey_get_post_actions() { return array('submit'); } /** * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the survey. * * @param MoodleQuickForm $mform form passed by reference */ function survey_reset_course_form_definition(&$mform) { $mform->addElement('header', 'surveyheader', get_string('modulenameplural', 'survey')); $mform->addElement('checkbox', 'reset_survey_answers', get_string('deleteallanswers','survey')); $mform->addElement('checkbox', 'reset_survey_analysis', get_string('deleteanalysis','survey')); $mform->disabledIf('reset_survey_analysis', 'reset_survey_answers', 'checked'); } /** * Course reset form defaults. * @return array */ function survey_reset_course_form_defaults($course) { return array('reset_survey_answers'=>1, 'reset_survey_analysis'=>1); } /** * Actual implementation of the reset course functionality, delete all the * survey responses for course $data->courseid. * * @global object * @param $data the data submitted from the reset course. * @return array status array */ function survey_reset_userdata($data) { global $DB; $componentstr = get_string('modulenameplural', 'survey'); $status = array(); $surveyssql = "SELECT ch.id FROM {survey} ch WHERE ch.course=?"; $params = array($data->courseid); if (!empty($data->reset_survey_answers)) { $DB->delete_records_select('survey_answers', "survey IN ($surveyssql)", $params); $DB->delete_records_select('survey_analysis', "survey IN ($surveyssql)", $params); $status[] = array('component'=>$componentstr, 'item'=>get_string('deleteallanswers', 'survey'), 'error'=>false); } if (!empty($data->reset_survey_analysis)) { $DB->delete_records_select('survey_analysis', "survey IN ($surveyssql)", $params); $status[] = array('component'=>$componentstr, 'item'=>get_string('deleteallanswers', 'survey'), 'error'=>false); } // No date shifting. // Any changes to the list of dates that needs to be rolled should be same during course restore and course reset. // See MDL-9367. return $status; } /** * @uses FEATURE_GROUPS * @uses FEATURE_GROUPINGS * @uses FEATURE_MOD_INTRO * @uses FEATURE_COMPLETION_TRACKS_VIEWS * @uses FEATURE_GRADE_HAS_GRADE * @uses FEATURE_GRADE_OUTCOMES * @param string $feature FEATURE_xx constant for requested feature * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose. */ function survey_supports($feature) { switch($feature) { case FEATURE_GROUPS: return true; case FEATURE_GROUPINGS: return true; case FEATURE_MOD_INTRO: return true; case FEATURE_COMPLETION_TRACKS_VIEWS: return true; case FEATURE_COMPLETION_HAS_RULES: return true; case FEATURE_GRADE_HAS_GRADE: return false; case FEATURE_GRADE_OUTCOMES: return false; case FEATURE_BACKUP_MOODLE2: return true; case FEATURE_SHOW_DESCRIPTION: return true; case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_COMMUNICATION; default: return null; } } /** * This function extends the settings navigation block for the site. * * It is safe to rely on PAGE here as we will only ever be within the module * context when this is called * * @param settings_navigation $settings * @param navigation_node $surveynode */ function survey_extend_settings_navigation(settings_navigation $settings, navigation_node $surveynode) { global $DB; $cm = get_coursemodule_from_id('survey', $settings->get_page()->cm->id); $context = context_module::instance($cm->id); // Check to see if groups are being used in this survey, confirm user can access. $groupmode = groups_get_activity_groupmode($cm); $currentgroup = groups_get_activity_group($cm, true); if (has_capability('mod/survey:readresponses', $context) && !($currentgroup === 0 && $groupmode == SEPARATEGROUPS && !has_capability('moodle/site:accessallgroups', $context))) { $survey = $DB->get_record("survey", ["id" => $cm->instance]); $url = new moodle_url('/mod/survey/report.php', ['id' => $cm->id]); if ($survey && ($survey->template != SURVEY_CIQ)) { $url->param('action', 'summary'); } else { $url->param('action', 'questions'); } $surveynode->add(get_string("responsereports", "survey"), $url); } } /** * Return a list of page types * @param string $pagetype current page type * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ function survey_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-survey-*'=>get_string('page-mod-survey-x', 'survey')); return $module_pagetype; } /** * Mark the activity completed (if required) and trigger the course_module_viewed event. * * @param stdClass $survey survey object * @param stdClass $course course object * @param stdClass $cm course module object * @param stdClass $context context object * @param string $viewed which page viewed * @since Moodle 3.0 */ function survey_view($survey, $course, $cm, $context, $viewed) { // Trigger course_module_viewed event. $params = array( 'context' => $context, 'objectid' => $survey->id, 'courseid' => $course->id, 'other' => array('viewed' => $viewed) ); $event = \mod_survey\event\course_module_viewed::create($params); $event->add_record_snapshot('course_modules', $cm); $event->add_record_snapshot('course', $course); $event->add_record_snapshot('survey', $survey); $event->trigger(); // Completion. $completion = new completion_info($course); $completion->set_module_viewed($cm); } /** * Helper function for ordering a set of questions by the given ids. * * @param array $questions array of questions objects * @param array $questionorder array of questions ids indicating the correct order * @return array list of questions ordered * @since Moodle 3.0 */ function survey_order_questions($questions, $questionorder) { $finalquestions = array(); foreach ($questionorder as $qid) { $finalquestions[] = $questions[$qid]; } return $finalquestions; } /** * Translate the question texts and options. * * @param stdClass $question question object * @return stdClass question object with all the text fields translated * @since Moodle 3.0 */ function survey_translate_question($question) { if ($question->text) { $question->text = get_string($question->text, "survey"); } if ($question->shorttext) { $question->shorttext = get_string($question->shorttext, "survey"); } if ($question->intro) { $question->intro = get_string($question->intro, "survey"); } if ($question->options) { $question->options = get_string($question->options, "survey"); } return $question; } /** * Returns the questions for a survey (ordered). * * @param stdClass $survey survey object * @return array list of questions ordered * @since Moodle 3.0 * @throws moodle_exception */ function survey_get_questions($survey) { global $DB; $questionids = explode(',', $survey->questions); if (! $questions = $DB->get_records_list("survey_questions", "id", $questionids)) { throw new moodle_exception('cannotfindquestion', 'survey'); } return survey_order_questions($questions, $questionids); } /** * Returns subquestions for a given question (ordered). * * @param stdClass $question questin object * @return array list of subquestions ordered * @since Moodle 3.0 */ function survey_get_subquestions($question) { global $DB; $questionids = explode(',', $question->multi); $questions = $DB->get_records_list("survey_questions", "id", $questionids); return survey_order_questions($questions, $questionids); } /** * Save the answer for the given survey * * @param stdClass $survey a survey object * @param array $answersrawdata the answers to be saved * @param stdClass $course a course object (required for trigger the submitted event) * @param stdClass $context a context object (required for trigger the submitted event) * @since Moodle 3.0 */ function survey_save_answers($survey, $answersrawdata, $course, $context) { global $DB, $USER; $answers = array(); // Sort through the data and arrange it. // This is necessary because some of the questions may have two answers, eg Question 1 -> 1 and P1. foreach ($answersrawdata as $key => $val) { if ($key != "userid" && $key != "id") { if (substr($key, 0, 1) == "q") { $key = clean_param(substr($key, 1), PARAM_ALPHANUM); // Keep everything but the 'q', number or P number. } if (substr($key, 0, 1) == "P") { $realkey = (int) substr($key, 1); $answers[$realkey][1] = $val; } else { $answers[$key][0] = $val; } } } // Now store the data. $timenow = time(); $answerstoinsert = array(); foreach ($answers as $key => $val) { if ($key != 'sesskey') { $newdata = new stdClass(); $newdata->time = $timenow; $newdata->userid = $USER->id; $newdata->survey = $survey->id; $newdata->question = $key; if (!empty($val[0])) { $newdata->answer1 = $val[0]; } else { $newdata->answer1 = ""; } if (!empty($val[1])) { $newdata->answer2 = $val[1]; } else { $newdata->answer2 = ""; } $answerstoinsert[] = $newdata; } } if (!empty($answerstoinsert)) { $DB->insert_records("survey_answers", $answerstoinsert); } // Update completion state. $cm = get_coursemodule_from_instance('survey', $survey->id, $course->id); $completion = new completion_info($course); if (isloggedin() && !isguestuser() && $completion->is_enabled($cm) && $survey->completionsubmit) { $completion->update_state($cm, COMPLETION_COMPLETE); } $params = array( 'context' => $context, 'courseid' => $course->id, 'other' => array('surveyid' => $survey->id) ); $event = \mod_survey\event\response_submitted::create($params); $event->trigger(); } /** * Check if the module has any update that affects the current user since a given time. * * @param cm_info $cm course module data * @param int $from the time to check updates from * @param array $filter if we need to check only specific updates * @return stdClass an object with the different type of areas indicating if they were updated or not * @since Moodle 3.2 */ function survey_check_updates_since(cm_info $cm, $from, $filter = array()) { global $DB, $USER; $updates = new stdClass(); if (!has_capability('mod/survey:participate', $cm->context)) { return $updates; } $updates = course_check_module_updates_since($cm, $from, array(), $filter); $updates->answers = (object) array('updated' => false); $select = 'survey = ? AND userid = ? AND time > ?'; $params = array($cm->instance, $USER->id, $from); $answers = $DB->get_records_select('survey_answers', $select, $params, '', 'id'); if (!empty($answers)) { $updates->answers->updated = true; $updates->answers->itemids = array_keys($answers); } // Now, teachers should see other students updates. if (has_capability('mod/survey:readresponses', $cm->context)) { $select = 'survey = ? AND time > ?'; $params = array($cm->instance, $from); if (groups_get_activity_groupmode($cm) == SEPARATEGROUPS) { $groupusers = array_keys(groups_get_activity_shared_group_members($cm)); if (empty($groupusers)) { return $updates; } list($insql, $inparams) = $DB->get_in_or_equal($groupusers); $select .= ' AND userid ' . $insql; $params = array_merge($params, $inparams); } $updates->useranswers = (object) array('updated' => false); $answers = $DB->get_records_select('survey_answers', $select, $params, '', 'id'); if (!empty($answers)) { $updates->useranswers->updated = true; $updates->useranswers->itemids = array_keys($answers); } } return $updates; } /** * This function receives a calendar event and returns the action associated with it, or null if there is none. * * This is used by block_myoverview in order to display the event appropriately. If null is returned then the event * is not displayed on the block. * * @param calendar_event $event * @param \core_calendar\action_factory $factory * @param int $userid User id to use for all capability checks, etc. Set to 0 for current user (default). * @return \core_calendar\local\event\entities\action_interface|null */ function mod_survey_core_calendar_provide_event_action(calendar_event $event, \core_calendar\action_factory $factory, int $userid = 0) { global $USER; if (empty($userid)) { $userid = $USER->id; } $cm = get_fast_modinfo($event->courseid, $userid)->instances['survey'][$event->instance]; $context = context_module::instance($cm->id); if (!has_capability('mod/survey:participate', $context, $userid)) { return null; } $completion = new \completion_info($cm->get_course()); $completiondata = $completion->get_data($cm, false, $userid); if ($completiondata->completionstate != COMPLETION_INCOMPLETE) { return null; } return $factory->create_instance( get_string('view'), new \moodle_url('/mod/survey/view.php', ['id' => $cm->id]), 1, true ); } /** * Add a get_coursemodule_info function in case any survey type wants to add 'extra' information * for the course (see resource). * * Given a course_module object, this function returns any "extra" information that may be needed * when printing this activity in a course listing. See get_array_of_activities() in course/lib.php. * * @param stdClass $coursemodule The coursemodule object (record). * @return cached_cm_info An object on information that the courses * will know about (most noticeably, an icon). */ function survey_get_coursemodule_info($coursemodule) { global $DB; $dbparams = ['id' => $coursemodule->instance]; $fields = 'id, name, intro, introformat, completionsubmit'; if (!$survey = $DB->get_record('survey', $dbparams, $fields)) { return false; } $result = new cached_cm_info(); $result->name = $survey->name; if ($coursemodule->showdescription) { // Convert intro to html. Do not filter cached version, filters run at display time. $result->content = format_module_intro('survey', $survey, $coursemodule->id, false); } // Populate the custom completion rules as key => value pairs, but only if the completion mode is 'automatic'. if ($coursemodule->completion == COMPLETION_TRACKING_AUTOMATIC) { $result->customdata['customcompletionrules']['completionsubmit'] = $survey->completionsubmit; } return $result; } /** * Callback which returns human-readable strings describing the active completion custom rules for the module instance. * * @param cm_info|stdClass $cm object with fields ->completion and ->customdata['customcompletionrules'] * @return array $descriptions the array of descriptions for the custom rules. */ function mod_survey_get_completion_active_rule_descriptions($cm) { // Values will be present in cm_info, and we assume these are up to date. if (empty($cm->customdata['customcompletionrules']) || $cm->completion != COMPLETION_TRACKING_AUTOMATIC) { return []; } $descriptions = []; foreach ($cm->customdata['customcompletionrules'] as $key => $val) { switch ($key) { case 'completionsubmit': if (!empty($val)) { $descriptions[] = get_string('completionsubmit', 'survey'); } break; default: break; } } return $descriptions; }