]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19692: Improvement to help icon for completion tickboxes, based on user testing
authorsam_marshall <sam_marshall>
Thu, 2 Jul 2009 09:18:26 +0000 (09:18 +0000)
committersam_marshall <sam_marshall>
Thu, 2 Jul 2009 09:18:26 +0000 (09:18 +0000)
course/format/topics/format.php
course/format/weeks/format.php
course/lib.php
lang/en_utf8/completion.php
lib/completionlib.php
theme/standard/styles_layout.css

index 67dee6735cf35b1df3ae9627da6b714055071c65..3eac76ac0668730b36abf8e6b9c7af9a20c95f29 100644 (file)
 
     echo skip_main_destination();
 
+    // Print the Your progress icon if the track completion is enabled
+    $completioninfo = new completion_info($course);
+    $completioninfo->print_help_icon();
+
     print_heading_block(get_string('topicoutline'), 'outline');
 
     // Note, an ordered list would confuse - "1" could be the clipboard or summary.
index 5f90f45844cf05d3b8ab0cd13d7d463831b702b9..4e6e171013cb9b18c66da8e0754c721bb72e92be 100644 (file)
     print_container_start();
 
     echo skip_main_destination();
+
+    //Print the Your progress icon if the track completion is enabled
+    $completioninfo = new completion_info($course);
+    $completioninfo->print_help_icon();
+
     print_heading_block(get_string('weeklyoutline'), 'outline');
 
     // Note, an ordered list would confuse - "1" could be the clipboard or summary.
index 3bc4d30e54ee7519660fbe9df9e82c8227875773..ba47511a2308b57b6bb7294a27b206cf77821297 100644 (file)
@@ -1458,7 +1458,6 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                     }
                 }
                 if ($completionicon) {
-                    static $shownhelp=false;
                     $imgsrc = $CFG->pixpath.'/i/completion-'.$completionicon.'.gif';
                     $imgalt = get_string('completion-alt-'.$completionicon,'completion');
                     if ($completion==COMPLETION_TRACKING_MANUAL && !$isediting) {
@@ -1481,10 +1480,6 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                         }
                         echo "
 <form class='togglecompletion$extraclass' method='post' action='togglecompletion.php'><div>";
-                        if(!$shownhelp && !$isediting) {
-                            helpbutton('completionicons',get_string('completionicons','completion'),'completion');
-                            $shownhelp = true;
-                        }
                         echo "
 <input type='hidden' name='id' value='{$mod->id}' />
 <input type='hidden' name='completionstate' value='$newstate' />
@@ -1493,10 +1488,6 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                     } else {
                         // In auto mode, or when editing, the icon is just an image
                         echo "<span class='autocompletion'>";
-                        if (!$shownhelp && !$isediting) {
-                            helpbutton('completionicons',get_string('completionicons','completion'),'completion');
-                            $shownhelp = true;
-                        }
                         echo "<img src='$imgsrc' alt='$imgalt' title='$imgalt' /></span>";
                     }
                 }
index f0f9b8155fd09fbe7997b4a36c34c048f49e5272..bcb18125f91b01ace863f5fb8b64aed1ecbbd411 100644 (file)
@@ -48,4 +48,5 @@ $string['saved']='Saved';
 $string['unlockcompletion']='Unlock completion options';
 $string['writingcompletiondata']='Writing completion data';
 $string['completionicons']='progress icons';
+$string['yourprogress']='Your progress';
 ?>
index c29059a6a7b7a30ac5ab8d37be15202e7b8661e0..fe988510d148b33ad6ec621e93c1012fca95c36b 100644 (file)
@@ -160,6 +160,20 @@ class completion_info {
         return $cm->completion;
     }
 
+    /**
+     * Print the Your progress help icon if the completion tracking is enabled.
+     * @global object
+     * @return void
+     */
+    public function print_help_icon() {
+        global $PAGE;
+        if ($this->is_enabled() && !$PAGE->user_is_editing() && isloggedin() && !isguestuser()) {
+            echo '<span class="completionprogress">'.get_string('yourprogress','completion').' ';
+            helpbutton('completionicons',get_string('completionicons','completion'),'completion');
+            echo '</span>';
+        }
+    }
+    // OU specific end
     /**
      * Updates (if necessary) the completion state of activity $cm for the given
      * user.
index ff087549f11ff09878b1cbcbe2bf369386ca3b23..6889b0f82c3517c14d4470c1e66eab286215395e 100644 (file)
@@ -2138,8 +2138,12 @@ border-width:0px;
   background:white;
   font-size:0.85em;
 }
-.course-view form.togglecompletion img.iconhelp,
-.course-view span.autocompletion img.iconhelp {
+.course-view .completionprogress {
+    font-size:0.80em;
+    float:right;
+    padding:8px 26px 5px 5px; ;
+}
+.course-view .completionprogress img.iconhelp {
   vertical-align:top;
 }