Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small fixes #190

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified 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.
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.17.0",
"version": "1.17.1",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
15 changes: 7 additions & 8 deletions src/customQuestionTypes/labeledRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ export function labeledRange(SurveyJS) {
el.classList.add("sliderContainer");
const dl = document.createElement("datalist");
dl.id = `${question.name}_slider_vals`;
dl.style.justifyContent = 'normal';
dl.style.justifyContent = "normal";
question.valueLabels.forEach((label) => {
var option = document.createElement("div");
option.classList.add("sliderLabel");
var leftPosition = ((label.value - slider.min) / (slider.max - slider.min) * 100);
var leftPosition =
((label.value - slider.min) / (slider.max - slider.min)) * 100;
option.style.left = `${leftPosition}%`;
console.log("value", label.value);
console.log("left", leftPosition);
console.log("min", slider.min);
console.log("max", slider.max);
// console.log("value", label.value);
// console.log("left", leftPosition);
// console.log("min", slider.min);
// console.log("max", slider.max);
option.innerHTML = `
<div class="each_label">
<div class="tick"></div>
Expand All @@ -88,8 +89,6 @@ export function labeledRange(SurveyJS) {
dl.classList.add("sliderLabels");
el.appendChild(dl);



slider.setAttribute("list", dl.id);
slider.classList.add("slider");

Expand Down
2 changes: 2 additions & 0 deletions surveys/discussionGeneral/discussionGeneral.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
{
"type": "radiogroup",
"name": "discussionDisagreement",
"isRequired": true,
"title": "How much did participants disagree on the discussion topic?",
"choices": [
{
Expand Down Expand Up @@ -230,6 +231,7 @@
{
"type": "radiogroup",
"name": "selfInsight",
"isRequired": true,
"title": "How much did this discussion help you understand your own thoughts more deeply?",
"choices": [
{
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":"927ac49633859d09c7e0c8c2d0431f461c9c9151","score":"6d791d5cbc184e2ce33ae6a0eb7ca9ed8656f6d6"}
{"survey":"e0f81e6ef1b81009be12d6f8ae29db71dd2d630e","score":"6d791d5cbc184e2ce33ae6a0eb7ca9ed8656f6d6"}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
{
"type": "text",
"inputType": "range",
"isRequired": true,
"name": "republicanTemp",
"title": "How do you feel toward Republicans?",
"min": 0,
Expand All @@ -34,6 +35,7 @@
{
"type": "text",
"inputType": "range",
"isRequired": true,
"name": "democratTemp",
"title": "How do you feel towards Democrats?",
"min": 0,
Expand Down
Binary file modified surveys/partisanFeelingThermometerUS/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/partisanFeelingThermometerUS/sha.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"survey":"2851ef988613a0b74ecdbbd34f23d69d3a1f67ac","score":"150210b7aba45083a2483b58e028c525b2e1fde7"}
{"survey":"b6636c45ded4a21854a90fa3c22ccfd4e26a5af9","score":"150210b7aba45083a2483b58e028c525b2e1fde7"}
Binary file modified surveys/politicalPartyUS/page1.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/politicalPartyUS/page1_other.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/politicalPartyUS/page2.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/politicalPartyUS/page2_other.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions surveys/politicalPartyUS/politicalPartyUS.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
"inputType": "range",
"name": "republicanImportance",
"title": "How important is being a Republican to you?",
"description": "Below is a range from 0 to 100 indicating how important this is to you. Click on any space within this range and a bar will appear. Feel free to move that bar around to the number that best represents your answer.",
"description": "Click anywhere on the slider below to place a marker and drag it to your preferred position.",
"visibleIf": "{party} = 'Republican'",
"requiredIf": "{party} = 'Republican'",
"min": 0,
"max": 100,
"step": 1,
Expand All @@ -78,8 +79,9 @@
"inputType": "range",
"name": "democratImportance",
"title": "How important is being a Democrat to you?",
"description": "Below is a range from 0 to 100 indicating how important this is to you. Click on any space within this range and a bar will appear. Feel free to move that bar around to the number that best represents your answer.",
"description": "Click anywhere on the slider below to place a marker and drag it to your preferred position.",
"visibleIf": "{party} = 'Democrat'",
"requiredIf": "{party} = 'Democrat'",
"min": 0,
"max": 100,
"step": 1,
Expand All @@ -96,7 +98,7 @@
"inputType": "range",
"name": "independentImportance",
"title": "How important is being an Independent to you?",
"description": "Below is a range from 0 to 100 indicating how important this is to you. Click on any space within this range and a bar will appear. Feel free to move that bar around to the number that best represents your answer.",
"description": "Click anywhere on the slider below to place a marker and drag it to your preferred position.",
"visibleIf": "{party} = 'Independent'",
"min": 0,
"max": 100,
Expand All @@ -114,8 +116,9 @@
"inputType": "range",
"name": "otherImportance",
"title": "How important is being a member of your political party to you?",
"description": "Below is a range from 0 to 100 indicating how important this is to you. Click on any space within this range and a bar will appear. Feel free to move that bar around to the number that best represents your answer.",
"description": "Click anywhere on the slider below to place a marker and drag it to your preferred position.",
"visibleIf": "{party} = 'Other'",
"requiredIf": "{party} = 'Independent'",
"min": 0,
"max": 100,
"step": 1,
Expand Down
2 changes: 1 addition & 1 deletion surveys/politicalPartyUS/sha.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"survey":"80b9769ececff2a0d93e25ec56f2669dcb080f24","score":"4f9591e4781bc5e1c4ab6f57b1c3c9953c5f9dad"}
{"survey":"d56d46da3f0f237afbce28c6e935cc07eb2af855","score":"4f9591e4781bc5e1c4ab6f57b1c3c9953c5f9dad"}
1,794 changes: 907 additions & 887 deletions surveys/rmeTen/rmeTen.json

Large diffs are not rendered by default.

Binary file modified 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 modified 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 modified 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 modified 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 modified 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 modified 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 modified 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 modified 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 modified 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 modified 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.
2 changes: 1 addition & 1 deletion surveys/rmeTen/sha.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"survey":"b487ecbdbb884190ab6ee4ea225d471f4a81e14a","score":"da256c890dcc2abf230820dfa348c8a760f8f4ca"}
{"survey":"1a2d8942ec36e65434be2521b28d5cd29bd568e7","score":"da256c890dcc2abf230820dfa348c8a760f8f4ca"}
Binary file modified surveys/traitRatings/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions surveys/traitRatings/traitRatings.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ const dummy = {
set(response) {},
};

const dataNames = [
"patriotic",
"intelligent",
"honest",
"openMinded",
"generous",
"hypocritical",
"selfish",
"mean",
];

describe("TraitRatings", () => {
it("completes", () => {
cy.spy(dummy, "set").as("callback");
cy.mount(<TraitRatings onComplete={dummy.set} />);
cy.viewport("macbook-11");
cy.checkRandomization(dataNames);

cy.get('[data-name="patriotic"] input[value="1"]').click({
force: true,
Expand Down
1 change: 0 additions & 1 deletion surveys/traitRatings/traitRatings.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
}
],
"showPageTitles": false,
"questionsOnPageMode": "singlePage",
"widthMode": "responsive",
"showCompletedPage": false
}
Loading