Skip to content

Commit

Permalink
Add feeling judged question to discussionGeneral (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPHoughton authored Nov 26, 2024
1 parent 583a976 commit 93a9b1a
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 5 deletions.
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.18.0",
"version": "1.18.1",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion surveys/CRT/sha.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"survey":"690943ff35f376e2dd6740ccad0bcb663da3c411","score":"d386c94c3de5d37e09537a0974aacb0256d51f9b"}
{"survey":"f706a4ec757d196716c0cdc99c37cb42ea5bbed6","score":"4df0f09da3993bdca1a11c534442042d2054d2b2"}
20 changes: 19 additions & 1 deletion surveys/discussionGeneral/discussionGeneral.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ describe("DiscussionGeneral", () => {
force: true,
});

cy.get('[data-name="selfJudged"]').contains("Some").click({
force: true,
});

cy.get('[data-name="selfVoice"]').contains("Neutral").click({
force: true,
});
Expand Down Expand Up @@ -76,7 +80,21 @@ describe("DiscussionGeneral", () => {
expect(spyCall["result"]["selfLearned"]).to.eq("0.25");
expect(spyCall["result"]["discussionDepth"]).to.eq("0.0");
expect(spyCall["result"]["discussionDisagreement"]).to.eq("0.5");
expect(spyCall["result"]["discussionOverall"]).to.eq("0.375");
expect(spyCall["result"]["discussionOverall"]).to.eq(
(
(0.5 + // discussionEnjoy
0.25 + // selfLearned
0 + // discussionDepth
// disagreement is omitted
(1 - 0.75) + // tension
0.75 + // selfSpeakUp
0.5 + // selfVoice
(1 - 0.75) + // selfAnxious
(1 - 0.5) + // selfJudged
0.5) / // selfInsight
9
).toFixed(3)
);
});
});
});
28 changes: 28 additions & 0 deletions surveys/discussionGeneral/discussionGeneral.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,34 @@
}
]
},
{
"type": "radiogroup",
"name": "selfJudged",
"title": "During the discussion, did you feel that you or people like you were being judged?",
"isRequired": true,
"choices": [
{
"value": "0.0",
"text": "Not at all"
},
{
"value": "0.25",
"text": "Not very much"
},
{
"value": "0.5",
"text": "Some"
},
{
"value": "0.75",
"text": "A fair amount"
},
{
"value": "1.0",
"text": "A great deal"
}
]
},
{
"type": "radiogroup",
"name": "selfInsight",
Expand Down
4 changes: 4 additions & 0 deletions surveys/discussionGeneral/discussionGeneral.score.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { parse } from "survey-react";

function sum(array) {
return array.reduce((acc, val) => acc + val, 0);
}
Expand All @@ -23,6 +25,7 @@ export default function scoreFunc(responses) {
selfSpeakUp: responses["selfSpeakUp"],
selfVoice: responses["selfVoice"],
selfAnxious: responses["selfAnxious"],
selfJudged: responses["selfJudged"],
selfInsight: responses["selfInsight"],

discussionEnjoy: responses["discussionEnjoy"],
Expand All @@ -39,6 +42,7 @@ export default function scoreFunc(responses) {
parseFloat(responses["selfSpeakUp"]),
parseFloat(responses["selfVoice"]),
1 - parseFloat(responses["selfAnxious"]),
1 - parseFloat(responses["selfJudged"]),
parseFloat(responses["selfInsight"]),
]).toFixed(3),
};
Expand Down
Binary file modified surveys/discussionGeneral/screenshot.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 surveys/discussionGeneral/sha.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"survey":"e0f81e6ef1b81009be12d6f8ae29db71dd2d630e","score":"6d791d5cbc184e2ce33ae6a0eb7ca9ed8656f6d6"}
{"survey":"305f142faacb6d13653346f1920fd1dc69467389","score":"d96ff22fa58e68a2653e95f5acf78f6641dbefa9"}
2 changes: 1 addition & 1 deletion surveys/rmeTen/sha.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"survey":"1a2d8942ec36e65434be2521b28d5cd29bd568e7","score":"da256c890dcc2abf230820dfa348c8a760f8f4ca"}
{"survey":"180106b2041588258caa2ef3656b15dc749d1a75","score":"f4ef2b447ba5a8a61322c268286ca48e90b770a1"}

0 comments on commit 93a9b1a

Please sign in to comment.