Skip to content
Snippets Groups Projects
Commit 8022fe4d authored by Janis Daniel Dähne's avatar Janis Daniel Dähne
Browse files

- tutor view subsequent editor now respect file visibility and readonly

parent 66d6cb65
Branches
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ namespace ClientServer.Helpers
/// </summary>
public static class Constants
{
public static string VersionString = "2.20.3";
public static string VersionString = "2.20.4";
/// <summary>
/// this is only set once at program.cs!!
......
......@@ -43,11 +43,11 @@ namespace ClientServer.Controllers.Core.Exercises.DoExerciseAfterSolution
int userId = GetUserId();
await _GetAfterSolution(generatedCode, pLangId, userId);
await _GetAfterSolution(generatedCode, pLangId, userId, false);
}
internal async Task _GetAfterSolution(string generatedCode, int pLangId, int targetUserId)
internal async Task _GetAfterSolution(string generatedCode, int pLangId, int targetUserId, bool asTutor)
{
//ensure plang exists
PLang pLang = await _context.PLangs
......@@ -139,8 +139,18 @@ namespace ClientServer.Controllers.Core.Exercises.DoExerciseAfterSolution
return;
}
//template files should be loaded
var errorMsg = UserSolutionHelper.ReplaceReadonlyFiles(afterSolution, codeTemplate, true, false);
string errorMsg;
if (asTutor)
{
//template files should be loaded
errorMsg = UserSolutionHelper.ReplaceReadonlyFiles(afterSolution, codeTemplate, false, true);
}
else
{
//template files should be loaded
errorMsg = UserSolutionHelper.ReplaceReadonlyFiles(afterSolution, codeTemplate, true, false);
}
if (errorMsg != null)
{
......
......@@ -453,7 +453,7 @@ namespace ClientServer.Controllers.Core.Exercises
var doExerciseAfterSolutionController = new DoExerciseAfterSolutionController(_context)
{ControllerContext = this.ControllerContext};
await doExerciseAfterSolutionController._GetAfterSolution(exerciseRelease.GeneratedCode, pLangId, userId);
await doExerciseAfterSolutionController._GetAfterSolution(exerciseRelease.GeneratedCode, pLangId, userId, true);
}
[HttpGet("after/testresults/{exerciseReleaseId}/{userId}/{pLangId}")]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment