Index: TestHarness4LAMS2/src/org/lamsfoundation/testharness/learner/MockLearner.java =================================================================== diff -u -r5e293840a55c1131a25d4caad05205f896ed4ae6 -rda506197047df06aabd8b50ffd781288b940a417 --- TestHarness4LAMS2/src/org/lamsfoundation/testharness/learner/MockLearner.java (.../MockLearner.java) (revision 5e293840a55c1131a25d4caad05205f896ed4ae6) +++ TestHarness4LAMS2/src/org/lamsfoundation/testharness/learner/MockLearner.java (.../MockLearner.java) (revision da506197047df06aabd8b50ffd781288b940a417) @@ -153,6 +153,8 @@ private static final Set SCRIBE_FINISHED_TOOL_CONTENT = new TreeSet(); private static final short SCRIBE_SUBMIT_REPORT_ATTEMPTS = 3; + private static final String NB_SUBSTRING = "/lams/tool/lanb11/"; + private static int joinLessonUserCount = 0; private static int topJoinLessonUserCount = 0; private boolean finished = false; @@ -460,6 +462,8 @@ return handleToolAssessment(resp, form); } else if (asText.contains(SCRIBE_TOOL_SUBSTRING)) { return handleToolScribe(resp, form); + } else if (asText.contains(NB_SUBSTRING)) { + handleToolNb(resp, form); } } log.debug("Filling form fillFormArbitrarily"); @@ -894,12 +898,21 @@ } } + private void handleToolNb(WebResponse resp, WebForm form) throws IOException { + String asText = resp.getText(); + if (asText.contains("submitForm('reflect')")) { + form.setAttribute("action", form.getAction() + "?method=reflect"); + } else { + form.setAttribute("action", form.getAction() + "?method=finish"); + } + } + private WebResponse handleToolAssessment(WebResponse resp, WebForm form) throws SAXException, IOException { String asText = resp.getText(); // check if current user is the leader boolean hasEditRights = asText.contains(MockLearner.ASSESSMENT_HAS_EDIT_RIGHT_SUBSTRING); Matcher m; - + boolean canFinish = asText.contains(MockLearner.ASSESSMENT_FINISH_BUTTON_SUBSTRING); if (hasEditRights) { // this is a Leader or it is a non-Leader Assessmnt @@ -946,7 +959,8 @@ if (m.find()) { finishURL = m.group(1); } else { - throw new TestHarnessException("Finish URL "+MockLearner.ASSESSMENT_FINISH_PATTERN+" was not found in Assessment Tool"); + throw new TestHarnessException( + "Finish URL " + MockLearner.ASSESSMENT_FINISH_PATTERN + " was not found in Assessment Tool"); } return (WebResponse) new Call(wc, test, username + " finishes Assessment", finishURL).execute(); Index: lams_tool_nb/web/learnerContent.jsp =================================================================== diff -u -r5b38d0691ca23ad51191739eac80b91e434e498a -rda506197047df06aabd8b50ffd781288b940a417 --- lams_tool_nb/web/learnerContent.jsp (.../learnerContent.jsp) (revision 5b38d0691ca23ad51191739eac80b91e434e498a) +++ lams_tool_nb/web/learnerContent.jsp (.../learnerContent.jsp) (revision da506197047df06aabd8b50ffd781288b940a417) @@ -11,8 +11,7 @@ } function submitForm(methodName) { var f = document.getElementById('learnerForm'); - var m = document.getElementById('methodVar'); - m.value = methodName; + f.action += "?method=" + methodName; f.submit(); } @@ -25,7 +24,6 @@ -
@@ -81,9 +79,4 @@ - - - - - - + \ No newline at end of file