Index: lams_tool_eadventure/.classpath =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 --- lams_tool_eadventure/.classpath (.../.classpath) (revision 7322054ababd8f5387c3424cdd38d99c3ab49e02) +++ lams_tool_eadventure/.classpath (.../.classpath) (revision 6ea6b66ee54c1f8523ca68af071fcf82caeb5e98) @@ -7,20 +7,16 @@ - - - - - - - - - - + + + + + + + - - + Index: lams_tool_eadventure/build.xml =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 --- lams_tool_eadventure/build.xml (.../build.xml) (revision 7322054ababd8f5387c3424cdd38d99c3ab49e02) +++ lams_tool_eadventure/build.xml (.../build.xml) (revision 6ea6b66ee54c1f8523ca68af071fcf82caeb5e98) @@ -277,9 +277,6 @@ - - - Index: lams_tool_eadventure/lib/jaxen/sax.jar =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 Binary files differ Index: lams_tool_eadventure/lib/jaxen/saxpath.jar =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 Binary files differ Index: lams_tool_eadventure/lib/reload_2_0_1/jdom.jar =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 Binary files differ Index: lams_tool_eadventure/lib/reload_2_0_1/moonunitsrc.jar =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 Binary files differ Index: lams_tool_eadventure/lib/reload_2_0_1/reload-diva.jar =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 Binary files differ Index: lams_tool_eadventure/lib/reload_2_0_1/reload-editor.jar =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 Binary files differ Index: lams_tool_eadventure/lib/reload_2_0_1/xml-apis.jar =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 Binary files differ Index: lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureOutputFactory.java =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 --- lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureOutputFactory.java (.../EadventureOutputFactory.java) (revision 7322054ababd8f5387c3424cdd38d99c3ab49e02) +++ lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureOutputFactory.java (.../EadventureOutputFactory.java) (revision 6ea6b66ee54c1f8523ca68af071fcf82caeb5e98) @@ -33,6 +33,7 @@ import org.lamsfoundation.lams.learningdesign.BranchCondition; import org.lamsfoundation.lams.tool.OutputFactory; import org.lamsfoundation.lams.tool.OutputType; +import org.lamsfoundation.lams.tool.SimpleURL; import org.lamsfoundation.lams.tool.ToolOutput; import org.lamsfoundation.lams.tool.ToolOutputDefinition; import org.lamsfoundation.lams.tool.exception.ToolException; @@ -59,70 +60,74 @@ protected final static String OUTPUT_NAME_TOOL_CONDITION = "tool.condition"; @Override - public SortedMap getToolOutputDefinitions(Object toolContentObject) + public SortedMap getToolOutputDefinitions(Object toolContentObject, int definitionType) throws ToolException { TreeMap definitionMap = new TreeMap(); - - ToolOutputDefinition definition =null; - // add default outputs - definition = buildRangeDefinition(OUTPUT_NAME_LEARNER_TOTAL_SCORE, new Long(0), new Long(0), true ); - definitionMap.put(OUTPUT_NAME_LEARNER_TOTAL_SCORE, definition); - definition = buildBooleanOutputDefinition(OUTPUT_NAME_LEARNER_COMPLETED); - definitionMap.put(OUTPUT_NAME_LEARNER_COMPLETED, definition); - definition = buildRangeDefinition(OUTPUT_NAME_LEARNER_TOTAL_TIME, new Long(0), new Long(0), false ); - definitionMap.put(OUTPUT_NAME_LEARNER_TOTAL_TIME, definition); - definition = buildRangeDefinition(OUTPUT_NAME_LEARNER_REAL_TIME, new Long(0), new Long(0), false ); - definitionMap.put(OUTPUT_NAME_LEARNER_REAL_TIME, definition); - - Eadventure ead = (Eadventure)toolContentObject; - //TODO cambiar por ead.getParamsWithoutDeafault(); - Set eadParams = ead.getParams(); - for (EadventureParam param : eadParams){ + + switch (definitionType) { + case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_CONDITION: + ToolOutputDefinition definition = null; + // add default outputs + definition = buildRangeDefinition(OUTPUT_NAME_LEARNER_TOTAL_SCORE, new Long(0), new Long(0), true); + definitionMap.put(OUTPUT_NAME_LEARNER_TOTAL_SCORE, definition); + definition = buildBooleanOutputDefinition(OUTPUT_NAME_LEARNER_COMPLETED); + definitionMap.put(OUTPUT_NAME_LEARNER_COMPLETED, definition); + definition = buildRangeDefinition(OUTPUT_NAME_LEARNER_TOTAL_TIME, new Long(0), new Long(0), false); + definitionMap.put(OUTPUT_NAME_LEARNER_TOTAL_TIME, definition); + definition = buildRangeDefinition(OUTPUT_NAME_LEARNER_REAL_TIME, new Long(0), new Long(0), false); + definitionMap.put(OUTPUT_NAME_LEARNER_REAL_TIME, definition); + + Eadventure ead = (Eadventure) toolContentObject; + // TODO cambiar por ead.getParamsWithoutDeafault(); + Set eadParams = ead.getParams(); + for (EadventureParam param : eadParams) { String text; // skip default outputs - if (isDefaultOutput(param.getType())){ - if (param.getType().equals(EadventureConstants.PARAMS_TYPE_BOOLEAN)){ - definition = buildBooleanOutputDefinition(param.getName()); - definition.setDescription(getI18NText("output.desc.learner.user.defined", false) + param.getName()); - }else if (param.getType().equals(EadventureConstants.PARAMS_TYPE_INTEGER)){ - definition = buildRangeDefinition(param.getName(), new Long(0), null); - definition.setDescription(getI18NText("output.desc.learner.user.defined", false) + param.getName()); - } if (param.getType().equals(EadventureConstants.PARAMS_TYPE_STRING)){ - definition = buildRangeDefinition(param.getName(), new Long(0), null); - definition.setDescription(getI18NText("output.desc.learner.user.defined", false) + param.getName()); + if (isDefaultOutput(param.getType())) { + if (param.getType().equals(EadventureConstants.PARAMS_TYPE_BOOLEAN)) { + definition = buildBooleanOutputDefinition(param.getName()); + definition.setDescription(getI18NText("output.desc.learner.user.defined", false) + + param.getName()); + } else if (param.getType().equals(EadventureConstants.PARAMS_TYPE_INTEGER)) { + definition = buildRangeDefinition(param.getName(), new Long(0), null); + definition.setDescription(getI18NText("output.desc.learner.user.defined", false) + + param.getName()); + } + if (param.getType().equals(EadventureConstants.PARAMS_TYPE_STRING)) { + definition = buildRangeDefinition(param.getName(), new Long(0), null); + definition.setDescription(getI18NText("output.desc.learner.user.defined", false) + + param.getName()); + } + definitionMap.put(param.getName(), definition); } - definitionMap.put(param.getName(), definition); - } - } - - - //add the conditions defined at authoring - if (ead.getConditions()!=null&&ead.getConditions().size()>0){ - ToolOutputDefinition definitionOthers = buildBooleanSetOutputDefinition(OUTPUT_NAME_TOOL_CONDITION); - if ( definitionOthers.getDefaultConditions() == null ) + } + + // add the conditions defined at authoring + if (ead.getConditions() != null && ead.getConditions().size() > 0) { + ToolOutputDefinition definitionOthers = buildBooleanSetOutputDefinition(OUTPUT_NAME_TOOL_CONDITION); + if (definitionOthers.getDefaultConditions() == null) definitionOthers.setDefaultConditions(new ArrayList()); - + List defaultConditions = definitionOthers.getDefaultConditions(); String trueString = Boolean.TRUE.toString(); - + Iterator iter2 = ead.getConditions().iterator(); - while ( iter2.hasNext() ) { + while (iter2.hasNext()) { EadventureCondition condition = iter2.next(); - String name = buildConditionName(OUTPUT_NAME_TOOL_CONDITION, condition.getName()); - defaultConditions.add(new BranchCondition(null, null, condition.getSequenceId(), name, - condition.getName(), - OutputType.OUTPUT_BOOLEAN.toString(), - null, - null, - trueString)); + String name = buildConditionName(OUTPUT_NAME_TOOL_CONDITION, condition.getName()); + defaultConditions.add(new BranchCondition(null, null, condition.getSequenceId(), name, condition + .getName(), OutputType.OUTPUT_BOOLEAN.toString(), null, null, trueString)); } - + definitionOthers.setShowConditionNameOnly(Boolean.TRUE); - + definitionMap.put(OUTPUT_NAME_TOOL_CONDITION, definitionOthers); } - - + break; + case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_DATA_FLOW: + break; + } + return definitionMap; } Index: lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureServiceImpl.java =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 --- lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureServiceImpl.java (.../EadventureServiceImpl.java) (revision 7322054ababd8f5387c3424cdd38d99c3ab49e02) +++ lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/service/EadventureServiceImpl.java (.../EadventureServiceImpl.java) (revision 6ea6b66ee54c1f8523ca68af071fcf82caeb5e98) @@ -1053,22 +1053,22 @@ * @throws EadventureApplicationException */ - // @Override - public SortedMap getToolOutputDefinitions(Long toolContentId) throws ToolException { + // @Override + public SortedMap getToolOutputDefinitions(Long toolContentId, int definitionType) + throws ToolException { Eadventure content = getEadventureByContentId(toolContentId); if (content == null) { try { content = getDefaultContent(toolContentId); - + } catch (EadventureApplicationException e) { throw new ToolException(e); } } - - SortedMap prueba = getEadventureOutputFactory().getToolOutputDefinitions(content); - - - + + SortedMap prueba = getEadventureOutputFactory().getToolOutputDefinitions(content, + definitionType); + return prueba; } @@ -1621,6 +1621,10 @@ } + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return null; + } + //@Override public EadventureItemVisitLog getEadventureItemLog(Long itemUid, Long userId) { @@ -1643,10 +1647,4 @@ public void setEadventureExpressionDao(EadventureExpressionDAO eadventureExpressionDao) { this.eadventureExpressionDao = eadventureExpressionDao; } - - - - - - -} +} \ No newline at end of file Index: lams_tool_eadventure/web/WEB-INF/web.xml =================================================================== diff -u -r7322054ababd8f5387c3424cdd38d99c3ab49e02 -r6ea6b66ee54c1f8523ca68af071fcf82caeb5e98 --- lams_tool_eadventure/web/WEB-INF/web.xml (.../web.xml) (revision 7322054ababd8f5387c3424cdd38d99c3ab49e02) +++ lams_tool_eadventure/web/WEB-INF/web.xml (.../web.xml) (revision 6ea6b66ee54c1f8523ca68af071fcf82caeb5e98) @@ -10,20 +10,17 @@ org.eucm.lams.tool.eadventure.ApplicationResources - - - + contextConfigLocation classpath:/org/eucm/lams/tool/eadventure/dbupdates/autopatchContext.xml locatorFactorySelector - - classpath*:/org/lamsfoundation/lams/**/beanRefContext.xml + classpath:/org/lamsfoundation/lams/beanRefContext.xml parentContextKey