Update of
/var/cvs/contributions/didactor2/src/education/templates/education/tests
In directory james.mmbase.org:/tmp/cvs-serv22895
Modified Files:
buildtest.jsp definitions.jsp index.jsp
Added Files:
buildtestresult.jsp
Log Message:
cleaned up, split of building test result of index.jsp, to make for better
overviewable jsp
See also:
http://cvs.mmbase.org/viewcvs/contributions/didactor2/src/education/templates/education/tests
buildtestresult.jsp is new
Index: buildtest.jsp
===================================================================
RCS file:
/var/cvs/contributions/didactor2/src/education/templates/education/tests/buildtest.jsp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- buildtest.jsp 20 Mar 2008 14:36:03 -0000 1.37
+++ buildtest.jsp 26 Jun 2008 12:50:21 -0000 1.38
@@ -27,6 +27,7 @@
</mm:notpresent>
</mm:present>
+ <jsp:text><!-- Made test: ${madetest} --></jsp:text>
<div class="content learnenvironment tests">
<!-- Take care: form name is used in JavaScript of the specific
question jsp pages! -->
@@ -36,11 +37,9 @@
method="POST">
<mm:node number="$learnobject" id="test">
- <mm:field name="showtitle">
- <mm:compare value="1">
- <h1><mm:field name="name"/></h1>
- </mm:compare>
- </mm:field>
+
+ <di:title field="name" />
+
<mm:hasfield name="text">
<mm:field name="text" escape="toxml"/>
@@ -69,6 +68,8 @@
<mm:write session="my_questions" referid="my_questions" />
+ <jsp:text><!-- givenanswers: ${givenanswers}, my questions:
${my_questions} --></jsp:text>
+
<mm:listnodes referid="my_questions">
<mm:present referid="copybookNo">
Index: definitions.jsp
===================================================================
RCS file:
/var/cvs/contributions/didactor2/src/education/templates/education/tests/definitions.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- definitions.jsp 21 Dec 2005 08:40:20 -0000 1.2
+++ definitions.jsp 26 Jun 2008 12:50:21 -0000 1.3
@@ -1,4 +1,8 @@
-<mm:import id="TESTSCORE_INCOMPLETE">-1</mm:import>
-<mm:import id="TESTSCORE_TBS">-4</mm:import> <%-- e.g. there are open
questions --%>
-<mm:import id="TESTSCORE_WR">0</mm:import> <%-- e.g. there are open questions
--%>
-<mm:import id="TESTSCORE_COR">1</mm:import> <%-- e.g. there are open questions
--%>
+<jsp:root
+ xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
+ xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0">
+ <mm:import id="TESTSCORE_INCOMPLETE">-1</mm:import>
+ <mm:import id="TESTSCORE_TBS">-4</mm:import> <!-- e.g. there are open
questions -->
+ <mm:import id="TESTSCORE_WR">0</mm:import> <!-- e.g. there are open
questions -->
+ <mm:import id="TESTSCORE_COR">1</mm:import> <!-- e.g. there are open
questions -->
+</jsp:root>
Index: index.jsp
===================================================================
RCS file:
/var/cvs/contributions/didactor2/src/education/templates/education/tests/index.jsp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- index.jsp 15 Jan 2008 15:45:54 -0000 1.32
+++ index.jsp 26 Jun 2008 12:50:21 -0000 1.33
@@ -1,6 +1,7 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:di="http://www.didactor.nl/ditaglib_1.0" >
<mm:content postprocessor="none" type="application/xml" expires="0">
<mm:cloud rank="didactor user">
@@ -18,7 +19,23 @@
<di:copybook><mm:node id="copybookNo" /></di:copybook>
<mm:node number="$testNo">
+
+ <mm:function name="online" write="false">
+ <c:choose>
+ <c:when test="${_ eq false}">
+ <!-- Test not online, show that -->
+ <div class="learnenvironment copybook_${copybookNo}">
+ <di:translate key="education.testnotyetavailable" />
+ <mm:field name="online_date">
+ <mm:time format=":FULL" /></mm:field> - <mm:field
name="offline_date"><mm:time format=":FULL" />
+ </mm:field>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <!-- Test is indeed online -->
+
<mm:present referid="copybookNo">
+ <!-- Determin wether test was made already -->
<mm:relatednodescontainer path="madetests,copybooks"
element="madetests">
<mm:constraint field="score" referid="TESTSCORE_INCOMPLETE"
inverse="true"/>
<mm:constraint field="copybooks.number" value="$copybookNo" />
@@ -29,106 +46,29 @@
</mm:relatednodescontainer>
</mm:present>
- <mm:booleanfunction name="online" inverse="true">
- <div class="learnenvironment copybook_${copybookNo}">
- <di:translate key="education.testnotyetavailable" />
- <mm:field name="online_date"><mm:time format=":FULL" /></mm:field>
- <mm:field name="offline_date"><mm:time format=":FULL" /></mm:field>
- <mm:import id="testCantBeShowed" />
- </div>
- </mm:booleanfunction>
+ <jsp:text><!-- made test no: ${madetestNo} --></jsp:text>
- <mm:notpresent referid="testCantBeShowed">
<mm:present referid="madetestNo">
- <div class="learnenvironment">
- <mm:field name="showtitle">
- <mm:compare value="1">
- <h1><mm:field name="name"/></h1>
- </mm:compare>
- </mm:field>
- <mm:field id="maychange" name="maychange" write="false"/>
- <mm:field id="mayview" name="mayview" write="false"/>
- <mm:field id="feedback" name="feedbackpage" write="false"/>
- <mm:import externid="justposted" />
-
- <mm:field name="number">
- <mm:compare referid2="justposted" inverse="true">
- <mm:compare referid="madetestscore" referid2="TESTSCORE_TBS">
- <p><di:translate key="education.alreadymade_tobescored"
/></p>
- </mm:compare>
-
- <mm:compare referid="madetestscore" referid2="TESTSCORE_TBS"
inverse="true">
- <!-- if madestestscore larger or equal than requiredscore
-->
- <mm:field id="requiredscore" name="requiredscore"
write="false"/>
-
- <mm:islessthan referid="feedback" value="1">
- <mm:islessthan referid="madetestscore"
referid2="requiredscore" inverse="true">
- <di:translate key="education.alreadymade_success"
/><p/>
- </mm:islessthan>
- <mm:islessthan referid="madetestscore"
referid2="requiredscore">
- <di:translate key="education.alreadymade_fail" /><p/>
- </mm:islessthan>
- </mm:islessthan>
-
- <mm:compare referid="feedback" value="1">
- <di:translate key="education.alreadymade" /> <p/>
- </mm:compare>
-
- <table>
- <tr>
- <mm:compare referid="mayview" value="1">
- <td>
- <div class="button1">
- <mm:treefile
page="/education/tests/viewanswersframe.jsp" objectlist="$includePath"
write="false"
-
referids="$referids,testNo,madetestNo,[EMAIL PROTECTED]"
- >
- <a href="${_}"
onclick="requestContent('${_}'); return false;"><di:translate
key="education.view" /></a>
- </mm:treefile>
- </div>
- </td>
- </mm:compare>
-
- <mm:compare referid="maychange" value="1">
- <td>
- <div class="button1">
- <mm:treefile
- page="/education/tests/buildtest.jsp"
objectlist="$includePath" write="false"
- referids="$referids,[EMAIL PROTECTED]">
- <a href="${_}">
- <mm:compare referid="feedback"
value="1"><di:translate key="education.again" /></mm:compare>
- <mm:compare referid="feedback"
value="0"><di:translate key="education.retry" /></mm:compare>
- </a>
- </mm:treefile>
- </div>
- </td>
- <td>
- <div class="button1">
- <mm:treefile
- page="/education/tests/buildtest.jsp"
objectlist="$includePath" write="false"
- referids="$referids,[EMAIL PROTECTED]">
- <mm:param name="clearmadetest">true</mm:param>
- <a href="${_}"><di:translate
key="education.clear" /></a>
- </mm:treefile>
- </div>
- </td>
- </mm:compare>
- </tr>
- </table>
- </mm:compare>
- </mm:compare>
- </mm:field>
- </div>
+ <!-- Made already, show the result -->
+ <mm:treeinclude
+ debug="html"
+ page="/education/tests/buildtestresult.jsp"
objectlist="$includePath"
+ referids="$referids,[EMAIL PROTECTED],madetestscore" />
</mm:present>
- </mm:notpresent>
- </mm:node>
- <mm:notpresent referid="testCantBeShowed">
+
<mm:present referid="madetestNo" inverse="true">
+ <!-- Not made already, build the test, and let the user make
it -->
<mm:treeinclude
debug="html"
page="/education/tests/buildtest.jsp" objectlist="$includePath"
referids="$referids,[EMAIL PROTECTED]" />
</mm:present>
- </mm:notpresent>
+
+ </c:otherwise>
+ </c:choose>
+ </mm:function>
+ </mm:node>
<mm:node number="$testNo">
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs