Link<ISIXmlSection> link = new Link<ISIXmlSection>("link") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
SectionStatus stat = getUserSectionStatus(student, sec);
ISIXmlSection targetSection = new SectionLinkFactory().sectionLinkDest(sec);
Class<? extends ISIStandardPage> pageType = ISIApplication.get().getReadingPageClass();
ISISession.get().setStudentModel(new HibernateObjectModel<User>(student));
PageParameters param = new PageParameters();
// TODO: This first statement is a hack. For some reason, getUnreadStudentMessages()
// is able to be out of sync with FeedbackMessage.isUnread() flag and is displaying
// the wrong icon on the page. See ISIApplication.statusIconFor() as well.
String s = null;
if (stat != null && stat.getUnreadStudentMessages() > 0 && (s = responseService.locationOfFirstUnreadMessage(student, sec)) != null) {
param.put("loc", s);
} else if (stat != null && stat.getCompleted() && !stat.getReviewed()){
ISIXmlSection section = targetSection.getSectionAncestor().firstPageWithResponseGroup();
if (section != null)
param.put("loc", (new ContentLoc(section).getLocation()));
else
throw new IllegalStateException("Section without response areas marked Ready For Review - should automatically be reviewed.");