Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Updating Learn LTI backend to work with LTI 1 Protocol as well #4

Merged
merged 3 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LtiLibrary.AspNetCore" Version="3.2.2" />
<PackageReference Include="LtiLibrary.AspNetCore" Version="3.2.3" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.16" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.2" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.4" />
Expand Down
Expand Up @@ -18,6 +18,7 @@ public class AssignmentsApi
{
private const string AssignmentsTableName = "Assignments";
private const string AssignmentsRoutePath = "assignments";
private const string LtiAdvantageVersionString = "1.3.0";

private readonly ILogger<AssignmentsApi> _logger;
private readonly IMapper _mapper;
Expand Down Expand Up @@ -66,10 +67,13 @@ public AssignmentsApi(IMapper mapper, ILogger<AssignmentsApi> logger)
if (assignmentEntity == null)
return new NotFoundResult();

Platform platform = await platformsClient.GetPlatform(assignmentEntity.PlatformId);

AssignmentDto assignmentDto = _mapper.Map<AssignmentDto>(assignmentEntity);
assignmentDto.PlatformPersonalization = _mapper.Map<PlatformPersonalizationDto>(platform);

if (assignmentEntity.LtiVersion == LtiAdvantageVersionString)
{
Platform platform = await platformsClient.GetPlatform(assignmentEntity.PlatformId);
assignmentDto.PlatformPersonalization = _mapper.Map<PlatformPersonalizationDto>(platform);
}

return new OkObjectResult(assignmentDto);
}
Expand Down
2 changes: 1 addition & 1 deletion backend/Functions/Edna.Connect/Edna.Connect.csproj
Expand Up @@ -4,13 +4,13 @@
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LtiLibrary.AspNetCore" Version="3.2.2" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.2.2" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Bindings\Edna.Bindings.Assignment\Edna.Bindings.Assignment.csproj" />
<ProjectReference Include="..\..\Bindings\Edna.Bindings.Lti1\Edna.Bindings.Lti1\Edna.Bindings.Lti1.csproj" />
<ProjectReference Include="..\..\Bindings\Edna.Bindings.LtiAdvantage\Edna.Bindings.LtiAdvantage.csproj" />
<ProjectReference Include="..\..\Bindings\Edna.Bindings.Platform\Edna.Bindings.Platform\Edna.Bindings.Platform.csproj" />
</ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions client/.env.development
@@ -1,9 +1,9 @@
REACT_APP_EDNA_AAD_CLIENT_ID="902124e7-55c2-49bd-bcb9-8245c5d15e64"
REACT_APP_EDNA_MAIN_URL="http://localhost:3000/"
REACT_APP_EDNA_MAIN_URL="http://localhost:3000"
REACT_APP_EDNA_DEFAULT_SCOPE="api://902124e7-55c2-49bd-bcb9-8245c5d15e64/default"
REACT_APP_EDNA_TENANT_ID="72f988bf-86f1-41af-91ab-2d7cd011db47"
REACT_APP_EDNA_ASSIGNMENT_SERVICE_URL="https://edna-lite-assignments.azurewebsites.net/api/"
REACT_APP_EDNA_LINKS_SERVICE_URL="https://edna-lite-dev-links.azurewebsites.net/api/"
REACT_APP_EDNA_LEARN_CONTENT="https://edna-lite-dev-learn-content.azurewebsites.net/api/"
REACT_APP_EDNA_USERS_SERVICE_URL="https://edna-lite-dev-users.azurewebsites.net/api/"
REACT_APP_EDNA_PLATFORM_SERVICE_URL="https://edna-lite-dev-platform.azurewebsites.net/api/"
REACT_APP_EDNA_ASSIGNMENT_SERVICE_URL="https://edna-lite-assignments.azurewebsites.net/api"
REACT_APP_EDNA_LINKS_SERVICE_URL="https://edna-lite-dev-links.azurewebsites.net/api"
REACT_APP_EDNA_LEARN_CONTENT="https://edna-lite-dev-learn-content.azurewebsites.net/api"
REACT_APP_EDNA_USERS_SERVICE_URL="https://edna-lite-dev-users.azurewebsites.net/api"
REACT_APP_EDNA_PLATFORM_SERVICE_URL="https://edna-lite-dev-platform.azurewebsites.net/api"
12 changes: 6 additions & 6 deletions client/.env.production
@@ -1,9 +1,9 @@
REACT_APP_EDNA_AAD_CLIENT_ID="902124e7-55c2-49bd-bcb9-8245c5d15e64"
REACT_APP_EDNA_MAIN_URL="https://ednaliteclientdev.z6.web.core.windows.net/"
REACT_APP_EDNA_MAIN_URL="https://ednaliteclientdev.z6.web.core.windows.net"
REACT_APP_EDNA_DEFAULT_SCOPE="api://902124e7-55c2-49bd-bcb9-8245c5d15e64/default"
REACT_APP_EDNA_TENANT_ID="72f988bf-86f1-41af-91ab-2d7cd011db47"
REACT_APP_EDNA_ASSIGNMENT_SERVICE_URL="https://edna-lite-assignments.azurewebsites.net/api/"
REACT_APP_EDNA_LINKS_SERVICE_URL="https://edna-lite-dev-links.azurewebsites.net/api/"
REACT_APP_EDNA_LEARN_CONTENT="https://edna-lite-dev-learn-content.azurewebsites.net/api/"
REACT_APP_EDNA_USERS_SERVICE_URL="https://edna-lite-dev-users.azurewebsites.net/api/"
REACT_APP_EDNA_PLATFORM_SERVICE_URL="https://edna-lite-dev-platform.azurewebsites.net/api/"
REACT_APP_EDNA_ASSIGNMENT_SERVICE_URL="https://edna-lite-assignments.azurewebsites.net/api"
REACT_APP_EDNA_LINKS_SERVICE_URL="https://edna-lite-dev-links.azurewebsites.net/api"
REACT_APP_EDNA_LEARN_CONTENT="https://edna-lite-dev-learn-content.azurewebsites.net/api"
REACT_APP_EDNA_USERS_SERVICE_URL="https://edna-lite-dev-users.azurewebsites.net/api"
REACT_APP_EDNA_PLATFORM_SERVICE_URL="https://edna-lite-dev-platform.azurewebsites.net/api"