Browse Source

update readme, en language pack and shows in teacher interface

bernardo 5 years ago
parent
commit
afd2178a30
4 changed files with 62 additions and 8 deletions
  1. 28 1
      lang/en/gradeimporter.php
  2. 23 2
      lib.php
  3. 5 5
      mod_form.php
  4. 6 0
      readme.md

+ 28 - 1
lang/en/gradeimporter.php

@@ -5,4 +5,31 @@ $string['modulename'] = 'Grade Importer';
 $string['modulenameplural'] = 'Grade Importers';
 
 $string['gradeimporterintro'] = 'This module facilitates...';
-$string['gradeimportername'] = 'Grade Importer Name';
+$string['gradeimportername'] = 'Grade Importer Name';
+
+//formStrings
+
+    //Generic 
+    $string['description'] = 'Description';
+    $string['visibility'] = 'Can students see this?';
+
+    //Generic error Messages
+
+    //gradeImporter form
+    $string['instanceName'] = 'Name';
+    $string['visibilityOn'] = 'Students can see this';
+    $string['visibilityOff'] = 'Students can\'t see this';
+
+    //gradeImporter form errors
+    $string['error_instanceNameField'] = 'Insert a name';
+
+    //submission form
+    $string['submissionName'] = 'Name';
+    $string['gradebookN'] = 'This submission goes to gradebook';
+    $string['gradebookY'] = 'This submission does not go to gradebook';
+    $string['submissionFiles'] = 'Choose the students feedback file';
+    $string[''] = '';
+    $string[''] = '';
+
+    //submission form errors
+    $string['error_submissionNameField'] = 'Please insert a name for this submission';

+ 23 - 2
lib.php

@@ -1,7 +1,28 @@
 <?php
 
-function tool_devcourse_extend_navigation_course($navigation, $course, $coursecontext) {
+//adds gradeimporter to add new activity page
+    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_add_instance ($data, $mform) {
+    global $DB;
+  
+    $cmid = $data->coursemodule;
+  
+    $gradeimporterid = $DB->insert_record("gradeimporter", $data);
+    $data->id = $gradeimporterid;
+  
+    $context = context_module::instance($cmid);
+    $gradeimporter = $DB->get_record('gradeimporter', array('id' => $gradeimporterid), '*', MUST_EXIST);
+  
+   // iassign_grade_item($gradeimporter);
+  
+    // log event -----------------------------------------------------
+    iassign_log::add_log('add_gradeimporter', 'name: ' . $data->name, $cmid);
+    // log event -----------------------------------------------------
+  
+    return $iassign->id;
+    }

+ 5 - 5
mod_form.php

@@ -14,14 +14,14 @@
             $mform =& $this->_form;
             $course_modules_id = optional_param('update', 0, PARAM_INT);
 
-            $mform->addElement('text', 'name', get_string('instanceName', 'formStrings'), array('size'=>'64'));
+            $mform->addElement('text', 'name', get_string('instanceName', 'gradeimporter'), array('size'=>'64'));
             $mform->setType('name', PARAM_TEXT);
-            $mform->addRule('name', get_string('error_instanceNameField', 'formStrings'), 'required', null, 'client');
+            $mform->addRule('name', get_string('error_instanceNameField', 'gradeimporter'), 'required', null, 'client');
 
-            $this->standard_intro_elements(get_string('description', 'formStrings'));
+            $this->standard_intro_elements(get_string('description', 'gradeimporter'));
 
-            $ynoptions = array(0 => get_string('visibilityOn', 'formStrings'),
-                           1 => get_string('visibilityOff', 'formStrings'));
+            $ynoptions = array(0 => get_string('visibilityOn', 'gradeimporter'),
+                           1 => get_string('visibilityOff', 'gradeimporter'));
 
             $this->standard_coursemodule_elements();
 

+ 6 - 0
readme.md

@@ -1,3 +1,9 @@
 ### Important Links
+- [gradeimporter Repository](http://200.144.254.107/git/bernardo/gradeImporter)
 - [Moodle School](https://moodledev.moodle.school/ )
 - [Repository Plugin - MoodleDocs](https://docs.moodle.org/dev/Repository_plugins)
+- [Introduction to Activity modules](https://docs.moodle.org/dev/Activity_modules)
+- [String API](https://docs.moodle.org/dev/String_API)
+- [new module documentation](https://docs.moodle.org/dev/Tutorial)
+- [XMLDB - plugin to help build install.xml](https://docs.moodle.org/dev/Using_XMLDB)
+- [iassign repository - working activity plugin developed by LInE](http://200.144.254.107/git/LInE/iassign)