Skip to content

Commit

Permalink
Add TIPI + other scales
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPHoughton committed Sep 26, 2023
1 parent 939dc27 commit e6929a5
Show file tree
Hide file tree
Showing 63 changed files with 1,371 additions and 340 deletions.
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/new-survey.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Add a new survey to the repository according to the instructions in [the package

# Survey Title

"Super Special Survey" <- note, this is just a placeholder name - replace it with the name of the actual survey.

## Survey Source

## Survey Overview
Expand All @@ -20,7 +22,7 @@ Add a new survey to the repository according to the instructions in [the package

- [ ] Create a new folder in surveys w/ descriptive, easy-to-read name `superSpecialSurvey/`
- [ ] Create SurveyJS .json file (_e.g._ `superSpecialSurvey/superSpecialSurvey.json`)
- [ ] Change the default completion page to a blank page (```"showCompletedPage": false```)
- [ ] Change the default completion page to a blank page (`"showCompletedPage": false`)
- [ ] Create a .bib file citing your references for the survey (_always:_ `superSpecialSurvey/references.bib`)
- [ ] Create file with function to aggregate survey data (_e.g._ `superSpecialSurvey.score.js`)
- [ ] Create a cypress test of the survey (e.g. `superSpecialSurvey.cy.jsx`)
Expand Down
Binary file modified cypress/screenshots/labeledRangeTest/afterClick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/screenshots/labeledRangeTest/beforeClick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@watts-lab/surveys",
"version": "1.8.13",
"version": "1.9.0",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
30 changes: 25 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ import autonomyNeedSatisfactionSha from "../surveys/autonomyNeedSatisfaction/sha
import { default as autonomyNeedSatisfactionScoreFunc } from "../surveys/autonomyNeedSatisfaction/autonomyNeedSatisfaction.score.js";
export const AutonomyNeedSatisfaction = SurveyFactory("autonomyNeedSatisfaction", autonomyNeedSatisfactionJson, autonomyNeedSatisfactionScoreFunc, autonomyNeedSatisfactionSha);

import awarenessMonitoringGrowthJson from "../surveys/awarenessMonitoringGrowth/awarenessMonitoringGrowth.json";
import awarenessMonitoringGrowthSha from "../surveys/awarenessMonitoringGrowth/sha.json";
import { default as awarenessMonitoringGrowthScoreFunc } from "../surveys/awarenessMonitoringGrowth/awarenessMonitoringGrowth.score.js";
export const AwarenessMonitoringGrowth = SurveyFactory("awarenessMonitoringGrowth", awarenessMonitoringGrowthJson, awarenessMonitoringGrowthScoreFunc, awarenessMonitoringGrowthSha);

import conflictAndViabilityJson from "../surveys/conflictAndViability/conflictAndViability.json";
import conflictAndViabilitySha from "../surveys/conflictAndViability/sha.json";
import { default as conflictAndViabilityScoreFunc } from "../surveys/conflictAndViability/conflictAndViability.score.js";
export const ConflictAndViability = SurveyFactory("conflictAndViability", conflictAndViabilityJson, conflictAndViabilityScoreFunc, conflictAndViabilitySha);

import constructiveListeningBehaviorsJson from "../surveys/constructiveListeningBehaviors/constructiveListeningBehaviors.json";
import constructiveListeningBehaviorsSha from "../surveys/constructiveListeningBehaviors/sha.json";
import { default as constructiveListeningBehaviorsScoreFunc } from "../surveys/constructiveListeningBehaviors/constructiveListeningBehaviors.score.js";
Expand Down Expand Up @@ -49,6 +59,16 @@ import partisanFeelingThermometerUSSha from "../surveys/partisanFeelingThermomet
import { default as partisanFeelingThermometerUSScoreFunc } from "../surveys/partisanFeelingThermometerUS/partisanFeelingThermometerUS.score.js";
export const PartisanFeelingThermometerUS = SurveyFactory("partisanFeelingThermometerUS", partisanFeelingThermometerUSJson, partisanFeelingThermometerUSScoreFunc, partisanFeelingThermometerUSSha);

import perceptionOfOthersJson from "../surveys/perceptionOfOthers/perceptionOfOthers.json";
import perceptionOfOthersSha from "../surveys/perceptionOfOthers/sha.json";
import { default as perceptionOfOthersScoreFunc } from "../surveys/perceptionOfOthers/perceptionOfOthers.score.js";
export const PerceptionOfOthers = SurveyFactory("perceptionOfOthers", perceptionOfOthersJson, perceptionOfOthersScoreFunc, perceptionOfOthersSha);

import persuasionAndLearningJson from "../surveys/persuasionAndLearning/persuasionAndLearning.json";
import persuasionAndLearningSha from "../surveys/persuasionAndLearning/sha.json";
import { default as persuasionAndLearningScoreFunc } from "../surveys/persuasionAndLearning/persuasionAndLearning.score.js";
export const PersuasionAndLearning = SurveyFactory("persuasionAndLearning", persuasionAndLearningJson, persuasionAndLearningScoreFunc, persuasionAndLearningSha);

import politicalPartyUSJson from "../surveys/politicalPartyUS/politicalPartyUS.json";
import politicalPartyUSSha from "../surveys/politicalPartyUS/sha.json";
import { default as politicalPartyUSScoreFunc } from "../surveys/politicalPartyUS/politicalPartyUS.score.js";
Expand All @@ -64,12 +84,12 @@ import relatednessNeedSatisfactionSha from "../surveys/relatednessNeedSatisfacti
import { default as relatednessNeedSatisfactionScoreFunc } from "../surveys/relatednessNeedSatisfaction/relatednessNeedSatisfaction.score.js";
export const RelatednessNeedSatisfaction = SurveyFactory("relatednessNeedSatisfaction", relatednessNeedSatisfactionJson, relatednessNeedSatisfactionScoreFunc, relatednessNeedSatisfactionSha);

import superSpecialSurveyJson from "../surveys/superSpecialSurvey/superSpecialSurvey.json";
import superSpecialSurveySha from "../surveys/superSpecialSurvey/sha.json";
import { default as superSpecialSurveyScoreFunc } from "../surveys/superSpecialSurvey/superSpecialSurvey.score.js";
export const SuperSpecialSurvey = SurveyFactory("superSpecialSurvey", superSpecialSurveyJson, superSpecialSurveyScoreFunc, superSpecialSurveySha);

import teamViabilityJson from "../surveys/teamViability/teamViability.json";
import teamViabilitySha from "../surveys/teamViability/sha.json";
import { default as teamViabilityScoreFunc } from "../surveys/teamViability/teamViability.score.js";
export const TeamViability = SurveyFactory("teamViability", teamViabilityJson, teamViabilityScoreFunc, teamViabilitySha);

import TIPIJson from "../surveys/TIPI/TIPI.json";
import TIPISha from "../surveys/TIPI/sha.json";
import { default as TIPIScoreFunc } from "../surveys/TIPI/TIPI.score.js";
export const TIPI = SurveyFactory("TIPI", TIPIJson, TIPIScoreFunc, TIPISha);
29 changes: 29 additions & 0 deletions surveys/TIPI/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Ten Item Personality Inventory

## Survey Purpose

This particular survey aims to use the Ten-Item Personality Inventory (TIPI) to quantify the particpant's Big-Five personality dimensions.

## Theoretical construct

The Big 5 personality inventory includes

- Extroversion
- Conscientiousness
- Agreeableness
- Openness to experience
- Emotional Stability / Neuroticism

Measuring these traits can be expensive, as the traditional big 5 tests have many questions. This scale takes a rough measure of these attributes, and was originally developed in:

> Gosling, Samuel D., Peter J. Rentfrow, and William B. Swann Jr. "A very brief measure of the Big-Five personality domains." Journal of Research in personality 37.6 (2003): 504-528.
> When time is limited, researchers may be faced with the choice of using an extremely brief measure of the Big-Five personality dimensions or using no measure at all. To meet the need for a very brief measure, 5 and 10-item inventories were developed and evaluated. Although somewhat inferior to standard multi-item instruments, the instruments reached adequate levels in terms of: (a) convergence with widely used Big-Five measures in self, observer, and peer reports, (b) test–retest reliability, (c) patterns of predicted external correlates, and (d) convergence between self and observer ratings. On the basis of these tests, a 10-item measure of the Big-Five dimensions is offered for situations where very short measures are needed, personality is not the primary topic of interest, or researchers can tolerate the somewhat diminished psychometric properties associated with very brief measures.
# Adaptations

The original survey asked people to fill in a number in a blank. Here we provide a range of numerical values.

### Screenshot

![Screenshot](screenshot.png)
96 changes: 96 additions & 0 deletions surveys/TIPI/TIPI.cy.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import React from "react";
import { TIPI } from "../../src/index";

const dummy = {
set(response) {},
};

describe("SuperSpecialSurvey", () => {
it("completes", () => {
cy.spy(dummy, "set").as("callback");
cy.mount(<TIPI onComplete={dummy.set} />);

// extroversion
cy.get('[data-name="extroversion"] input[value="1"]').click({
force: true,
});

cy.get('[data-name="quietness"] input[value="6"]').click({
force: true,
});

// Agreeableness
cy.get('[data-name="criticalness"] input[value="2"]').click({
force: true,
});

cy.get('[data-name="sympathy"] input[value="3"]').click({
force: true,
});

// Conscientiousness
cy.get('[data-name="dependability"] input[value="5"]').click({
force: true,
});

cy.get('[data-name="carelessness"] input[value="2"]').click({
force: true,
});

// Emotional Stability
cy.get('[data-name="anxiety"] input[value="1"]').click({
force: true,
});

cy.get('[data-name="calmness"] input[value="7"]').click({
force: true,
});

// Openness
cy.get('[data-name="openness"] input[value="4"]').click({
force: true,
});

cy.get("form") // submit surveyJS form
.then(($form) => {
cy.wrap($form.find('input[type="button"][value="Complete"]')).click();
});

// check mandatory is enforced
cy.contains("Response required");

cy.get('[data-name="conventionality"] input[value="4"]').click({
force: true,
});

cy.screenshot("TIPI/screenshot", { overwrite: true });

cy.get("form") // submit surveyJS form
.then(($form) => {
cy.wrap($form.find('input[type="button"][value="Complete"]')).click();
});

cy.get(".sv-body").should("not.exist");

cy.get("@callback").should("have.been.called");
cy.get("@callback").then((spy) => {
const spyCall = spy.getCall(-1).args[0];
console.log(spyCall);
expect(spyCall["result"]["normExtroversion"]).to.eq(
(0.083333).toFixed(3)
);
expect(spyCall["result"]["normAgreeableness"]).to.eq(
(0.58333).toFixed(3)
);
expect(spyCall["result"]["normConscientiousness"]).to.eq(
(0.75).toFixed(3)
);
expect(spyCall["result"]["normEmotionalStability"]).to.eq(
(1.0).toFixed(3)
);
expect(spyCall["result"]["normOpennessToExperience"]).to.eq(
(0.5).toFixed(3)
);
});
});
});
136 changes: 136 additions & 0 deletions surveys/TIPI/TIPI.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"logoPosition": "right",
"focusFirstQuestionAutomatic": false,
"pages": [
{
"name": "page1",
"elements": [
{
"type": "html",
"name": "Prompt",
"hideNumber": true,
"html": "<h1> Here are a number of personality traits that may or may not apply to you. Please indicate the extent to which you agree or disagree with that statement. You should rate the extent to which the pair of traits applies to you, even if one characteristic applies more strongly than the other. </h1><h1>I see myself as ...</h1>"
},
{
"type": "html",
"name": "Prompt",
"hideNumber": true,
"html": "<p> Scale key: (1) Strongly Disagree, (2) Disagree, (3) Slightly Disagree, (4) Neutral, (5) Slightly Agree, (6) Agree, (7) Strongly Agree</p>"
},
{
"type": "panel",
"name": "randomizationPanel",
"elements": [
{
"type": "rating",
"name": "extroversion",
"title": "... extroverted, enthusiastic",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "criticalness",
"title": "... critical, quarrelsome",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "dependability",
"title": "... dependable, self-disciplined",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "anxiety",
"title": "... anxious, easily upset",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "openness",
"title": "... open to new experience, complex",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "quietness",
"title": "... reserved, quiet",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "sympathy",
"title": "... sympathetic, warm",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "carelessness",
"title": "... disorganized, careless",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "calmness",
"title": "... calm, emotionally stable",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
},
{
"type": "rating",
"name": "conventionality",
"title": "... conventional, uncreative",
"rateMax": 7,
"minRateDescription": "Strongly disagree",
"maxRateDescription": "Strongly agree",
"displayMode": "buttons",
"isRequired": true
}
],
"questionsOrder": "random",
"showQuestionNumbers": "off"
}
],
"questionTitleLocation": "top",
"questionsOrder": "initial"
}
],
"showPageTitles": false,
"widthMode": "responsive",
"showCompletedPage": false
}
Loading

0 comments on commit e6929a5

Please sign in to comment.