if (!isProblemset) {
List<Problem> problems = context.getProblems();
context.setAttribute("problems", problems);
long roleId = Utility.parseLong(context.getRequest().getParameter("roleId"));
RankList ranklist = StatisticsManager.getInstance().getRankList(contest.getId(), roleId);
String export = context.getRequest().getParameter("export");
if ("txt".equalsIgnoreCase(export)) {
return this.export(context, contest, problems, ranklist, export);
} else if ("xls".equalsIgnoreCase(export)) {
return this.export(context, contest, problems, ranklist, export);
}
context.setAttribute("RankList", ranklist);
} else {
int from = Utility.parseInt(context.getRequest().getParameter("from"));
if (from < 0) {
from = 0;
}
int count = 30;
String sort=context.getRequest().getParameter("order");
if(sort==null)
{
sort="ac";
}
ProblemsetRankList ranklist =
StatisticsManager.getInstance().getProblemsetRankList(contest.getId(), from, count, sort);
if (from > 0) {
context.setAttribute("previousFrom", from - count > 0 ? from - count : 0);
}
if (ranklist.getSolved().length == count) {
context.setAttribute("nextFrom", from + count);
}
context.setAttribute("RankList", ranklist);
}