Feature Update – slider questions, collections, *email update

Here’s what’s new:

Slider Questions

Now you can ask your users slider-style questions. Slider questions are a good alternative to multiple choice questions when the answer options are on a continuum or on the same spectrum.

Simply write and indent “*type: slider” beneath your *question to allow your users to slide a cursor to their preferred answer.

Slider Options

There are two general types of slider questions:

  1. Discrete
  2. Continuous

Plus, two bonus specifications you can make to your questions:

  1. setting a *min and *max value to continuous slider questions
  2. adding text *before and *after the slider bar

Discrete

With discrete slider questions, you specify what each of the options are that your users can slide across. Here’s the example that generates the image from above:

In this example, users will see a question that says “Do you like bacon?” Beneath that, they’ll see a line running from left to right. They can slide their cursor over the line to see different options and choose their answer. The cursor will snap into place at each of the four answer choices.

Continuous

When no answers are provided to a slider, it becomes a continuous slider. Continuous sliders provide users with 100 numerical options to select from. By default, this range goes from 0 to 100. Here’s an example:

This slider will flow freely along a continuum of 0 to 100.

Mix and max keywords

You can specify the range of continuous variables you’d like users to be able to choose from by using the *min and *max keyword. As an example:

This slider will flow freely from 1 to 10. One hundred data points are possible, meaning users could put the cursor onto “5” or be as precise as “6.74.” If you don’t want users to have this level of precision, then you can use a discrete slider by instead indenting the numbers 1, 2, 3…10 beneath your question and removing the *min and *max keywords.

Before and after text

Here’s how your program would look to the user with *before and *after keywords added:

Special text has been added to the left and right side of the slider. Here’s the code that made that program possible:

Publicize GuidedTrack code

You may wish to make your GuidedTrack code public, so that others can copy and improve upon your work.

To do so, go to the “Share” tab of your program and then the tab “Who has access.” Then select “Public Code.” Now anyone who runs your program can also see the code and could copy it for themselves if they choose to. In this part of the program settings, you can also restrict access to your program to just a few “collaborators.” Doing this means that only you and a select few can edit or view your program.

Collections

We got into collections a little bit in our last post. You learned that when checkbox responses are saved, they’re saved in what’s called a collection, which could look something like this:

You also learned that you can use the “in” expression to provide special content to users who checked off a certain item. For example, imagine we asked users to check off which pets they had and saved their responses as “pets.”

If we then wanted to give a follow-up question to users who had checked off “Cat,” we could do the following:

Remember, capitalization and punctuation are important when using “in” expressions. Writing “cat” in lowercase would not have worked.

Now, we’re going to delve even deeper into collections. This functionality is essential for complex programs like the following:

  • You want to store each answer that a user provided to a repeated question.
  • You want to combine a user’s answers from two or more questions into one variable.
  • You need to alphabetize a list of things
  • You need to get the mean of a list of things
  • You need to know the size of a list of things

Getting and using a specific item in a collection

Let’s suppose you have a collection of numbers that looks like this:

We’ll pretend these represent a person’s mood scores (how they felt on a scale of 1-10) across time. Notice how collections can contain collections within them (as the third position in this collection does). For now, just imagine that the mood scores of the third position (4, 3, 5) are clumped together because they were all collected in the same day.

There are several ways the program can use collections to interact with the user. You can simply show the user their collection:

This would produce a line of text that looked like this to the user:

You can also show the user specific entries in their entire collection. In our example, we want to show the user the first and second things in their collection:

Users would see the following:

You can also show users a specific entry of a collection within a collection:

With the above code, users would see the following:

Collection entries can be used similarly as other variables. For example, you can do the following things:

In the first example, if user’s first mood score in their collection were a 7 or above, they’d see “You started with a pretty good mood.” In the second example, users would see as many smiley faces as their mood rating. In this case, they’d see 8 smiley faces.

Get the size of a collection

Getting the size of a collection is pretty easy. Using our earlier pet example, we could say:

This would then say “You have 3 different kinds of pets” because our pets collection contained a dog, cat, and a small furry thing.

Get the mean value of a collection of numbers

If you have a collection of numbers, such as [10, 10, 30, 30], you can easily find the mean of the collection, like this:

This would read as “The mean of these values is: 20.”

Add something to the end of a collection

Adding new items to a collection is pretty easy. If you have a collection called “user_badges,” you could add a new entry to the collection like so:

The new entry, “Topped 1,000 points,” would be added to the end of the collection called user_badges.

Now let’s use a more complicated example about a question that asks users to painstakingly enter 50 hobbies. Here, the collection is initially empty.

First, we have to set up the collection that the user’s answers will go into. We’ve written >>hobbies=[ ] at the top. Initially, it’s an empty collection, but it will soon fill up with user data.

Users will next see “Enter one of your hobbies” and can enter whatever they like in the box. Their answer is saved as the variable “newHobby.” Then, this variable is added to the end of the collection called hobbies. Since the collection is empty in the beginning, the first answer users provide will momentarily be the only thing in the collection. The user will next see “Great! Now add another” and the question will reappear. Users will repeat the process of typing in each new hobby for a total of 50 times. Each time, the variable “newHobby” will change to the latest thing they wrote and this thing will be added to the end of the user’s collection. When users are finished, they will see “Here are the hobbies you listed:” followed by all 50 of the hobbies they typed.

You’ll notice that in the user_badges example what’s called a “text string” was added to the collection (“Topped 1,000 points”) and in the second example the value of a variable was added (newHobby). In all aspects of GuidedTrack, there are three different types of information you can store and work with: text strings, numbers, and collections. There are also variables, which store any of the three types. Here’s how a text string, number, and collection looks:

Here’s how a variable looks:

Insert something in a specific point in the collection

When you add something to a collection, it gets added to the very end of the collection. But what if you want to insert something at a very specific spot of the collection? You’d do so like this:

This inserts “lawn mowing” as the 3rd thing in the hobbies collection. Within the parentheses, the first part is always the thing you want to insert. The second part is the position that you want to insert the thing in.

In this next example, the user’s answer has been added to the beginning of their collection.

Sort a collection

It’s pretty easy to sort a collection so that all the entries are in increasing order (a, b, c…1, 2, 3). Or, in decreasing order (9, 8, 7…z, y, x)

Sort is also very handy for collections of numbers. It can be used to put all the numbers in either increasing or decreasing numerical order.

Randomize a collection

Similarly, you can sort the items in a collection so they’re in a completely random order:

Combine two or more collections

Let’s say you have two collections and you want to combine them into one collection. We’ll use these two as an example:

In order to add the items of listB into listA, you’d use the following code:

In the above example, listB would still contain its original 4 items, but listA would now have 7 items (its original 3, plus the 4 from listB). If you were to show listA to users it would look like this:

Let’s imagine the variable listB didn’t actually exist. You can still add these new numbers to listA like so:

Send an email to a specific email address

You can easily add the *to field to any email. This will allow your email to be sent to anyone of your, or your user’s, choice.

For example, this could be a great way to get immediate feedback about the program you’ve created:

The *to field can also contain a variable. So, you could ask user’s their email address, save it as a variable, then email them some content from the program, should they want you to do that. Previously, you could only email users by having them *login to GuidedTrack.

Improvements in data syncing and a *wait update

You may have noticed some new pretty swirly things happening when you begin a program.

This mesmerizing little graphic appears when your program takes a little while to load. It reassures user’s that your excellent content is on its way.

At the end of your program, there will likely be a similar progress indicator. On its final screen, your program will briefly pause and display the below progress bar. During this time, GuidedTrack is ensuring that all the data your user has provided will be synced with the server.

In the past, it was possible for some users to go so quickly through programs and close them so abruptly that some of their answers wouldn’t have been transferred over, which could lead to gaps in the CSV data file. With the new loading bar appearing on the last screen of your program, you will be assured to get all the data from users who finish your program.

There’s a second way you can ensure users’ data is captured in the CSV. You can use the *wait keyword like so:

Simply type “*wait: data” and the program will pause just long enough to store all the information it hasn’t yet stored. Data is stored periodically throughout your user’s run anyway, but this keyword may be useful in spots where users may close out of your program too soon. This allows you to control, at any point in the program, that the data is totally synced, whereas the automatic wait and progress indicator on the final page only ensures this sync at the end of the program.