Index: lams_learning/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_learning/conf/language/lams/ApplicationResources.properties,v diff -u -r1.59 -r1.60 --- lams_learning/conf/language/lams/ApplicationResources.properties 9 Apr 2014 21:15:29 -0000 1.59 +++ lams_learning/conf/language/lams/ApplicationResources.properties 22 Dec 2014 16:04:10 -0000 1.60 @@ -11,6 +11,7 @@ error.message.404 =The page you have requested can not be found. error.message.login =You need login here error.title =Error occured +error.learner.not.finished =Cannot export portfolio, the user did not finish the lesson yet. message.activity.loading =The next task is loading. Please wait.... message.lesson.finished =Congratulations, {0}, you have finished. message.lesson.finishedCont =You have now completed the {0} lesson. You can return at anytime to this lesson and revisit and review activities by double clicking on the blue icons in the left hand progress bar. You can now close this window. Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java,v diff -u -r1.40 -r1.41 --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java 22 Dec 2014 10:24:23 -0000 1.40 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java 22 Dec 2014 16:04:10 -0000 1.41 @@ -123,19 +123,21 @@ } if (!securityService.isLessonLearner(lesson.getLessonId(), currentUserId, "export portfolio", false)) { - response.sendError(HttpServletResponse.SC_FORBIDDEN, "The user is not a learner in the lesson"); + // the way that LAMS works here will make 403 actually send 200, so it's better to use 500 + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "The user is not a learner in the lesson"); return; } LearnerProgress learnerProgress = lessonService.getUserProgressForLesson(currentUserId, lesson.getLessonId()); if ((learnerProgress == null) || !learnerProgress.isComplete()) { MainExportServlet.log.error("Learner with ID: " + currentUserId + " has not finished lesson with ID: " + lesson.getLessonId()); - response.sendError(HttpServletResponse.SC_FORBIDDEN, "The learner has not finished the lesson"); + response.sendError(HttpServletResponse.SC_NO_CONTENT, "The learner has not finished the lesson"); return; } } else if (!securityService.isLessonMonitor(lesson.getLessonId(), currentUserId, "export portfolio", false)) { - response.sendError(HttpServletResponse.SC_FORBIDDEN, "The user is not a learner in the lesson"); + // the way that LAMS works here will make 403 actually send 200, so it's better to use 500 + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "The user is not a learner in the lesson"); return; } @@ -147,7 +149,8 @@ + learnerLogin + ".zip"; } else if (mode.equals(ToolAccessMode.TEACHER.toString())) { if (!securityService.isLessonMonitor(lesson.getLessonId(), currentUserId, "export portfolio", false)) { - response.sendError(HttpServletResponse.SC_FORBIDDEN, "The user is not a monitor in the lesson"); + // the way that LAMS works here will make 403 actually send 200, so it's better to use 500 + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "The user is not a monitor in the lesson"); return; } Index: lams_learning/web/exportWaitingPage.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/exportWaitingPage.jsp,v diff -u -r1.19 -r1.20 --- lams_learning/web/exportWaitingPage.jsp 13 Feb 2009 00:17:40 -0000 1.19 +++ lams_learning/web/exportWaitingPage.jsp 22 Dec 2014 16:04:10 -0000 1.20 @@ -106,11 +106,15 @@ window.location.href = url; break; + case 204: + msg = ""; + document.getElementById("message").innerHTML = msg; + break; case 404: //status 404 Not Found msg = "."; alert(msg); break; - case 500: //status 500 Internal Server Error + case 500: // status 500 Internal Server Error msg = "

Status 500

"; document.getElementById("message").innerHTML = msg; break;