Index: lams_central/src/java/org/lamsfoundation/lams/web/tag/GenerateIDTag.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/tag/Attic/GenerateIDTag.java,v diff -u -r1.2 -r1.3 --- lams_central/src/java/org/lamsfoundation/lams/web/tag/GenerateIDTag.java 13 Jun 2006 00:40:40 -0000 1.2 +++ lams_central/src/java/org/lamsfoundation/lams/web/tag/GenerateIDTag.java 22 Jun 2006 02:31:08 -0000 1.3 @@ -33,6 +33,7 @@ import org.lamsfoundation.lams.web.util.AttributeNames; import org.apache.log4j.Logger; +import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager; import java.util.Random; @@ -56,27 +57,55 @@ /** The random number to be output */ private int number = -1; + private Integer lessonID; public GenerateIDTag() { super(); } + /** + * @param id Lesson ID + */ + public void setId(String id) { + this.id = id; + } + /** + * @return Lesson ID + * + * @jsp.attribute required="false" + * rtexprvalue="true" + * description="Lesson Identifier" + */ + public String getId() { + return this.id; + } + + public int doStartTag() throws JspException { String uniqueID; HttpSession ss = SessionManager.getSession(); JspWriter writer = pageContext.getOut(); try { if(ss != null){ + if(getId() != null && getId().startsWith("$")) + ExpressionEvaluatorManager.evaluate("id", getId(), String.class, this, pageContext); + if((uniqueID = (String)ss.getAttribute(AttributeNames.UID)) != null){ - writer.print(uniqueID); + if(getId() != null) + writer.print(uniqueID + "%" + getId()); + else + writer.print(uniqueID); } else { long seed = System.currentTimeMillis(); Random rand = new Random(seed); number = rand.nextInt(); if (number != -1) { ss.setAttribute(AttributeNames.UID, String.valueOf(number)); - writer.print(String.valueOf(number)); + if(getId() != null) + writer.print(ss.getAttribute(AttributeNames.UID) + "%" + getId()); + else + writer.print(ss.getAttribute(AttributeNames.UID)); } else { log.warn("GenerateIDTag could not write out random number because no new integer value was assigned."); } Index: lams_central/web/WEB-INF/lams.tld =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/Attic/lams.tld,v diff -u -r1.19 -r1.20 --- lams_central/web/WEB-INF/lams.tld 21 Jun 2006 12:08:15 -0000 1.19 +++ lams_central/web/WEB-INF/lams.tld 22 Jun 2006 02:31:08 -0000 1.20 @@ -35,7 +35,7 @@ Output a random number for the learner and passon flash movies to communicate directly. id - true + false true @@ -302,15 +302,9 @@ headItems /WEB-INF/tags/headItems.tag - - - Passon - /WEB-INF/tags/Passon.tag + Passon + /WEB-INF/tags/Passon.tag - - ExportPortOutput - /WEB-INF/tags/ExportPortOutput.tag -