From 94fb60d570e10f06f0c612d795d8c47b0da26705 Mon Sep 17 00:00:00 2001 From: Scott D Date: Tue, 27 Jun 2023 14:03:58 +0100 Subject: [PATCH] Update personalizer-quickstart.cs Fix logic errors in the program. There should be no reward when Bill doesn't buy the recommended product. --- dotnet/Personalizer/quickstart-sdk/personalizer-quickstart.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dotnet/Personalizer/quickstart-sdk/personalizer-quickstart.cs b/dotnet/Personalizer/quickstart-sdk/personalizer-quickstart.cs index 4a0535de..bde94406 100644 --- a/dotnet/Personalizer/quickstart-sdk/personalizer-quickstart.cs +++ b/dotnet/Personalizer/quickstart-sdk/personalizer-quickstart.cs @@ -268,12 +268,10 @@ public static float GetRewardScore(Context context, string actionId) } else if (actionFeatures.ItemAttributes.Price >= 10 && !context.Location.Equals("midwest")) { - rewardScore = 1.0f; Console.WriteLine($"\nBill didn't buy {actionId} because the price was too high when not visting his friend Warren in the midwest."); } - else if (actionFeatures.DietaryAttributes.LowCarb && context.Location.Equals("midwest")) + else if (!actionFeatures.DietaryAttributes.LowCarb && context.Location.Equals("midwest")) { - rewardScore = 1.0f; Console.WriteLine($"\nBill didn't buy {actionId} because it's not low-carb, and he's in the midwest visitng his friend Warren."); } }