Skip to content

Commit

Permalink
fix scoring on discussionGeneral
Browse files Browse the repository at this point in the history
fixes #197
  • Loading branch information
JamesPHoughton committed Nov 15, 2024
1 parent 2fc49cc commit 64412f2
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 141 deletions.
41 changes: 22 additions & 19 deletions surveys/discussionGeneral/discussionGeneral.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,35 @@ describe("DiscussionGeneral", () => {
cy.mount(<DiscussionGeneral onComplete={dummy.set} />);
cy.viewport("macbook-11");

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

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

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

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

cy.get('[data-name="discussionTension"] input[value="5"]').click({
force: true,
});
cy.get('[data-name="discussionTension"]')
.contains("Moderately tense")
.click({
force: true,
});

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

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

Expand All @@ -47,11 +51,11 @@ describe("DiscussionGeneral", () => {
// check mandatory is enforced
cy.contains("Response required");

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

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

Expand All @@ -68,12 +72,11 @@ describe("DiscussionGeneral", () => {
cy.get("@callback").then((spy) => {
const spyCall = spy.getCall(-1).args[0];
console.log(spyCall);
expect(spyCall["result"]["normDiscussionEnjoy"]).to.eq((0).toFixed(3));
expect(spyCall["result"]["normSelfLearned"]).to.eq((0.25).toFixed(3));
expect(spyCall["result"]["normDiscussionDepth"]).to.eq((0.5).toFixed(3));
expect(spyCall["result"]["normDiscussionDisagreement"]).to.eq(
(0.75).toFixed(3)
);
expect(spyCall["result"]["discussionEnjoy"]).to.eq("0.5");
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");
});
});
});
90 changes: 45 additions & 45 deletions surveys/discussionGeneral/discussionGeneral.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
"isRequired": true,
"choices": [
{
"value": "1",
"value": "0.0",
"text": "Not at all"
},
{
"value": "2",
"value": "0.25",
"text": "Not very much"
},
{
"value": "3",
"value": "0.5",
"text": "Some"
},
{
"value": "4",
"value": "0.75",
"text": "A fair amount"
},
{
"value": "5",
"value": "1.0",
"text": "A great deal"
}
]
Expand All @@ -39,23 +39,23 @@
"isRequired": true,
"choices": [
{
"value": "6",
"value": "0.0",
"text": "Nothing at all"
},
{
"value": "5",
"value": "0.25",
"text": "Very little"
},
{
"value": "2",
"value": "0.5",
"text": "Some"
},
{
"value": "4",
"value": "0.75",
"text": "A fair amount"
},
{
"value": "3",
"value": "1.0",
"text": "A great deal"
}
]
Expand All @@ -67,23 +67,23 @@
"isRequired": true,
"choices": [
{
"value": "1",
"value": "0.0",
"text": "Not at all"
},
{
"value": "3",
"value": "0.25",
"text": "Only at the surface level"
},
{
"value": "4",
"value": "0.5",
"text": "Moderately"
},
{
"value": "5",
"value": "0.75",
"text": "Quite Thoroughly"
},
{
"value": "6",
"value": "1.0",
"text": "Deeply and extensively"
}
]
Expand All @@ -95,23 +95,23 @@
"title": "How much did participants disagree on the discussion topic?",
"choices": [
{
"value": "1",
"value": "0.0",
"text": "No disagreement at all"
},
{
"value": "2",
"value": "0.25",
"text": "Not very much disagreement"
},
{
"value": "3",
"value": "0.5",
"text": "Some disagreement"
},
{
"value": "4",
"value": "0.75",
"text": "A fair amount of disagreement"
},
{
"value": "5",
"value": "1.0",
"text": "A great deal of disagreement"
}
]
Expand All @@ -123,23 +123,23 @@
"isRequired": true,
"choices": [
{
"value": "1",
"value": "1.0",
"text": "Very tense and uncomfortable"
},
{
"value": "2",
"value": "0.75",
"text": "Moderately tense"
},
{
"value": "3",
"value": "0.5",
"text": "Somewhat relaxed, with multiple moments of tension"
},
{
"value": "4",
"value": "0.25",
"text": "Mostly relaxed, with rare moments of tension"
},
{
"value": "5",
"value": "0.0",
"text": "Completely relaxed and calm"
}
]
Expand All @@ -151,23 +151,23 @@
"isRequired": true,
"choices": [
{
"value": "1",
"value": "0.0",
"text": "Never"
},
{
"value": "2",
"value": "0.25",
"text": "Rarely"
},
{
"value": "3",
"value": "0.5",
"text": "Sometimes"
},
{
"value": "4",
"value": "0.75",
"text": "Often"
},
{
"value": "5",
"value": "1.0",
"text": "Always"
}
]
Expand All @@ -179,23 +179,23 @@
"isRequired": true,
"choices": [
{
"value": "1",
"value": "0.0",
"text": "Very uncomfortable"
},
{
"value": "2",
"value": "0.25",
"text": "Somewhat uncomfortable"
},
{
"value": "5",
"value": "0.5",
"text": "Neutral"
},
{
"value": "3",
"value": "0.75",
"text": "Fairly comfortable"
},
{
"value": "4",
"value": "1.0",
"text": "Very comfortable"
}
]
Expand All @@ -207,23 +207,23 @@
"isRequired": true,
"choices": [
{
"value": "1",
"value": "0.0",
"text": "Not at all"
},
{
"value": "2",
"value": "0.25",
"text": "Not very much"
},
{
"value": "3",
"value": "0.5",
"text": "Some"
},
{
"value": "4",
"value": "0.75",
"text": "A fair amount"
},
{
"value": "5",
"value": "1.0",
"text": "A great deal"
}
]
Expand All @@ -235,23 +235,23 @@
"title": "How much did this discussion help you understand your own thoughts more deeply?",
"choices": [
{
"value": "1",
"value": "0.0",
"text": "Not at all"
},
{
"value": "2",
"value": "0.25",
"text": "Not very much"
},
{
"value": "3",
"value": "0.5",
"text": "Some"
},
{
"value": "4",
"value": "0.75",
"text": "A fair amount"
},
{
"value": "5",
"value": "1.0",
"text": "A great deal"
}
]
Expand Down
Loading

0 comments on commit 64412f2

Please sign in to comment.