Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.8",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}
207 changes: 207 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
/Documentation/Help/

# Visual Studo 2015 cache/options directory
.vs/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

## Ignore key files for GlobeSpotter for ArcGIS Pro
/client-side/C#/GlobeSpotterArcGISPro/GlobeSpotterArcGISPro/Resources/APIKey.xml
/client-side/C#/SignKey
/StreetSmartAPI/StreetSmart.Tests.NET6/appsettings.User.json
/StreetSmartAPI/StreetSmart.WinForms.Tests.NET6/appsettings.User.json
/StreetSmartAPI/StreetSmart.WinForms.Tests/appsettings.User.json
/ClassMonitor/ClassMonitor.Web/LocalDatabase.db
/ClassMonitor/ClassMonitor.Web/LocalDatabase.db-shm
/ClassMonitor/ClassMonitor.Web/LocalDatabase.db-wal
13 changes: 13 additions & 0 deletions ClassMonitor/ClassMonitor.Core/ClassMonitor.Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
</ItemGroup>

</Project>
14 changes: 14 additions & 0 deletions ClassMonitor/ClassMonitor.Core/DomainAggregate/Domain.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassMonitor.Core.DomainAggregate
{
public class Domain
{
public int Id { get; set; }
public string Name { get; set; }
}
}
16 changes: 16 additions & 0 deletions ClassMonitor/ClassMonitor.Core/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using ClassMonitor.Core.Interfaces;
using ClassMonitor.Core.Services;
using Microsoft.Extensions.DependencyInjection;

namespace ClassMonitor.Core
{
public static class Extensions
{
public static IServiceCollection AddCoreServices(this IServiceCollection services)
{
services.AddScoped<IStudentProgressService, StudentProgressService>();

return services;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using ClassMonitor.Core.Models;

namespace ClassMonitor.Core.Interfaces
{
public interface IStudentProgressService
{
Task<ProgressByStudent[]> GetDailyProgressByStudent(int year, int month, int day);

Task<ProgressByStudent[]> GetMonthlyProgressByStudent(int year, int month);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassMonitor.Core.LearningObjectiveAggregate
{
public class LearningObjective
{
public int Id { get; set; }
public string Name { get; set; }
}
}
9 changes: 9 additions & 0 deletions ClassMonitor/ClassMonitor.Core/Models/ProgressByStudent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace ClassMonitor.Core.Models
{
public class ProgressByStudent
{
public required DateTime DateTime { get; set; }
public required string StudentName { get; set; }
public required int? Progress { get; set; }
}
}
40 changes: 40 additions & 0 deletions ClassMonitor/ClassMonitor.Core/Services/StudentProgressService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using ClassMonitor.Core.Interfaces;
using ClassMonitor.Core.Models;
using ClassMonitor.Core.WorkAggregate;
using Microsoft.EntityFrameworkCore;

namespace ClassMonitor.Core.Services
{
public class StudentProgressService(DbContext context) : IStudentProgressService
{
public async Task<ProgressByStudent[]> GetDailyProgressByStudent(int year, int month, int day)
{
return await context.Set<Work>()
.Where(x => x.SubmitDateTime.Day == day && x.SubmitDateTime.Month == month && x.SubmitDateTime.Year == year)
.OrderBy(x => x.UserId)
.ThenBy(x => x.SubmitDateTime)
.Select(x => new ProgressByStudent
{
DateTime = x.SubmitDateTime,
Progress = x.Progress,
StudentName = "Student " + x.UserId
})
.ToArrayAsync();
}

public async Task<ProgressByStudent[]> GetMonthlyProgressByStudent(int year, int month)
{
return await context.Set<Work>()
.Where(x => x.SubmitDateTime.Month == month && x.SubmitDateTime.Year == year)
.OrderBy(x => x.UserId)
.ThenBy(x => x.SubmitDateTime)
.Select(x => new ProgressByStudent
{
DateTime = x.SubmitDateTime,
Progress = x.Progress,
StudentName = "Student " + x.UserId
})
.ToArrayAsync();
}
}
}
14 changes: 14 additions & 0 deletions ClassMonitor/ClassMonitor.Core/SubjectAggregate/Subject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassMonitor.Core.SubjectAggregate
{
public class Subject
{
public int Id { get; set; }
public string Name { get; set; }
}
}
13 changes: 13 additions & 0 deletions ClassMonitor/ClassMonitor.Core/UserAggregate/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassMonitor.Core.UserAggregate
{
public class User
{
public int Id { get; set; }
}
}
Loading