?? finishaction.java
字號(hào):
package org.yeeku.action;
import org.apache.struts.action.*;
import org.apache.struts.validator.DynaValidatorForm;
import javax.servlet.http.*;
import java.util.*;
import org.yeeku.action.base.BaseAction;
import org.yeeku.model.Question;
/**
* @author yeeku.H.lee kongyeeku@163.com
* @version 1.0
* <br>Copyright (C), 2005-2008, yeeku.H.Lee
* <br>This program is protected by copyright laws.
* <br>Program Name:
* <br>Date:
*/
public class FinishAction extends BaseAction
{
public ActionForward execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request, HttpServletResponse response)throws Exception
{
HttpSession session = request.getSession(false);
Map<String , Integer> replyMap = null;
if( (replyMap = (Map)session.getAttribute("replyMap")) == null )
{
replyMap = new HashMap<String , Integer>();
}
int questionTotal = 0;
int rightTotal = 0;
int total = 0;
for (String replyId : replyMap.keySet())
{
int score = replyMap.get(replyId);
total += score;
if (score > 0)
{
rightTotal++;
}
questionTotal++;
}
request.setAttribute("total" , total);
request.setAttribute("questionTotal" , questionTotal);
request.setAttribute("rightTotal" , rightTotal);
return mapping.findForward("success");
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -