You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will come back later and update this value once we start working on block visibility.
@@ -293,7 +317,7 @@ We will come back later and update this value once we start working on block vis
293
317
27. Let’s name the field aus\_citizen\_or\_permanent\_resident
294
318

295
319
296
-
28. Add the options for the field. Please note that in this case, we are using prefix and suffix for the field to improve the UX of the webform.
320
+
28. Add the options for the field. Please note that in this case, we are using prefix and suffix for the field to improve the UX of the webform.\
297
321

298
322
299
323
29. Now, we need to associate it to an OpenFisca variable. Scroll down and click this dropdown.
@@ -302,35 +326,36 @@ We will come back later and update this value once we start working on block vis
302
326
30. When you click the dropdown, you will see a list of variables defined in the OpenFisca API, which was defined earlier.
303
327

304
328
305
-
31. Select the appropriate variable from the dropdown
329
+
31. Select the appropriate variable from the dropdown\
306
330

307
331
308
-
32. Next, we need to enter the entity name. Click the "Fisca entity key" field.
332
+
32. Next, we need to enter the entity name. Click the "Fisca entity key" field.\
309
333

310
334
311
-
33. Type PersonA
335
+
33. Type PersonA\
312
336

313
337
314
338
34. Next we go ahead and add all the other variables to the webform.
315
339
316
340
35. Now we need to add the return variables as hidden fields.
317
-
So we search for "hidden" and click "Add element"
341
+
So we search for "hidden" and click "Add element"\
318
342

319
343
320
-
36. This is the return variable if the person qualifies for disability allowance or not.
344
+
36. This is the return variable if the person qualifies for disability allowance or not.\
321
345

322
346
323
-
37. We will associate the OpenFisca variable to this as well:
347
+
37. We will associate the OpenFisca variable to this as well:\
324
348

325
349
326
350
327
351
38. We will follow the same process and add the 2 more return variables we need.
328
352
disability\_allowance\_benefit and monthly\_income\_exceeds\_limit
329
353
330
-
39. You may or may not want to add conditional visibility options for the form. E.g. if the user says that they are NOT an AUS citizen or resident, we might want to show them a “You are not eligible” message and not show them the Submit button. For this, you can add a markup like this
354
+
39. You may or may not want to add conditional visibility options for the form. E.g. if the user says that they are NOT an AUS citizen or resident, we might want to show them a “You are not eligible” message and not show them the Submit button. For this, you can add a markup like this\
331
355

332
356
333
-
And configure conditions like this: 
357
+
And configure conditions like this:\
358
+

334
359
335
360
40. The form is now created. Below is a screenshot of what it looks like in the frontend of the website.
336
361

@@ -385,7 +410,7 @@ In our use case, the user can either be eligible or not eligible for disability
385
410

386
411

387
412

388
-
2. Add an relevant title (You are eligible) and accompanying content and then click **Save**.
413
+
2. Add a relevant title (You are eligible) and accompanying content and then click **Save**.
389
414

390
415
3. Similarly, create another page for not eligible with a title (You are not eligible) and relevant content, and then click **Save**.
391
416
@@ -419,7 +444,9 @@ Payload:
419
444
420
445

421
446
422
-
Response:
447
+
Response:
448
+
449
+

423
450
424
451
Results:
425
452
@@ -433,8 +460,9 @@ The content of the results page can be customised as required.
433
460
434
461
OpenFisca also has a concept of **Parameters**. A parameter is a property of the legislation that changes over time. Unlike a variable, a parameter is not specific to a specific entity (e.g. person, household).
435
462
436
-
In our use case, one of the parameters would be the disability allowance benefit.![][image60]
463
+
In our use case, one of the parameters would be the disability allowance benefit.
437
464
465
+

438
466
The module allows us to expose certain parameters as tokens as well, so that they can be shown in the result pages. This can improve the user experience by giving the user as much information as possible when showing results.
439
467
440
468
You will need to enable the module [Token Filter](https://www.drupal.org/project/token_filter) and then add tokens on the page to show more details.
@@ -488,7 +516,7 @@ So, before we start this exercise, the website builder/developer for the website
488
516
489
517

490
518
491
-
This points to the paragraph **Block RAC Elements.**
519
+
This points to the paragraph **Block RAC Elements.**\
492
520

493
521
494
522
@@ -500,7 +528,7 @@ Let’s start with use case 1 mentioned above:
500
528
You are not eligible because your income exceeds a minimum amount (defined as a parameter in OpenFisca). Response from OpenFisca would have these values:
501
529
502
530
1. disability\_allowance\_eligible=0
503
-
2. monthly\_income\_exceeds\_limit=1
531
+
2. monthly\_income\_exceeds\_limit=1
504
532
505
533
**Note**:
506
534
@@ -530,18 +558,18 @@ For block creation you can follow the steps below.
530
558
531
559
The variables need to be fully qualified. So persons.personA.disability\_allowance\_eligible and not disability\_allowance\_eligible
532
560
533
-
This interface can cater for a complex set of conditions, when we want to check for operators other than \=
561
+
This interface can cater for a complex set of conditions, when we want to check for operators other than \=\
534
562

535
563
536
564
We can add multiple conditions, which need to be an ORed or XORed (instead of AND)
537
565
538
566

539
567
540
-
We can also add multiple sets of conditions, and use AND/ OR/ XOR between them.
568
+
We can also add multiple sets of conditions, and use AND/ OR/ XOR between them.\
541
569

542
570
543
571
7. Save the Block.
544
-
8. Now, let’s place the block. Go to Block layout![][image77]
@@ -576,7 +604,7 @@ As you can see in the screenshot above, the ‘Income exceeds limit’ block we
576
604
577
605
Once you’ve created the webform it’s time for testing (quality assurance). Part of the early business analyst work is to create test cases that the OpenFisca developers use when writing the code. These test cases can be re-used by adding the inputs to the frontend webform.
578
606
579
-
Below is a screenshot of test cases prepared for the ACT.
607
+
Below is a screenshot of test cases prepared for the ACT use case.
580
608
581
609

582
610
@@ -597,9 +625,10 @@ Add in the required values to the webform and then click on Submit.
597
625
We’re expecting a result of **eligible** and a dollar figure of $200.
598
626

599
627
600
-
##Exercise: testing the webform
628
+
[//]: #(## Exercise: testing the webform)
601
629
602
-
Now test the second scenario from above in the webform. You’re expecting a result of Not eligible with the ‘income too high’ block.
630
+
[//]: #()
631
+
[//]: #(Now test the second scenario from above in the webform. You’re expecting a result of Not eligible with the ‘income too high’ block.)
0 commit comments