Designing Worksheets: Primer

Table of Contents

  1. Intuitive Overview of Worksheets
  2. Creating Worksheets
    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. References

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 Worksheets

The first step is to open up the Worksheet Editor. After signing in, you can open the Worksheet Editor by clicking on the Creators tab in the Worksheets homepage, or by clicking on Create Worksheet link in your Dashboard. Alternatively, you can follow this link.

 

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

 

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

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. 

 

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.  

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.

 

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.

 

In addition, check the option labeled Refresh Worksheet on change. You must check this option for all form elements - checkboxes, radio buttons, text fields, text areas, dropdowns, and buttons - whose values are used in the worksheet's rules. Checking Refresh Worksheet on change, enables the worksheet's rules to be triggered when the value of the form element changed. 

2c. Specifying the Worksheet's Rules

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)

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.

 

You can find a comprehensive tutorial on the rule language used in Worksheets in [1]. To learn more about the special predicates e.g. style, value that are used in Worksheet, we refer you to [2]. You can also find tutorials on creating worksheets in [3]. There, you'll learn how to create worksheets - ranging from from simple worksheets e.g. quizzes and forms to complex worksheets such as academic programsheets, games, and simulations.     

3. Saving Worksheets 

In order to save your worksheet, click through Worksheet > Save in the Worksheet Menu. After choosing 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 ,  and  icons 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.

 

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. References

1. Deductive Databases http://logic.stanford.edu/logicprogramming/notes/ddb.html

2. Worksheet Rule Reference http://worksheets.stanford.edu/homepage/reference.html

3. Worksheet Tutorials and Walkthroughshttp://worksheets.stanford.edu/homepage/tutorial.html