[samigo-team] Flow controll in Samigo-app
David Horwitz
david.horwitz at uct.ac.za
Fri Mar 22 06:03:49 PDT 2013
Thanks Karen, that did the trick once I had repeated in couple of the other actions (save & submit)
Going to attach an updated patch for testing.
D
On Tue, 2013-03-19 at 11:22 -0700, Karen Tsao wrote:
Hi David,
I think you can try to throw the exception from SubmitToGradingActionListener again and catch it in DeliveryBean. For example for the Next button:
public String next_page()
{
String nextAction = checkBeforeProceed();
log.debug("***** next Action="+nextAction);
if (!("safeToProceed").equals(nextAction)){
return nextAction;
}
forGrade = false;
if (this.actionMode == TAKE_ASSESSMENT
|| this.actionMode == TAKE_ASSESSMENT_VIA_URL)
{
syncTimeElapsedWithServer();
SubmitToGradingActionListener listener =
new SubmitToGradingActionListener();
try {
listener.processAction(null);
}
catch (FinFormatException e) {
log.debug(e.getMessage());
return "takeAssessment";
}
catch (SaLengthException sae) {
log.debug(sae.getMessage());
return "takeAssessment";
}
// This is the code from your patch. I moved it from SubmitToGradingActionListener to here
catch (SamigoDataAccessException e) {
e.printStackTrace();
FacesContext context = FacesContext.getCurrentInstance();
String err = (String) ContextUtil.getLocalizedString(
"org.sakaiproject.tool.assessment.bundle.AuthorMessages",
"saveanswer_exception_error");
context.addMessage(null, new FacesMessage(err));
return "takeAssessment";
}
}
I didn't try this out in my instance and so you might still need to make some changes. But I think something like this should work.
Thanks,
Karen
On Tue, Mar 19, 2013 at 5:37 AM, David Horwitz <david.horwitz at uct.ac.za<mailto:david.horwitz at uct.ac.za>> wrote:
Hi All,
Having spent my time mostly in the service layer I've hit a point where my limited knowledge of the Samigo app (and JSF) has let me down. Bsically what I'm trying to do for SAM-2080 is this:
If a service level error occurs on save or next:
1) Display an alert
2) Stay on the page
I've got 1 working with minimal modification to DeliveryBean & SubmitTogradingActionListener but can't seem to see how to get 2 working. it would seem that DeliveryBean.checkBeforeProceed would be the place to check for the error condition, but i've been unsuccessful in that.
Any tips welcomed!
D
________________________________
UNIVERSITY OF CAPE TOWN
This e-mail is subject to the UCT ICT policies and e-mail disclaimer published on our website at http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 21 650 9111<tel:%2B27%2021%20650%209111>. This e-mail is intended only for the person(s) to whom it is addressed. If the e-mail has reached you in error, please notify the author. If you are not the intended recipient of the e-mail you may not use, disclose, copy, redirect or print the content. If this e-mail is not related to the business of UCT it is sent by the sender in the sender's individual capacity.
_______________________________________________
samigo-team mailing list
samigo-team at collab.sakaiproject.org<mailto:samigo-team at collab.sakaiproject.org>
http://collab.sakaiproject.org/mailman/listinfo/samigo-team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/samigo-team/attachments/20130322/030e683c/attachment-0001.html
More information about the samigo-team
mailing list