1.0.1 • Published 3 years ago

volkeno-react-native-quiz-true-false v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

volkeno-react-native-quiz-true-false

Single select

Add it to your project

  • Using NPM npm install volkeno-react-native-quiz-true-false
  • or:
  • Using Yarn yarn add volkeno-react-native-quiz-true-false

Usage

import React from "react";

import QuizeTrueFalse from "volkeno-react-native-quiz-true-false";

const QuizTrueFalseApp = () => {
  const data = [
    {
      question:
        "Pendant la préhistoire, la période l’âge de la pierre polie a suivi l’age de la pierre taillée",
      answer: true,
    },
    {
      question:
        "Une personne qui parle couramment le français est un Francophone :",

      answer: true,
    },
    {
      question:
        "Quel petit signe place-t-on parfois sous la lettre C ? Une virgule",
      answer: false,
    },
  ];
  return (
    <QuizeTrueFalse
      containerStyle={{ backgroundColor: "#FFF", paddingTop: 30 }}
      questionTitleStyle={{ fontSize: 22, color: "#000" }}
      trueText="Vrai"
      falseText="Faux"
      textStyle={{ fontSize: 18, color: "#000" }}
      checkedColor={"#000"}
      uncheckedColor="#000"
      responseRequired={true}
      nextButtonText={"Next"}
      nextButtonStyle={{ backgroundColor: "#06d755" }}
      nextButtonTextStyle={{ color: "#FFF" }}
      prevButtonText={"Prev"}
      prevButtonStyle={{ backgroundColor: "#fa5541" }}
      prevButtonTextStyle={{ color: "#FFF" }}
      endButtonText={"Done"}
      endButtonStyle={{ backgroundColor: "#000" }}
      endButtonTextStyle={{ color: "#FFF" }}
      buttonsContainerStyle={{ marginTop: "auto" }}
      onEnd={(results) => {
        console.log(results);
      }}
      data={data}
    />
  );
};

export default QuizTrueFalseApp;

Properties

Property nameTypeDescription
containerStyleObjectCustom style for the screen container
questionTitleStyleObjectcustom style for the title of the question
trueTextStringdefault to True
falseTextStringdefault to False
textStyleObjectcustom style for the text
checkedColorStringcustom color for the checkbox if checked
uncheckedColorStringcustom color for the checkbox if unchecked
responseRequiredBooleanmake the answer mandatory if true. default to false
nextButtonTextStringthe text of the next button
nextButtonStyleObjectCustom for the next button
nextButtonTextStyleObjectCustom for the title of the next button
prevButtonTextStringthe text of the prev button
prevButtonStyleObjectCustom for the prev button
prevButtonTextStyleObjectCustom for the title of the prev button
endButtonTextStringthe text of the end button
endButtonStyleObjectCustom for the end button
endButtonTextStyleObjectCustom for the title of the end button
buttonsContainerStyleObjectCustom for the container of the next and prev buttons
onEndFunctionFunction to handle the end of the quiz

ISC Licensed