Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-1758

Replacing a solution does not delete the former file

    XMLWordPrintable

    Details

      Description

      When replacing a solution, the file of the former solution is not deleted, so the students will see at least 2 files, the actual solution and all former solutions. This is a problem when working with dummy solutions if the solution is not ready when the task starts and solution is activated in the workflow.

      This patch fixes that:

      diff --git a/src/main/java/org/olat/course/nodes/gta/ui/EditSolutionController.java b/src/main/java/org/olat/course/nodes/gta/ui/EditSolutionController.java
      --- a/src/main/java/org/olat/course/nodes/gta/ui/EditSolutionController.java
      +++ b/src/main/java/org/olat/course/nodes/gta/ui/EditSolutionController.java
      @@ -68,7 +68,7 @@
       		this(ureq, wControl, solution, solutionDir, solutionContainer, false);
       	}
       	
      -	private EditSolutionController(UserRequest ureq, WindowControl wControl,
      +	public EditSolutionController(UserRequest ureq, WindowControl wControl,
       			Solution solution, File solutionDir, VFSContainer solutionContainer, boolean replaceFile) {
       		super(ureq, wControl);
       		this.replaceFile = replaceFile;
      diff --git a/src/main/java/org/olat/course/nodes/gta/ui/GTASampleSolutionsEditController.java b/src/main/java/org/olat/course/nodes/gta/ui/GTASampleSolutionsEditController.java
      --- a/src/main/java/org/olat/course/nodes/gta/ui/GTASampleSolutionsEditController.java
      +++ b/src/main/java/org/olat/course/nodes/gta/ui/GTASampleSolutionsEditController.java
      @@ -247,7 +247,7 @@
       	}
       	
       	private void doReplace(UserRequest ureq, Solution solution) {
      -		editSolutionCtrl = new EditSolutionController(ureq, getWindowControl(), solution, solutionDir, solutionContainer);
      +		editSolutionCtrl = new EditSolutionController(ureq, getWindowControl(), solution, solutionDir, solutionContainer, true);
       		listenTo(editSolutionCtrl);
       
       		String title = translate("add.solution");
      

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              stephan Stephan Clemenz
              Tester:
              Stephan Clemenz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m