bernardo 5 lat temu
rodzic
commit
063e541b04
4 zmienionych plików z 49 dodań i 0 usunięć
  1. 10 0
      index.php
  2. 0 0
      lib.php
  3. 31 0
      mod_form.php
  4. 8 0
      view.php

+ 10 - 0
index.php

@@ -0,0 +1,10 @@
+<?php
+    require_once('../../config.php');
+
+    $id = required_param('id', PARAM_INT);           // Course ID
+
+    // Ensure that the course specified is valid
+    if (!$course = $DB->get_record('course', array('id'=> $id))) {
+        print_error('Course ID is incorrect');
+    }
+?>

+ 0 - 0
lib.php


+ 31 - 0
mod_form.php

@@ -0,0 +1,31 @@
+<?php
+    if (!defined('MOODLE_INTERNAL')) {
+        die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
+    }
+
+    require_once($CFG->dirroot.'/course/moodleform_mod.php');
+    require_once($CFG->dirroot.'/mod/gradeImporter/lib.php');
+
+    class mod_gradeImporter_mod_form extends moodleform_mod {
+
+        function definition() {
+            global $CFG, $DB, $OUTPUT;
+
+            $mform =& $this->_form;
+
+            $mform->addElement('text', 'name', get_string('moduleName', 'mod_gradeImporter'), array('size'=>'64'));
+            $mform->setType('name', PARAM_TEXT);
+            $mform->addRule('name', null, 'required', null, 'client');
+
+            $ynoptions = array(0 => get_string('no'),
+                               1 => get_string('yes'));
+            $mform->addElement('select', 'usecode', 'USE CODE', $ynoptions);
+            $mform->setDefault('usecode', 0);
+            $mform->addHelpButton('usecode', 'usecode', 'certificate');
+
+            $this->standard_coursemodule_elements();
+
+            $this->add_action_buttons();
+            }
+    }
+?>

+ 8 - 0
view.php

@@ -0,0 +1,8 @@
+<?php
+    require('../../config.php');
+    require_once('lib.php');
+
+    $id = required_param('id', PARAM_INT);
+    list ($course, $cm) = get_course_and_cm_from_cmid($id, 'certificate');
+    $certificate = $DB->get_record('certificate', array('id'=> $cm->instance), '*', MUST_EXIST);
+?>