A Tutorial on Designing Worksheets

Table of Contents

  1. Intuitive Overview of Worksheets
  2. Creating your First Worksheet
    1. Designing the Worksheet's UI
    2. Converting UI Elements into Worksheet Cells
    3. Specifying the Worksheet's Rules
  3. Saving Worksheets
  4. Publishing Worksheets
  5. Walkthroughs

1. Intuitive Overview of Worksheets

Worksheets are dynamic, interactive data-driven webpages. Elements in the webpage are cells in the worksheet, and dynamics of the worksheet is enabled by writing rules relating these cells and the underlying data, analogous to formulae in spreadsheets. 

 

In the following, we will familiarize you with the steps involved in creating, and managing worksheets. First, we will show how you can create a worksheet through our WYSIWYG Worksheet Editor.

 

Before you can use the Worksheet Editor, you must register for an account, and sign in at http://worksheets.stanford.edu. After signing in, you will be directed to your Worksheets Dashboard which lists all the worksheets that are created by you.  

2. Creating your First Worksheet

The first step is to open up the Worksheet Editor. After signing in, you'll be forwarded to your Dashboard, where you can open the Worksheet Editor by clicking on the Create Worksheet link. Create Worksheet from Dashboard Alternatively, you can open the Worksheet Editor by following this link.

 

When you open the Worksheet Editor, you'll notice a blank canvas - this is your worksheet's UI.

 

Worksheet Editor

You'll also notice a menu bar at the top called the Worksheet Menu. The Worksheet Menu contains options for designing the worksheet's UI, accessing the Rule Editor for specifying rules that govern the worksheet's behavior, and saving the worksheet. 

 

Finally, there is a bar at the bottom of the editor. This is the Worksheet Navigation Bar. By clicking on the tags in the Navigation Bar, you can select the corresponding elements in your worksheet's UI. To edit the properties of a selected element, double click on its tag. To remove an element from the worksheet, select it, and then, click through Edit > Remove in the Worksheet Menu, or press the Backspace or the Delete key.

 

In the following, we'll help you create a very simple worksheet. This worksheet will enable you to color some text on the fly. First, you'll design the worksheet's UI. 

2a. Designing the Worksheet's UI

Dropdown List

First, let's add a menu containing different colors. Click through Insert > Form Element > Dropdown List in the Worksheet Menu. You'll be presented with a dialog listing out the properties of a dropdown list. In the space provided under Options (one per line), write out the following. 

black
red
green
blue

You're done configuring your dropdown list for now. Click on the green check mark at the top left corner of the dialog to add the dropdown list to your worksheet. 

Edit Dropdown List

Let's now try to configure your worksheet so that foreground color of the dropdown list reflects the option chosen from the list. There are two steps in doing so.


First, convert the dropdown list into a worksheet cell.


Second, specify rules that change the color of this worksheet cell to correspond to the value of the cell i.e. option selected from the dropdown list.  

 

Dropdown List

2b. Converting UI Elements into Worksheet Cells

In order to convert an element in your worksheet's UI into a worksheet cell, assign the element an identifier or ID - say list. This can be done in the editing dialog for the dropdown list.


Editing Dialog

To open the editing dialog double click on the dropdown list in the worksheet's UI. Alternatively, double click on the tag labeled select in the Navigation Bar at the bottom.


Convert Dropdown List to Worksheet cell

In addition, check the option labeled Refresh Worksheet on change. You must check this option for all form elements, whose values are used in the worksheet's rules. This includes all relevant
- checkboxes,
- radio buttons,
- text fields,
- text areas,
- dropdowns,
- sliders, and
- buttons. 

Checking Refresh Worksheet on change, enables the worksheet's rules to be triggered when the value of the form element changes. 

2c. Specifying the Worksheet's Rules

Rule Editor from Worksheet Menu

You can specify and control the behavior and the dynamics of your worksheet by specifying logical rules in the Worksheet Rule Editor.


You can open up the Worksheet Rule Editor by clicking through View > Rule Editor in the Worksheet Menu.


In this worksheet, let's change the foreground color of the dropdown list to reflect the option chosen from the list. One way of doing so is to add the following rules in the Rule Editor.

style(list, color, black) :- value(list, black)
style(list, color, red) :- value(list, red)
style(list, color, green) :- value(list, green)
style(list, color, blue) :- value(list, blue)

Note that instead of explicitly specifying a rule for every possible option in the drop-down menu, you could compactly characterize the above behavior by using variables as in the following rule.

style(list, color, X) :- value(list, X)
Rule Editor

The next step is to save the rules in the Rule Editor.


This'll bring up to the WYSIWYG interface for editing the worksheet's UI. At this point you're done creating a very basic worksheet. You can preview your worksheet by clicking through View > Preview Worksheet in the Worksheet Menu.

Preview Worksheet Worksheet Behavior Worksheet Behavior when different values are selected from Dropdown list.

 

You can find a comprehensive tutorial on the rule language used in Worksheets at:  http://logic.stanford.edu/logicprogramming/notes/brief.html

3. Saving Worksheets 

Saving Worksheet

To save your worksheet, click through Worksheet > Save in the Worksheet Menu. After entering a name for your worksheet, your worksheet will be saved, and can be accessed through your Dashboard

 

You can view your worksheet, edit your worksheet, and delete your worksheet by clicking on the icons: , , and next to the worksheet's name in your Dashboard respectively.

4. Publishing Worksheets

Worksheets that are saved into your account are, by default, private i.e. not viewable by other users. In order to make your worksheets viewable by anyone with a link, you have to publish your worksheets.

Managing Worksheet

You can determine the privacy status of your worksheet by visiting your Dashboard, and inspecting the Status icon next to your worksheet's name. If the icon is , then the worksheet is privately accessible, otherwise accessible to anyone with a link to the worksheet. 

 

You can publish a private worksheet, by clicking on the status icon . This toggles the privacy status to  i.e. public.

5. Walkthroughs

- Worksheet Abstractions

- A Walkthrough on Creating Quizzes

- A Walkthrough on Creating Decision Trees

- A Guide to Working with Dynamic Tables and Charts