lib.php 1.0 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. //adds gradeimporter to add new activity page
  3. function tool_devcourse_extend_navigation_course($navigation, $course, $coursecontext) {
  4. $url = new moodle_url('/admin/tool/devcourse/index.php');
  5. $devcoursenode = navigation_node::create('Development course', $url, navigation_node::TYPE_CUSTOM, 'Dev course', 'devcourse');
  6. $navigation->add_node($devcoursenode);
  7. }
  8. function gradeimporter_add_instance ($data, $mform) {
  9. global $DB;
  10. $cmid = $data->coursemodule;
  11. $gradeimporterid = $DB->insert_record("gradeimporter", $data);
  12. $data->id = $gradeimporterid;
  13. $context = context_module::instance($cmid);
  14. $gradeimporter = $DB->get_record('gradeimporter', array('id' => $gradeimporterid), '*', MUST_EXIST);
  15. // iassign_grade_item($gradeimporter);
  16. // log event -----------------------------------------------------
  17. iassign_log::add_log('add_gradeimporter', 'name: ' . $data->name, $cmid);
  18. // log event -----------------------------------------------------
  19. return $iassign->id;
  20. }