From: sam_marshall Date: Thu, 2 Jul 2009 09:18:26 +0000 (+0000) Subject: MDL-19692: Improvement to help icon for completion tickboxes, based on user testing X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e3568fde9c6116d0e2548ab39ec180007a2dfec7;p=moodle.git MDL-19692: Improvement to help icon for completion tickboxes, based on user testing --- diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 67dee6735c..3eac76ac06 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -106,6 +106,10 @@ 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. diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 5f90f45844..4e6e171013 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -95,7 +95,11 @@ 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. diff --git a/course/lib.php b/course/lib.php index 3bc4d30e54..ba47511a23 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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 "
"; - if(!$shownhelp && !$isediting) { - helpbutton('completionicons',get_string('completionicons','completion'),'completion'); - $shownhelp = true; - } echo " @@ -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 ""; - if (!$shownhelp && !$isediting) { - helpbutton('completionicons',get_string('completionicons','completion'),'completion'); - $shownhelp = true; - } echo "$imgalt"; } } diff --git a/lang/en_utf8/completion.php b/lang/en_utf8/completion.php index f0f9b8155f..bcb18125f9 100644 --- a/lang/en_utf8/completion.php +++ b/lang/en_utf8/completion.php @@ -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'; ?> diff --git a/lib/completionlib.php b/lib/completionlib.php index c29059a6a7..fe988510d1 100644 --- a/lib/completionlib.php +++ b/lib/completionlib.php @@ -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 ''.get_string('yourprogress','completion').' '; + helpbutton('completionicons',get_string('completionicons','completion'),'completion'); + echo ''; + } + } + // OU specific end /** * Updates (if necessary) the completion state of activity $cm for the given * user. diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index ff087549f1..6889b0f82c 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -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; }