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

Add decaying average logic to the frontend #86

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
032ea68
Add multi threading
Typiqally Apr 14, 2023
7641206
Restyle KPI Table and cleanup code
Typiqally Apr 14, 2023
8d9d49a
Rename to correspond to definitions
Typiqally Apr 14, 2023
3d1ee1b
Reformat code
Typiqally Apr 14, 2023
8295477
Add loading icon
Typiqally Apr 14, 2023
7962e7b
Decrease personal development graph width
Typiqally Apr 14, 2023
a12b45c
Add decaying average to front-end
Typiqally Apr 14, 2023
efca089
Rename styling entries to conform with coding conventions and reforma…
Typiqally Apr 14, 2023
65a5389
Use colors from domain
Typiqally Apr 14, 2023
bd4f59b
Small cleanup changes
NealGeilen Apr 15, 2023
488da6d
Eslint enforcements updates
NealGeilen Apr 15, 2023
9ee5291
CI testing
NealGeilen Apr 15, 2023
71b75fb
CI testing
NealGeilen Apr 15, 2023
c1f5ea6
Bugfixes
NealGeilen Apr 15, 2023
cb302de
Hardcoded preliminary version of the dashboard with functional term b…
Apr 16, 2023
5041972
Fix competence profile being empty and cleanup code
Typiqally Apr 16, 2023
3ea3a3f
Make personal development height the same as competence graph
Typiqally Apr 16, 2023
a61c98f
Use different order for terms
Typiqally Apr 16, 2023
12480af
Remove centering
Typiqally Apr 17, 2023
538b674
Show toolbar
Typiqally Apr 17, 2023
0bc075d
changes of commands to pnpm
NealGeilen Apr 18, 2023
d7e52cd
Set version and package manager
NealGeilen Apr 18, 2023
4812b69
Add a readme
NealGeilen Apr 18, 2023
ae5a09d
First POC for moving DecayingAverage logic to frontend
NealGeilen Apr 19, 2023
905acfb
Moved the DecayingAverage.ts to the frontend
NealGeilen Apr 20, 2023
3d45b06
Removal backed code of decayingAverage
NealGeilen Apr 20, 2023
7b82b50
Fronted changes
NealGeilen Apr 20, 2023
5221926
Merge branch 'poc/performance_dashboard' into poc/performance_dashboa…
NealGeilen Apr 21, 2023
599cdd4
Merge
NealGeilen Apr 21, 2023
d9c28fd
Trying
NealGeilen Apr 26, 2023
49dcd29
POC decaying average
NealGeilen May 2, 2023
4232181
Cleanup
NealGeilen May 5, 2023
7d86203
Add abstraction for competence outcome results
Typiqally May 8, 2023
09d349d
Removal of backend Decaying average calculations
NealGeilen May 8, 2023
56e988b
Calculating decaying average in the frontend
NealGeilen May 8, 2023
d27aada
Frontend implementation of decaying average
NealGeilen May 8, 2023
d924721
Import change
NealGeilen May 8, 2023
ea5f226
code cleanup
NealGeilen May 8, 2023
58f04df
code cleanup
NealGeilen May 8, 2023
bd6ea6f
Graph changes on term selection
NealGeilen May 8, 2023
6d19f74
Implementation PersonalDevelopmentGraph.vue
NealGeilen May 11, 2023
bddee02
Warning fixes
NealGeilen May 11, 2023
c090f5c
Mastery level indication in PersonalDevelopmentGraph.vue
NealGeilen May 11, 2023
ee8c67b
Fixed the mess
NealGeilen May 11, 2023
9b43516
Change AssessedAt to SubmittedAt
Typiqally May 12, 2023
f020dd7
Added comments
NealGeilen May 15, 2023
7bf4e0d
Cleanup code
Typiqally May 17, 2023
6f43787
MOved functions inside mount function
NealGeilen May 18, 2023
20c6365
Changed function names
NealGeilen May 18, 2023
b0375b6
Changes and removed unused file
NealGeilen May 18, 2023
cb09d7f
Project setting changes
NealGeilen May 18, 2023
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
1 change: 0 additions & 1 deletion Epsilon.Abstractions/Epsilon.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
<ItemGroup>
<ProjectReference Include="..\Epsilon.Canvas.Abstractions\Epsilon.Canvas.Abstractions.csproj" />
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions Epsilon.Abstractions/Model/CompetenceOutcomeResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Epsilon.Abstractions.Model;

public record CompetenceOutcomeResult(
int OutcomeId,
double Grade,
DateTime SubmittedAt
);
4 changes: 1 addition & 3 deletions Epsilon.Abstractions/Model/CompetenceProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ public record CompetenceProfile(
IHboIDomain HboIDomain,
IEnumerable<ProfessionalTaskResult> ProfessionalTaskOutcomes,
IEnumerable<ProfessionalSkillResult> ProfessionalSkillOutcomes,
IEnumerable<EnrollmentTerm> Terms,
IEnumerable<DecayingAveragePerLayer> DecayingAveragesPerTask,
IEnumerable<DecayingAveragePerSkill> DecayingAveragesPerSkill
IEnumerable<EnrollmentTerm> Terms
);
2 changes: 0 additions & 2 deletions Epsilon.Abstractions/Model/CourseModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ public class CourseModule
{
public string Name { get; set; } = string.Empty;
public IEnumerable<CourseOutcome> Kpis { get; set; } = Enumerable.Empty<CourseOutcome>();

public string DecayingAverage { get; set; }
}
}
7 changes: 7 additions & 0 deletions Epsilon.Abstractions/Model/DecayingAverage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Epsilon.Abstractions.Model;

public record DecayingAverage(
double Score,
int ArchitectureLayer,
int Activity
);
6 changes: 0 additions & 6 deletions Epsilon.Abstractions/Model/DecayingAveragePerActivity.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Epsilon.Abstractions/Model/DecayingAveragePerLayer.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Epsilon.Abstractions/Model/DecayingAveragePerSkill.cs

This file was deleted.

3 changes: 2 additions & 1 deletion Epsilon.Abstractions/Model/ProfessionalSkillResult.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
namespace Epsilon.Abstractions.Model;

public record ProfessionalSkillResult(
int OutcomeId,
int Skill,
int MasteryLevel,
double Grade,
DateTime AssessedAt
);
) : CompetenceOutcomeResult(OutcomeId, Grade, AssessedAt);
3 changes: 2 additions & 1 deletion Epsilon.Abstractions/Model/ProfessionalTaskResult.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
namespace Epsilon.Abstractions.Model;

public record ProfessionalTaskResult(
int OutcomeId,
int ArchitectureLayer,
int Activity,
int MasteryLevel,
double Grade,
DateTime AssessedAt
);
) : CompetenceOutcomeResult(OutcomeId, Grade, AssessedAt);
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ namespace Epsilon.Canvas.Abstractions.Model.GraphQl;

public record SubmissionsHistoriesConnectionNode(
[property: JsonPropertyName("attempt")] int? Attempt,
[property: JsonPropertyName("submittedAt")] DateTime? SubmittedAt,
[property: JsonPropertyName("rubricAssessmentsConnection")] RubricAssessmentsConnection? RubricAssessments
);
18 changes: 1 addition & 17 deletions Epsilon.Canvas.Abstractions/Model/OutcomeResultCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,4 @@ public record OutcomeResultCollection(
[property: JsonPropertyName("outcome_results")]
IEnumerable<OutcomeResult> OutcomeResults,
[property: JsonPropertyName("linked")] OutcomeResultCollectionLink? Links
)
{
public double GetDecayingAverage()
{
var decayingAverage = 0.0;

foreach(var grade in OutcomeResults)
{
if (grade.Score != null)
{
decayingAverage = decayingAverage * 0.35 + grade.Score.Value * 0.65;
}
}

return decayingAverage;
}
}
);
1 change: 1 addition & 0 deletions Epsilon.Canvas/QueryConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ query MyQuery {
}
}
attempt
submittedAt
}
}
postedAt
Expand Down
72 changes: 35 additions & 37 deletions Epsilon.Host.Frontend/src/components/CompetenceGraph.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<template>
<ApexChart
type="bar"
height="350"
width="750"
:options="chartOptions"
:series="series" />
:series="series"
height="350"
type="bar"
width="750" />
</template>

<script lang="ts" setup>
import ApexChart from "vue3-apexcharts"
import { DecayingAveragePerLayer, IHboIDomain } from "../logic/Api"
import { onMounted } from "vue"
import { IHboIDomain, ProfessionalTaskResult } from "../logic/Api"
import { onMounted, watch } from "vue"
import {
DecayingAverageLogic,
DecayingAveragePerLayer,
} from "../logic/DecayingAverageLogic"

const series: Array<{
let series: Array<{
name: string
color: string
data: Array<string | number> | undefined
Expand All @@ -21,7 +25,7 @@ const chartOptions = {
annotations: {
yaxis: [
{
y: 9,
y: 3,
borderColor: "red",
strokeDashArray: 0,
label: {
Expand Down Expand Up @@ -77,41 +81,35 @@ const chartOptions = {

const props = defineProps<{
domain: IHboIDomain
data: DecayingAveragePerLayer[]
data: ProfessionalTaskResult[]
}>()

onMounted(() => {
// Setup categories
const activities = props.domain.activities

if (activities != null) {
activities.forEach((s) => {
function loadChartData(): void {
series = []
chartOptions.xaxis.categories = []
if (props.domain.activities != null) {
props.domain.activities.forEach((s) => {
chartOptions.xaxis.categories.push(s.name as never)
})
}

// Add data
const layers = props.domain.architectureLayers

if (layers != null) {
props.data.forEach((layerDecayingAverage) => {
const layer = layers.find(
(layer) => layer.id == layerDecayingAverage.architectureLayer
)

if (layer != undefined) {
series.push({
name: layer.name as string,
color: layer.color as string,
data: layerDecayingAverage.layerActivities?.map(
(decayingAverage) =>
decayingAverage.decayingAverage?.toFixed(
2
) as string
),
})
}
DecayingAverageLogic.getAverageTaskOutcomeScores(
props.data,
props.domain
).map((layer: DecayingAveragePerLayer) => {
const ar = props.domain.architectureLayers?.at(layer.architectureLayer)
series.push({
name: ar?.name,
color: ar?.color,
data: layer.layerActivities.map((ac) =>
ac.decayingAverage.toFixed(3)
),
})
}
})
}

onMounted(() => {
loadChartData()
})
watch(() => loadChartData())
</script>
65 changes: 45 additions & 20 deletions Epsilon.Host.Frontend/src/components/PersonalDevelopmentGraph.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
<template>
<ApexChart
type="bar"
height="350"
width="200"
:options="chartOptions"
:series="series" />
:series="series"
height="350"
type="bar"
width="200" />
</template>

<script lang="ts" setup>
import ApexChart from "vue3-apexcharts"
import { DecayingAveragePerSkill, IHboIDomain } from "../logic/Api"
import { onMounted } from "vue"
import {
IHboIDomain,
MasteryLevel,
ProfessionalSkillResult,
} from "../logic/Api"
import { onMounted, watch } from "vue"
import { DecayingAverageLogic } from "../logic/DecayingAverageLogic"

const props = defineProps<{
domain: IHboIDomain
data: DecayingAveragePerSkill[]
data: ProfessionalSkillResult[]
}>()

const series: Array<{ name: string; data: Array<number | string> }> = []
let series: Array<{ name: string; data: Array<number | string> }> = []
const chartOptions = {
annotations: {
yaxis: [
Expand All @@ -36,7 +41,7 @@ const chartOptions = {
},
],
},
colors: ["#A8D08D"],
colors: ["#FFFFFF"],
chart: {
type: "bar",
stacked: true,
Expand Down Expand Up @@ -76,22 +81,42 @@ const chartOptions = {
}

onMounted(() => {
// Setup categories
const professionalSkills = props.domain.professionalSkills
loadChartData()
})
watch(() => loadChartData())

if (professionalSkills != null) {
professionalSkills.forEach((s) => {
chartOptions.xaxis.categories.push(s.shortName as never)
function loadChartData(): void {
series = []
chartOptions.xaxis.categories = []
if (props.domain.professionalSkills != null) {
props.domain.professionalSkills.forEach((s) => {
chartOptions.xaxis.categories.push(s.name as never)
})
}

// Add data
series.push({
name: "Decaying Average",
data: props.data.map(
(decayingAverage) =>
decayingAverage.decayingAverage?.toFixed(2) as string
),
name: "Score",
data: DecayingAverageLogic.getAverageSkillOutcomeScores(
props.data,
props.domain
)?.map((d) => {
return {
y: d.decayingAverage.toFixed(3),
x: props.domain.professionalSkills?.at(d.skill)?.name,
fillColor: getMastery(d.masteryLevel)?.color,
}
}),
})
})
}

function getMastery(masteryId: number): MasteryLevel | undefined {
if (props.domain.masteryLevels == null) {
return undefined
}

return props.domain.masteryLevels.find(
(masteryLevel) => masteryLevel.id == masteryId
)
}
</script>
Loading