Giter Club home page Giter Club logo

survey-library's Issues

Jump to missing "required" field

Is there currently anything within the library API that would allow me to "focus" on the top most missing field. Currently on long forms, you may not see that error...

"other" value

is it possible to get rid off the value "other"?

i think it's better to add the entered value in the data for the field directly.

as fas as i can see it seems to me that "other" is added to the fielddata and the entered data is
submitted as new "..-comment" field.

Not possible to set a trigger on a field inside a matrixdropdown

If I have a matrixdropdown, I cannot trigger on a field, only on the result of the entire question which does not work. I tested with "contains" but this does not work, either.

Would be much better to have something like this:

{ type: "visible", name: "myMatrix.row[3].field[5]", value: "sedan", questions: ["Sedan"] },

Custom dropdown Data Source

Hi,

i am trying to achieve a custom data source for dropdown components, which will help dropdown to be populated from a different data source rather than defining in the editor.
please have a look at the below changes, confirm if this is the right place or will it cause some other problems.
Object.defineProperty(n.prototype, "choices", {
get: function () {
debugger;
//"dataServiceURL" is a new property in dropdown property bag.
if (this.dataServiceURL != undefined) {
this.choicesValues = []; //reinitialize the Array
//loading with a different source.
this.choices = ["1|1st modified Item", "2|2nd Modified Item"];
console.log(this.choicesValues);
return this.choicesValues;
} else {
return this.choicesValues
}
},
set: function (t) {
debugger;
e.ItemValue.setData(this.choicesValues, t)
}

New feature : add a prioritize question type

A prioritize question type is a question where user is asked to order labels from most important to least important. It is usefull for website/app evolution prioritization.

It can be done either by drag and drop labels or putting the order number in front of each label.

Add indent property to question

The default indent property value is 0. The available values are: {0, 1, 2, 3}. The default offset, margin-left, for 1 is 20px, 40px for 2 and 60px for 3. To change it, use survey.css.question.indent, default value is 20.

Wrong CSS styles for links

In survey.css there is:

.sv_window_title a, a:link, a:visited {
text-decoration: none;
font-size: 14px;
font-style: normal;
color: black; }

That hits too many "a"-tags, also outside of the survey markup. The correct styling probably is this:

.sv_window_title a {
text-decoration: none;
font-size: 14px;
font-style: normal;
color: black; }

.sv_window_title a:link {
text-decoration: none;
font-size: 14px;
font-style: normal;
color: black; }

.sv_window_title a:visited {
text-decoration: none;
font-size: 14px;
font-style: normal;
color: black; }

Add cellType property to the matrix dropdown/dynamic

I have got a survey with a dropdown matrix question that has a lot of checkbox columns. Actually all columns are checkbox. Since the default editor is dropdown, all columns have cellType: "checkbox" attribute. It would be nice to have the cellType on the question/matrix level to change the default editor type.

Uncaught TypeError: self.getProgress is not a function in kosurvey.ts

I'm trying to embed a generated JSON survey in an existing website with the above error.

I have scaled back my example to the simplest possible config;

`

<script src="https://cdnjs.buttflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script> <script src="js/survey.bootstrap.js"></script>
<div id= "mySurveyJSName" ></div>

<script>
    var survey = new Survey.Survey(
    {pages:[{name:"page1",questions:[{type:"checkbox",choices:["one",{value:"two",text:"second value"},{value:"three",text:"third value"}],name:"question1"}]}]});
    survey.onComplete.add(function (s) {
    alert("The results are:" + JSON.stringify(s.data));
     });
    survey.render("mySurveyJSName");
</script>
`

Pretty much as per the instructions on the "Embed Survey" tab in the visual editor, with the inclusion of some Bootstrap CSS (removal of which has no effect).

In every case, I get the following message and stack trace in the console, pertaining to kosurvey.ts;

kosurvey.ts:73Uncaught TypeError: self.getProgress is not a function (anonymous function) @ kosurvey.ts:73 Pc @ knockout-min.js:51 Qc @ knockout-min.js:51 aa @ knockout-min.js:50 a.m.a.B @ knockout-min.js:49 SurveyBase.onBeforeCreating @ kosurvey.ts:73 SurveyModel @ survey.ts:83 SurveyBase @ kosurvey.ts:23 Survey @ koSurveybootstrap.ts:11 (anonymous function) @ surveytest2:16

I'm not too proficient with either JS or TS and have reached the end of my ideas!

Multiple Criteria in trigger

Hi,

Could you please add Multiple statement feature to execute a single trigger, criteria could be 'n' numbers of statements for a single trigger.
for e,g;
if(Age > 24 And Gender == 'Male')
{
//visible trigger
}

Thanks for a wonderful survey engine.

Thanks,
Muhammad Faraz Khan

Rating control does not return results

Rating control selections are not added to the survey result. This occurs using the default values (1 to 5), and when setting custom values.

If you make a Rating control 'Required' surveyjs will always identify it as unselected ("Please answer the question" alert appears).

Example survey:
var survey = new Survey.Survey(
{pages:[{name:"page1",questions:[{type:"rating",isRequired:true,name:"question1"}]}]});

Add survey.questionTitleTemplate property

By default the question title rendered as: "{no}. {require} {title}".
The default value of survey.questionTitleTemplate is empty string, the default template is used.
The template could be set to : "{no}) {title} ({require})", the example of tittle rendering:
"2) My Title (*)".

Change properties array parameter in JsonObject.metaData.addClass method

Optionally, add ability to use json object to define a property. For example:

Survey property: "showQuestionNumbers"
JsonObject.metaData.setPropertyValues("survey", "showQuestionNumbers", null, "on");
JsonObject.metaData.setPropertyChoices("survey", "showQuestionNumbers", ["on", "onPage", "off"]);

It can be define directly in the properties parameter as:

{name: "showQuestionNumbers", default: "on", choices: ["on", "onPage", "off"]}

It will make the code looks clear and speed-up the loading metadata.

Ability to provide secure question hints

I would like to use surveyjs to conduct tests of student knowledge. The problem is I want to separate out survey takers with greater knowledge that can answer the question with no extra help. Others may need a hint (or two) to be able to get started and then can make progress on their own. Still others may need several hints before they can do anything with a question. At a high level, the scoring we have to perform afterward will need to take the level of hinting required to get to a correct answer.

It's important that the survey model on the client does NOT contain the hints until they are asked for. It would be easy to bring up browser developer tools and see the additional hints in memory, thereby invalidating the meaning of the test because the taker had hints that were unaccounted for. The hard requirement is any hints must be dynamically added to the model on the client. In general a hint could change the question and the multiple choice answers, but to keep it simple we could probably limit it to just a more descriptive question and leave the answers the same.

It would be great if surveyjs supported this notion natively, with a user-defined callout like the validation code does now, but instead to ask the server for the hinted question title and call a surveyjs API to update the question title and hint level, and for the completed report to indicate the level of hint shown for each question. From looking at the examples and code it does not currently support this, so I'm looking for a workaround.

Is it possible to implement a parent React component that feeds the surveyjs component?

  • Parent component presents the hinting UI. When click on hint, need to know from surveyjs component which page/question is current.
  • Parent communicates with the server to request a hint-level enhanced question title, and then updates the model props passed into surveyjs.
  • Q: Would surveyjs be able to handle such changes to the model and still maintain it's state correctly for past page questions and the current page?

I don't see question responses being stored as state in the react components, so I presume this just lives in the DOM until advancing to the next page.

Custom CSS

Would it be possible to add "customizable classes" to the generated tags?

For example, for a matrix style of question, I would like to add a "table-hover" class to the table tag.

Not seeing a way to do this effectively, without having to resort to using javascript (addClass to the DOM node).

Did something like $("div#surveyContainer table.table").addClass("table-striped surveyTable"); but it is disappearing when the page next button is clicked.

How to handle these kind of scenarios.

Add survey.questionStartIndex property

The question "no" (question index) by default starts from 1.
The default value of survey.questionStartIndex is empty string.
If survey.questionStartIndex = "100", the first question index will be 100.
If survey.questionStartIndex = "a", the first question index will be "a", the second question index - "b".

matrixdropdown does not keep values selected

The typical example matrixdropdown has a few rows and columns.
Each has a select box with the same choices.
Now when one of the selectboxes is changed, all the selectboxes change to the same value.
Second issue: none of these values are kept so none of these can be stored.

Expected result: being able to set a different selection for each select box.

Feature Request : Matrix question with flexible input type.

Hi first of all thanks for this awesome library. It's awesome and very promising. I convinced my team to use it production, good job.

In my use cases there is a scenario where I need a matrix or tabular question. And cells can not only be drop down's and radio but can also be text input, check boxes etc. I think it will be a handy feature for all.

Support for file attachments

Please add support for the file attachment capability during a survey.

I think, that upon attaching a file, it will encode as a Base64 string. The string would then be returned in the result object

Thanks

Multiple trigger not working for checkboxes

Sample json working on survey builder broken in latest build
{
pages: [
{
name: "page1",
questions: [
{
type: "checkbox",
choices: [
"one",
{
value: "two",
text: "second value"
},
{
value: "three",
text: "third value"
}
],
name: "question1"
},
{
type: "text",
name: "question2",
visible: false
},
{
type: "text",
name: "question3",
visible: false
},
{
type: "text",
name: "question4",
visible: false
}
]
}
],
triggers: [
{
type: "visible",
operator: "contains",
value: "one",
name: "question1",
questions: [
"question2"
]
},
{
type: "visible",
operator: "contains",
value: "two",
name: "question1",
questions: [
"question3"
]
}
]
}

Visible triggers should clear question's answer. Issue in multi level dependent question.

Here's the scenario.
-Q1
---Q2
--------Q3

Q1's answer triggers Q2. Q2's answer triggers Q3.
Now first user answer Q1 which makes Q2 visible. Then answer Q2 which makes question Q3 visible.
Now if user change answer of Q1 it will make Q2 invisible but as Q2's answer is not cleared Q3 will be visible. Which is kind of illegal state.

Q1
---------Q3

Here's the json to reproduce the scenario.
Steps:
Q1 = 1
Q2 = 1
Q3 = 1
now before submitting set
Q1 = 2

{
clearInvisibleValues: true,
pages: [
{
name: "page1",
questions: [
{
type: "radiogroup",
choices: [
"one",
{
value: "two",
text: "second value"
},
{
value: "three",
text: "third value"
}
],
name: "question1"
},
{
type: "radiogroup",
choices: [
"one",
{
value: "two",
text: "second value"
},
{
value: "three",
text: "third value"
}
],
indent: 1,
name: "question2",
visible: false
},
{
type: "radiogroup",
choices: [
"one",
{
value: "two",
text: "second value"
},
{
value: "three",
text: "third value"
}
],
indent: 2,
name: "question3",
visible: false
}
]
}
],
triggers: [
{
type: "visible",
operator: "equal",
value: "one",
name: "question1",
questions: [
"question2"
]
},
{
type: "visible",
operator: "equal",
value: "one",
name: "question2",
questions: [
"question3"
]
}
]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.