Bläddra i källkod

Update 'settings.php'

Synchronizing iAssign Git with the current iAssign stable version (until Moodle 5.0).
Small changes in: ilm_manager.php, lang/*/iassign.php
Bigger changes in: ilm_manager_form.php, lib.php, settings_form.php, settings.php, version.php, backup/moodle2/*.php, ilm_debug/escreva.php, ilm_handlers/java.php
New iLM versions: iassign/ilm/iFractions/, iassign/ilm/iHanoi/, iassign/ilm/iVProg/
New file (was missing): settings_activities.php
leo 2 veckor sedan
förälder
incheckning
010ba0f5ec
1 ändrade filer med 23 tillägg och 5 borttagningar
  1. 23 5
      settings.php

+ 23 - 5
settings.php

@@ -108,12 +108,14 @@ if ($action == 'view') { // in Admin interface after "click" over "Activities mo
   $action_add = new popup_action('click', $url_add, 'popup', array('width' => 900, 'height' => 650));
   $link_add = $OUTPUT->action_link($url_add, get_string('add_ilm_iassign', 'iassign'), $action_add) . $OUTPUT->help_icon('add_ilm_iassign', 'iassign');
 
-  //2022/02
+  //2022/02 'settings_see_activities' = "See all the iLM activies"
+  //TODO $link_see_activities = "http://.../mod/iassign/settings_activities.php?action=activities" for now 'settings_activities.php' requires "&courseid=422&ilm_id=61"
   $url_activities = new moodle_url('/mod/iassign/settings_activities.php', array('action' => 'activities')); // examine the data base of all iLM activities
   $action_activities = new popup_action('click', $url_activities, 'popup', array('width' => 900, 'height' => 650));
   $link_see_activities = $OUTPUT->action_link($url_activities, get_string('settings_see_activities', 'iassign'), $action_activities) . $OUTPUT->help_icon('settings_see_activities', 'iassign');
   //$link_see_activities = "";
 
+  //TODO To be used to see all the activities (for now is necessary to provide a given course to a specfic iLM, through it {modules}.id)
   $url_import = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'import'));
   $action_import = new popup_action('click', $url_import, 'popup', array('width' => 900, 'height' => 650));
   $link_import = $OUTPUT->action_link($url_import, get_string('import_ilm', 'iassign'), $action_import) . $OUTPUT->help_icon('import_ilm', 'iassign');
@@ -121,11 +123,17 @@ if ($action == 'view') { // in Admin interface after "click" over "Activities mo
   // First list all iLM from type HTML, then the "applets"
   // $iassign_ilms = $DB->get_records('iassign_ilm', array('parent' => 0)); // id, version, parent, name
   // {iassign_ilm} : id name version type description url extension parent file_jar file_class width height enable timemodified author timecreated evaluate reevaluate editingbehavior submissionbehavior action_buttons
-  $iassign_ilms = $DB->get_records_sql("SELECT id,type,description,name,parent,url,version,extension,evaluate,reevaluate,editingbehavior,submissionbehavior FROM {iassign_ilm} WHERE parent=0 ORDER BY type");
+  
+  // In upgrade could get erro if field 'reevaluate' does not exists
+  // $iassign_ilms = $DB->get_records_sql("SELECT id,type,description,name,parent,url,version,extension,evaluate,reevaluate,editingbehavior,submissionbehavior FROM {iassign_ilm} WHERE parent=0 ORDER BY type");
+  $iassign_ilms = $DB->get_records_sql("SELECT * FROM {iassign_ilm} WHERE parent=0 ORDER BY type");
 
+  // Put at the first line of the iLM table: "Add iLM" "See all the activities" "Import iLM"
   $str .= '<table id="outlinetable" class="generaltable boxaligncenter" cellpadding="5" width="100%">' . chr(13);
   $str .= '<tr><td colspan=2 align=left>' . $link_add . "</td>\n";
   $str .= "<td align=right></td>\n"; //2022/02
+  //TODO $str .= "<td align=right>" . $link_see_activities . "</td>\n"; //TODO It will presents the option 'settings_see_activities' - must provide {course}.id and {modules}.id
+  //TODO $link_see_activities = "http://.../mod/iassign/settings_activities.php?action=activities&courseid=422&ilm_id=61"
   $str .= '<td colspan=2 align=right>' . $link_import . "</td>\n";
   $str .= "</tr>\n";
 
@@ -241,8 +249,9 @@ else if ($action == 'confirm_upgrade') {
   $settings->add(new admin_setting_heading('iassign', get_string('upgrade_ilm_title', 'iassign'), $str));
   } // else if ($action == 'confirm_upgrade')
 
-else if ($action == 'config') { // Administration > plugins > iAssign : after "click" over the "gear" icon (at right of the iLM line) reaches this point
-  //D echo "<br/><br/><br/><br/><br/><br/>settings.php: action==config: ilm_id=" . $ilm_id . "<br/>";
+else if ($action == 'config') {
+  // Administration > plugins > iAssign : after "click" over the "gear" icon (at right of the iLM line) reaches this point
+  // Presents basic information about this iLM
 
   $url_return = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign'));
   $link_return = $OUTPUT->action_link($url_return, get_string('return', 'iassign'));
@@ -303,8 +312,12 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after "c
       elseif ($ilm_parent->enable == 1 && $total == 0) {
         $link_visible = $OUTPUT->action_link($url_visible, iassign_icons::insert('hide_ilm'));
         }
+      else if ($ilm_parent->enable == 0) { // unlock = Unlock
+        // $link_visible = '&nbsp;' . iassign_icons::insert('unlock'); - 'unlock' = 'Unlock'
+        $link_visible = $OUTPUT->action_link($url_visible, iassign_icons::insert('show_ilm'));
+        }
       else {
-        $link_visible = '&nbsp;' . iassign_icons::insert('unlock');
+        $link_visible = $OUTPUT->action_link($url_visible, iassign_icons::insert('hide_ilm'));
         }
 
       $url_copy = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'copy', 'ilm_id' => $ilm_parent->id));
@@ -398,7 +411,12 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after "c
         $enable = get_string('no', 'iassign');
       $str .= '<td width="50%"><strong>' . get_string('enable', 'iassign') . ':</strong>&nbsp;' . $enable . '</td></tr>' . chr(13);
 
+      // 'The iLM name of directory (HTML/JS) or iLM package (Java JAR)'
+      // This field name is heritage from the first implementation of iAssign allowing only to integrate Java
       $str .= '<tr><td width="50%" title="field: file_jar"><strong>' . get_string('file_jar', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->file_jar . '</td>' . chr(13);
+      
+      // 'Initial file name ("*.html", if HTML; or "*.class", if Java)'
+      // This field name is heritage from the first implementation of iAssign allowing only to integrate Java
       $str .= '<td width="50%" title="field: file_class"><strong>' . get_string('file_class', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->file_class . '</td></tr>' . chr(13);
 
       $str .= '<tr><td width="50%" title="field: extension"><strong>' . get_string('extension', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->extension . '</td>' . chr(13);