From 8e906aca421e449b9c9644965fae936603049b9d Mon Sep 17 00:00:00 2001 From: Cheng Guo <wonderful.guo@gmail.com> Date: Fri, 7 Feb 2014 16:45:46 -0500 Subject: [PATCH] Added a profession question in the study --- Survey/src/java/servlet/Conclusion.java | 37 +++++++++++++++++++++++++ Survey/web/conclusion.jsp | 33 +++++++++++++++++++++- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/Survey/src/java/servlet/Conclusion.java b/Survey/src/java/servlet/Conclusion.java index ea821f6..5acf75d 100644 --- a/Survey/src/java/servlet/Conclusion.java +++ b/Survey/src/java/servlet/Conclusion.java @@ -167,6 +167,43 @@ public class Conclusion extends HttpServlet { file.write(("</question>").getBytes()); file.write(System.getProperty("line.separator").getBytes()); + String healthEx = request.getParameter("healthEx"); + file.write(("<question>").getBytes()); + file.write(("<time>").getBytes()); + file.write(time1.getBytes()); + file.write(("</time>").getBytes()); + file.write(("<name>").getBytes()); + file.write(("healthEx").getBytes()); + file.write(("</name>").getBytes()); + file.write(("<value>").getBytes()); + if (healthEx != null) { + file.write(healthEx.substring(0, 1).getBytes()); + } + file.write(("</value>").getBytes()); + file.write(("<label>").getBytes()); + if (healthEx != null) { + file.write(healthEx.substring(1).getBytes()); + } + file.write(("</label>").getBytes()); + file.write(("</question>").getBytes()); + file.write(System.getProperty("line.separator").getBytes()); + + String profession = request.getParameter("profession"); + file.write(("<question>").getBytes()); + file.write(("<time>").getBytes()); + file.write(time1.getBytes()); + file.write(("</time>").getBytes()); + file.write(("<name>").getBytes()); + file.write(("profession").getBytes()); + file.write(("</name>").getBytes()); + file.write(("<value>").getBytes()); + if (profession != null) { + file.write(profession.getBytes()); + } + file.write(("</value>").getBytes()); + file.write(("</question>").getBytes()); + file.write(System.getProperty("line.separator").getBytes()); + String education = request.getParameter("education"); file.write(("<question>").getBytes()); file.write(("<time>").getBytes()); diff --git a/Survey/web/conclusion.jsp b/Survey/web/conclusion.jsp index 010b844..b4d483d 100644 --- a/Survey/web/conclusion.jsp +++ b/Survey/web/conclusion.jsp @@ -193,7 +193,7 @@ </tr> </table><br> - <h4>How are you employed? Check all that apply.</h4> + <h4>Employment status. Check all that apply.</h4> <table> <tr> <td> @@ -258,7 +258,38 @@ </td> </tr> </table><br> + + <h4>Do you have training or experience with a health profession?</h4> + <table> + <tr> + <td> + <input type="radio" name="healthEx" value="0Yes"/> + </td> + <td> + Yes + </td> + </tr> + <tr height="3px"></tr> + <tr> + <td> + <input type="radio" name="healthEx" value="1No"/> + </td> + <td> + No + </td> + </tr> + </table><br> + <h4>If so, please explain?</h4> + <table> + <tr> + <td> + <input type="text" name="profession" class="input-xxlarge search-query"> + </td> + </tr> + </table><br> + + <h4>What is the highest level of education you have achieved?</h4> <table> <tr> -- GitLab