Skip to content

Commit

Permalink
Merge pull request #161 from amirrr/RMET-short
Browse files Browse the repository at this point in the history
Reading the Mind in the Eyes test (RMET)
  • Loading branch information
markwhiting authored Jan 24, 2024
2 parents 45e64dc + b7a526d commit 63e0266
Show file tree
Hide file tree
Showing 35 changed files with 380 additions and 4 deletions.
Binary file added cypress/screenshots/rmetTen/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@watts-lab/surveys",
"version": "1.10.0",
"version": "1.11.0",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
"scripts": {
"prebuild": "node computeSha.js && node builder.js",
"build": "npx rollup --config",
"test": "npx cypress open"

},
"repository": {
"type": "git",
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ import relatednessNeedSatisfactionSha from "../surveys/relatednessNeedSatisfacti
import { default as relatednessNeedSatisfactionScoreFunc } from "../surveys/relatednessNeedSatisfaction/relatednessNeedSatisfaction.score.js";
export const RelatednessNeedSatisfaction = SurveyFactory("relatednessNeedSatisfaction", relatednessNeedSatisfactionJson, relatednessNeedSatisfactionScoreFunc, relatednessNeedSatisfactionSha);

import rmeTenJson from "../surveys/rmeTen/rmeTen.json";
import rmeTenSha from "../surveys/rmeTen/sha.json";
import { default as rmeTenScoreFunc } from "../surveys/rmeTen/rmeTen.score.js";
export const RmeTen = SurveyFactory("rmeTen", rmeTenJson, rmeTenScoreFunc, rmeTenSha);

import SVIJson from "../surveys/SVI/SVI.json";
import SVISha from "../surveys/SVI/sha.json";
import { default as SVIScoreFunc } from "../surveys/SVI/SVI.score.js";
Expand Down
Binary file modified surveys/SVI/screenshot.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 surveys/demographics/screenshotGeneral.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 surveys/demographics/screenshotUSA.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 surveys/relatednessNeedSatisfaction/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions surveys/rmeTen/references.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@article{Chander2020,
title = {Development of a short-form version of the Reading the Mind in the Eyes Test for assessing theory of mind in older adults},
author = {Chander, Russell J and Grainger, Sarah A and Crawford, John D and Mather, Karen A and Numbers, Katya and Cleary, Rhiagh and Kochan, Nicole A and Brodaty, Henry and Henry, Julie D and Sachdev, Perminder S},
journal = {International journal of geriatric psychiatry},
year = {2020},
volume = {35},
number = {11},
pages = {1322-1330},
month = {Nov},
doi = {10.1002/gps.5369},
issn = {1099-1166 (Electronic), 0885-6230 (Linking)},
pmid = {32584445},
url = {https://doi.org/10.1002/gps.5369},
abstract = {BACKGROUND: The Reading the Mind in the Eyes test (RMET) is a 36-item assessment for theory of mind (ToM) performance. While this measure has been shown to be sensitive to age-related ToM difficulties, there are no established cutoffs or guidelines currently available that are specific to older adults. This article seeks to validate a short-form version of the RMET appropriate for use in such populations. METHODS: Cross-sectional data from 295 participants (mean age 86 years) from the Sydney Memory and Ageing Study, a longitudinal community observational cohort. Participants underwent an assessment battery that included the RMET. Individuals who scored >1SD below the RMET scores of cognitively normal participants were deemed to have below average RMET scores. Various model-building methods were used to generate short-form solutions of the RMET, which were compared with previously validated versions in their predictive power for below average full RMET performance. RESULTS: Individuals with below average RMET performance tended to be older and have poorer global cognition. Of the eight short-form solutions, the 21-item version generated using genetic algorithm exhibited the best classification performance with an area under the receiver operating curve (AUROC) of 0.98 and had 93.2% accuracy in classifying individuals with below average ToM. A shorter 10-item solution derived by ant colony optimization also had acceptable performance. CONCLUSION: We recommend the 21-item version of the RMET for use in older adult populations for identifying individuals with impaired ToM. Where an even shorter version is needed with a trade-off of slightly reduced performance, the 10-item version is acceptable.},
keywords = {Aged, Aged, 80 and over, Aging, Cross-Sectional Studies, Humans, Memory, Surveys and Questionnaires, Theory of Mind},
note = {CI - © 2020 John Wiley \& Sons Ltd.},
affiliation = {Centre for Healthy Brain Ageing (CheBA), School Of Psychiatry, University of New South Wales, Sydney, New South Wales, 2052, Australia.},
orcid = {0000-0002-2110-5958, 0000-0001-9487-6617, 0000-0002-9595-3220},
}
72 changes: 72 additions & 0 deletions surveys/rmeTen/rmeTen.cy.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import React from "react";
import { RmeTen } from "../../src/index";

const surveyJsonPath = "surveys/rmeTen/rmeTen.json";

// Initialize an empty answers object
const answers = {};

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

describe("RMETTen", () => {
it("completes the survey", () => {
cy.spy(dummy, "set").as("callback");
cy.mount(<RmeTen onComplete={dummy.set} />);
cy.viewport("macbook-11");

cy.readFile(surveyJsonPath).then((surveyJson) => {
// Build the answers object by assuming each question's answer is the first choice
surveyJson.pages.forEach((page) => {
page.elements.forEach((element) => {
if (element.type === "radiogroup") {
answers[element.name] = element.choices[0];
}
});
});

// Now iterate over pages to perform the survey
surveyJson.pages.forEach((page, pageIndex) => {
page.elements.forEach((element) => {
if (element.type === "image") {
// Verify the image is present
cy.get("img").should("have.attr", "src", element.imageLink);
} else if (element.type === "radiogroup") {
// Click the radio button corresponding to the question
const answerValue = answers[element.name];
cy.get(
`[data-name="${element.name}"] input[value="${answerValue}"]`
).click({ force: true });
}
});

cy.screenshot(`rmeTen/screenshot_${pageIndex}`, {
overwrite: true,
});

// Click "Next" button if not on the last page
if (pageIndex < surveyJson.pages.length - 1) {
cy.get('input[type="button"][value="Next"]').click({ force: true });
}
});

cy.screenshot("rmetTen/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);
});
});
});
});
239 changes: 239 additions & 0 deletions surveys/rmeTen/rmeTen.json

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions surveys/rmeTen/rmeTen.score.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// No postprocessing needed for this survey
// Item 4: Insisting
// Item 6: Fantasizing
// Item 11: Regretful
// Item 15: Contemplative
// Item 17: Doubtful
// Item 22: Preoccupied
// Item 24: Pensive
// Item 27: Cautious
// Item 28: Interested
// Item 29: Reflective

const answers = {
question1: "insisting",
question2: "fantasizing",
question3: "regretful",
question4: "contemplative",
question5: "doubtful",
question6: "preoccupied",
question7: "pensive",
question8: "cautious",
question9: "interested",
question10: "reflective",
};

export default function scoreFunc(responses) {
let score = 0;

Object.keys(answers).forEach((questionName) => {
const response = responses[questionName];
const answer = answers[questionName];

if (response === answer) {
score += 1;
}
});

return { score: score, maxScore: 10, minScore: 0, responses: responses };
}
Binary file added surveys/rmeTen/screenshot_0.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 added surveys/rmeTen/screenshot_1.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 added surveys/rmeTen/screenshot_2.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 added surveys/rmeTen/screenshot_3.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 added surveys/rmeTen/screenshot_4.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 added surveys/rmeTen/screenshot_5.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 added surveys/rmeTen/screenshot_6.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 added surveys/rmeTen/screenshot_7.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 added surveys/rmeTen/screenshot_8.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 added surveys/rmeTen/screenshot_9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions surveys/rmeTen/sha.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"survey":"a877564008c8a997f270e2b19d813a5fb516c406","score":"ba0f44e4945160b5327df9edc7bd5f840443f951"}
Binary file modified surveys/teamViability/screenshot.png
2 changes: 1 addition & 1 deletion surveys/teamViability/teamViability.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("TeamViability", () => {
it("completes", () => {
cy.spy(dummy, "set").as("callback");
cy.mount(<TeamViability onComplete={dummy.set} />);
cy.viewport('macbook-11');
cy.viewport("macbook-11");

cy.get('[data-name="capableUnit"] input[value="2"]').click({
force: true,
Expand Down

0 comments on commit 63e0266

Please sign in to comment.