12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- function tool_devcourse_extend_navigation_course($navigation, $course, $coursecontext) {
- $url = new moodle_url('/admin/tool/devcourse/index.php');
- $devcoursenode = navigation_node::create('Development course', $url, navigation_node::TYPE_CUSTOM, 'Dev course', 'devcourse');
- $navigation->add_node($devcoursenode);
- }
- function gradeimporter_supports($feature) {
- switch($feature) {
- case FEATURE_MOD_INTRO: return true;
- case FEATURE_SHOW_DESCRIPTION: return true;
-
- default: return null;
- }
- }
- function gradeimporter_add_instance ($data, $mform) {
-
- global $DB;
- $data->timemodified = time();
-
- $data->id = $DB->insert_record("gradeimporter", $data);
-
- return $data->id;
- }
- function gradeimporter_update_instance ($data){
-
- global $DB;
- $data->timemodified = time();
- $data->id = $data->instance;
- return $DB->update_record('gradeimporter', $data);
- }
- function gradeimporter_delete_instance($data){
-
- global $DB;
-
- if (!$data = $DB->get_record('gradeimporter', array('id'=>$id) ) ){
- return false;
- }
- $cm = get_coursemodule_from_instance('gradeimporter', $gradeimporter->id);
- $context = context_module::instance($cm->id);
-
- $fs = get_file_storage();
- $fs->delete_area_files($context->id, 'mod_gradeimporter');
-
-
- $DB->delete_records('gradeimporter_submission', array('gradeimporterid' => $gradeimporter->id));
- $DB->delete_records('gradeimporter_feedback', array('gradeimporterid' => $gradeimporter->id));
-
- $DB->delete_records('gradeimporter', array('id'=>$id) );
- return true;
- }
|