">
<%-- DISPLAY NAVIGATION BAR --%>
<%-- HEADER --%>
<%= scriptLabel %> (<%= scriptNumber %>)
<%-- END OF HEADER --%>
<%-- Current element index --%>
<%-- HIDDEN FORM FIELDS --%>
<%-- Next element requested index --%>
|
<%
for (int eltIndex = 0; eltIndex < pagesElements.size(); eltIndex++) {
ScriptElementBean scriptElement = (ScriptElementBean)pagesElements.elementAt(eltIndex);
LinkScriptElementBean linkScriptElement = (LinkScriptElementBean)pagesLinkScriptElements.elementAt(eltIndex);
Vector scriptElementResponses = (Vector)responses.get(linkScriptElement.getID());
if (scriptElementResponses == null) {
scriptElementResponses = new Vector();
} else {
for (int i = 0; i < scriptElementResponses.size(); i++) {
if (scriptElementResponses.elementAt(i) != null) {
((ScriptElementResponseBean)scriptElementResponses.elementAt(i)).setSession(session);
}
}
}
if (scriptElement != null) {
String qLabel = null;
try {
qLabel = scriptElement.getSceLabel();
} catch (FieldNotInitializedException fnie) {
}
String qDescription = null;
try {
qDescription = Utils.formatToWeb(scriptElement.getSceDescription(), false);
} catch (FieldNotInitializedException fnie) {
}
// remplacement de $$actor$$ et $$person$$
if (qDescription != null) {
qDescription = Utils.replace(qDescription, "$$person$$", perCompleteName);
qDescription = Utils.replace(qDescription, "$$actor$$", actCompleteName);
}
/*
String qComment = null;
try {
qComment = Utils.formatToWeb((String)scriptElement.getCustomProperty("SceComment_"), false);
} catch (FieldNotInitializedException fnie) {
}
// remplacement de $$actor$$ et $$person$$
if (qComment != null) {
qComment = Utils.replace(qComment, "$$person$$", perCompleteName);
qComment = Utils.replace(qComment, "$$actor$$", actCompleteName);
}
*/
//IMAGE
String picID = null;
try {
picID = scriptElement.getSceImage();
} catch (FieldNotInitializedException ex) {
}
%>
<%-- DISPLAY SCRIPT ELEMENT LABEL --%>
|
<%= qLabel == null ? " " : qLabel %>
|
|
|
<%-- DISPLAY SCRIPT ELEMENT IMAGE IF ANY --%>
<% if (picID != null) { %>
">
|
|
<% } %>
<%-- DISPLAY SCRIPT ELEMENT DESCRIPTION --%>
<%= qDescription == null ? " " : qDescription %>
|
<%-- DISPLAY SCRIPT ELEMENT ANSWERS --%>
<%
if (scriptElement.getSceHasAnswers() == 1) {
String qType = null;
try {
qType = scriptElement.getSceType();
} catch (FieldNotInitializedException fnie) {
}
//if text libre
if ( qType == null || qType.equals(dico.getRefIdByCode("SceType" , "FRE")) ) {
int inputSize = 0;
try {
inputSize = scriptElement.getSceInputSize();
} catch (FieldNotInitializedException fnie) {
}
String value = "";
if (scriptElementResponses.size() > 0) {
try { value = ((ScriptElementResponseBean)scriptElementResponses.elementAt(0)).getSerText(); }
catch (FieldNotInitializedException e) {}
}
if (inputSize == -1) {
%>
<%--
--%>
|
<%
} else {
%>
<%----%>
">
|
<%
}
} else { //Pas Texte libre, c-a-d REF ou LST
boolean isREF = false;
boolean isLST = false;
if ( qType.equals(dico.getRefIdByCode("SceType" , "REF")) ) {
isREF = true;
}
if ( qType.equals(dico.getRefIdByCode("SceType" , "LST")) ) {
isLST = true;
}
boolean isCombo = true;
boolean isRadio = false;
boolean isCheck = false;
String dispType = null;
try {
dispType = scriptElement.getSceDispType();
} catch (FieldNotInitializedException fnie) {
}
if (dispType != null && dispType.equals(dico.getRefIdByCode("SceDispType", "RADIO"))) {
isCombo = false;
isRadio = true;
}
if (dispType != null && dispType.equals(dico.getRefIdByCode("SceDispType", "CHECK"))) {
isCombo = false;
isCheck = true;
}
int complementaryText = 0;
try {
complementaryText = scriptElement.getSceAssociatedText();
} catch (FieldNotInitializedException fnie) {
}
int nbColumn = 1;
try {
nbColumn = scriptElement.getSceColumnsNb();
} catch (FieldNotInitializedException fnie) {
}
int hasOther = 0;
try {
hasOther = scriptElement.getSceHasOther();
} catch (FieldNotInitializedException fnie) {
}
String refTableID = null;
try {
refTableID = scriptElement.getSceRefTable();
} catch (FieldNotInitializedException fnie) {
}
Vector possibleResponses = new Vector();
Vector recordedResponses = new Vector(); //in this vector we will store the responses from scriptElementResponses that we have
Hashtable complementaryTexts = new Hashtable(); //in this hashtable we will store the complementary texts that we have
if ( isLST ) {
for (int j=0 ; j < 15 ; j++) {
String lstAnswer = null;
try {
Method getter = Class.forName("com.edeal.frontline.ScriptElementBean").getMethod("getSceLstAnswer" + j , null);
lstAnswer = (String) getter.invoke(scriptElement , null);
} catch (Exception e) {
}
if (lstAnswer != null) {
Vector oneResponse = new Vector();
oneResponse.add(Integer.toString(j));
oneResponse.add(lstAnswer);
possibleResponses.add(oneResponse);
}
}
for (int k = 0 ; k < scriptElementResponses.size() ; k++) {
try {
String choice = new Integer(((ScriptElementResponseBean)scriptElementResponses.elementAt(k)).getSerPosition()).toString();
recordedResponses.addElement(choice);
complementaryTexts.put(choice, ((ScriptElementResponseBean)scriptElementResponses.elementAt(k)).getSerMoreText());
} catch (FieldNotInitializedException e) {}
}
} else {
try {
possibleResponses = dico.getRefList(session, refTableID , "Te1");
} catch (FrontlineException fe) {
logger.error("DBG: dico.getRefList a lancé une exception : " + fe.getMessage());
}
for (int k = 0 ; k < scriptElementResponses.size() ; k++) {
try {
String choice = ((ScriptElementResponseBean)scriptElementResponses.elementAt(k)).getSerRefValID();
recordedResponses.addElement(choice);
complementaryTexts.put(choice, ((ScriptElementResponseBean)scriptElementResponses.elementAt(k)).getSerMoreText());
} catch (FieldNotInitializedException e) {}
}
}
if (isCombo) {
%>
<%----%>
<%
if (complementaryText > 0) {
String compText = null;
if (responseChoice != null) {
compText = (String)complementaryTexts.get(responseChoice);
}
%>
" size="<%= Integer.toString(complementaryText) %>">
<%
}
%>
|
<%
} else { // pas combo , c-a-d checkbox ou radio
String tagType = "checkbox";
if (isRadio) {
tagType = "radio";
}
%>
<%----%>
<%}%>
|
<%-- OBJECTIONS / ARGUMENTS --%>
<%
if (scriptElement != null && scriptElement.getID() != null) {
Vector linksList = (Vector)objections.get(scriptElement.getID());
//if there are links to objections
if (linksList != null && linksList.size() > 0) {
%>
|
|
<%
//for each objection
for (int i=0 ; i < linksList.size() ; i++) {
Hashtable curLink = (Hashtable) linksList.elementAt(i);
String curLsoObjectionID = (String) curLink.get("LsoObjectionID");
String obaObjection = (String) curLink.get("LsoObjectionID:ObaObjection");
%><%--<%= obaObjection %> <%
--%>
<%= obaObjection %> <%
}
%>
|
<% }//end of if there are links to objections
}//end of if there is a script element
%><%-- END OF OBJECTIONS / ARGUMENTS --%><%
}//end of if (texte libre)
}//end of if (scriptElement.getSceHasAnswers() == 1)
}
}
%>
<%-- IF THIS IS THE LAST ELEMENT, WE MAY WANT TO SHOW THE EVENT STATUS SECTION --%>
<% if (lsePosition == scriptElements.size() - 1) { %>
<%-- EVENT STATUS SECTION --%>
<%-- END OF EVENT STATUS SECTION --%>
<% } %>
<%-- PROGRESS BAR --%>
<% if (lsePosition != scriptPages.size() -1) { %>
<% } else { %>
<% } %>
<%-- END OF PROGRESS BAR --%>
<%
if (pagesElements == null || pagesElements.size() == 0) {
%><%
}
%>
<%if (hasNotes){%>