Skip to content

Commit

Permalink
reset recommendation to 3 level system to avoid inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MaHaWo committed Dec 18, 2024
1 parent d3779b3 commit b30078d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 51 deletions.
46 changes: 2 additions & 44 deletions frontend/src/lib/components/ChildrenFeedback.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,10 @@ let currentSessionIndices = $state([0, intervalSize]);
let relevant_sessionkeys = $state([] as number[]);
const milestonePresentation = [
{ icon: CheckCircleSolid, color: "green", text: $_("milestone.recommendOk") },
{
icon: EyeSolid,
color: "green",
text: $_("milestone.recommendOkWithCaveat"),
},
{
icon: BellActiveSolid,
color: "orange",
text: $_("milestone.recommendWatch"),
},
{
icon: ExclamationCircleSolid,
color: "orange",
text: $_("milestone.recommendWatchWithCaveat"),
text: $_("milestone.recommendWatch"),
},
{
icon: CloseCircleSolid,
Expand Down Expand Up @@ -240,7 +230,7 @@ let promise = $state(setup());

{#snippet evaluation(aid: number, milestone_or_group: MilestonePublic | MilestoneGroupPublic | undefined, value: number, isMilestone: boolean, withText: boolean = false)}
<div class="text-gray-700 dark:text-gray-400 space-x-2 space-y-4 p-2 m-2">
{#if value === 2}
{#if value === 1}
<div class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 items-center">
<CheckCircleSolid color = "green" size="xl"/>
<span class = "text-gray-700 dark:text-gray-400 font-bold " >
Expand All @@ -251,17 +241,6 @@ let promise = $state(setup());
<p>{$_("milestone.recommendOk")}</p>
{/if}
</div>
{:else if value === 1}
<div class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 items-center">
<EyeSolid color = "green" size="xl"/>
<span class = "text-gray-700 dark:text-gray-400 font-bold " >
{milestone_or_group?.text[$locale as string].title}
</span>
<Hr class="mx-2"/>
{#if withText}
<p>{$_("milestone.recommendOkWithCaveat")}</p>
{/if}
</div>
{:else if value === 0}
<div class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 items-center">
<BellActiveSolid color = "orange" size="xl"/>
Expand All @@ -283,27 +262,6 @@ let promise = $state(setup());
</Modal>
</span>
{/if}
{:else if value === -1}
<div class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 items-center">
<ExclamationCircleSolid color = "orange" size="xl"/>
<span class = "text-gray-700 dark:text-gray-400 font-bold " >
{milestone_or_group?.text[$locale as string].title}
</span>
<Hr class="mx-2"/>
{#if withText}
<p>{$_("milestone.recommendWatchWithCaveat")}</p>
{/if}
</div>
{#if isMilestone}
<span class = "ml-auto mt-4">
<Button id="b1" onclick={()=>{
showHelp= true;
}}>{$_("milestone.help")}</Button>
<Modal title={$_("milestone.help")} bind:open={showHelp} dismissable={true} >
{milestone_or_group?.text[$locale as string].help}
</Modal>
</span>
{/if}
{:else}
<div class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 items-center">
<CloseCircleSolid color = "red" size="xl"/>
Expand Down
12 changes: 5 additions & 7 deletions mondey_backend/src/mondey_backend/routers/scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@
class TrafficLight(Enum):
"""
Enum for the trafficlight feedback.
Includes -2 for red, -1 for overall yellow but with red minimum score (yellowWithCaveat), 0 for yellow, and 1 for green with yellow minimum score (greenWithCaveat). 2 is green overall.
Includes -1 for red, 0 for yellow and 1 is green overall.
Invalid is -3 and is included for edge cases like no data.
Invalid is -2 and is included for edge cases like no data.
"""

invalid = -3
red = -2
yellowWithCaveat = -1
invalid = -2
red = -1
yellow = 0
greenWithCaveat = 1
green = 2
green = 1


def compute_feedback_simple(
Expand Down

0 comments on commit b30078d

Please sign in to comment.