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

- added totalReleases, totalSubmissions, totalTags to dashboard usage

parent 6c3e2e94
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,7 @@ namespace ClientServer.Controllers
Jc.Serialize(new BasicResponse(ResponseCode.NotFound, "systems settings not found")));
return;
}
var settingsFromBackend = SystemSettingsController._CreateSystemSettingsFromBackend(systemSettings);
await
......@@ -270,10 +270,31 @@ namespace ClientServer.Controllers
int totalGroupRoles = await _context.GroupRoles.CountAsync();
int totalExercises = await _context.Exercises.CountAsync();
int totalCustomProjects = await _context.CustomProjects.CountAsync();
int runningAssessments = await _context.ExerciseReleases.CountAsync(p => p.HasAutomaticAssessmentStarted
&& p
.HasAutomaticAssessmentFinished ==
false);
int runningAssessments = await _context.ExerciseReleases
.CountAsync(p => p.HasAutomaticAssessmentStarted
&& p
.HasAutomaticAssessmentFinished ==
false);
int totalSubmissions =
await _context.ExerciseReleases
.Where(p => p.ExerciseReleaseWithUserAsParticipations.Count >= 5)
.SumAsync(p => p.ExerciseReleaseWithUserAsParticipations.Count);
// int totalSubmissions2 =
// await _context.ExerciseReleases
// .SumAsync(p => p.ExerciseReleaseWithUserAsParticipations.Count);
//or maybe only count where we have >2 / >5 submissions? else it's likely to be a test release
//also excludes releases where we have no submissions
int totalReleases = await _context.ExerciseReleases
.CountAsync(p => p.ExerciseReleaseWithUserAsParticipations.Count >= 5);
// int totalReleases2 = await _context.ExerciseReleases
// .CountAsync();
int totalTags = await _context.Tags.CountAsync();
var statistic = new LogicalUsageStatistic()
{
......@@ -284,6 +305,9 @@ namespace ClientServer.Controllers
TotalGroupRoles = totalGroupRoles,
TotalExercises = totalExercises,
TotalCustomProjects = totalCustomProjects,
TotalTags = totalTags,
TotalReleases = totalReleases,
TotalSubmissions = totalSubmissions,
RunningAssessments = runningAssessments,
};
......@@ -419,6 +443,10 @@ namespace ClientServer.Controllers
public int TotalExercises { get; set; }
public int TotalCustomProjects { get; set; }
public int TotalTags { get; set; }
public int TotalReleases { get; set; }
public int TotalSubmissions { get; set; }
/// <summary>
/// the number of running assessments
/// </summary>
......@@ -461,7 +489,7 @@ namespace ClientServer.Controllers
public string DashboardScriptPathRelativeToCurrentDir { get; set; }
public bool RunAssessmentsAsync { get; set; }
public bool IsInitControllerEnabled { get; set; }
public bool EnsureFileUploadDirStructure { get; set; }
public string FileUploadDirRelativePath { get; set; }
public string MarkdownAssetFilesUploadDirName { get; set; }
......
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