Browse Source

Improved better activities list

Igor 4 years ago
parent
commit
8f2dd47acc
4 changed files with 36 additions and 36 deletions
  1. BIN
      icon/__comment_unread.gif
  2. BIN
      icon/comment_unread.gif
  3. 1 1
      lang/en/iassign.php
  4. 35 35
      locallib.php

BIN
icon/__comment_unread.gif


BIN
icon/comment_unread.gif


+ 1 - 1
lang/en/iassign.php

@@ -273,7 +273,7 @@ $string['hbar_orange_r']                  = '';
 $string['hbar_red']                       = '';
 $string['hbar_red_r']                     = '';
 $string['height']                         = 'Height';
-$string['help_ilm']                       = 'on the iLM';
+$string['help_ilm']                       = 'About iLM';
 $string['helpactivitygroup']              = 'Seen by group type?';
 $string['helpactivitygroup_help']         = '<p>If this option is on the activities will be grouped by type, otherwise they will be displayed in a single block in the order of registration.</p>';
 $string['helpchoose_file']                = 'iLM file';

+ 35 - 35
locallib.php

@@ -1316,8 +1316,8 @@ class iassign {
 
     // helpbutton('legend', get_string('legend', 'iassign'), 'iassign', $image = true, $linktext = false, $text = '', $return = false,
     // $imagetext = '');
-    print '<strong>' . get_string('legend', 'iassign') . '</strong>';
-    print '&nbsp;' . iassign_icons::insert('correct') . '&nbsp;' . get_string('correct', 'iassign');
+    print '<strong>' . get_string('legend', 'iassign') . '</strong> <br>';
+    print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . iassign_icons::insert('correct') . '&nbsp;' . get_string('correct', 'iassign');
     print '&nbsp;' . iassign_icons::insert('incorrect') . '&nbsp;' . get_string('incorrect', 'iassign');
     print '&nbsp;' . iassign_icons::insert('post') . '&nbsp;' . get_string('post', 'iassign');
     print '&nbsp;' . iassign_icons::insert('not_post') . '&nbsp;' . get_string('not_post', 'iassign');
@@ -1328,7 +1328,7 @@ class iassign {
       print '</td>' . "\n";
       if ($this->action != 'print') {
         $link_print = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=print&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('print') . '&nbsp;' . get_string('print', 'iassign') . "</a>";
-        $link_stats = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=stats&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('results') . '&nbsp;' . get_string('graphic', 'iassign') . "</a>";
+        //$link_stats = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=stats&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('results') . '&nbsp;' . get_string('graphic', 'iassign') . "</a>";
         $link_export = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=export_csv&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('export_ilm') . '&nbsp;' . get_string('export_csv', 'iassign') . "</a>";
         $link_auto_evaluate = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=auto_evaluate&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('correct') . '&nbsp;' . get_string('auto_evaluate_reprocess', 'iassign') . "</a>";
         print '<td width=15% align="right">' . $link_stats . '</td>' . "\n";
@@ -1338,12 +1338,6 @@ class iassign {
         } // if ($this->action != 'print')
       print '</tr></table>' . "\n";
       } // if (has_capability('mod/iassign:viewreport', $this->context, $USER->id) && $this->action == 'report')
-    elseif (has_capability('mod/iassign:submitiassign', $this->context, $USER->id)) {
-      $link_stats = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=stats_student&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('results') . '&nbsp;' . get_string('results', 'iassign') . "</a>";
-      print '<td width=15% align="right">' . $link_stats . '</td>' . "\n";
-      print '</tr></table>' . "\n";
-      } // elseif (has_capability('mod/iassign:submitiassign', $this->context, $USER->id))
-    else
       print '</td></tr></table>' . "\n";
     } // function view_legend_icons()
 
@@ -2803,36 +2797,32 @@ class iassign {
     else if ($notice != '')
       print($OUTPUT->notification(get_string($notice, 'iassign'), 'notifysuccess'));
 
-    print $OUTPUT->box_start();
 
-    print '<table width=100% border=0><tr>' . "\n";
+    //print '<table width=100% border=0><tr>' . "\n";
     $url_help = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'list', 'ilm_id' => 1));
     $action_help = new popup_action('click', $url_help, 'iplookup', array('title' => get_string('help_ilm', 'iassign'), 'width' => 1200, 'height' => 700));
 
-    $link_help = $OUTPUT->action_link($url_help, iassign_icons::insert('help_ilm') . get_string('help_ilm', 'iassign'), $action_help);
-    $link_add = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=add&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('add_iassign') . get_string('add_iassign', 'iassign') . "</a>";
-    $link_report = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=report&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('view_report') . get_string('report', 'iassign') . "</a>";
+    $link_help = $OUTPUT->action_link($url_help, iassign_icons::insert('help_ilm') . ' ' . get_string('help_ilm', 'iassign'), $action_help);
+    $link_add = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=add&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('add_iassign') . ' ' . get_string('add_iassign', 'iassign') . "</a>";
+    $link_report = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=report&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('view_report') . ' ' . get_string('report', 'iassign') . "</a>";
 
     // TODO: esta consulta esta sendo feita novamente na linha +/- 2258
     if (has_capability('mod/iassign:viewiassignall', $this->context, $USER->id)) {
       // could be "has_capability('mod/iassign:viewiassignall', $this->context, $USER->id)"
       // Has capability to see "report": teacher or up
-      print '<td width=10% align="left">' . "\n";
-      print $link_help;
-      print '</td>' . "\n";
-      print '<td width=10% align="left">' . "\n";
-      print $link_report;
-      print '</td>' . "\n";
       } // if (has_capability('mod/iassign:viewiassignall', $this->context, $USER->id))
     if (has_capability('mod/iassign:editiassign', $this->context, $USER->id)) {
-      print '<td width=15% align="left">' . "\n";
-      print $link_add;
-      print "</td>\n";
+      //print '<td width=15% align="left">' . "\n";
+      //print $link_add;
+      //print "</td>\n";
       } // if (has_capability('mod/iassign:editiassign', $this->context, $USER->id))
+    
+    //print '</tr></table>' . "\n";
+
+
+    print '<div style="float: right;">';
     if (has_capability('mod/iassign:editiassign', $this->context, $USER->id)) {
       if ($iassign_list) {
-        print '<td align="right">' . "\n";
-
         // $USER->iassignEdit == 0 view 'Turn editing off'
         // $USER->iassignEdit == 1 view 'Turn editing on'
         if (!isset($USER->iassignEdit))
@@ -2850,15 +2840,22 @@ class iassign {
         print "\n<form name='formEditPost' id='formEditPost' method='post' action='$editPost' enctype='multipart/form-data'>\n";
         print " <input type=submit value='$bottonEdit_message'/>\n";
         print "</form>\n";
-        print "</td>\n";
+        print "<br><br>";
         } // if ($iassign_list)
       }
-    print '</tr></table>' . "\n";
-
-    if (has_capability('mod/iassign:submitiassign', $this->context, $USER->id))
-      $this->view_legend_icons();
-
-    print $OUTPUT->box_end();
+    if (has_capability('mod/iassign:editiassign', $this->context, $USER->id)) {
+      print $link_add . '<br><br>';
+      print $link_report . '<br><br>';
+      }
+    if (has_capability('mod/iassign:submitiassign', $this->context, $USER->id)) {
+      $link_stats = "<a href='" . $CFG->wwwroot . "/mod/iassign/view.php?id=" . $id . "&action=stats_student&iassignid=" . $this->iassign->id . "'>" . iassign_icons::insert('results') . '&nbsp;' . get_string('results', 'iassign') . "</a>";
+      print '<td width=15% align="right">' . $link_stats . '</td>' . "\n";
+      print '</tr></table>' . "\n";
+    } // if (has_capability('mod/iassign:submitiassign', $this->context, $USER->id))
+    if (has_capability('mod/iassign:editiassign', $this->context, $USER->id)) {
+      print '<br><br>'.$link_help . '<br><br>';
+    }
+    print '</div>';
 
     $iassign_array_exercise = array();
     $i_exercise = 0;
@@ -2895,15 +2892,15 @@ class iassign {
         }
 
       if ($iassign_array_exercise) {
-        $title = get_string('exercise', 'iassign');
+        $title = get_string('exercise', 'iassign').(count($iassign_array_exercise)>1?'s':'');
         $this->show_iassign($title, $iassign_array_exercise, $i_exercise);
         }
       if ($iassign_array_test) {
-        $title = get_string('test', 'iassign');
+        $title = get_string('test', 'iassign').(count($iassign_array_test)>1?'s':'');
         $this->show_iassign($title, $iassign_array_test, $i_test);
         }
       if ($iassign_array_example) {
-        $title = get_string('example', 'iassign');
+        $title = get_string('example', 'iassign').(count($iassign_array_example)>1?'s':'');;
         $this->show_iassign($title, $iassign_array_example, $i_example);
         }
       if ($iassign_array_general) {
@@ -2934,6 +2931,9 @@ class iassign {
         print $OUTPUT->box_end();
         } // if (has_capability('mod/iassign:editiassign', $this->context, $USER->id))
       } // if (count($iassign_list) > 5 && !(has_capability('mod/iassign:submitiassign', $this->context, $USER->id)))
+      
+      if (has_capability('mod/iassign:submitiassign', $this->context, $USER->id))
+        $this->view_legend_icons();
     } // function view_iassigns()