Internet Research Methods in Psychology |
Updates will be posted here throughout the semester.Readings and Materials
Iris |
David |
Jing |
Yuchen |
Kevin |
Lauren |
Noam |
Emily D |
Emily G |
Lecture 01 PowerPointLinks to useful resources:
HTML Quick Reference Guide for Class Discussion
Try it yourselfNetfirms
NetfirmsHTML Colors
http://www.w3schools.com/html/html_colors.aspHomework, due next week
http://html-color-codes.info/
Set up your website. Include the following elements:
- An "index" page that briefly describes who you are and how to contact you
- A separate page that describes your research interests
- A separate page that contains your publications and/or conference presentations
- Your home page should contain links to these new research and pubs pages
- A new directory labeled "homework"
- Within your /homework/ directory, create a page called "homework.html" and put a nice message on it for me to read
- At least one of these pages should demonstrate your skills with the following
- links
- images
http://www.w3schools.com/css/default.asp
Great CSS Reference Page
CSS Properties
CSS Selectors
There are two assignments for next week.
Part 1.
Create a webpage that uses what you've learned about forms to collect the following data from a user:
Be sure to demonstrate your ability to use the following input options: radio, checkbox, select menu, textbox, textarea, submit button. Please save the page as homework2.html and place it in your /homework/ directory.
- Information about the uesr's age
- Information about the user's sex
- Information about a user's ethnicity
- Which of the following adjectives the user thinks is descriptive of him or herself: outgoing, happy, energetic, athletic, fit, smart, religious, fabulous
- A rating of how hungry the person is on a 1 to 7 scale, anchored by "not at all" and "can eat a horse"
- A brief description of the person's childhood experiences
Part 2.
Please describe for me at least one research project you would like to be able to implement based on skills that you hope to acquire in this course. It is not important that you explain the conceptual issues that might motivate the research. I'm more interested in the nuts and bolts of how you might collect data. Please send this description to me via e-mail OR, if you prefer, include it on your homework2.html page.
Topic | Live Output | Code with detailed notes |
Basic PHP | Output | Code and notes |
Variables (literal and interpreted) | Output | Code and notes |
Variable manipulation | Output | Code and notes |
CGI data and variables | Output | Code and notes |
If-else conditionals + isset/empty | Output | Code and notes |
Arrays | Output | Code and notes |
Loops: for-next + while + foreach | Output | Code and notes |
Create a webpage that does the following:
- The first time the user visits the page, the page will ask him or her for a name. Include a submit button to advance to the next step.
- Once submitted, the SAME PHP FILE will present a welcome messsage that uses substitution to acknowledge the user by name. It will also present three questions of your choosing for which the user can submit responses. Please feel free to use radio buttons, textboxes, or whatever input option you like. Again, include a submit button at the end of the page.
- When the user submits, the SAME PHP FILE should include a thank you message. In addition, you should use IF-THEN conditionals to present a thank you message that is customized for one of your questions. (Example: If you ask about mood, you can wish someone who is having a bad day a better day. If someone says they are hungry, make a suggestion for something tasty.)
- If we had time to cover data saving in class (EDIT: WE DIDN'T), please also have your PHP script save the data and display the current contents of your data file.
Topic | Live Output | Code with detailed notes |
Passing variables forward as hidden variables | Output | Code and notes |
Using pass variables to track page progress | Output | Code and notes |
Randomize the order of stimuli, passing ARRAYs foward as hidden variables | Output | Code and notes |
Random assignment to conditions | Output | Code and notes |
Writing data to text files | Output | Code and notes |
Reading and using data from text files | explode() | Output | Code and notes |
The homework assignment is to simply rework the assignment you turned in this past week, but with the following modifications/additions:
1. The questions you ask after you've obtained the name of the user should be presented on multiple, separate pages rather than on a single page. (This is similar in spirit to the example we discussed in class in which I presented each mood item on a separate page.)
2. I want you to adopt the cyclical procedure we discussed for keeping form data "alive" across multiple, stateless submissions of a page. Thus, please "read in" all the CGI data at the start of your PHP script and, at the start of each FORM, be sure to pass forward all relevant data (whether collected yet or not) as HIDDEN tags.
3. I want you to explore the shuffle() function for the purposes of randomizing arrays and demonstrate you ability to use the procedure in your PHP script. I'm not too particular on how you use it. Some things that come to mind include using it to randomly assign people to one set of questions vs. another, randomizing the order of the questions you present, randomizing the feedback you present.
If you want to challenge yourself, I strongly encourage you to practice passing array data forward as HIDDEN tags. Even if this function isn't critical for the operation of your script, this is something you'll want to practice so that the process doesn't seem too foreign.
4. Finally, I want you to save the data you collect from your users to a text file. Moreover, your feedback page should also read the text file and present the contents of the file in a quick and dirty way so I can see it and make sure things are working okay when I run your PHP script. As an example of what I have in mind, see the output on this page http://www.yourpersonality.net/P593/PHPtutorial08.php.
Topic | Live Output | Code with detailed notes |
Basic fuction: Create, call, arguments, and return | Output | Code and notes |
A function that averages scores, with graceful handling of missing data | Output | Code and notes |
A function that makes radio button creation easier; sticky forms | Output | Code and notes |
A function for passing forward all information as hidden tags (extension of PHPtutorial11.php) | Output | Code and notes |
Each student will be responsible for creating a function that they think will be useful for their purposes or more general research purposes. Importantly, these functions must be flexible enough that other people in the class can use them. They should be documented clearly.
- A function that computes and returns the variance and SD of a set of scores.
- A function that computes and returns the correlation between two variables with paired observations.
- A function that returns a random number ranging from X to Y, where X and Y are user supplied arguments.
- A function that computes and returns a person's z-score.
Topic | Live Output | Code with detailed notes |
Write data to a MySQL database via PHP | Output | Code and notes |
Read from a MySQL databse and process data via PHP | Output | Code and notes |
Adapt one of the online questionnaires you've created such that it saves the data to a MySQL database rather than saving the data as a text file. You should also demonstrate that you know how to access the data in the SQL file once it has been stored there (e.g., using SELECT commands via PHP).
Additional challenge
- Use a function you or one of your peers created to operate upon the data that have been stored in your SQL databse.
Topic | Live Output | Code with detailed notes |
Basic graphing | Output | Code and notes |
Form validation | Output | Code and notes |
Topic | Live Output | Code with detailed notes |
Using javascript to make forms appear and disappear in conditional ways | Output | right-click live page for source code |
javascript to make radio buttons more intuitive and dynamic | Output | right-click live page for source code |
javascript for basic text field validation | Output | right-click live page for source code |
javascript for basic radio button validation | Output | right-click live page for source code |
jQuery for a score bar that expands | Output | right-click live page for source code |
jQuery for toggling sections on and off | Output | right-click live page for source code |
jQuery - Combine previous two ideas | Output | right-click live page for source code |
flot demonstration of a bargraph for a 2x2 design | Output | Code and notes |
flot demonstration of a scatterplot and line graph | Output | Code and notes |
flot demonstration of a scatterplot that dynamically loads PHP array data | Output | Code and notes |
Topic | Live Output | Code with detailed notes |
Entry page for live demonstration | Demo | |
index.php | Code and notes | |
change_password.php | Code and notes | |
create_account.php | Code and notes | |
forgot_password.php | Code and notes | |
logout.php | Code and notes | |
menu.php | Code and notes | |
surveydemo1.php | Code and notes |
Topic | Live Output | Code with detailed notes Entries in bold contain different code than the entries from last week |
Entry page for live demonstration | Demo | |
index.php | Code and notes | |
change_password.php | Code and notes | |
create_account.php | Code and notes | |
forgot_password.php | Code and notes | |
logout.php | Code and notes | |
menu.php | Code and notes | |
surveydemo1.php | Code and notes | |
surveydemo2.php | Code and notes | |
surveydemo3.php | Code and notes | |
resultsdemo2.php | Code and notes | |
resultsdemo3.php | Code and notes |
Topic | Live Output | Code with detailed notes Entries in bold contain different code than the entries from last week |
Entry page for live demonstration | Demo | |
index.php | Code and notes | |
change_password.php | Code and notes | |
create_account.php | Code and notes | |
forgot_password.php | Code and notes | |
logout.php | Code and notes | |
menu.php | Code and notes | |
surveydemo2.php | Code and notes | |
resultsdemo2.php | Code and notes | |
userinformation.php | Code and notes |