index.js
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* LearnDash Block ld-exam-question
*
* @since 4.0.0
* @package LearnDash
*/
import { __, _x, sprintf} from "@wordpress/i18n";
import { registerBlockType } from "@wordpress/blocks";
import { InnerBlocks } from "@wordpress/block-editor";
import { MdAssignment } from "react-icons/md";
/**
* LearnDash block functions
*/
import { ldlms_get_custom_label } from "../../ldlms.js";
import Edit from "./edit";
export const settings = {
block_key: "learndash/ld-exam-question",
block_title: sprintf(
// translators: placeholder: Challenge Exam Question.
_x(
"%s Question",
"placeholder: Challenge Exam Question",
"learndash"
),
ldlms_get_custom_label( "exam" )
),
block_description: sprintf(
// translators: placeholder: Create a question for your Challenge Exam.
_x(
"Create a question for your %s",
"placeholder: Create a question for your Challenge Exam",
"learndash"
),
ldlms_get_custom_label( "exam" )
)
};
registerBlockType( settings.block_key, {
title: settings.block_title,
description: settings.block_description,
icon: <MdAssignment />,
category: "learndash-blocks",
parent: [ "learndash/ld-exam" ],
supports: {
html: false,
},
providesContext: {
"learndash/question_type": "question_type",
},
attributes: {
question_title: {
type: "string",
},
question_type: {
type: "string",
}
},
edit: Edit,
save: () => <InnerBlocks.Content />,
});