Index: lams_common/src/java/org/lamsfoundation/lams/util/svg/SVGGenerator.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/svg/SVGGenerator.java,v diff -u -r1.15 -r1.16 --- lams_common/src/java/org/lamsfoundation/lams/util/svg/SVGGenerator.java 10 Jun 2013 10:59:10 -0000 1.15 +++ lams_common/src/java/org/lamsfoundation/lams/util/svg/SVGGenerator.java 5 Nov 2013 18:36:49 -0000 1.16 @@ -809,8 +809,8 @@ } // trim text to fit into container - if (text.length() > 21) { - text = text.substring(0, 20); + if (text.length() > 20) { + text = text.substring(0, 19); } Element textNode = doc.createElementNS(SVGConstants.SVG_NAMESPACE, "text"); Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/web/includes/javascript/monitorLesson.js,v diff -u -r1.28 -r1.29 --- lams_monitoring/web/includes/javascript/monitorLesson.js 11 Oct 2013 12:06:59 -0000 1.28 +++ lams_monitoring/web/includes/javascript/monitorLesson.js 5 Nov 2013 18:36:51 -0000 1.29 @@ -815,52 +815,51 @@ actY = +activityShape.attr('y') + 1; } + // add group of users icon + var actRightBorder = actX + (isGate? 40 : +activityShape.attr('width')); + var groupTitle = activity.learners.length + ' ' + LEARNER_GROUP_COUNT_LABEL + + ' ' + LEARNER_GROUP_SHOW_LABEL; + // if icons do not fit in shape anymore, show a group icon + var element = appendXMLElement('image', { + 'id' : 'act' + activity.id + 'learnerGroup', + 'x' : actRightBorder - 19, + 'y' : actY + 1, + 'height' : 16, + 'width' : 16, + 'xlink:href' : LAMS_URL + 'images/icons/group.png' + }, null, activityGroup[0]); + appendXMLElement('title', null, groupTitle, element); + // add a small number telling how many learners are in the group + element = appendXMLElement('text', { + 'id' : 'act' + activity.id + 'learnerGroupText', + 'x' : actRightBorder - 10, + 'y' : actY + 24, + 'text-anchor': 'middle', + 'font-family': 'Verdana', + 'font-size' : 8 + }, activity.learners.length, activityGroup[0]); + appendXMLElement('title', null, groupTitle, element); + var actTooltip = LEARNER_GROUP_LIST_TITLE_LABEL; - - $.each(activity.learners, function(learnerIndex, learner){ - if (isGate || (activity.learners.length > 8 && learnerIndex == 7)) { - // maximum 8 icons fit in an activity - var actRightBorder = actX + (isGate? 40 : +activityShape.attr('width')); - var groupTitle = activity.learners.length + ' ' + LEARNER_GROUP_COUNT_LABEL - + ' ' + LEARNER_GROUP_SHOW_LABEL; - // if icons do not fit in shape anymore, show a group icon - var element = appendXMLElement('image', { - 'id' : 'act' + activity.id + 'learnerGroup', - 'x' : actRightBorder - 19, - 'y' : actY + 1, - 'height' : 16, - 'width' : 16, - 'xlink:href' : LAMS_URL + 'images/icons/group.png' - }, null, activityGroup[0]); - appendXMLElement('title', null, groupTitle, element); - // add a small number telling how many learners are in the group - element = appendXMLElement('text', { - 'id' : 'act' + activity.id + 'learnerGroupText', - 'x' : actRightBorder - 10, - 'y' : actY + 24, - 'text-anchor': 'middle', - 'font-family': 'Verdana', - 'font-size' : 8 - }, activity.learners.length, activityGroup[0]); - appendXMLElement('title', null, groupTitle, element); - // stop processing learners - return false; - - } else { - /* make an icon for each learner */ - var element = appendXMLElement('image', { - 'id' : 'act' + activity.id + 'learner' + learner.id, - 'x' : actX + learnerIndex*15, - 'y' : actY, - 'height' : 16, - 'width' : 16, - 'xlink:href' : LAMS_URL + 'images/icons/user.png' - }, null, activityGroup[0]); + // draw single user icons for the first few + if (!isGate) { + $.each(activity.learners, function(learnerIndex, learner){ var learnerDisplayName = getLearnerDisplayName(learner); - appendXMLElement('title', null, learnerDisplayName, element); actTooltip += '\n' + learnerDisplayName; - } - }); + + if (learnerIndex < 8) { + element = appendXMLElement('image', { + 'id' : 'act' + activity.id + 'learner' + learner.id, + 'x' : actX + learnerIndex*15, + 'y' : actY, + 'height' : 16, + 'width' : 16, + 'xlink:href' : LAMS_URL + 'images/icons/user.png' + }, null, activityGroup[0]); + appendXMLElement('title', null, learnerDisplayName, element); + } + }); + } appendXMLElement('title', null, actTooltip, activityGroup[0]); }