Skip to content
Snippets Groups Projects
Commit cba01108 authored by srosse's avatar srosse
Browse files

OO-1593: allow D&D on assessment test node if only one test part

parent 1a61f3da
No related branches found
No related tags found
No related merge requests found
......@@ -486,7 +486,8 @@ public class AssessmentTestComposerController extends MainLayoutBasicController
}
} else if(droppedObject instanceof AssessmentSection
&& (targetObject instanceof AssessmentSection || targetObject instanceof TestPart)) {
&& (targetObject instanceof AssessmentSection || targetObject instanceof TestPart
|| (targetObject instanceof AssessmentTest && ((AssessmentTest)targetObject).getTestParts().size() == 1))) {
AssessmentSection droppedSection = (AssessmentSection)droppedObject;
if(droppedSection.getParentSection() != null) {
droppedSection.getParentSection().getSectionParts().remove(droppedSection);
......@@ -499,6 +500,9 @@ public class AssessmentTestComposerController extends MainLayoutBasicController
} else if(targetObject instanceof TestPart) {
TestPart targetTestPart = (TestPart)targetObject;
targetTestPart.getAssessmentSections().add(droppedSection);
} else if(targetObject instanceof AssessmentTest) {
TestPart targetTestPart = ((AssessmentTest)targetObject).getTestParts().get(0);
targetTestPart.getAssessmentSections().add(droppedSection);
}
}
} else {
......
......@@ -144,7 +144,9 @@ public class AssessmentTestEditorAndComposerTreeModel extends GenericTreeModel i
public boolean isNodeDroppable(TreeNode node) {
if(node == null) return false;
Object uobject = node.getUserObject();
return uobject instanceof AssessmentSection || uobject instanceof TestPart || uobject instanceof AssessmentItemRef;
return uobject instanceof AssessmentSection || uobject instanceof TestPart
|| uobject instanceof AssessmentItemRef
|| (uobject instanceof AssessmentTest && ((AssessmentTest)uobject).getTestParts().size() == 1);
}
@Override
......
......@@ -88,7 +88,7 @@ form.testPart.navigationMode.linear=Linear
form.testPart.navigationMode.nonlinear=Nicht linear
form.unkown=Unbekannt
item.session.control.allow.comment=Kommentar erlauben
item.session.control.allow.review=Review erlauben
item.session.control.allow.review=R\u00FCckblick erlauben
item.session.control.attempts=Versuch
item.session.control.show.solution=L\u00F6sung anzeigen
max.score=Maximal erreichbare Punktzahl
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment