From a16118027d2adb0aedd76902cf8d2d83692bb949 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Thu, 1 Sep 2022 08:07:56 +0200 Subject: [PATCH] :pencil: More explicite set variable compute examples --- .../docs/editor/blocks/logic/set-variable.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/docs/docs/editor/blocks/logic/set-variable.md b/apps/docs/docs/editor/blocks/logic/set-variable.md index cddea31e7..40e52516e 100644 --- a/apps/docs/docs/editor/blocks/logic/set-variable.md +++ b/apps/docs/docs/editor/blocks/logic/set-variable.md @@ -12,16 +12,32 @@ This value can be any kind of plain text but also **Javascript code**. ## Expressions with existing variables -It means you can apply operations on existing variables: +It means you can apply operations on existing variables. + +Add a value to your variable: ``` {{Score}} + 5 ``` +Compute a sum of variables: + +``` +{{Score}} + {{Answer}} +``` + +Multiply variables together: + ``` {{Score}} * {{Multiplier}} ``` +Compute a percentage: + +``` +{{Score}} * 100 / {{Max Score}} +``` + ## Current Date You can create a `Submitted at` (or any other name) variable using this code: