Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java,v
diff -u -r1.117 -r1.118
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 10 Dec 2014 11:00:20 -0000 1.117
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 13 Feb 2015 21:54:06 -0000 1.118
@@ -39,7 +39,6 @@
import java.util.TreeMap;
import java.util.TreeSet;
-import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
@@ -894,25 +893,29 @@
final String NEW_LINE_CHARACTER = "
";
HttpSession ss = SessionManager.getSession();
- UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
- Long userId = new Long(toolUser.getUserID().longValue());
+ UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ Long userId = new Long(userDto.getUserID().longValue());
QaQueUsr user = getUserByIdAndSession(userId, new Long(sessionId));
-
String fullName = user.getFullname();
- String message = NEW_LINE_CHARACTER + NEW_LINE_CHARACTER
- + messageService.getMessage("label.user.has.answered.questions", new Object[] { fullName });
-
+ //add question-answer pairs to email message
List responses = qaUsrRespDAO.getResponsesByUserUid(user.getUid());
+ Date attemptTime = new Date();
+ String message = new String();
for (QaUsrResp response : responses) {
String question = response.getQaQuestion().getQuestion();
String answer = response.getAnswer();
- message += NEW_LINE_CHARACTER + NEW_LINE_CHARACTER + question + answer;
+ message += NEW_LINE_CHARACTER + NEW_LINE_CHARACTER + question + " " + answer;
+ attemptTime = response.getAttemptTime();
}
+
+ message = NEW_LINE_CHARACTER
+ + NEW_LINE_CHARACTER
+ + messageService
+ .getMessage("label.user.has.answered.questions", new Object[] { fullName, attemptTime })
+ + message + NEW_LINE_CHARACTER + NEW_LINE_CHARACTER;
- message += NEW_LINE_CHARACTER + NEW_LINE_CHARACTER;
-
eventNotificationService.notifyLessonMonitors(sessionId, message, true);
}