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
601 changes: 601 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# SnappetChallenge
At [Snappet](http://www.snappet.org), we care about data and we care about code. When we interview for development positions, we want to see code and we want to discuss code. That's why we want candidates to show some work on our challenge. This challenge is not meant to cost you tons of time. A few hours should be enough. The challenge is defined very broadly. You could spend weeks on it, or half an hour. We understand that in 2 hours, you can only do so much. Don't worry about completeness, work on something that works and shows your skills.
# Snappet Coding Challenge

### Language
From the next paragraph on, this challenge is worded in Dutch. Snappet is a Dutch organisation. We are present in several European countries and part of our development team is based in Russia, but still, most of the organisation is Dutch. We all speak English, standups, code and documentation are in English, but being able to operate in a Dutch environment is a required skill. So use whatever tools you can to make sense of the rest of the challenge if you are not a Dutch speaker. It is part of the exercise. :)
This is an example solution based on the snappet coding challenge.

### De opdracht
In deze repository vind je een folder Data met daarin work.csv en work.json. Beiden bevatten dezelfde data, je hoeft er maar één te gebruiken (wat jij handig vindt). In dit bestand zitten de werkresultaten van de kinderen in één klas over een maand.
The solution exposes an API allowing the teacher to retrieve progress information for a given classroom and date.

Maak een rapport of scherm of wat ook dat een leerkracht een overzicht geeft van hoe zijn klas vandaag heeft gewerkt en waaraan. Het is nu dinsdag 2015-03-24 11:30:00 UTC. De antwoorden van na dat tijdstip worden dus nog niet getoond.
This solution is scaffolded based on the AWS Lambda ASP.NET Core Web API template, found on the Amazon.Lambda.Templates namespace.
The initial dataset is found in the Data folder, work.json.
The dataset is imported into an EF core InMemory database.

Maak een pull request aan waarin je in ieder geval een readme hebt opgenomen die uitlegt wat je moet doen om het resultaat te kunnen bekijken.
### Public API ###

### Achtergrond informatie
- Alle tijden zijn in UTC
- Er is een attribuut Progress. Dit geeft de verandering in de inschatting van de vaardigheid van de leerling op een leerdoel. Daar zitten psychometrische modellen achter die rekening houden met de moeilijkheid van de opgave, of de opgave al eerder door deze leerling is gemaakt, etc. Er zijn meerdere situaties waarbij de Progress 0 is. Bijvoorbeeld als we nog geen goede calibratie van de moeilijkheid van de opgave hebben. Of als de leerling nog te weinig opgaven in een leerdoel heeft gemaakt om een goede schatting van de vaardigheid te maken.
- Aangezien deze dataset alleen wijzigingen laat zien en geen absolute waarde, kan je aan deze dataset niet zien wat de vaardigheid van iedere leerling is. Dat hoeft ook niet in de resultaten terug te komen.
The API is available publicly at the following URL:
https://n7d2hzb5th.execute-api.us-east-1.amazonaws.com/Prod/api/classroom/10/2015-03-19%2010%3A30%3A00
The date can be changed, it is currently set to "Tuesday 2015-03-24 11:30:00 UTC" as specified in the challenge

### Vrijheid
Deze opdracht is expres ruim geformuleerd. Je mag de technieken en tools gebruiken die je het liefst gebruikt. Je mag je tijd besteden aan de aspecten die je zelf het belangrijkst vindt. Er is geen tijd om alles te doen: maak een keuze. Bij Snappet werken we met C#, .NET, Typescript en Angular. Maar we denken dat een goede programmeur op een ander platform zich dat snel genoeg eigen maakt.
Je mag frameworks en libraries gebruiken. Je mag de data in een ander formaat omzetten of importeren in databases. Dan wel in de readme uitleggen hoe een ander het werkend kan krijgen.
De minimale requirement in de opdracht is "waar heeft mijn klas vandaag aan gewerkt". Dat kan in een lijstje, in een grafisch vorm, het kan als getallen of kleuren. Je kan het vergelijken met vorige week of een gemiddelde score. Probeer te bedenken wat voor een leerkracht in de klas het belangrijkst is.
### Running Locally ###

1. In your terminal window, browse to src\SnappetChallenge.Classroom.Api directory.
2. Execute "dotnet run"
3. You can then open a browser and point to http://localhost:5000/api/classroom/10/2015-03-19%2010%3A30%3A00

### AWS CloudFormation Deployment ###
The cloudformation template can be found at src\SnappetChallenge.Classroom.Api\template.yaml
By installing AWS toolkit for either Visual Studio or Rider, you can right click this file and deploy with your setup credentials.
57 changes: 57 additions & 0 deletions SnappetChallenge.Classroom.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8F9148B7-1380-4CDA-AE67-C6EFD1A5C4AB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SnappetChallenge.Classroom.Api", "src\SnappetChallenge.Classroom.Api\SnappetChallenge.Classroom.Api.csproj", "{9387F2DA-E2F0-4687-8A2A-B3DC137442A3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EBA5E12D-983D-4774-935C-E7790337E847}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SnappetChallenge.Classroom.Tests", "test\SnappetChallenge.Classroom.Tests\SnappetChallenge.Classroom.Tests.csproj", "{45D7AC65-54B0-458A-B50C-F3C781983200}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SnappetChallenge.Classroom.Infrastructure", "src\SnappetChallenge.Classroom.Infrastructure\SnappetChallenge.Classroom.Infrastructure.csproj", "{BA0F794F-5AD3-4C4D-90ED-B66DC0086BD7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SnappetChallenge.Classroom.Application", "src\SnappetChallenge.Classroom.Application\SnappetChallenge.Classroom.Application.csproj", "{6B188176-E041-463D-B769-E0860E629DA4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SnappetChallenge.Classroom.Domain", "src\SnappetChallenge.Classroom.Domain\SnappetChallenge.Classroom.Domain.csproj", "{76A6836F-5BEA-4791-B4A5-F58BDF5CD54A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9387F2DA-E2F0-4687-8A2A-B3DC137442A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9387F2DA-E2F0-4687-8A2A-B3DC137442A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9387F2DA-E2F0-4687-8A2A-B3DC137442A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9387F2DA-E2F0-4687-8A2A-B3DC137442A3}.Release|Any CPU.Build.0 = Release|Any CPU
{45D7AC65-54B0-458A-B50C-F3C781983200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{45D7AC65-54B0-458A-B50C-F3C781983200}.Debug|Any CPU.Build.0 = Debug|Any CPU
{45D7AC65-54B0-458A-B50C-F3C781983200}.Release|Any CPU.ActiveCfg = Release|Any CPU
{45D7AC65-54B0-458A-B50C-F3C781983200}.Release|Any CPU.Build.0 = Release|Any CPU
{BA0F794F-5AD3-4C4D-90ED-B66DC0086BD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA0F794F-5AD3-4C4D-90ED-B66DC0086BD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA0F794F-5AD3-4C4D-90ED-B66DC0086BD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA0F794F-5AD3-4C4D-90ED-B66DC0086BD7}.Release|Any CPU.Build.0 = Release|Any CPU
{6B188176-E041-463D-B769-E0860E629DA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B188176-E041-463D-B769-E0860E629DA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B188176-E041-463D-B769-E0860E629DA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B188176-E041-463D-B769-E0860E629DA4}.Release|Any CPU.Build.0 = Release|Any CPU
{76A6836F-5BEA-4791-B4A5-F58BDF5CD54A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76A6836F-5BEA-4791-B4A5-F58BDF5CD54A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76A6836F-5BEA-4791-B4A5-F58BDF5CD54A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76A6836F-5BEA-4791-B4A5-F58BDF5CD54A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9387F2DA-E2F0-4687-8A2A-B3DC137442A3} = {8F9148B7-1380-4CDA-AE67-C6EFD1A5C4AB}
{45D7AC65-54B0-458A-B50C-F3C781983200} = {EBA5E12D-983D-4774-935C-E7790337E847}
{BA0F794F-5AD3-4C4D-90ED-B66DC0086BD7} = {8F9148B7-1380-4CDA-AE67-C6EFD1A5C4AB}
{6B188176-E041-463D-B769-E0860E629DA4} = {8F9148B7-1380-4CDA-AE67-C6EFD1A5C4AB}
{76A6836F-5BEA-4791-B4A5-F58BDF5CD54A} = {8F9148B7-1380-4CDA-AE67-C6EFD1A5C4AB}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Mvc;
using SnappetChallenge.Classroom.Domain.Errors;
using SnappetChallenge.Classroom.Infrastructure.Repositories;

namespace SnappetChallenge.Classroom.Api.Controllers;

[Route("api/[controller]")]
public class ClassroomController(ILogger<ClassroomController> logger, IReadonlyClassroomRepository repository)
: ControllerBase
{
[HttpGet]
[HttpGet("{classroomId:int}")]
public async Task<IActionResult> Get(int classroomId, CancellationToken cancellationToken)
{
var classroom = await repository.GetClassroomOverviewAsync(classroomId, DateTime.UtcNow, cancellationToken);

if (classroom == null)
{
return Problem(detail: ClassroomErrors.NotFound(classroomId).Description);
}

return Ok(classroom);
}


[HttpGet("{classroomId:int}/{currendDate:datetime}")]
public async Task<IActionResult> Get(int classroomId, DateTime currendDate, CancellationToken cancellationToken)
{
var classroom = await repository.GetClassroomOverviewAsync(classroomId, currendDate, cancellationToken);
return Ok(classroom);
}
}
Loading