Update of 
/var/cvs/contributions/didactor2/src/education/java/nl/didactor/education/functions
In directory 
james.mmbase.org:/tmp/cvs-serv14970/education/java/nl/didactor/education/functions

Modified Files:
        GivenAnswers.java 
Log Message:
added some functions to make jsps simpler


See also: 
http://cvs.mmbase.org/viewcvs/contributions/didactor2/src/education/java/nl/didactor/education/functions


Index: GivenAnswers.java
===================================================================
RCS file: 
/var/cvs/contributions/didactor2/src/education/java/nl/didactor/education/functions/GivenAnswers.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- GivenAnswers.java   17 Nov 2008 17:40:51 -0000      1.2
+++ GivenAnswers.java   20 Nov 2008 15:09:40 -0000      1.3
@@ -10,7 +10,7 @@
 /**
  * Givenanswers for a certain question.
  * @author Michiel Meeuwissen
- * @version $Id: GivenAnswers.java,v 1.2 2008/11/17 17:40:51 michiel Exp $
+ * @version $Id: GivenAnswers.java,v 1.3 2008/11/20 15:09:40 michiel Exp $
  */
 public class GivenAnswers {
     protected final static Logger log = 
Logging.getLoggerInstance(GivenAnswers.class);
@@ -34,6 +34,12 @@
     }
 
 
+    protected Node getMadeTestHolder(Node test) {
+        return test.getFunctionValue("madetestholder", null).toNode();
+
+    }
+
+
     /**
      */
     public NodeList  givenanswers() {
@@ -44,10 +50,12 @@
 
         NodeList mt = null;
         if (test != null) {
-            NodeQuery sq = Queries.createRelatedNodesQuery(test, madetests, 
"related", "DESTINATION");
+            NodeQuery sq = 
Queries.createRelatedNodesQuery(getMadeTestHolder(test), madetests, "related", 
"DESTINATION");
             RelationStep srs = sq.addRelationStep(copybooks, "related", 
"SOURCE");
             sq.addNode(srs.getNext(), copybook.getNumber());
             mt = madetests.getList(sq);
+            log.info("Made tests " + mt);
+
         }
 
 
@@ -65,8 +73,10 @@
 
         RelationStep rs = q.addRelationStep(copybooks, "related",  "SOURCE");
         q.addNode(rs.getNext(), copybook.getNumber());
-
-        return givenanswers.getList(q);
+        NodeList result = givenanswers.getList(q);
+        log.info("" + q.toSql());
+        log.info("" + result);
+        return  result;
     }
 
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to