Skip to Content
📧 Join the Teacharium waitlist to get access. 

Logic widgets

Logic widgets control the flow and behavior of your lessons. They work behind the scenes to manage navigation, show/hide content, and orchestrate interactive experiences without displaying visible content to learners.

Warning: It’s not a good idea to mix multiple logic widgets on the same step. Unexpected results can occur.

Logic Quiz

Use this widget on quiz steps where learners should attempt all questions before moving forward.

The widget automatically detects quiz items like Multiple Choice, Matching, or Matrix Choice widgets and monitors their completion.

Behavior

  • Monitors all quiz items on the step to check if they’ve been attempted
  • Disables the Next button until all items are attempted
  • When the learner clicks Next:
    • Evaluates whether all answers are correct
    • Shows feedback (if enabled) with a success or review message
    • Automatically advances to the next step after 3 seconds (if feedback is shown)
    • Advances immediately if feedback is disabled
  • Disables all items after submission (while showing feedback)

Inputs

Show Feedback (Yes/No)

  • Whether to display feedback messages after submission
  • If “Yes”, shows feedback for 3 seconds before advancing
  • If “No”, advances immediately to the next step

Correct Feedback Message (text)

  • The message displayed when all answers are correct
  • Only shown if “Show Feedback” is enabled
  • Default: “Great job! All answers are correct.”

Incorrect Feedback Message (text)

  • The message displayed when some answers are incorrect
  • Only shown if “Show Feedback” is enabled
  • Default: “Some answers need review. Let’s move on.”

Logic Practice

Use this widget for practice problems where learners should have multiple attempts with guided support.

It’s ideal for math problems, coding exercises, or any scenario where learners benefit from hints and seeing the correct answer after several tries.

Behavior

  • Monitors practice items to check if they’ve been attempted
  • Disables the Next and Check Answer buttons until all items are attempted
  • Shows a Hint button (if hints are configured)
  • When the learner clicks Check Answer:
    • If all answers are correct: shows success feedback and enables Next button
    • If answers are incorrect: increments the attempt counter and shows feedback
    • After maximum attempts: reveals correct answers and enables Next button
  • Provides progressive hints that cycle through the hint list

Inputs

Number of Tries (number)

  • How many times the learner can check their answer before seeing the solution
  • After reaching this limit, correct answers are displayed
  • Default: 3

Hints (array)

  • A list of hint messages to show when the learner requests help
  • Hints cycle through the list if requested multiple times
  • Each hint has:
    • Hint Text: The helpful message to display
  • Default: 3 sample hints provided

Correct Answer Feedback (text)

  • Message shown when the learner answers all items correctly
  • Default: “Great job!”

Show Answer Feedback (text)

  • Message shown when maximum attempts are reached and answers are revealed
  • Default: “Good try, now look at the correct answer”

Branching Logic

Use this widget when you want to create different learning paths based on learner responses, quiz scores, or other variable values. For instance, you might route struggling learners to review material while advancing others to new content.

Behavior

  • Evaluates conditions in order from top to bottom
  • Routes the learner to the target step of the first condition that evaluates to true
  • If no conditions match, routes to the default target step (if configured)
  • Disables the Next button if no conditions match and no default is set
  • During playback, the widget is invisible to learners

Inputs

Conditions (array)

  • Each condition has three parts:
    • Label: A descriptive name for the condition (for your reference)
    • Condition: The logical expression to evaluate (uses variable values)
    • Target Step: The step to navigate to if this condition is true

Default Target Step (optional)

  • The step to navigate to when no conditions match
  • If left empty and no conditions match, the Next button will be disabled

Logic Gateway

Use this widget when you need to control when learners can proceed to the next step.

Unlike Logic Quiz and Logic Practice which have predefined behaviors, Logic Gateway gives you flexible criteria to enable the Next button based on item status or custom conditions.

Behavior

  • Initially disables the Next button when the step loads
  • Enables the Next button when criteria are met
  • Disables the Next button again if criteria become unmet
  • During playback, the widget is invisible to learners

Inputs

Criteria (radio selection)

Choose the condition that must be met before the Next button becomes enabled:

  • All Attempted: All items on the current step must be attempted (at least one interaction)

    • Useful when you want learners to try everything before moving on
    • Doesn’t require correct answers, just engagement with each item
  • All Correct: All items on the current step must be answered correctly

    • Ensures mastery before progression
    • More strict than “All Attempted”
    • Items must be both attempted and correct
  • Custom Condition: Use a custom condition to determine when to enable the Next button

    • Provides maximum flexibility
    • Can evaluate variables, scores, or any other lesson data
    • Example: Enable when a score variable exceeds a threshold

Condition (condition builder)

  • Define your own logic using the condition builder
  • Can compare variables, check values, or create complex expressions
  • The Next button enables when this condition evaluates to true

Example Use Cases

  • Require learners to interact with all elements on a step before continuing
  • Gate progression until all practice problems are solved correctly
  • Enable navigation based on a calculated score or performance metric
  • Create custom progression rules that don’t fit the predefined logic widget patterns

Run Action

Use this widget when you want to automatically execute an action once when a step loads. This is useful for setting up the initial state of a step, such as setting variables, controlling button states, or triggering other side effects without requiring learner interaction.

Behavior

  • Executes the configured action exactly once when the step loads
  • Runs automatically without any learner interaction required
  • Does not execute during editing (only during playback)
  • Has no visual component - completely invisible to learners
  • Ideal for setup tasks like initializing variables or configuring the UI

Inputs

Action to Run (action)

  • The action that will be executed when the step loads
  • Can be any valid Teacharium action, such as:
    • setVariable: Set a variable to a specific value
    • setNextButtonStatus: Enable or disable the Next button
    • setNextButtonLabel: Change the text on the Next button
    • setCheckAnswerButtonStatus: Enable or disable the Check Answer button
    • And any other supported action type
  • The action runs only once per step visit

Example Use Cases

  • Set initial variable values at the start of a section
  • Disable the Next button until certain criteria are met (combined with other widgets)
  • Initialize the UI state for complex interactions
  • Set custom button labels for context-specific navigation
Last updated on