我正在开发一个在线测试应用程序,我正在将所有问题从xml文件提取到jsp页面...所有问题都在jsp中使用for循环显示...现在我不想要所有的在单个页面中的问题,而不是我希望它们一个接一个地显示为用户单击“下一步”按钮。所以这里是我正在使用的代码,它只显示第一个和第二个问题,从第三个问题开始,它逐渐淡出并再次淡出......没有点击“下一步”按钮......需要一些这里的建议......谢谢......这是代码:
和jsp代码..:
METHOD =“post”>
<%
for(int i = 0; i < javapaperList.size(); i++){
JavaPaper paper = javapaperList.get(i);
String text = paper.getText();
StringTokenizer tokens = new StringTokenizer(text, "##");
int tokensint = tokens.countTokens();
%>
<div class="questions" id=<%out.println("qx" + paper.getId());%> style="display:none" >
<%
while(tokens.hasMoreTokens()){
%>
<label class="questiontext" ><%=tokens.nextToken()%></label><br>
<%
}
%>
<BR>
<BR>
<INPUT TYPE="radio" NAME=<%out.println("question" + paper.getId());%> VALUE="A" id=<% out.println("A" + paper.getId()); %> onClick="rboc(this)" class="option">
<% out.println(paper.getOptiona());%>
<BR>
<INPUT TYPE="radio" NAME=<%out.println("question" + paper.getId());%> VALUE="B" id=<% out.println("B" + paper.getId()); %> onClick="rboc(this)" class="option">
<% out.println(paper.getOptionb());%>
<BR>
<INPUT TYPE="radio" NAME=<%out.println("question" + paper.getId());%> VALUE="C" id=<% out.println("C" + paper.getId()); %> onClick="rboc(this)" class="option">
<% out.println(paper.getOptionc());%>
<BR>
<INPUT TYPE="radio" NAME=<%out.println("question" + paper.getId());%> VALUE="D" id=<% out.println("D" + paper.getId()); %> onClick="rboc(this)" class="option">
<% out.println(paper.getOptiond());%>
<BR>
<INPUT TYPE="radio" NAME=<%out.println("question" + paper.getId());%> VALUE="E" id=<% out.println("E" + paper.getId()); %> onClick="rboc(this)" class="option">
<% out.println(paper.getOptione());%>
<br>
<br>
<textarea name="<%out.println("question" + paper.getId());%>" id=<% out.println("q" + paper.getId()); %> style="display:none" onClick="clearContents(this)"><%out.println("question" + paper.getId());%></textarea>
<br>
<%
if(b!=false||x==10){
x++;
%>
<BR> </div>
<input type="button" id="next" value="NEXT" ></input>
<BR>
<%
}
}
%>
<input type='hidden' value=<%out.println(javapaperList.size());%> id="javapaperlist"/>
<input type="submit" id="submitButton" value="Submit">
</FORM>