QTIResultManager qrm = QTIResultManager.getInstance();
List testResultSets = qrm.getResultSets(course.getResourceableId(), test.getIdent(),
test.getReferencedRepositoryEntry().getKey(), null);
for (Iterator j = testResultSets.iterator(); j.hasNext();) {
QTIResultSet qrs = (QTIResultSet) j.next();
// - modify date on test set must be newer than last visit of
// assessment tool
// - user must either be course administrator (access to all
// users granted)
// or in a course right group with the assessment tool right or
// a course
// coach. in the second case, only tests of users are shown that
// the coach does actually
// coach himself. he does not have access to other users
Date modDate = qrs.getLastModified();
if (modDate.after(compareDate) && (hasFullAccess || PersistenceHelper.listContainsObjectByKey(coachedUsers, qrs.getIdentity()))) {
String score = (new Float(qrs.getScore())).toString();
String desc = translator.translate("notifications.entry", new String[] { test.getShortTitle(),
NotificationHelper.getFormatedName(qrs.getIdentity()), score });
String urlToSend = null;
if(p.getBusinessPath() != null) {
String businessPath = p.getBusinessPath() + "[assessmentTool:0][Identity:" + qrs.getIdentity().getKey() + "][CourseNode:" + test.getIdent() + "]";
urlToSend = NotificationHelper.getURLFromBusinessPathString(p, businessPath);
}
SubscriptionListItem subListItem = new SubscriptionListItem(desc, urlToSend, modDate, CSS_CLASS_USER_ICON);
si.addSubscriptionListItem(subListItem);
}