1.0.14 • Published 6 months ago

@juratbek/editorjs-quiz v1.0.14

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

Quiz Tool for Editor.js

This tool for the Editor.js allows you to add single select and multi select tests, submitting them.

npm.io

Installation

npm i @juratbek/editorjs-quiz
yarn add @juratbek/editorjs-quiz

Usage

Add the Quiz tool to the tools property of the Editor.js initial config.

import EditorJs from "@editorjs/editorjs";
import Quiz from "@juratbek/editorjs-quiz";

const editor = EditorJs({
  // ...
  tools: {
    quiz: {
      class: Quiz,
      config: {
        onSubmit: submitCallback,
      },
    },
  },
});

Config Params

FieldTypeDescription
onSubmitFunctionFunction callback which will be called on submit. It is available in readOnly mode
languagestringlanguage of the tool. Currently Uzbek (uz) and English (en) languages are supported

Output data

FieldTypeDescription
variantsobject[]list of variants which is added in the tool. A variant will contain value and text fields ({ value: number, text: string })
answersnumber[]list of values of right answers, which is selected by the editor. This values is got from value field of the variants
typestringtype of the quiz (singleSelect or multiSelect)
1.0.14

6 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago