Submit a request
Submit a request

Setting Up a Data Table and Inserting Dynamic Content into a Question

This feature requires the Author API interface. If the Data button does not appear as in the screenshots below, contact support and we will enable the feature for you. 

Adding Dynamic Content

Open a new Item and click on the Settings button on the top right of the Item.

fig1DC.png

Figure 1: Settings button in the Item.


In the pop-up window, click on the data table icon, and insert the data from a CSV file or a spreadsheet and click Continue.

Note that your data must have column headers that represent the purpose of each column. These column headers will appear as variable names in the UI. In this example, we will use Operand 1, Operand 2, and Result.

fig2DC.png

Figure 2: Inserting data in the Item.


The pasted content will be transformed into the data table. If you are happy with your data table, click Apply. It will be automatically saved and you will be brought back to Item Edit.

If the data does not appear to your liking, edit the CSV and try again.

Hint: Preview the CSV in a spreadsheet application, like Google Sheets, to see if it matches your expectations.

fig3DC.png

Figure 3: Data table with a set of variables that represent two Operands and Result.


You can now use the data to create Questions. Add a Question to an Item as normal. We are going to use a Math question type as an example.

Let's create a simple math expression. Open a new Math question and add a single response container to the formula template field.

fig4DC.png

Figure 4: Enter an empty response box inside the Formula template area.


Then under More Options navigate to the Response Container Formula template under the Layout section. From the formula keypad, select the Data option (see Figure 5).

DynamicResponseContainer.png

Figure 5: Formula keypad with Data button.


Choose Operand1 from the drop-down menu, add a plus sign and then select Operand2. Add an equals sign and a response box as shown in Figure 6.

fig6DC.png

Figure 6: Math Response container formula template with variables.


Then go to the validation section, and from the Value field click on the Data button inside the formula keypad. This time select Result instead of inserting a response box. You have now set the expression syntax and the result for each value combination, all in a few clicks.

DynamicDataImageMath.png

Figure 7: Added equation with result variable from data to validation.


Now when you preview the Question you will see the Data button with left and right arrows. Click on the arrows to switch between equation combinations you've created, and test the correct response for each of them.

fig8DC.png

Figure 8: Question with Dynamic Content preview. 

 

Note: we suggest you limit data table sizes to 20 columns and 50 rows, for optimal performance and manageability in the authoring interface. If you intend to exceed these limits, please discuss this with Learnosity Support. 

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity by clicking here.