Obojobo

Obojobo

  • Authors
  • Developers
  • GitHub

› Developers Section Topics

Getting Started

  • OboNode Structure
  • Text Content Conventions
  • Triggers and Actions

Misc Dev Topics

  • Obojobo Glossary
  • Question Selection Algorithm
  • Range Strings

Events Reference

  • Caliper Event Reference
  • Obojobo Event Reference

OboNode & Content Block Reference

  • ActionButton
  • Assessment
  • Assessment > rubric
  • Assessment > rubric > mod
  • Assessment > scoreAction
  • Break
  • Code
  • Content
  • Figure
  • Heading
  • HTML
  • IFrame
  • List
  • List > listStyle
  • List > listStyle > indent
  • Materia
  • MathEquation
  • MCAssessment
  • MCAssessment > MCChoice
  • MCAssessment > MCChoice > MCAnswer
  • MCAssessment > MCChoice > MCFeedback
  • Module
  • NumericAssessment
  • NumericAssessment > NumericChoice
  • NumericAssessment > NumericChoice > NumericAnswer
  • NumericAssessment > NumericChoice > NumericFeedback
  • Page
  • Question
  • QuestionBank
  • Table
  • Table > gridTextGroup
  • Text
  • textGroup
  • textGroup > textItem
  • textGroup > textItem > styleableText
  • textGroup > textItem > styleableText > styleList
  • trigger
  • trigger > action
  • YouTube

trigger

Class: Content Block

A listener for a certain event that performs an action when it occurs.

Triggers are linked to the OboNode that contains them. They are only fired when the matching event type is heard for that particular node. For example a trigger listening to the onClick event is only linked to the clicking of the ActionButton it is attached to.

Triggers must always be wrapped in a triggers array.

Structure

Property Required Type Description
type Required String This is the event that causes this trigger to run. Currently, the system only supports a limited range of triggers in the following OboNodes:
actions Required Array<action> One or more actions to perform when this trigger is run.

Supported Action Types

Action Type Node Types Description
onMount All Fired when a node is added to the DOM
onUnmount All Fired when a node is removed from the DOM
onNavEnter Page Assessment Fired when a node is navigated to
onNavExit Page Assessment Fired when a node is navigated away from
onStartAttempt Assessment Fired when an assessment attempt is started
onEndAttempt Assessment Fired when an assessment attempt is submitted
onClick ActionButton Fired when an ActionButton button is clicked

Required Children

None

Variables Registered

None

Example

JSON

"triggers": [
  {
    "type":"onStartAttempt",
    actions: [
      {
        "type":"nav:lock"
      }
    ]
  },
  {
    "type":"onEndAttempt",
    actions: [
      {
        "type":"nav:unlock"
      }
    ]
  }
]

OboXML

<triggers>
  <trigger type="onStartAttempt">
    <actions>
      <action type="nav:lock" />
    </actions>
  </trigger>
  <trigger type="onEndAttempt">
    <actions>
      <action type="nav:unlock" />
    </actions>
  </trigger>
</triggers>

These triggers would be placed in an Assessment node, and would cause the navigation bar to lock when the assessment started, and unlock once the navigation was finished.

  • Structure
    • Supported Action Types
  • Required Children
  • Variables Registered
  • Example
    • JSON
    • OboXML
Visit Obojobo on GitHub
Obojobo
Obojobo™ ©2021 University of Central Florida