$total += $ra;
$count ++;
}
- $return->grades[$currentuser] = format_float($total/$count, 2);
+ $return->grades[$currentuser] = (string) format_float($total/$count, 2);
+ if ( count($ratingsuser) > 1 ) {
+ $return->grades[$currentuser] .= " (" . count($ratingsuser) . ")";
+ }
}
} else {
$return->grades[$currentuser] = "";
$total += $ra;
$count ++;
}
- $return->grades[$currentuser] = format_float((float)$total/(float)$count, 2);
+ $return->grades[$currentuser] = (string) format_float((float)$total/(float)$count, 2);
+
+ if ( count($ratingsuser) > 1 ) {
+ $return->grades[$currentuser] .= " (" . count($ratingsuser) . ")";
+ }
}
} else {
$return->grades[$currentuser] = "";
function glossary_print_entry($course, $cm, $glossary, $entry, $mode="",$hook="",$printicons = 1, $displayformat = -1, $ratings = NULL) {
global $THEME, $USER, $CFG;
+ $return = false;
if ( $displayformat < 0 ) {
$displayformat = $glossary->displayformat;
}
}
if ( !$basicformat and $permissiongranted or $displayformat >= 2) {
- return glossary_print_entry_by_format($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings);
+ $return = glossary_print_entry_by_format($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings);
} else {
switch ( $displayformat ) {
case GLOSSARY_FORMAT_SIMPLE:
- return glossary_print_entry_by_default($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings);
+ $return = glossary_print_entry_by_default($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings);
break;
case GLOSSARY_FORMAT_CONTINUOUS:
- return glossary_print_entry_continuous($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings);
+ $return = glossary_print_entry_continuous($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings);
break;
}
}
}
+ return $return;
}
function glossary_print_entry_concept($entry) {
echo $entry->concept;
echo " ";
glossary_print_entry_definition($entry);
+
+ $icons = '';
if ( $printicons ) {
- $icons = glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook,"html");
- echo "($icons)";
+ $icons = glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook,"html");
+ }
+
+ echo '(';
+ if ( $icons ) {
+ echo $icons;
}
$return = glossary_print_entry_ratings($course, $entry, $ratings);
+
+ echo ')<br>';
+
}
return $return;
}
$strratings = get_string("ratings", "glossary");
}
- echo "$strratings: ";
+ echo "<font size=-1>$strratings: ";
link_to_popup_window ("/mod/glossary/report.php?id=$entryid", "ratings", $mean, 400, 600);
+ echo "</font>";
}
}
if ($ratings->scale = make_grades_menu($glossary->scale)) {
$ratings->assesstimestart = $glossary->assesstimestart;
$ratings->assesstimefinish = $glossary->assesstimefinish;
- if ($glossary->assessed == 2 and !isteacher($course->id)) {
- $ratings->allow = false;
- } else {
- $ratings->allow = true;
- }
-
- echo "<form name=form method=post action=rate.php>";
- echo "<input type=hidden name=id value=\"$course->id\">";
}
+ if ($glossary->assessed == 2 and !isteacher($course->id)) {
+ $ratings->allow = false;
+ } else {
+ $ratings->allow = true;
+ }
+
+ echo "<form name=form method=post action=rate.php>";
+ echo "<input type=hidden name=id value=\"$course->id\">";
}
foreach ($allentries as $entry) {
if ( !$tableisopen ) {
if ($glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS OR
- $glossary->displayformat == GLOSSARY_FORMAT_SIMPLE) {
+ $glossary->displayformat == GLOSSARY_FORMAT_SIMPLE or $mode == 'entry') {
print_simple_box_start("center","95%","#ffffff","5","generalbox");
$tableisopen = 1;
}
}
/// and finally print the entry.
+
if ( glossary_print_entry($course, $cm, $glossary, $entry, $mode, $hook,1,$displayformat,$ratings) ) {
$ratingsmenuused = true;
}
}
if ( $tableisopen ) {
if ($glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS OR
- $glossary->displayformat == GLOSSARY_FORMAT_SIMPLE ) {
+ $glossary->displayformat == GLOSSARY_FORMAT_SIMPLE or $mode == 'entry') {
print_simple_box_end();
$tableisopen = 0;
}
}
if ($ratingsmenuused) {
- echo "<center><input type=\"submit\" value=\"".get_string("sendinratings", "glossary")."\">";
+ echo "<p><center><input type=\"submit\" value=\"".get_string("sendinratings", "glossary")."\">";
if ($glossary->scale < 0) {
if ($scale = get_record("scale", "id", abs($glossary->scale))) {
print_scale_menu_helpbutton($course->id, $scale );