use of org.olat.course.nodes.gta.model.SolutionList in project openolat by klemens.
the class ConvertToGTACourseNode method copySolutions.
private void copySolutions(TACourseNode sourceNode, GTACourseNode gtaNode, CourseEnvironment courseEnv) {
ModuleConfiguration gtaConfig = gtaNode.getModuleConfiguration();
String solutionPath = SolutionController.getSolutionPathRelToFolderRoot(courseEnv, sourceNode);
OlatRootFolderImpl solutionContainer = new OlatRootFolderImpl(solutionPath, null);
VFSContainer solutionDirectory = gtaManager.getSolutionsContainer(courseEnv, gtaNode);
SolutionList solutionList = new SolutionList();
for (VFSItem solution : solutionContainer.getItems()) {
if (solution instanceof VFSLeaf) {
VFSLeaf solutionDocument = solutionDirectory.createChildLeaf(solution.getName());
VFSManager.copyContent((VFSLeaf) solution, solutionDocument);
Solution solDef = new Solution();
convertMetada(solutionContainer, solutionDirectory, solution.getName(), null, solDef);
solDef.setFilename(solution.getName());
solutionList.getSolutions().add(solDef);
}
}
gtaConfig.set(GTACourseNode.GTASK_SOLUTIONS, solutionList);
}
Aggregations