public Object call(Object[] inStack) {
/*
* argument check
*/
if (inStack.length > 1) {
return handleException( new ArgumentParseException(ArgumentParseException.NEEDS_FEWER_ARGUMENTS, name, "", "error.fewerargs",
"solution.provideone.nodereference"));
} else if (inStack.length < 1) { return handleException( new ArgumentParseException(ArgumentParseException.NEEDS_MORE_ARGUMENTS, name, "",
"error.moreargs", "solution.provideone.nodereference")); }
/*
* argument type check
*/
if (!(inStack[0] instanceof String)) return handleException( new ArgumentParseException(ArgumentParseException.WRONG_ARGUMENT_FORMAT, name, "",
"error.argtype.coursnodeidexpeted", "solution.example.node.infunction"));
String childId = (String) inStack[0];
/*
* check reference integrity
*/
CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
if (cev != null) {
if (!cev.existsNode(childId)) { return handleException( new ArgumentParseException(ArgumentParseException.REFERENCE_NOT_FOUND, name, childId,
"error.notfound.coursenodeid", "solution.copypastenodeid")); }
if (!cev.isAssessable(childId)) { return handleException(new ArgumentParseException(ArgumentParseException.REFERENCE_NOT_FOUND, name,
childId, "error.notassessable.coursenodid", "solution.takeassessablenode")); }
// remember the reference to the node id for this condtion
cev.addSoftReference("courseNodeId", childId);
// return a valid value to continue with condition evaluation test
return defaultValue();