When i am building the table the 10th column for first row comming next line, when i inspect that value than it is coming in another table.
<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;"> <%=t%> </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;"> <%=t%> </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("&#8211;", "-");
String rXCR = strRes.replaceAll("&#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;"> <%=t%> </td>
<%}else if(strMethodOfDelivery.equals("O")){%> <td class="<%=(l % 2 == 0 ? "alt" : "")%>" style="font-size: 20px;"> <%=t%> </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;"> <%=t%> </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;"> <%=t%> </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("&#8211;", "-");
String rXCR = strRes.replaceAll("&#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;"> <%=t%> </td>
<%}else if(strMethodOfDelivery.equals("O")){%> <td class="<%=(l % 2 != 0 ? "alt" : "")%>" style="font-size: 20px;"> <%=t%> </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
The Questions Missed: 10 is coming in new table, when i inspect the code it showing separate tbody for this only one value of 10.