Browse Source

Update 'settings.php'

Considering table 'iassign_ilm': messages to fields 'evaluate', 'reevaluate', 'editingbehavior'; fixes to allow the edition of 'reevaluate', 'editingbehavior'
leo 2 years ago
parent
commit
ea952f46d8
1 changed files with 101 additions and 67 deletions
  1. 101 67
      settings.php

+ 101 - 67
settings.php

@@ -6,6 +6,10 @@
  * It provides a link to the iAssign general configurations area ('pluginname').
  * 
  * Release Notes:
+ * - v 2.0.1 2022/09/15
+ *   + Considering table 'iassign_ilm': messages to fields 'evaluate', 'reevaluate', 'editingbehavior'; fixes to allow the edition of 'reevaluate', 'editingbehavior'
+ * - v 2.0.0 2022/02/22
+ *   + New option to see all activities of a given iLM (./mod/iassign/settings_activities.php?action=activities&ilm_id=38)
  * - v 1.9.3 2020/08/03
  *   + Debug security added into "else if ($action == 'config')": if (!isset($ilm) || !$ilm) return;* - v 1.9.2 2020/02/15
  *   + Fixed 2 problems inside 'if ($ilm_parent)': 1. Error: '+' -> '.'; 2. Changed 'if (is_object($ilm_parent)) if (is_object($ilm_parent->description))'
@@ -28,12 +32,15 @@
  *   + Now view separate only iLMs for filter versions.
  * 
  * @author Patricia Alves Rodrigues
- * @author Leônidas O. Brandão
+ * @author Leo^nidas de Oliveira Branda~o
  * @version v 1.9.1 2017/12/02
  * @package mod_iassign_settings
  * @since 2010/09/27
  * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
  * 
+ * @calledby ./admin/search.php: every time enter 'search' Moodle class all plugin installed through its 'settings.php'
+ * @calledby ./admin/search.php: when choose iAssign setting enter here again
+ * 
  * <b>License</b> 
  *  - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -45,6 +52,14 @@ global $OUTPUT, $CFG, $DB;
 require_once($CFG->dirroot . '/mod/iassign/lib.php');
 require_once($CFG->dirroot . '/mod/iassign/locallib.php');
 
+if (!is_siteadmin()) { // ./lib/accesslib.php
+  print "Access denied!<br/>";
+  exit();
+  }
+
+//$context = context_module::instance($USER->cm); // usado no: ilm_handlers/html5.php
+//USER.{context}.id=" . $context->id
+
 $action = optional_param('action', 'view', PARAM_TEXT);
 $ilm_id = optional_param('ilm_id', 0, PARAM_INT);
 $ilm_param_id = optional_param('ilm_param_id', 0, PARAM_INT);
@@ -88,54 +103,67 @@ if (!file_exists($CFG->dirroot . '/lib/editor/tinymce/plugins/iassign/version.ph
   $str .= $OUTPUT->box_end();
   }
 
-if ($action == 'view') {
+if ($action == 'view') { // in Admin interface after "click" over "Activities modules" of iAssign, reaches this point
   $url_add = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'add'));
   $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
+  $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 = "";
+
   $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');
 
-  // First list all iLM from type HTML
+  // 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_ilms = $DB->get_records_sql("SELECT id, description, name, parent, url, version FROM {iassign_ilm} WHERE parent = 0 ORDER BY type");
+  // {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");
 
   $str .= '<table id="outlinetable" class="generaltable boxaligncenter" cellpadding="5" width="100%">' . chr(13);
-  $str .= '<tr><td colspan=2 align=left>' . $link_add . '</td>';
-  $str .= '<td colspan=2 align=right>' . $link_import . '</td></tr>';
+  $str .= '<tr><td colspan=2 align=left>' . $link_add . "</td>\n";
+  $str .= "<td align=right></td>\n"; //2022/02
+  $str .= '<td colspan=2 align=right>' . $link_import . "</td>\n";
+  $str .= "</tr>\n";
 
   if ($iassign_ilms) {
-
     foreach ($iassign_ilms as $ilm) {
+      //D echo " - iLM: id=" . $ilm->id . "; name=" . $ilm->name . "; extension=" . $ilm->extension . "<br/>\n";
+
+      // ./mod/iassign/icon/icon_see_activities.gif
+      $url_activities = new moodle_url('/mod/iassign/settings_activities.php', array('action' => 'activities', 'ilm_id' => $ilm->id)); // examine the data base of all iLM activities
+      $link_activities = $OUTPUT->action_link($url_activities, iassign_icons::insertIT('icon_see_activities','see_ilm_activities','see_ilm_activities')); // locallib.php: class 'iassign_icons'
+
       $url_config = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'config', 'ilm_id' => $ilm->id));
-      $link_config = $OUTPUT->action_link($url_config, iassign_icons::insert('config_ilm'));
+      $link_config = $OUTPUT->action_link($url_config, iassign_icons::insertIT('gear_bw_small','config_ilm','config_ilm')); // put the "gear" icon (at right): config_ilm = "Manager the configuration of iLM"
 
       $ilm_count = 1;
-      $ilm_version = 0;
-      //R $iassign_ilm_list = $DB->get_records('iassign_ilm', array('parent' => $ilm->id)); //*******************************************
+      $ilm_version = 0; //R $iassign_ilm_list = $DB->get_records('iassign_ilm', array('parent' => $ilm->id)); //_ other sintax to get iLM
       $iassign_ilm_list = $DB->get_records_sql("SELECT id, version FROM {iassign_ilm} WHERE parent = " . $ilm->id );
 
       if ($iassign_ilm_list) {
         foreach ($iassign_ilm_list as $ilm_parent) {
           $ilm_count++;
-          if (floatval(preg_replace('/[^0-9]+/', '', $ilm_parent->version)) > $ilm_version)
-            $ilm_version = floatval(preg_replace('/[^0-9]+/', '', $ilm_parent->version));
+          if (floatval(preg_replace('/[^0-9]+/', '', $ilm_parent->version)) > $ilm_version) $ilm_version = floatval(preg_replace('/[^0-9]+/', '', $ilm_parent->version));
           }
         }
 
       $str_sql = "SELECT COUNT(id) FROM {iassign_statement} WHERE iassign_ilmid =" . $ilm->id;
-      $iassign_count = $DB->count_records_sql($str_sql, null);
+      $iassign_count = $DB->count_records_sql($str_sql, null); // get the total of activities with this iLM
 
-      //R $iassign_ilm_parent = $DB->get_records('iassign_ilm', array('parent' => $ilm->id)); //*******************************************
+      // Count the number of iLM derived from '$ilm'
+      //R $iassign_ilm_parent = $DB->get_records('iassign_ilm', array('parent' => $ilm->id)); //_ other sintax to get iLM
       $iassign_ilm_parent = $DB->get_records_sql("SELECT id FROM {iassign_ilm} WHERE parent = " . $ilm->id);
       foreach ($iassign_ilm_parent as $ilm_parent) {
-        //R $iassign_statement = $DB->get_records('iassign_statement', array('iassign_ilmid' => $ilm_parent->id)); //*******************************************
-        //R if ($iassign_statement) { // $iassign_count += count($iassign_statement);
-          $str_sql_parents = "SELECT COUNT(id) FROM {iassign_statement} WHERE iassign_ilmid =" . $ilm_parent->id;
-          $iassign_count += $DB->count_records_sql($str_sql_parents, null);
-        //R   }
+        //R $iassign_statement = $DB->get_records('iassign_statement', array('iassign_ilmid' => $ilm_parent->id)); //_ other sintax to get iLM
+        //R if ($iassign_statement) { $iassign_count += count($iassign_statement); }
+        $str_sql_parents = "SELECT COUNT(id) FROM {iassign_statement} WHERE iassign_ilmid =" . $ilm_parent->id;
+        $iassign_count += $DB->count_records_sql($str_sql_parents, null);
         }
+      //D echo " &nbsp; &nbsp; #atividade derivadas do iLM id=" . $ilm->id . " : " . $iassign_count . "<br/>\n"; 
 
       $link_upgrade = "";
       $upgrade_file = $ilm->url . 'ilm-upgrade_' . strtolower($ilm->name) . '.xml';
@@ -158,26 +186,32 @@ if ($action == 'view') {
       else
         $str_description = $description_obj;
 
+      $str_info = 'type=' . $ilm->type . ', evaluate=' . $ilm->evaluate . ', reevaluate=' . $ilm->reevaluate . ', editingbehavior=' . $ilm->editingbehavior . ', submissionbehavior=' . $ilm->submissionbehavior;
       $str .= '<tr>';
-      $str .= '<td class="header c1" width=75% title="fields: name, description"><strong>' . $ilm->name . ' (' . $ilm->version . ')<br/>' .
-          $str_description . '</strong></td>' . chr(13);
+      $str .= '<td class="header c1" width=70% title="fields: name, description"><strong title="' . $str_info . '">' . $ilm->name . ' (' . $ilm->version . ')<br/>' .
+        $str_description . '</strong></td>' . chr(13);
 
       $str .= '<td class="header c1" width=10% ><strong>' . get_string('versions_ilm', 'iassign') . ':</strong>&nbsp;' . $ilm_count . '</td>' . chr(13);
       $str .= '<td class="header c1" width=10% ><strong>' . get_string('activities', 'iassign') . ':</strong>&nbsp;' . $iassign_count . '</td>' . chr(13);
-      $str .= '<td class="header c1" width=5% align=center valign=bottom>' . $link_upgrade . '&nbsp;&nbsp;' . $link_config . '</td>' . chr(13);
-      $str .= '</tr>';
+
+      //$str .= '<td class="header c1" width=5% ><strong>' . get_string('see_activities', 'iassign') . ':</strong>&nbsp;' . $link_see_activities . '</td>' . chr(13);
+      $str .= '<td class="header c1" width=5% align="center">' . $link_activities . '</td>' . chr(13);
+      //$str .= "<td></td>\n"; //$link_see_activities = ""; //2022/02
+
+      $str .= '<td class="header c1" width=5% align="center">' . $link_upgrade . '&nbsp;&nbsp;' . $link_config . '</td>' . chr(13); //  valign=bottom
+      $str .= '</tr>' . chr(13);
       } // foreach ($iassign_ilms as $ilm)
     } // if ($iassign_ilms)
-  $str .= '</table>';
+  $str .= '</table>' . chr(13);
 
+  // Print the iLM table
   $settings->add(new admin_setting_heading('iassign', get_string('config_ilm', 'iassign') . $OUTPUT->help_icon('modulename', 'iassign'), $str));
+
   } // if ($action == 'view')
 else if ($action == 'confirm_upgrade') {
-
   $ilm = $DB->get_record('iassign_ilm', array('id' => $ilm_id));
 
   $upgrade_file = $ilm->url . 'ilm-upgrade_' . strtolower($ilm->name) . '.xml';
-
   $upgrade_xml = @simplexml_load_file($upgrade_file, null, LIBXML_NOCDATA);
 
   $lang = current_language();
@@ -187,10 +221,8 @@ else if ($action == 'confirm_upgrade') {
   else
     $description = $upgrade_xml->description->en;
 
-
   $str .= '<table id="outlinetable" class="generaltable boxaligncenter" width="100%">' . chr(13);
   $str .= '<tr><td>' . $description;
-
   $str .= '</td></tr></table>';
 
   $optionsno = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'view'));
@@ -204,15 +236,13 @@ else if ($action == 'confirm_upgrade') {
   $url_no = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'view'));
   $link_no = $OUTPUT->action_link($url_no, "<b>" . get_string('no', 'iassign') . "</b>");
 
-
   $str .= $link_no . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $link_yes . "</center>";
 
-
   $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 select the iLM reaches this point
-  //D echo "settings.php: action==config<br/>";
+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/>";
 
   $url_return = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign'));
   $link_return = $OUTPUT->action_link($url_return, get_string('return', 'iassign'));
@@ -222,18 +252,22 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
   $link_new_version = $OUTPUT->action_link($url_new_version, get_string('new_version_ilm', 'iassign'), $action_new_version);
 
   $str .= '<table id="outlinetable" class="generaltable boxaligncenter" cellpadding="5" width="100%">' . chr(13);
-  $str .= '<tr><td colspan=2 align=left>' . $link_return . '</td><td colspan=1 align=right>' . $link_new_version . '</td></tr>';
+  $str .= '<tr><td colspan=2 align=left>' . $link_return . '</td><td colspan=1 align=right>' . $link_new_version . '</td></tr>' . chr(13);
 
   $ilm = $DB->get_record('iassign_ilm', array('id' => $ilm_id));
 
   if (!isset($ilm) || !$ilm) return; // debug security...
 
-  $iassign_ilm_parent = $DB->get_records_sql(
-    'SELECT s.* FROM {iassign_ilm} s WHERE s.parent = :parent ORDER BY s.version DESC', array('parent' => $ilm->id));
+  // $sql_query = 'SELECT s.* FROM {iassign_ilm} s WHERE s.parent = :parent ORDER BY s.version DESC'; // must find ":parent" is $ilm->id
+  $sql_query = 'SELECT s.* FROM {iassign_ilm} s WHERE s.parent = '. $ilm->id . ' ORDER BY s.version DESC'; // more efficient, one string replacement less
+  $iassign_ilm_parent = $DB->get_records_sql($sql_query, array('parent' => $ilm->id));
   array_unshift($iassign_ilm_parent, $ilm);
 
   if ($iassign_ilm_parent) {
+    //D echo "<br/><br/>iassign_ilm_parent: " . $sql_query . "<br/>"; $conta = 0; //hoje
+
     foreach ($iassign_ilm_parent as $ilm_parent) {
+      //D echo $conta . ": ilm_parent="; print_r($ilm_parent); echo "<br/>\n"; $conta++; //hoje
 
       $url_default = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'confirm_default_ilm', 'ilm_id' => $ilm_parent->id, 'ilm_parent' => $ilm->id));
       if (count($iassign_ilm_parent) == 1)
@@ -287,8 +321,7 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
         }
       else
         $link_delete = iassign_icons::insert('delete_ilm_disable');
-      
-      
+
       if (strtolower($ilm_parent->type) == 'html5') {
         $url_delete = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'confirm_delete_ilm', 'ilm_id' => $ilm_parent->id, 'ilm_parent' => $ilm->id));
         $link_delete = $OUTPUT->action_link($url_delete, iassign_icons::insert('delete_ilm'));
@@ -340,7 +373,7 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
           $str_description = $description_obj;
         }
       $str .= '<td width="50%"><strong>' . get_string('description', 'iassign') . ':</strong>&nbsp;' .
-              $str_description . '</td>'; // iassign_language::get_description_lang($current_language, $ilm_parent->description)
+              $str_description . '</td>' . chr(13); // iassign_language::get_description_lang($current_language, $ilm_parent->description)
 
       $str .= '<td width="50%"><strong>' . get_string('activities', 'iassign') . ':</strong>&nbsp;' . $total . '</td>' . chr(13);
       $str .= '</tr>' . chr(13);
@@ -348,9 +381,9 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
       $langs_str = iassign_language::get_all_lang($ilm_parent->description);
       $str .= '<tr>';
       if ($langs_str != "")
-        $str .= '<td><strong>' . get_string('language_label', 'iassign') . ':</strong>&nbsp;' . $langs_str . '</td>';
-      $str .= '<td><strong>' . get_string('type_ilm', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->type . '</td>';
-      $str .= '</tr>';
+        $str .= '<td><strong>' . get_string('language_label', 'iassign') . ':</strong>&nbsp;' . $langs_str . '</td>' . chr(13);
+      $str .= '<td><strong>' . get_string('type_ilm', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->type . '</td>' . chr(13);
+      $str .= '</tr>' . chr(13);
 
       
       if (strtolower($ilm_parent->type) == 'java') {
@@ -363,31 +396,32 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
         $enable = get_string('yes', 'iassign');
       else
         $enable = get_string('no', 'iassign');
-      $str .= '<td width="50%"><strong>' . get_string('enable', 'iassign') . ':</strong>&nbsp;' . $enable . '</td></tr>';
+      $str .= '<td width="50%"><strong>' . get_string('enable', 'iassign') . ':</strong>&nbsp;' . $enable . '</td></tr>' . chr(13);
 
-      $str .= '<tr><td width="50%" title="field: file_jar"><strong>' . get_string('file_jar', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->file_jar . '</td>';
-      $str .= '<td width="50%" title="field: file_class"><strong>' . get_string('file_class', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->file_class . '</td></tr>';
+      $str .= '<tr><td width="50%" title="field: file_jar"><strong>' . get_string('file_jar', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->file_jar . '</td>' . chr(13);
+      $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>';
+      $str .= '<tr><td width="50%" title="field: extension"><strong>' . get_string('extension', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->extension . '</td>' . chr(13);
       $str .= '<td width="50%" title="field: width"><strong>' . get_string('width', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->width;
-      $str .= '&nbsp;&nbsp;<strong>' . get_string('height', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->height . '</td></tr>';
+      $str .= '&nbsp;&nbsp;<strong>' . get_string('height', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->height . '</td></tr>' . chr(13);
 
+      // Field 'iassign_ilm.evaluate'
       if ($ilm_parent->evaluate == 1)
-        $evaluate = get_string('yes', 'iassign');
+        $opt_evaluate = get_string('yes', 'iassign');
       else
-        $evaluate = get_string('no', 'iassign');
-
-      $str .= '<tr><td width="50%" title="field: evaluate"><strong>' . get_string('evaluate', 'iassign') . ':</strong>&nbsp;' . $evaluate . '</td>';
-
+        $opt_evaluate = get_string('no', 'iassign');
+      $str .= '<tr><td width="50%" title="field: evaluate"><strong>' . get_string('evaluate', 'iassign') . ':</strong>&nbsp;' . $opt_evaluate . '</td>' . chr(13);
       if ($ilm_parent->reevaluate == 1)
-        $reevaluate = get_string('yes', 'iassign');
+        $opt_reevaluate = get_string('yes', 'iassign');
       else
-        $reevaluate = get_string('no', 'iassign');
-      $str .= '<td width="50%"><strong>' . get_string('auto_evaluate_name_config', 'iassign') . ':</strong>&nbsp;' . $reevaluate . '</td></tr>';
-      
-      $str .= '<tr><td><strong>' . get_string('editing_behavior_view', 'iassign') . ':</strong> ';
+        $opt_reevaluate = get_string('no', 'iassign');
+
+      // Field 'iassign_ilm.reevaluate.'
+      $str .= '<td width="50%"><strong>' . get_string('auto_evaluate_name_config', 'iassign') . ':</strong>&nbsp;' . $opt_reevaluate . '</td></tr>' . chr(13);
 
-      if ($ilm_parent->editingbehavior == 0) {
+      // Field 'iassign_ilm.editingbehavior'
+      $str .= '<tr><td><strong>' . get_string('editing_behavior_view', 'iassign') . ':</strong> ';
+      if ($ilm_parent->editingbehavior == 0) { // 'iassign_ilm.editingbehavior' = 1 => the iLM allows the editing of a previous submission
         $str .=  get_string('editing_behavior_0', 'iassign');
       } elseif ($ilm_parent->editingbehavior == 1) {
         $str .=  get_string('editing_behavior_1', 'iassign');
@@ -399,10 +433,10 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
       } elseif ($ilm_parent->submissionbehavior == 1) {
         $str .= get_string('submission_behavior_1', 'iassign');
       }
-      $str .= '</td></tr>';
+      $str .= '</td></tr>' . chr(13);
 
       $str .= '<tr>' . chr(13);
-      $str .= '<td width="50%"><strong>' . get_string('file_created', 'iassign') . ':</strong>&nbsp;' . userdate($ilm_parent->timecreated) . '</td>';
+      $str .= '<td width="50%"><strong>' . get_string('file_created', 'iassign') . ':</strong>&nbsp;' . userdate($ilm_parent->timecreated) . '</td>' . chr(13);
       $str .= '<td width="50%"><strong>' . get_string('file_modified', 'iassign') . ':</strong>&nbsp;' . userdate($ilm_parent->timemodified) . '</td>' . chr(13);
       $str .= '</tr>' . chr(13);
 
@@ -410,7 +444,7 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
       $user_ilm = $DB->get_record('user', array('id' => $ilm_parent->author));
       if ($user_ilm) {
         $str .= '<tr>' . chr(13);
-        $str .= '<td colspan=2><strong>' . get_string('author', 'iassign') . ':</strong>&nbsp;' . $user_ilm->firstname . '&nbsp;' . $user_ilm->lastname . '</td>';
+        $str .= '<td colspan=2><strong>' . get_string('author', 'iassign') . ':</strong>&nbsp;' . $user_ilm->firstname . '&nbsp;' . $user_ilm->lastname . '</td>' . chr(13);
         $str .= '</tr>' . chr(13);
         }
         
@@ -456,9 +490,9 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
         $link_delete_param = $OUTPUT->action_link($url_delete_param, iassign_icons::insert('delete_param'));
 
         $str .= '<tr>' . chr(13);
-        $str .= '<td>' . $ilm_config->param_name . '</td>';
-        $str .= '<td>' . $ilm_config->param_value . '</td>';
-        $str .= '<td width="50%">' . $ilm_config->description . '</td>';
+        $str .= '<td>' . $ilm_config->param_name . '</td>' . chr(13);
+        $str .= '<td>' . $ilm_config->param_value . '</td>' . chr(13);
+        $str .= '<td width="50%">' . $ilm_config->description . '</td>' . chr(13);
         $str .= '<td width="10%"><center>';
         $str .= $link_edit_param . '&nbsp;&nbsp;';
         $str .= $link_copy_param . '&nbsp;&nbsp;';
@@ -474,11 +508,11 @@ else if ($action == 'config') { // Administration > plugins > iAssign : after se
       $str .= '</tr>' . chr(13);
 
       $str .= '</table>';
-      $str .= '</td></tr>';
-      $str .= '</tr><td colspan="3"></td></tr>';
+      $str .= '</td></tr>' . chr(13);
+      $str .= '</tr><td colspan="3"></td></tr>' . chr(13);
       }
-    }
+    } // if ($iassign_ilm_parent)
   $str .= '</table>';
 
   $settings->add(new admin_setting_heading('iassign', $ilm->name . '&nbsp;', $str));
-  }
+  } // else if ($action == 'config')