1.3.2 • Published 4 years ago

questions-shortlist v1.3.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

questions-shortlist

NPM JavaScript Style Guide

Install

npm install --save questions-shortlist

Usage

import React, { Component } from "react";

import Questions from "questions-shortlist";

class Example extends Component {
  render() {
    return <Questions />;
  }
}

If you want to track the weighing og the question, the only thing you have to do is put with_weight as prop of Questions component

import React, { Component } from "react";

import Questions from "questions-shortlist";

class Example extends Component {
  render() {
    return <Questions with_weight />;
  }
}

If you want to have the component on English, set a cookie 'my_locale' with the value 'en'

DEVELOP

Put in src/index.js

import ReactDOM from "react-dom";
...

ReactDOM.render(<MultipleQuestions />, document.getElementById("root"));

In package.json put the following:

{
  "scripts": {
    "start": "react-scripts start"
  }
}

If you want to have questions for example, put the following in src/components/index.jsx

const questions = [
      {
        killer_value: "1;3",
        killer_condition: "are_options?",
        description: "text",
        value_type: "multiple_option",
        order: "0",
        options: ["1", "2", "3", "4"]
      },
      {
        killer_value: ["1", "3"],
        killer_condition: "isnt_option?",
        description: "text",
        value_type: "option",
        order: "2",
        options: ["1", "2", "3", "4"]
      },
      {
        killer_value: ["1"],
        killer_condition: "isnt_option?",
        description: "text",
        value_type: "option",
        order: "3",
        options: ["1", "2", "3", "4"]
      },
      {
        killer_value: "4",
        killer_condition: "isnt_option?",
        description: "text",
        value_type: "option",
        order: "4",
        options: ["1", "2", "3", "4"]
      },
      {
        killer_value: "Si",
        killer_condition: "==",
        description: "text",
        value_type: "boolean",
        order: "5"
      }
    ];

    ...

    <MultipleForm questions={ questions } t={ t } name={ props.form_name || "project[questions_attributes]" }/>

License

MIT © PDFK

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago