This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Welcome | |
| The experiment you are about to complete is an educational exercise designed for PSY 1903: Programming for Psychologists</em>; it is not intended as a true scientific experiment. | |
| No identifying information will be collected, data will not be shared beyond our class, and your participation is completely voluntary. | |
| If you have any questions, please reach out to Dr. Garth Coombs (garthcoombs@fas.harvard.edu), one of the head instructors of PSY 1903. | |
| If you agree to participate, press SPACE to continue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Select the elements on the page we will alter | |
| let num1Span = document.getElementById('num1'); | |
| let num2Span = document.getElementById('num2'); | |
| // Example numbers | |
| let num1 = 5; | |
| let num2 = 9; | |
| // Update the elements on the page with the example numbers | |
| num1Span.innerHTML = num1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Don’t redeclare the same variable: | |
| let answer = prompt('What is 1 + 1?'); | |
| console.log('You answered: ' + answer); | |
| let answer = prompt('What is 4 + 8?'); | |
| console.log('You answered: ' + answer); | |
| // Instead do this: |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Emp ID,satisfaction_level,last_evaluation,number_project,average_montly_hours,time_spend_company,Work_accident,promotion_last_5years,dept,salary | |
| 1,0.38,0.53,2,157,3,0,0,sales,low | |
| 2,0.8,0.86,5,262,6,0,0,sales,medium | |
| 3,0.11,0.88,7,272,4,0,0,sales,medium | |
| 4,0.72,0.87,5,223,5,0,0,sales,low | |
| 5,0.37,0.52,2,159,3,0,0,sales,low | |
| 6,0.41,0.5,2,153,3,0,0,sales,low | |
| 7,0.1,0.77,6,247,4,0,0,sales,low | |
| 8,0.92,0.85,5,259,5,0,0,sales,low | |
| 9,0.89,1,5,224,5,0,0,sales,low |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Basic text formatting | |
| **This text is bold - it must be important** | |
| _This text is italicized; you should probably pay attention to it..._ | |
| [Click this link to learn about jsPsych...](https://www.jspsych.org) | |
| Lists are created using asterisks or plus signs: | |
| + Item 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This experiment is an educational exercise about learning to program and analyze a psychological experiment and not a “real” scientific experiment. No identifying information is collected, and data will not be shared beyond our class. If you agree to help out by completing the tasks and questionnaires, please click Continue. Otherwise, you may close this tab. If you have any questions, please reach out to Dr. Garth Coombs <garthcoombs@fas.harvard.edu>, one of the head instructors of PSY 1903: Programming for Psychological Scientists. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let conditions = []; | |
| for (let i = 0; i < 3; i++) { | |
| let numbers = []; | |
| // FYI: When using a nested numerical for loop, it’s common practice | |
| // to use "j" as the iterator variable in the inner loop since "i" is already being | |
| // used as the iterator variable in the outer for loop | |
| for (let j = 0; j < 3; j++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang='en'> | |
| <head> | |
| <title></title> | |
| <meta charset='utf-8'> | |
| <link href=data: , rel=icon> | |
| </head> | |
| <body> | |
| </body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "block": "practice", | |
| "trials": [ | |
| { | |
| "word": "crumb", | |
| "color": "red", | |
| "isNeutral": true | |
| }, | |
| { |