Difference between revisions of "Information Foraging Assignment: Nursery School"

From CSE256A Wiki
Jump to navigation Jump to search
Line 75: Line 75:
  
 
==Defining New CSS Properties==
 
==Defining New CSS Properties==
−
An example of the hierarchical CSS styles.
+
CSS styles are hierarchical, with more specific formatting rules taking precedence over more general ones. So, for example if a specification for a paragraph element sets a font and font color and then a paragraph element for a specific class sets different values for these things, the specific class's values win for that class. For more details, check out: [https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity Specificity] and [https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade The Cascade].
−
Find the HTML element for "Our students" and look at it's styling. Where is the CSS specification that defines it's font?  
+
 
 +
===An Example of Styles that Cascaded===
 +
Use the web developer tools to find the HTML element for "Our students" and look at it's styling.  
 +
 
 +
'''Question:''' Where is the CSS specification that defines it's font?
 +
 
 +
If you've found the right thing, you should see that the font property is defined on an ancestor.
 +
 
 +
===Making a New Style===
 +
 
  
 
Then, I was thinking about asking them to define a new style for the Announcements to make the text bigger so that it stands out more.
 
Then, I was thinking about asking them to define a new style for the Announcements to make the text bigger so that it stands out more.

Revision as of 19:31, 9 January 2020

Task Description

Washington University hosts and on-site nursery school for children ages 2.5-5 years old. In this project, we are going to work to improve nursery school site visitors’ ability to find relevant information using Information Foraging Theory. Information Foraging Theory describes how users search for information using different cues.

Specifically, we will study the following scenarios:

  1. Asd
  2. Asdf
  3. Asdf
  4. asf

Prerequisite Readings

Before starting this project, you should read the following:

Running the Site Locally

  1. Open a terminal window or the terminal in your code editor.
  2. Navigate to your repository folder. This should be something like: cse256a-s20-<YOURWUSTLKEY>.
  3. Type in:
python -m http.server 8000.

This starts a local webserver from that directory.

  1. Navigate to: ​ http://localhost:8000/information-foraging/files/index.html

Project Set-up

Introductory Studio

The goal of this studio is to introduce you to the basic set of skills that you will need in order to begin modifying the nursery school site. While you won't emerge at the end of this knowing everything there is to know about html, css, and javascript, this should give you enough to be able to modify the starting code we've given you.

General model

For those who have never done any web programming before, we'll end up touching three kinds of files:

  • Html contains static information and it's organization (*.html)
  • Css allows you to set the visual properties and control how different website elements look (*.css)
  • Javascript enables your site to have interactivity and respond to what users do (*.js)

Running the Nursery School Site

  1. Open a terminal window or the terminal in your code editor.
  2. Navigate to your repository folder. This should be something like: cse256a-s20-<YOURWUSTLKEY>.
  3. Start a local webserver by typing in (from your repository directory):
python -m http.server 8000.

Then, open: ​ http://localhost:8000/information-foraging/files/index.html

Finding Content in HTML

ComeVisitStart.jpg

Today's web browsers provide developer tools that can be handy in finding things you want to modify in the nursery school site. For purposes of this studio, we'll assume you are using Chrome. We're going to start by changing the "come visit" call to action in the center of index.html. In some cases, you can just search for text in the page within VSCode. In other cases, you may need to navigate around more in the html structure. For this, the developer tools can be extremely helpful.

OpenDeveloperTools.jpg

Opening the Developer Tools: First, we'll open the developer tools. From the three dots menu all the way on the top right, choose "More tools" and then "Developer tools."

DeveloperToolsRight.jpg

A Quick Tour of the Element Pane:Now, you should see a panel open on the right hand side. The elements area of the developer tools shows the structure of the html document open in Chrome. Using the element pane, you can look at the structure of the information in the document. In html, different types of information are enclosed in tags. For example, a link looks like this:

<a class="site-title" href="/information-foraging/files/index.html">Nursery School</a> 
  • The <a> and </a> define the beginning and end of the link information.
  • Inside the <a> tag, there are some properties defined: the address to link to (href) and a class that can link to css formatting instructions.
  • Between <a> and </a>, we see the link text that appears on the page: Nursery School

If you want to find a specific item on the page there are two ways to do so:

  1. You can hover over elements in the element pane, and they will get highlighted in the page. Note that html is hierarchical, so you may need to tunnel into child elements to find what you need.
  2. You can also right click on the element you want to find and choose Inspect from the pop-up menu.

Task 1: Use the developer tools to find the visit call to action. What is the opening html tag for the entire gray region? Note: this should be something like: <tagType propertyName="propertyValue">

Adding New HTML Content

Should this have an example from the studio last semester?

Finding and Modifying CSS Properties

When you select an HTML element in the Elements pane, you can see its relevant CSS styling information in the pane immediately below. Note that these can also be hierarchical, so the Styles scrollpane shows you all of the relevant CSS for the selected element. Many of the names are self-explanatory, but searching for "<HTML TagName> <propertyName>" is a good way to find documentation and examples. So, for example, a search for "p line-height" explains that it's basically a way to change the line spacing, specified in pixels.

Sometimes, the properties currently used in CSS won't do what you want. You can also look up how which properties are available for a given HTML element. Searching for "<HTML TagName> properties" like "p properties" can help you determine what kinds of styling options are available.

Troubleshooting: Browsers like to cache .css files and are often fairly aggressive about not reloading them. So, if you change things and they don't show up when you reload the page, you may need to clear your cache information. On Chrome you can do this from the three dots menu. Select More tools and thenClear browsing data.

Task 2: Currently, there's an 80 pixel border around "Visit Our School", the "Our students..." sentence and the "Contact Us" button. Figure out how to change it to a 60 pixel border. Then, make it so that "Our students..." text has a larger inset from the border. Note: To accomplish this, you will need to change one existing css property value and at least one new one. What are the modified css specifications needed to accomplish this? (Just the ones for classes you changed.)

Defining New CSS Properties

CSS styles are hierarchical, with more specific formatting rules taking precedence over more general ones. So, for example if a specification for a paragraph element sets a font and font color and then a paragraph element for a specific class sets different values for these things, the specific class's values win for that class. For more details, check out: Specificity and The Cascade.

An Example of Styles that Cascaded

Use the web developer tools to find the HTML element for "Our students" and look at it's styling.

Question: Where is the CSS specification that defines it's font?

If you've found the right thing, you should see that the font property is defined on an ancestor.

Making a New Style

Then, I was thinking about asking them to define a new style for the Announcements to make the text bigger so that it stands out more.

Javascript

Have them go through an example of creating a sticky menu.

Relevant skills

  1. Opening the developer tools (ok)
  2. Right click to inspect (ok)
  3. Locating an inspected element in the code (ok)
  4. How to get to the style info in case the css is a thing (ok)
  5. Creating an alternative style for something
  6. And looking up the elements (I did this with a in index.css to get the inline version)
  7. Troubleshooting: page changes not showing up - may need to clear the browser cache. (ok)
  8. Search and replace to do things like edit the header for each page. VSCode - replace in files
  9. make a sticky header https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_sticky_header

Your new version should perform 20% better than the old version, as measured by incorrect clicks to get to an answer. We’ll use the baseline data that you have in your repository as the comparison. A user will be considered fully correct when they navigate to the data using the specified correct path and write an answer that makes sense for the question. Just being on the right page isn’t enough. Your new version should address each of the 10 tasks. The tasks are all posted on Piazza.

Submission

When you submit, you’ll submit your site and the (unique) “correct path” for each of the tasks. We will randomly choose three of the tasks to test. For future iterations, we’ll keep two tasks the same and then choose a different third task. This is intended to keep disincentivize degenerate designs while also giving you an opportunity to iterate.