表第一行的最后一列是在JSP中移动到新表

时间:2015-12-08 12:52:34

标签: jquery jsp

当我构建表时,第一行的第10列将在下一行中进行,当我检查该值时,它会在另一个表中进行。

        <table class="table" style="table-layout: fixed; width: 100%;">
                            <tr>
                                <%int l = 1;
                                String strRes = "";
                                String strIT = "";
                                String strPT = "";
                                String strCA = "";
                                for (int t = ms; t <= strResponseList.split("`", -1).length; t++) {
                                    strRes = strResponseList.split("`", -1)[t - 1];
                                    strIT = strItemTypes.split("`", -1)[t - 1];
                                    strPT = strPoints.split(",", -1)[t - 1];
                                    strCA = strCorrectAnswers[t - 1];
                                    if(bRBtnSelection){
                                    if(!"1".equals(objStudentResponse.getPilotItems().split(",")[t-1])) {   
                                    boolean bCheck = (!"XCR".equals(strIT)  ? (!CommonUtility.isValidValue(strRes) && !(strRes.equals(strCorrectAnswers[t - 1]))) || (!CommonUtility.isNumeric(strCorrectAnswers[t - 1]) && !(strRes.equals(strCorrectAnswers[t - 1]))) 
                                            || (CommonUtility.isNumeric(strRes) && CommonUtility.isNumeric(strCorrectAnswers[t - 1]) && (Float.parseFloat(strRes) != Float.parseFloat(strCorrectAnswers[t - 1])) || (!CommonUtility.isNumeric(strRes) && CommonUtility.isNumeric(strCorrectAnswers[t - 1]))) : true);
                                    if (!"0".equals(strPoints.split(",", -1)[t - 1]) && (bCheck)) {// No need to check IsNUmber and IsAlphaNumeric for XCR items
                                    if(bShowQuestion) {%> 
                                    <td class="text-left" style="width: 150px;">Questions Missed:</td><%bShowQuestion = false;}
                                    if(!"XCR".equals(strIT)) { 
                                    if(strIT.equals("GM") || strIT.equals("GGM")){
                                    if(!strPoints.split(",", -1)[t - 1].equals(strScoreList[t - 1])) {
                                        l++;
                                        if(bShowTimeSpent && strMethodOfDelivery.equals("O")){lstQuestionMiss.add(t);}
                                    %> <td class="<%=(l % 2 == 0 ? "alt" : "")%>" style="font-size: 20px;"> &nbsp;<%=t%> &nbsp;</td>
                                    <% if(l == 10) {ms = t + 1; if(t >= strResponseList.split("`", -1).length) end = false; break; } if(t >= strResponseList.split("`", -1).length) {ms = t + 1; end = false;} ;
                                    }}
                                    else{
                                    l++;    
                                    if(bShowTimeSpent && strMethodOfDelivery.equals("O")){lstQuestionMiss.add(t);}
                                    %> <td class="<%=(l % 2 == 0 ? "alt" : "")%>" style="font-size: 20px;"> &nbsp;<%=t%> &nbsp;</td>
                                    <% if(l == 10) {ms = t + 1; if(t >= strResponseList.split("`", -1).length) end = false; break; } if(t >= strResponseList.split("`", -1).length) {ms = t + 1; end = false;} ;
                                    }   
                                    } else {
                                        l++;
                                        String cXCR = strCorrectAnswers[t - 1].replaceAll("&amp;#8211;", "-");
                                        String rXCR = strRes.replaceAll("&amp;#8211;", "-").replaceAll(" ","");
                                        boolean bXC = false;
                                        if(cXCR.indexOf("`") > -1) {
                                            for(int i1 = 0; i1 < cXCR.split("`").length; i1++) {
                                                if(bXC) break;
                                                String cX = cXCR.split("`")[i1];
                                                if(!CommonUtility.isValidValue(cX) || !CommonUtility.isValidValue(rXCR.split("<br/>", -1)[i1])
                                                        || (cX.indexOf("|") == -1 && !(rXCR.split("<br/>", -1)[i1].equals(cX)))){
                                                    bXC = true;
                                                }
                                            }
                                        } else {
                                            if((cXCR.indexOf("|") > -1 && Arrays.asList(cXCR.split("\\|", -1)).indexOf(rXCR) == -1) || (cXCR.indexOf("|", -1) == -1 && !(rXCR.equals(cXCR))))
                                                bXC = true;
                                        }
                                        if(bXC){if(bShowTimeSpent && strMethodOfDelivery.equals("O")){lstQuestionMiss.add(t);}
                                        if(strMethodOfDelivery.equals("S") && !rXCR.equals(strPT)){
                                        %> <td class="<%=(l % 2 == 0 ? "alt" : "")%>" style="font-size: 20px;"> &nbsp;<%=t%> &nbsp;</td>
                                        <%}else if(strMethodOfDelivery.equals("O")){%> <td class="<%=(l % 2 == 0 ? "alt" : "")%>" style="font-size: 20px;"> &nbsp;<%=t%> &nbsp;</td> <%}
                                        if(l == 10) {ms = t + 1; if(t >= strResponseList.split("`", -1).length) end = false; break; } if(t >= strResponseList.split("`", -1).length) {ms = t + 1; end = false;} l++;}
                                    }
                                %>
                                <% }}}else{      // for All items radio button
                                    if(l == 1) {%> <td class="text-left" style="width: 250px;">Questions:</td><%}l++;
                                    if(!"XCR".equals(strIT)) { 
                                    if(strIT.equals("GM") || strIT.equals("GGM")){
                                    if(!strPoints.split(",", -1)[t - 1].equals(strScoreList[t - 1])) {
                                        if(bShowTimeSpent && strMethodOfDelivery.equals("O")){lstQuestionMiss.add(t);}
                                    %> <td class="<%=(l % 2 == 0 ? "alt" : "")%>" style="font-size: 20px;"> &nbsp;<%=t%> &nbsp;</td>
                                    <% if(l == 10) { ms = t + 1; if(t >= strResponseList.split("`", -1).length){end = false;} break; } l++; if(t >= strResponseList.split("`", -1).length) {ms = t + 1; end = false;} ;
                                    }}
                                    else{
                                    if(bShowTimeSpent && strMethodOfDelivery.equals("O")){lstQuestionMiss.add(t);}
                                    %> <td class="<%=(l % 2 == 0 ? "alt" : "")%>" style="font-size: 20px;"> &nbsp;<%=t%> &nbsp;</td>
                                    <% if(l == 10) {ms = t + 1; if(t >= strResponseList.split("`", -1).length){end = false;} break;} if(t >= strResponseList.split("`", -1).length) {ms = t + 1; end = false;} ;
                                    }   
                                    } else {
                                        String cXCR = strCorrectAnswers[t - 1].replaceAll("&amp;#8211;", "-");
                                        String rXCR = strRes.replaceAll("&amp;#8211;", "-").replaceAll(" ","");
                                        boolean bXC = false;
                                        if(cXCR.indexOf("`") > -1) {
                                            for(int i1 = 0; i1 < cXCR.split("`").length; i1++) {
                                                if(bXC) break;
                                                String cX = cXCR.split("`")[i1];
                                                if(!CommonUtility.isValidValue(cX) || !CommonUtility.isValidValue(rXCR.split("<br/>", -1)[i1])
                                                        || (cX.indexOf("|") == -1)){
                                                    bXC = true;
                                                }
                                            }
                                        } else {
                                            if((cXCR.indexOf("|") > -1 && Arrays.asList(cXCR.split("\\|", -1)).indexOf(rXCR) == -1) || (cXCR.indexOf("|", -1) == -1))
                                                bXC = true;
                                        }
                                        if(bXC){if(bShowTimeSpent && strMethodOfDelivery.equals("O")){lstQuestionMiss.add(t);}
                                        if(strMethodOfDelivery.equals("S")){
                                        %> <td class="<%=(l % 2 == 0 ? "alt" : "")%>" style="font-size: 20px;"> &nbsp;<%=t%> &nbsp;</td>
                                        <%}else if(strMethodOfDelivery.equals("O")){%> <td class="<%=(l % 2 != 0 ? "alt" : "")%>" style="font-size: 20px;"> &nbsp;<%=t%> &nbsp;</td> <%}
                                        if(l == 10) {ms = t + 1; if(t >= strResponseList.split("`", -1).length) end = false; break; } if(t >= strResponseList.split("`", -1).length) {ms = t + 1; end = false;} l++;}
                                    }
                                %> <% } if(t >= strResponseList.split("`", -1).length) end = false; }%>
                            </tr>
                        </table>

This is my table code which i used to build table, and the output is coming as:
Questions Missed:    1       2       3       4       5       6       7       9  
Your Response:   B       B           -       B       -       FT      B       B  
Correct Response:    A       AB      1       Y       A       1       TF      A       A  

Questions Missed:    10  

错过的问题:10将进入新表,当我检查代码时,它显示单独的tbody,只有一个值为10。

0 个答案:

没有答案
相关问题