Multi-Currency ACBC

Zachary Anderson
Last updated: 04 Mar 2022
Written for: Lighthouse Studio 9.3

Description

An advanced tool that can be used to customize the summed price of an ACBC exercise. Supports all ACBC question types where summed price can appear.

Instructions

  • Requires Better Lighthouse Library if applied to a BYO question.
  • Please locate and follow the instructions found in the question's footer regarding how to apply the script to each ACBC question type.
  • Line 50 must be updated with the name of the ACBC exercise.
  • Line 52 defines whether the original summed price should be displayed. This can be set dynamically per-responsent.
  • Lines 53-90 define additional prices to display after the original summed price. Each price supports the following properties:
    • id defines an identifier that can optionally be used in concatenatePrices, writeByo, and writeUnacceptable.
    • show defines whether the price is meant to be shown. This can be set dynamically per-responsent.
    • label defines the attribute label to display, when applicable.
    • calculate controls how this price is meant to be calculated. This function takes in the original summed price and returns the summed price in this currency.
    • formatting controls the formatting to be used in displaying this price. Each property works the same as the equivalent ACBC settings.
      • override is an advanced feature for applying a custom formatting. It should usually be left as null.
  • If the ACBC's original summed price does not use . as the decimal separator, line 93 should be updated.
  • Line 94 can be used to hide the attribute labels in Screener, Choice, and Calibration questions.
  • If the summed price is to be shown in Unacceptable questions and the "More than" setting has been changed in the ACBC settings, line 95 should be updated.
  • Line 96 defines the word "or," which is used when displaying multiple prices in a BYO or Unacceptable question.

Options

  • Line 98 defines the identifier used for the original summed price value, similar to the id property above.
  • If the multiCurrencySummedPrice or multiCurrencyLevel classes cannot be used for whatever reason, different classes can be used instead so long as lines 99 and 100 are updated accordingly.
  • The concatenatePrices function on line 102 can be updated to change how multiple prices are displayed on a single line.
  • In the unlikely case that your ACBC settings cause the script to be unable to automatically parse the label and price in a BYO or Unacceptable question, the functions readByo, writeByo, readUnacceptable, and writeUnacceptable can be updated.