diff --git a/database/migrations/2022_09_14_135742_add_guess_the_answer.php b/database/migrations/2022_09_14_135742_add_guess_the_answer.php new file mode 100644 index 000000000..838c7447c --- /dev/null +++ b/database/migrations/2022_09_14_135742_add_guess_the_answer.php @@ -0,0 +1,29 @@ + AddGuessTheAnswerSemanticsSeeder::class, + '--force' => true + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/database/migrations/2022_09_19_115439_add_question_set_one_twenty.php b/database/migrations/2022_09_19_115439_add_question_set_one_twenty.php new file mode 100644 index 000000000..c894b6793 --- /dev/null +++ b/database/migrations/2022_09_19_115439_add_question_set_one_twenty.php @@ -0,0 +1,29 @@ + AddQuestionSetOneTwentySemanticsSeeder::class, + '--force' => true + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/database/migrations/2022_09_21_111955_add_essay_fifteen_semantics.php b/database/migrations/2022_09_21_111955_add_essay_fifteen_semantics.php new file mode 100644 index 000000000..29ff6cd2e --- /dev/null +++ b/database/migrations/2022_09_21_111955_add_essay_fifteen_semantics.php @@ -0,0 +1,29 @@ + AddEssayFifteenSemanticsSeeder::class, + '--force' => true + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/database/migrations/2022_09_23_113308_add_column_layout_semantics.php b/database/migrations/2022_09_23_113308_add_column_layout_semantics.php new file mode 100644 index 000000000..a9193e60b --- /dev/null +++ b/database/migrations/2022_09_23_113308_add_column_layout_semantics.php @@ -0,0 +1,31 @@ + AddColumnLayoutSemanticsSeeder::class, + '--force' => true + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/database/seeds/AddColumnLayoutSemanticsSeeder.php b/database/seeds/AddColumnLayoutSemanticsSeeder.php new file mode 100644 index 000000000..232852b0f --- /dev/null +++ b/database/seeds/AddColumnLayoutSemanticsSeeder.php @@ -0,0 +1,163 @@ + "H5P.Column", "major_version" => 1, "minor_version" => 15]; + $h5pFibLib = DB::table('h5p_libraries')->where($h5pFibLibParams)->first(); + + if (empty($h5pFibLib)) { + $h5pFibLibId = DB::table('h5p_libraries')->insertGetId([ + 'name' => 'H5P.Column', + 'title' => 'Column', + 'major_version' => 1, + 'minor_version' => 15, + 'patch_version' => 2, + 'embed_types' => 'iframe', + 'runnable' => 1, + 'restricted' => 0, + 'fullscreen' => 0, + 'preloaded_js' => 'scripts/h5p-column.js', + 'preloaded_css' => 'styles/h5p-column.css,styles/custom-column-layout.css', + 'drop_library_css' => '', + 'semantics' => $this->getSemantics(), + 'tutorial_url' => ' ', + 'has_icon' => 1 + ]); + // insert libraries languages + $this->insertLibrariesLanguages($h5pFibLibId); + } + } + + /** + * Insert Library Language Semantics + * @param $h5pFibLibId + */ + private function insertLibrariesLanguages($h5pFibLibId) + { + // en.json + DB::table('h5p_libraries_languages')->insert([ + 'library_id' => $h5pFibLibId, + 'language_code' => 'en', + 'translation' => json_encode(json_decode('{ + "semantics": [ + { + "label": "List of Column Content", + "entity": "content", + "field": { + "fields": [ + { + "label": "Content" + }, + { + "label": "Separate content with a horizontal ruler", + "options": [ + { + "label": "Automatic (default)" + }, + { + "label": "Never use ruler above" + }, + { + "label": "Always use ruler above" + } + ] + } + ] + } + } + ] + } + '), JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) + ]); + } + + private function getSemantics() { + return '[ + { + "name": "content", + "label": "List of Column Content", + "importance": "high", + "type": "list", + "min": 1, + "entity": "content", + "field": { + "name": "content", + "type": "group", + "fields": [ + { + "name": "content", + "type": "library", + "importance": "high", + "label": "Content", + "options": [ + "H5P.Accordion 1.0", + "H5P.Agamotto 1.5", + "H5P.Audio 1.5", + "H5P.AudioRecorder 1.0", + "H5P.Blanks 1.14", + "H5P.Chart 1.2", + "H5P.Collage 0.3", + "H5P.CoursePresentation 1.24", + "H5P.Dialogcards 1.9", + "H5P.DocumentationTool 1.8", + "H5P.DragQuestion 1.14", + "H5P.DragText 1.10", + "H5P.Essay 1.5", + "H5P.GuessTheAnswer 1.5", + "H5P.Table 1.1", + "H5P.AdvancedText 1.1", + "H5P.IFrameEmbed 1.0", + "H5P.Image 1.1", + "H5P.ImageHotspots 1.10", + "H5P.ImageHotspotQuestion 1.8", + "H5P.ImageSlider 1.1", + "H5P.InteractiveVideo 1.24", + "H5P.Link 1.3", + "H5P.MarkTheWords 1.11", + "H5P.MemoryGame 1.3", + "H5P.MultiChoice 1.16", + "H5P.Questionnaire 1.3", + "H5P.QuestionSet 1.20", + "H5P.SingleChoiceSet 1.11", + "H5P.Summary 1.10", + "H5P.Timeline 1.1", + "H5P.TrueFalse 1.8", + "H5P.Video 1.6" + ] + }, + { + "name": "useSeparator", + "type": "select", + "importance": "low", + "label": "Separate content with a horizontal ruler", + "default": "auto", + "options": [ + { + "value": "auto", + "label": "Automatic (default)" + }, + { + "value": "disabled", + "label": "Never use ruler above" + }, + { + "value": "enabled", + "label": "Always use ruler above" + } + ] + } + ] + } + } + ]'; + } +} diff --git a/database/seeds/AddEssayFifteenSemanticsSeeder.php b/database/seeds/AddEssayFifteenSemanticsSeeder.php new file mode 100644 index 000000000..45c15e21c --- /dev/null +++ b/database/seeds/AddEssayFifteenSemanticsSeeder.php @@ -0,0 +1,732 @@ + "H5P.Essay", "major_version" => 1, "minor_version" => 5]; + $h5pFibLib = DB::table('h5p_libraries')->where($h5pFibLibParams)->first(); + if (empty($h5pFibLib)) { + $h5pFibLibId = DB::table('h5p_libraries')->insertGetId([ + 'name' => 'H5P.Essay', + 'title' => 'Essay', + 'major_version' => 1, + 'minor_version' => 5, + 'patch_version' => 0, + 'embed_types' => 'iframe', + 'runnable' => 1, + 'restricted' => 0, + 'fullscreen' => 0, + 'preloaded_js' => 'scripts/essay.js', + 'preloaded_css' => 'scripts/inputfield.js', + 'drop_library_css' => '', + 'semantics' => $this->getSemantics(), + 'tutorial_url' => ' ', + 'has_icon' => 1 + ]); + + // insert libraries languages + $this->insertLibrariesLanguages($h5pFibLibId); + } + } + + /** + * Insert Dependent Libraries + * @param $h5pFibLibId + */ + private function insertDependentLibraries($h5pFibLibId) + { + //Preloaded Dependencies + $h5pQuestionParams = ['name' => "Question", "major_version" => 1, "minor_version" => 4]; + $h5pQuestionLib = DB::table('h5p_libraries')->where($h5pQuestionParams)->first(); + $h5pQuestionLibId = $h5pQuestionLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pQuestionLibId, + 'dependency_type' => 'preloaded' + ]); + + + //Preloaded Dependencies + $h5pVTextUtilitiesparams = ['name' => "H5P.TextUtilities", "major_version" => 1, "minor_version" => 3]; + $h5pVTextUtilitiesparamsLib = DB::table('h5p_libraries')->where($h5pVTextUtilitiesparams)->first(); + $h5pVTextUtilitiesparamsLibId = $h5pVTextUtilitiesparamsLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pVTextUtilitiesparamsLibId, + 'dependency_type' => 'preloaded' + ]); + + //Preloaded Dependencies + $h5pJoubelUIParams = ['name' => "H5P.JoubelUI", "major_version" => 1, "minor_version" => 3]; + $h5pJoubelUIParamsLib = DB::table('h5p_libraries')->where($h5pJoubelUIParams)->first(); + $h5pJoubelUIParamsLibId = $h5pJoubelUIParamsLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pJoubelUIParamsLibId, + 'dependency_type' => 'preloaded' + ]); + + + // Editor Dependencies + + $h5pEditorShowWhenParams = ['name' => "H5PEditor.ShowWhen", "major_version" => 1, "minor_version" => 0]; + $h5pEditorShowWhenLib = DB::table('h5p_libraries')->where($h5pEditorShowWhenParams)->first(); + $h5pEditorShowWhenLibId = $h5pEditorShowWhenLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pEditorShowWhenLibId, + 'dependency_type' => 'editor' + ]); + + // Editor Dependencies + + $h5pEditorRangeListWhenParams = ['name' => "H5PEditor.RangeList", "major_version" => 1, "minor_version" => 0]; + $h5pEditorRangeListWhenLib = DB::table('h5p_libraries')->where($h5pEditorRangeListWhenParams)->first(); + $h5pEditorRangeListWhenLibId = $h5pEditorRangeListWhenLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pEditorRangeListWhenLibId, + 'dependency_type' => 'editor' + ]); + + // Editor Dependencies + + $h5pVerticalTabsParams = ['name' => "H5PEditor.VerticalTabs", "major_version" => 1, "minor_version" => 3]; + $h5pVerticalTabsLib = DB::table('h5p_libraries')->where($h5pVerticalTabsParams)->first(); + $h5pVerticalTabsLibId = $h5pVerticalTabsLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pVerticalTabsLibId, + 'dependency_type' => 'editor' + ]); + + } + + private function getSemantics() { + return '[ + { + "name": "media", + "type": "group", + "label": "Media", + "importance": "medium", + "fields": [ + { + "name": "type", + "type": "library", + "label": "Type", + "importance": "medium", + "options": [ + "H5P.Image 1.1", + "H5P.Video 1.5" + ], + "optional": true, + "description": "Optional media to display above the question." + }, + { + "name": "disableImageZooming", + "type": "boolean", + "label": "Disable image zooming", + "importance": "low", + "default": false, + "optional": true, + "widget": "showWhen", + "showWhen": { + "rules": [ + { + "field": "type", + "equals": "H5P.Image 1.1" + } + ] + } + } + ] + }, + { + "name": "taskDescription", + "label": "Task description", + "type": "text", + "widget": "html", + "importance": "high", + "description": "Describe your task here. The task description will appear above text input area.", + "placeholder": "Summarize the book in 500 characters ...", + "enterMode": "div", + "tags": [ + "strong", + "em", + "u", + "a", + "ul", + "ol", + "h2", + "h3", + "hr", + "pre", + "code" + ] + }, + { + "name": "placeholderText", + "label": "Help text", + "type": "text", + "description": "This text should help the user to get started.", + "placeholder": "This book is about ...", + "importance": "low", + "optional": true + }, + { + "name": "solution", + "type": "group", + "label": "Sample solution", + "importance": "high", + "expanded": true, + "description": "You can optionally add a sample solution thats shown after the student created a text. Its called sample solution because there probably is not only one solution", + "fields": [ + { + "name": "introduction", + "type": "text", + "label": "Introduction", + "importance": "low", + "description": "You can optionally leave the students some explanations about your example. The explanation will only show up if you add an example, too.", + "placeholder": "Please remember that you were not expected to come up with the exact same solution. Its just a good example.", + "optional": true, + "widget": "html", + "enterMode": "div", + "tags": [ + "strong", + "em", + "u", + "a", + "ul", + "ol", + "hr", + "code" + ] + }, + { + "name": "sample", + "type": "text", + "label": "Sample solution text", + "importance": "low", + "description": "The student will see a \"Show solution\" button after submitting if you provide some text here.", + "optional": true, + "widget": "html", + "enterMode": "div", + "tags": [ + "strong", + "a" + ] + } + ] + }, + { + "name": "keywords", + "label": "Keywords", + "importance": "high", + "type": "list", + "widgets": [ + { + "name": "VerticalTabs", + "label": "Default" + } + ], + "min": 1, + "entity": "Keyword", + "field": { + "name": "groupy", + "type": "group", + "label": "Keyword", + "fields": [ + { + "name": "keyword", + "type": "text", + "label": "Keyword", + "description": "Keyword or phrase to look for. Use an asterisk * as a wildcard for one or more characters. Use a slash / at the beginning and the end to use a regular expression.", + "importance": "medium" + }, + { + "name": "alternatives", + "type": "list", + "label": "Variations", + "description": "Add optional variations for this keyword. Example: For a city add alternatives town, municipality etc. Points will be awarded if the user includes any of the specified alternatives.", + "importance": "medium", + "entity": "variation", + "optional": true, + "min": 0, + "field": { + "name": "alternative", + "type": "text", + "label": "Keyword variation" + } + }, + { + "name": "options", + "type": "group", + "label": "Points, Options and Feedback", + "importance": "low", + "fields": [ + { + "name": "points", + "type": "number", + "label": "Points", + "default": 1, + "description": "Points that the user will get if he/she includes this keyword or its alternatives in the answer.", + "min": 1 + }, + { + "name": "occurrences", + "type": "number", + "label": "Occurrences", + "default": 1, + "description": "Define how many occurrences of the keyword or its variations should be awarded with points.", + "min": 1 + }, + { + "name": "caseSensitive", + "type": "boolean", + "label": "Case sensitive", + "default": true, + "description": "Makes sure the user input has to be exactly the same as the answer." + }, + { + "name": "forgiveMistakes", + "type": "boolean", + "label": "Forgive minor mistakes", + "description": "This will accept minor spelling mistakes (3-9 characters: 1 mistake, more than 9 characters: 2 mistakes)." + }, + { + "name": "feedbackIncluded", + "type": "text", + "label": "Feedback if keyword included", + "description": "This feedback will be displayed if the user includes this keyword or its alternatives in the answer.", + "optional": true, + "maxLength": 1000 + }, + { + "name": "feedbackMissed", + "type": "text", + "label": "Feedback if keyword missing", + "description": "This feedback will be displayed if the user doesn’t include this keyword or its alternatives in the answer.", + "optional": true, + "maxLength": 1000 + }, + { + "name": "feedbackIncludedWord", + "type": "select", + "label": "Feedback word shown if keyword included", + "importance": "low", + "description": "This option allows you to specify which word should be shown in front of your feedback if a keyword was found in the text.", + "optional": false, + "default": "keyword", + "options": [ + { + "value": "keyword", + "label": "keyword" + }, + { + "value": "alternative", + "label": "alternative found" + }, + { + "value": "answer", + "label": "answer given" + }, + { + "value": "none", + "label": "none" + } + ] + }, + { + "name": "feedbackMissedWord", + "type": "select", + "label": "Feedback word shown if keyword missing", + "importance": "low", + "description": "This option allows you to specify which word should be shown in front of your feedback if a keyword was not found in the text.", + "optional": false, + "default": "none", + "options": [ + { + "value": "keyword", + "label": "keyword" + }, + { + "value": "none", + "label": "none" + } + ] + } + ] + } + ] + } + }, + { + "name": "overallFeedback", + "type": "group", + "label": "Overall Feedback", + "importance": "low", + "expanded": true, + "fields": [ + { + "name": "overallFeedback", + "type": "list", + "widgets": [ + { + "name": "RangeList", + "label": "Default" + } + ], + "importance": "high", + "label": "Define custom feedback for any score range", + "description": "Click the \"Add range\" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!", + "entity": "range", + "min": 1, + "defaultNum": 1, + "optional": true, + "field": { + "name": "overallFeedback", + "type": "group", + "importance": "low", + "fields": [ + { + "name": "from", + "type": "number", + "label": "Score Range", + "min": 0, + "max": 100, + "default": 0, + "unit": "%" + }, + { + "name": "to", + "type": "number", + "min": 0, + "max": 100, + "default": 100, + "unit": "%" + }, + { + "name": "feedback", + "type": "text", + "label": "Feedback for defined score range", + "importance": "low", + "placeholder": "Fill in the feedback", + "optional": true + } + ] + } + } + ] + }, + { + "name": "behaviour", + "type": "group", + "label": "Behavioural settings", + "importance": "low", + "description": "These options will let you control how the task behaves.", + "fields": [ + { + "name": "minimumLength", + "label": "Minimum number of characters", + "type": "number", + "description": "Specify the minimum number of characters that the user must enter.", + "importance": "low", + "optional": true, + "min": "0" + }, + { + "name": "maximumLength", + "label": "Maximum number of characters", + "type": "number", + "description": "Specify the maximum number of characters that the user can enter.", + "importance": "low", + "optional": true, + "min": "0" + }, + { + "name": "inputFieldSize", + "label": "Input field size", + "type": "select", + "importance": "low", + "description": "The size of the input field in amount of lines it will cover", + "options": [ + { + "value": "1", + "label": "1 line" + }, + { + "value": "3", + "label": "3 lines" + }, + { + "value": "10", + "label": "10 lines" + } + ], + "default": "10" + }, + { + "name": "enableRetry", + "label": "Enable \"Retry\"", + "type": "boolean", + "importance": "low", + "description": "If checked, learners can retry the task.", + "default": true, + "optional": true + }, + { + "name": "ignoreScoring", + "label": "Ignore scoring", + "type": "boolean", + "importance": "low", + "description": "If checked, learners will only see the feedback that you provided for the keywords, but no score.", + "default": false, + "optional": true + }, + { + "name": "pointsHost", + "label": "Points in host environment", + "type": "number", + "importance": "low", + "description": "Used to award points in host environment merely for answering (not shown to learner).", + "min": 0, + "default": 1, + "widget": "showWhen", + "showWhen": { + "rules": [ + { + "field": "ignoreScoring", + "equals": true + } + ] + } + }, + { + "name": "percentagePassing", + "type": "number", + "label": "Passing percentage", + "description": "Percentage thats necessary for passing", + "optional": true, + "min": 0, + "max": 100, + "widget": "showWhen", + "showWhen": { + "rules": [ + { + "field": "ignoreScoring", + "equals": false + } + ] + } + }, + { + "name": "percentageMastering", + "type": "number", + "label": "Mastering percentage", + "description": "Percentage thats necessary for mastering. Setting the mastering percentage below 100 % will lower the maximum possible score accordingly. Its intended to give some leeway to students, not to \"graciously accept\" solutions that do not contain all keywords.", + "optional": true, + "min": 0, + "max": 100, + "widget": "showWhen", + "showWhen": { + "rules": [ + { + "field": "ignoreScoring", + "equals": false + } + ] + } + }, + { + "name": "overrideCaseSensitive", + "type": "select", + "label": "Override case sensitive", + "importance": "low", + "description": "This option determines if the \"Case sensitive\" option will be activated for all keywords.", + "optional": true, + "options": [ + { + "value": "on", + "label": "Enabled" + }, + { + "value": "off", + "label": "Disabled" + } + ] + }, + { + "name": "overrideForgiveMistakes", + "type": "select", + "label": "Override forgive mistakes", + "importance": "low", + "description": "This option determines if the \"Forgive mistakes\" option will be activated for all keywords.", + "optional": true, + "options": [ + { + "value": "on", + "label": "Enabled" + }, + { + "value": "off", + "label": "Disabled" + } + ] + } + ] + }, + { + "name": "checkAnswer", + "type": "text", + "label": "Text for \"Check\" button", + "importance": "low", + "default": "Check", + "common": true + }, + { + "name": "tryAgain", + "label": "Text for \"Retry\" button", + "type": "text", + "importance": "low", + "default": "Retry", + "common": true + }, + { + "name": "showSolution", + "type": "text", + "label": "Text for \"Show solution\" button", + "importance": "low", + "default": "Show solution", + "common": true + }, + { + "name": "feedbackHeader", + "type": "text", + "label": "Header for panel containing feedback for included/missing keywords", + "importance": "low", + "default": "Feedback", + "common": true + }, + { + "name": "solutionTitle", + "type": "text", + "label": "Label for solution", + "importance": "low", + "default": "Sample solution", + "common": true + }, + { + "name": "remainingChars", + "type": "text", + "label": "Remaining characters", + "importance": "low", + "common": true, + "default": "Remaining characters: @chars", + "description": "Message for remaining characters. You can use @chars which will be replaced by the corresponding number." + }, + { + "name": "notEnoughChars", + "type": "text", + "label": "Not enough characters", + "importance": "low", + "common": true, + "default": "You must enter at least @chars characters!", + "description": "Message to indicate that the text doesnt contain enough characters. You can use @chars which will be replaced by the corresponding number." + }, + { + "name": "messageSave", + "type": "text", + "label": "Save message", + "description": "Message indicating that the text has been saved", + "importance": "low", + "common": true, + "default": "saved" + }, + { + "name": "ariaYourResult", + "type": "text", + "label": "Your result (not displayed)", + "description": "Accessibility text used for readspeakers. @score will be replaced by the number of points. @total will be replaced by the maximum possible points.", + "importance": "low", + "common": true, + "default": "You got @score out of @total points" + }, + { + "name": "ariaNavigatedToSolution", + "type": "text", + "label": "Navigation message (not displayed)", + "description": "Accessibility text used for readspeakers", + "importance": "low", + "common": true, + "default": "Navigated to newly included sample solution after textarea." + }, + { + "name": "currikisettings", + "type": "group", + "label": "Curriki settings", + "importance": "low", + "description": "These options will let you control how the curriki studio behaves.", + "optional": true, + "fields": [ + { + "label": "Do not Show Submit Button", + "importance": "low", + "name": "disableSubmitButton", + "type": "boolean", + "default": false, + "optional": true, + "description": "This option only applies to a standalone activity. The Submit button is required for grade passback to an LMS." + }, + { + "label": "Placeholder", + "importance": "low", + "name": "placeholder", + "type": "boolean", + "default": false, + "optional": true, + "description": "This option is a place holder. will be used in future" + }, + { + "label": "Curriki Localization", + "description": "Here you can edit settings or translate texts used in curriki settings", + "importance": "low", + "name": "currikil10n", + "type": "group", + "fields": [ + { + "label": "Text for \"Submit\" button", + "name": "submitAnswer", + "importance": "low", + "type": "text", + "default": "Submit", + "optional": true + }, + { + "label": "Text for \"Placeholder\" button", + "importance": "low", + "name": "placeholderButton", + "type": "text", + "default": "Placeholder", + "optional": true + } + ] + } + ] + } + ]'; + } +} diff --git a/database/seeds/AddGuessTheAnswerSemanticsSeeder.php b/database/seeds/AddGuessTheAnswerSemanticsSeeder.php new file mode 100644 index 000000000..b3759025d --- /dev/null +++ b/database/seeds/AddGuessTheAnswerSemanticsSeeder.php @@ -0,0 +1,166 @@ + "H5P.GuessTheAnswer", "major_version" => 1, "minor_version" => 5]; + $h5pFibLib = DB::table('h5p_libraries')->where($h5pFibLibParams)->first(); + if (empty($h5pFibLib)) { + $h5pFibLibId = DB::table('h5p_libraries')->insertGetId([ + 'name' => 'H5P.GuessTheAnswer', + 'title' => 'Guess the Answer', + 'major_version' => 1, + 'minor_version' => 5, + 'patch_version' => 1, + 'embed_types' => 'iframe', + 'runnable' => 1, + 'restricted' => 0, + 'fullscreen' => 0, + 'preloaded_js' => 'guess-the-answer.js', + 'preloaded_css' => 'guess-the-answer.css', + 'drop_library_css' => '', + 'semantics' => $this->getSemantics(), + 'tutorial_url' => ' ', + 'has_icon' => 1 + ]); + + // insert dependent libraries + $this->insertDependentLibraries($h5pFibLibId); + + // insert libraries languages + $this->insertLibrariesLanguages($h5pFibLibId); + } + } + /** + * Insert Dependent Libraries + * @param $h5pFibLibId + */ + private function insertDependentLibraries($h5pFibLibId) + { + //Preloaded Dependencies + $h5pFontAwesomeParams = ['name' => "FontAwesome", "major_version" => 4, "minor_version" => 5]; + $h5pFontAwesomeLib = DB::table('h5p_libraries')->where($h5pFontAwesomeParams)->first(); + $h5pFontAwesomeLibId = $h5pFontAwesomeLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pFontAwesomeLibId, + 'dependency_type' => 'preloaded' + ]); + + } + + /** + * Insert Library Language Semantics + * @param $h5pFibLibId + */ + private function insertLibrariesLanguages($h5pFibLibId) + { + // en.json + DB::table('h5p_libraries_languages')->insert([ + 'library_id' => $h5pFibLibId, + 'language_code' => 'en', + 'translation' => json_encode(json_decode('{"semantics":[{"label":"Task description","description":"Describe how the user should solve the task."},{"label":"Media","fields":[{"label":"Type","description":"Optional media to display above the question."}]},{"label":"Descriptive solution label","default":"Click to see the answer.","description":"Clickable text area where the solution will be displayed."},{"label":"Solution text","description":"The solution for the picture."}]}'), JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) + ]); + // af.json + DB::table('h5p_libraries_languages')->insert([ + 'library_id' => $h5pFibLibId, + 'language_code' => 'af', + 'translation' => json_encode(json_decode('{"semantics":[{"label":"Taak beskrywing","description":"Beskryf hoe die gebruiker die taak moet oplos."},{"label":"Media","fields":[{"label":"Tipe","description":"Opsionele media wat bo die vraag vertoon word."}]},{"label":"Beskrywende antwoordetiket","default":"Klik om die antwoord te sien.","description":"Klikbare teksarea waar die oplossing vertoon sal word."},{"label":"Antwoordteks","description":"Die antwoord vir die prent."}]}'), JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) + ]); + + // bg.json + DB::table('h5p_libraries_languages')->insert([ + 'library_id' => $h5pFibLibId, + 'language_code' => 'bg', + 'translation' => json_encode(json_decode('{"semantics":[{"label":"Описание на задачата","description":"Опишете как потребителят трябва да реши задачата."},{"label":"Медия","fields":[{"label":"Тип","description":"Незадължителна медия, която ще се показва над въпроса."}]},{"label":"Описателен етикет за решение","default":"Кликнете, за да видите отговора.","description":"Текстова област с възможност за кликване, където ще се показва решението."},{"label":"Текст на решението","description":"Решение за изображението."}]}'), JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) + ]); + // bs.json + DB::table('h5p_libraries_languages')->insert([ + 'library_id' => $h5pFibLibId, + 'language_code' => 'bs', + 'translation' => json_encode(json_decode('{"semantics":[{"label":"Opis zadatka","description":"Opišite kako će korinik riješiti zadatak."},{"label":"Media","fields":[{"label":"Type","description":"Optional media to display above the question."}]},{"label":"Opisna oznaka za rješenje","default":"Kliknite da vitite odgovor","description":"Tekstualno područje za klikanje je ono područje gdje će biti prikazano rješenje."},{"label":"Tekst rješenja","description":"Rješenje za sliku."}]}'), JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) + ]); + // ca.json + DB::table('h5p_libraries_languages')->insert([ + 'library_id' => $h5pFibLibId, + 'language_code' => 'ca', + 'translation' => json_encode(json_decode('{"semantics":[{"label":"Descripció de la tasca","description":"Descriu com l’usuari ha de resoldre la tasca."},{"label":"Recurs","fields":[{"label":"Tipus","description":"Recursos opcionals per mostrar al damunt de la pregunta."}]},{"label":"Etiqueta per a una solució descriptiva","default":"Feu clic per veure la resposta.","description":"Zona de text en què es pot fer clic i on es mostrarà la solució."},{"label":"Text per a Solució","description":"Solució per a la imatge."}]}'), JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) + ]); + + } + + private function getSemantics() { + return '[ + { + "label": "Task description", + "importance": "medium", + "name": "taskDescription", + "type": "text", + "widget": "html", + "description": "Describe how the user should solve the task.", + "enterMode": "p", + "tags": [ + "strong", + "em", + "u", + "a", + "ul", + "ol", + "h2", + "h3", + "hr", + "pre", + "code" + ], + "optional": true + }, + { + "name": "media", + "type": "group", + "label": "Media", + "importance": "medium", + "fields": [ + { + "name": "type", + "type": "library", + "label": "Type", + "importance": "medium", + "options": [ + "H5P.Image 1.1", + "H5P.Video 1.6" + ], + "optional": true, + "description": "Optional media to display above the question." + } + ] + }, + { + "label": "Descriptive solution label", + "importance": "low", + "name": "solutionLabel", + "type": "text", + "widget": "textarea", + "default": "Click to see the answer.", + "description": "Clickable text area where the solution will be displayed.", + "optional": true + }, + { + "label": "Solution text", + "importance": "high", + "name": "solutionText", + "type": "text", + "widget": "textarea", + "description": "The solution for the picture." + } +]'; + } +} diff --git a/database/seeds/AddQuestionSetOneTwentySemanticsSeeder.php b/database/seeds/AddQuestionSetOneTwentySemanticsSeeder.php new file mode 100644 index 000000000..29823e13d --- /dev/null +++ b/database/seeds/AddQuestionSetOneTwentySemanticsSeeder.php @@ -0,0 +1,798 @@ + "H5P.QuestionSet", "major_version" => 1, "minor_version" => 20]; + $h5pFibLib = DB::table('h5p_libraries')->where($h5pFibLibParams)->first(); + if (empty($h5pFibLib)) { + $h5pFibLibId = DB::table('h5p_libraries')->insertGetId([ + 'name' => 'H5P.QuestionSet', + 'title' => 'Question Set', + 'major_version' => 1, + 'minor_version' => 20, + 'patch_version' => 7, + 'embed_types' => 'iframe', + 'runnable' => 1, + 'restricted' => 0, + 'fullscreen' => 0, + 'preloaded_js' => 'js/questionset.js', + 'preloaded_css' => 'css/questionset.css', + 'drop_library_css' => '', + 'semantics' => $this->getSemantics(), + 'tutorial_url' => ' ', + 'has_icon' => 1 + ]); + + // insert dependent libraries + $this->insertDependentLibraries($h5pFibLibId); + + // insert libraries languages + $this->insertLibrariesLanguages($h5pFibLibId); + } + } + + /** + * Insert Dependent Libraries + * @param $h5pFibLibId + */ + private function insertDependentLibraries($h5pFibLibId) + { + //Preloaded Dependencies + $h5pFontAwesomeParams = ['name' => "FontAwesome", "major_version" => 4, "minor_version" => 5]; + $h5pFontAwesomeLib = DB::table('h5p_libraries')->where($h5pFontAwesomeParams)->first(); + $h5pFontAwesomeLibId = $h5pFontAwesomeLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pFontAwesomeLibId, + 'dependency_type' => 'preloaded' + ]); + + //Preloaded Dependencies + $h5pEmbeddedJSParams = ['name' => "EmbeddedJS", "major_version" => 1, "minor_version" => 0]; + $h5pEmbeddedJSParamsLib = DB::table('h5p_libraries')->where($h5pEmbeddedJSParams)->first(); + $h5pEmbeddedJSParamsLibId = $h5pEmbeddedJSParamsLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pEmbeddedJSParamsLibId, + 'dependency_type' => 'preloaded' + ]); + + //Preloaded Dependencies + $h5pVideoParams = ['name' => "H5P.Video", "major_version" => 1, "minor_version" => 6]; + $h5pVideoParamsLib = DB::table('h5p_libraries')->where($h5pVideoParams)->first(); + $h5pVideoParamsLibId = $h5pVideoParamsLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pVideoParamsLibId, + 'dependency_type' => 'preloaded' + ]); + + //Preloaded Dependencies + $h5pJoubelUIParams = ['name' => "H5P.JoubelUI", "major_version" => 1, "minor_version" => 3]; + $h5pJoubelUIParamsLib = DB::table('h5p_libraries')->where($h5pJoubelUIParams)->first(); + $h5pJoubelUIParamsLibId = $h5pJoubelUIParamsLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pJoubelUIParamsLibId, + 'dependency_type' => 'preloaded' + ]); + + + // Editor Dependencies + + $h5pEditorShowWhenParams = ['name' => "H5PEditor.ShowWhen", "major_version" => 1, "minor_version" => 0]; + $h5pEditorShowWhenLib = DB::table('h5p_libraries')->where($h5pEditorShowWhenParams)->first(); + $h5pEditorShowWhenLibId = $h5pEditorShowWhenLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pEditorShowWhenLibId, + 'dependency_type' => 'editor' + ]); + + // Editor Dependencies + + $h5pEditorRangeListWhenParams = ['name' => "H5PEditor.RangeList", "major_version" => 1, "minor_version" => 0]; + $h5pEditorRangeListWhenLib = DB::table('h5p_libraries')->where($h5pEditorRangeListWhenParams)->first(); + $h5pEditorRangeListWhenLibId = $h5pEditorRangeListWhenLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pEditorRangeListWhenLibId, + 'dependency_type' => 'editor' + ]); + + // Editor Dependencies + + $h5pVerticalTabsParams = ['name' => "H5PEditor.VerticalTabs", "major_version" => 1, "minor_version" => 3]; + $h5pVerticalTabsLib = DB::table('h5p_libraries')->where($h5pVerticalTabsParams)->first(); + $h5pVerticalTabsLibId = $h5pVerticalTabsLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pVerticalTabsLibId, + 'dependency_type' => 'editor' + ]); + + // Editor Dependencies + + $h5pQuestionSetTextualEditorParams = ['name' => "H5PEditor.QuestionSetTextualEditor", "major_version" => 1, "minor_version" => 3]; + $h5pQuestionSetTextualEditorLib = DB::table('h5p_libraries')->where($h5pQuestionSetTextualEditorParams)->first(); + $h5pQuestionSetTextualEditorLibId = $h5pQuestionSetTextualEditorLib->id; + + DB::table('h5p_libraries_libraries')->insert([ + 'library_id' => $h5pFibLibId, + 'required_library_id' => $h5pQuestionSetTextualEditorLibId, + 'dependency_type' => 'editor' + ]); + + } + + /** + * Insert Library Language Semantics + * @param $h5pFibLibId + */ + private function insertLibrariesLanguages($h5pFibLibId) + { + // en.json + DB::table('h5p_libraries_languages')->insert([ + 'library_id' => $h5pFibLibId, + 'language_code' => 'en', + 'translation' => json_encode(json_decode('{"semantics":[{"label":"Quiz introduction","fields":[{"label":"Display introduction"},{"label":"Title","description":"This title will be displayed above the introduction text."},{"label":"Introduction text","description":"This text will be displayed before the quiz starts."},{"label":"Start button text","default":"Start Quiz"},{"label":"Background image","description":"An optional background image for the introduction."}]},{"label":"Background image","description":"An optional background image for the Question set."},{"label":"Progress indicator","description":"Question set progress indicator style.","options":[{"label":"Textual"},{"label":"Dots"}]},{"label":"Pass percentage","description":"Percentage of Total score required for passing the quiz."},{"label":"Questions","widgets":[{"label":"Default"},{"label":"Textual"}],"entity":"question","field":{"label":"Question type","description":"Library for this question."}},{"label":"Interface texts in quiz","fields":[{"label":"Back button","default":"Previous question"},{"label":"Next button","default":"Next question"},{"label":"Finish button","default":"Finish"},{"label":"Submit button","default":"Submit"},{"label":"Progress text","description":"Text used if textual progress is selected.","default":"Question: @current of @total questions"},{"label":"Label for jumping to a certain question","description":"You must use the placeholder %d instead of the question number, and %total instead of total amount of questions.","default":"Question %d of %total"},{"label":"Copyright dialog question label","default":"Question"},{"label":"Readspeaker progress","description":"May use @current and @total question variables","default":"Question @current of @total"},{"label":"Unanswered question text","default":"Unanswered"},{"label":"Answered question text","default":"Answered"},{"label":"Current question text","default":"Current question"},{"label":"Navigation label for readspeakers","default":"Questions"}]},{"label":"Disable backwards navigation","description":"This option will only allow you to move forward in Question Set"},{"label":"Randomize questions","description":"Enable to randomize the order of questions on display."},{"label":"Number of questions to be shown:","description":"Create a randomized batch of questions from the total."},{"label":"Quiz finished","fields":[{"label":"Display results"},{"label":"Display solution button"},{"label":"Display retry button"},{"label":"No results message","description":"Text displayed on end page when \"Display results\" is disabled","default":"Finished"},{"label":"Feedback heading","default":"Your result:","description":"This heading will be displayed at the end of the quiz when the user has answered all questions."},{"label":"Score announcer","description":"This label will be used for announcing the final score to the user on the end screen","default":"You got @finals out of @totals points"},{"label":"Overall Feedback","fields":[{"widgets":[{"label":"Default"}],"label":"Define custom feedback for any score range","description":"Click the \"Add range\" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!","entity":"range","field":{"fields":[{"label":"Score Range"},{},{"label":"Feedback for defined score range","placeholder":"Fill in the feedback"}]}}]},{"label":"Old Feedback","fields":[{"label":"Quiz passed greeting","description":"This text will be displayed above the score if the user has successfully passed the quiz."},{"label":"Passed comment","description":"This comment will be displayed after the score if the user has successfully passed the quiz."},{"label":"Quiz failed title","description":"This text will be displayed above the score if the user has failed the quiz."},{"label":"Failed comment","description":"This comment will be displayed after the score if the user has failed the quiz."}]},{"label":"Solution button label","default":"Show solution","description":"Text for the solution button."},{"label":"Retry button label","default":"Retry","description":"Text for the retry button."},{"label":"Finish button text","default":"Finish"},{"label":"Submit button text","default":"Submit"},{"label":"Display video before quiz results"},{"label":"Enable skip video button"},{"label":"Skip video button label","default":"Skip video"},{"label":"Passed video","description":"This video will be played if the user successfully passed the quiz."},{"label":"Fail video","description":"This video will be played if the user fails the quiz."}]},{"label":"Settings for \"Check\", \"Show solution\" and \"Retry\"","fields":[{"label":"Show \"Check\" buttons","description":"This option determines if the \"Check\" button will be shown for all questions."},{"label":"Override \"Show Solution\" button","description":"This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.","options":[{"label":"Enabled"},{"label":"Disabled"}]},{"label":"Override \"Retry\" button","description":"This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.","options":[{"label":"Enabled"},{"label":"Disabled"}]}]}]}'), JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) + ]); + } + + private function getSemantics() { + return '[ + { + "name": "introPage", + "type": "group", + "label": "Quiz introduction", + "importance": "medium", + "fields": [ + { + "name": "showIntroPage", + "type": "boolean", + "label": "Display introduction", + "importance": "low" + }, + { + "name": "title", + "type": "text", + "label": "Title", + "importance": "high", + "optional": true, + "description": "This title will be displayed above the introduction text.", + "tags": [ + "sub", + "sup", + "strong", + "em", + "code" + ] + }, + { + "name": "introduction", + "type": "text", + "widget": "html", + "label": "Introduction text", + "importance": "medium", + "optional": true, + "description": "This text will be displayed before the quiz starts.", + "enterMode": "p", + "tags": [ + "sub", + "sup", + "strong", + "em", + "p", + "code" + ] + }, + { + "name": "startButtonText", + "type": "text", + "label": "Start button text", + "importance": "low", + "optional": true, + "default": "Start Quiz" + }, + { + "name": "backgroundImage", + "type": "image", + "label": "Background image", + "importance": "low", + "optional": true, + "description": "An optional background image for the introduction." + } + ] + }, + { + "name": "backgroundImage", + "type": "image", + "label": "Background image", + "importance": "low", + "optional": true, + "description": "An optional background image for the Question set." + }, + { + "name": "progressType", + "type": "select", + "label": "Progress indicator", + "importance": "low", + "description": "Question set progress indicator style.", + "options": [ + { + "value": "textual", + "label": "Textual" + }, + { + "value": "dots", + "label": "Dots" + } + ], + "default": "dots" + }, + { + "name": "passPercentage", + "type": "number", + "label": "Pass percentage", + "importance": "low", + "description": "Percentage of Total score required for passing the quiz.", + "min": 0, + "max": 100, + "step": 1, + "default": 50 + }, + { + "name": "questions", + "label": "Questions", + "importance": "high", + "type": "list", + "widgets": [ + { + "name": "VerticalTabs", + "label": "Default" + }, + { + "name": "QuestionSetTextualEditor", + "label": "Textual" + } + ], + "min": 1, + "entity": "question", + "field": { + "name": "question", + "type": "library", + "label": "Question type", + "importance": "high", + "description": "Library for this question.", + "options": [ + "H5P.MultiChoice 1.16", + "H5P.DragQuestion 1.14", + "H5P.Blanks 1.14", + "H5P.MarkTheWords 1.11", + "H5P.DragText 1.10", + "H5P.TrueFalse 1.8", + "H5P.Essay 1.5" + ] + } + }, + { + "name": "texts", + "type": "group", + "label": "Interface texts in quiz", + "importance": "low", + "common": true, + "fields": [ + { + "name": "prevButton", + "type": "text", + "label": "Back button", + "importance": "low", + "default": "Previous question" + }, + { + "name": "nextButton", + "type": "text", + "label": "Next button", + "importance": "low", + "default": "Next question" + }, + { + "name": "finishButton", + "type": "text", + "label": "Finish button", + "importance": "low", + "default": "Finish" + }, + { + "name": "submitButton", + "type": "text", + "label": "Submit button", + "importance": "low", + "default": "Submit" + }, + { + "name": "textualProgress", + "type": "text", + "label": "Progress text", + "importance": "low", + "description": "Text used if textual progress is selected.", + "default": "Question: @current of @total questions", + "tags": [ + "strong", + "em", + "code" + ] + }, + { + "name": "jumpToQuestion", + "type": "text", + "label": "Label for jumping to a certain question", + "importance": "low", + "description": "You must use the placeholder %d instead of the question number, and %total instead of total amount of questions.", + "default": "Question %d of %total" + }, + { + "name": "questionLabel", + "type": "text", + "label": "Copyright dialog question label", + "importance": "low", + "default": "Question" + }, + { + "name": "readSpeakerProgress", + "type": "text", + "label": "Readspeaker progress", + "importance": "low", + "description": "May use @current and @total question variables", + "default": "Question @current of @total" + }, + { + "name": "unansweredText", + "type": "text", + "label": "Unanswered question text", + "importance": "low", + "default": "Unanswered" + }, + { + "name": "answeredText", + "type": "text", + "label": "Answered question text", + "importance": "low", + "default": "Answered" + }, + { + "name": "currentQuestionText", + "type": "text", + "label": "Current question text", + "importance": "low", + "default": "Current question" + }, + { + "name": "navigationLabel", + "type": "text", + "label": "Navigation label for readspeakers", + "importance": "low", + "default": "Questions" + } + ] + }, + { + "name": "disableBackwardsNavigation", + "type": "boolean", + "label": "Disable backwards navigation", + "importance": "low", + "description": "This option will only allow you to move forward in Question Set", + "optional": true, + "default": false + }, + { + "name": "randomQuestions", + "type": "boolean", + "label": "Randomize questions", + "importance": "low", + "description": "Enable to randomize the order of questions on display.", + "default": false + }, + { + "name": "poolSize", + "type": "number", + "min": 1, + "label": "Number of questions to be shown:", + "importance": "low", + "description": "Create a randomized batch of questions from the total.", + "optional": true + }, + { + "name": "endGame", + "type": "group", + "label": "Quiz finished", + "importance": "medium", + "fields": [ + { + "name": "showResultPage", + "type": "boolean", + "label": "Display results", + "importance": "low", + "default": true + }, + { + "name": "showSolutionButton", + "type": "boolean", + "label": "Display solution button", + "default": true + }, + { + "name": "showRetryButton", + "type": "boolean", + "label": "Display retry button", + "default": true + }, + { + "name": "noResultMessage", + "type": "text", + "label": "No results message", + "importance": "low", + "description": "Text displayed on end page when \"Display results\" is disabled", + "default": "Finished", + "optional": true + }, + { + "name": "message", + "type": "text", + "label": "Feedback heading", + "importance": "low", + "default": "Your result:", + "description": "This heading will be displayed at the end of the quiz when the user has answered all questions.", + "tags": [ + "strong", + "em", + "code" + ] + }, + { + "name": "scoreBarLabel", + "type": "text", + "label": "Score announcer", + "importance": "low", + "description": "This label will be used for announcing the final score to the user on the end screen", + "default": "You got @finals out of @totals points" + }, + { + "name": "overallFeedback", + "type": "group", + "label": "Overall Feedback", + "importance": "low", + "expanded": true, + "fields": [ + { + "name": "overallFeedback", + "type": "list", + "widgets": [ + { + "name": "RangeList", + "label": "Default" + } + ], + "importance": "high", + "label": "Define custom feedback for any score range", + "description": "Click the \"Add range\" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!", + "entity": "range", + "min": 1, + "defaultNum": 1, + "optional": true, + "field": { + "name": "overallFeedback", + "type": "group", + "importance": "low", + "fields": [ + { + "name": "from", + "type": "number", + "label": "Score Range", + "min": 0, + "max": 100, + "default": 0, + "unit": "%" + }, + { + "name": "to", + "type": "number", + "min": 0, + "max": 100, + "default": 100, + "unit": "%" + }, + { + "name": "feedback", + "type": "text", + "label": "Feedback for defined score range", + "importance": "low", + "placeholder": "Fill in the feedback", + "optional": true + } + ] + } + } + ] + }, + { + "name": "oldFeedback", + "type": "group", + "label": "Old Feedback", + "importance": "low", + "deprecated": true, + "fields": [ + { + "name": "successGreeting", + "type": "text", + "label": "Quiz passed greeting", + "importance": "low", + "optional": true, + "description": "This text will be displayed above the score if the user has successfully passed the quiz.", + "tags": [ + "strong", + "em", + "code" + ] + }, + { + "name": "successComment", + "type": "text", + "widget": "html", + "label": "Passed comment", + "importance": "low", + "optional": true, + "description": "This comment will be displayed after the score if the user has successfully passed the quiz.", + "tags": [ + "sub", + "sup", + "strong", + "em", + "a", + "p", + "code" + ] + }, + { + "name": "failGreeting", + "type": "text", + "label": "Quiz failed title", + "importance": "low", + "optional": true, + "description": "This text will be displayed above the score if the user has failed the quiz.", + "tags": [ + "strong", + "em", + "code" + ] + }, + { + "name": "failComment", + "type": "text", + "widget": "html", + "label": "Failed comment", + "importance": "low", + "optional": true, + "description": "This comment will be displayed after the score if the user has failed the quiz.", + "tags": [ + "sub", + "sup", + "strong", + "em", + "a", + "p", + "code" + ] + } + ] + }, + { + "name": "solutionButtonText", + "type": "text", + "label": "Solution button label", + "importance": "low", + "default": "Show solution", + "description": "Text for the solution button." + }, + { + "name": "retryButtonText", + "type": "text", + "label": "Retry button label", + "importance": "low", + "default": "Retry", + "description": "Text for the retry button." + }, + { + "name": "finishButtonText", + "type": "text", + "label": "Finish button text", + "importance": "low", + "default": "Finish" + }, + { + "name": "submitButtonText", + "type": "text", + "label": "Submit button text", + "importance": "low", + "default": "Submit" + }, + { + "name": "showAnimations", + "type": "boolean", + "label": "Display video before quiz results", + "importance": "low" + }, + { + "name": "skippable", + "type": "boolean", + "label": "Enable skip video button", + "importance": "low" + }, + { + "name": "skipButtonText", + "type": "text", + "label": "Skip video button label", + "importance": "low", + "default": "Skip video" + }, + { + "name": "successVideo", + "type": "video", + "label": "Passed video", + "importance": "low", + "optional": true, + "description": "This video will be played if the user successfully passed the quiz." + }, + { + "name": "failVideo", + "type": "video", + "label": "Fail video", + "importance": "low", + "optional": true, + "description": "This video will be played if the user fails the quiz." + } + ] + }, + { + "name": "override", + "type": "group", + "label": "Settings for \"Check\", \"Show solution\" and \"Retry\"", + "importance": "low", + "optional": true, + "fields": [ + { + "name": "checkButton", + "type": "boolean", + "label": "Show \"Check\" buttons", + "importance": "low", + "description": "This option determines if the \"Check\" button will be shown for all questions.", + "optional": true, + "default": true + }, + { + "name": "showSolutionButton", + "type": "select", + "label": "Override \"Show Solution\" button", + "importance": "low", + "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.", + "optional": true, + "widget": "showWhen", + "showWhen": { + "rules": [ + { + "field": "checkButton", + "equals": true + } + ] + }, + "options": [ + { + "value": "on", + "label": "Enabled" + }, + { + "value": "off", + "label": "Disabled" + } + ] + }, + { + "name": "retryButton", + "type": "select", + "label": "Override \"Retry\" button", + "importance": "low", + "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.", + "optional": true, + "widget": "showWhen", + "showWhen": { + "rules": [ + { + "field": "checkButton", + "equals": true + } + ] + }, + "options": [ + { + "value": "on", + "label": "Enabled" + }, + { + "value": "off", + "label": "Disabled" + } + ] + } + ] + },{ + "name": "currikisettings", + "type": "group", + "label": "Curriki settings", + "importance": "low", + "description": "These options will let you control how the curriki studio behaves.", + "optional": true, + "fields": [ + { + "label": "Do not Show Submit Button", + "importance": "low", + "name": "disableSubmitButton", + "type": "boolean", + "default": false, + "optional": true, + "description": "This option only applies to a standalone activity. The Submit button is required for grade passback to an LMS." + }, + { + "label": "Placeholder", + "importance": "low", + "name": "placeholder", + "type": "boolean", + "default": false, + "optional": true, + "description": "This option is a place holder. will be used in future" + }, + { + "label": "Curriki Localization", + "description": "Here you can edit settings or translate texts used in curriki settings", + "importance": "low", + "name": "currikil10n", + "type": "group", + "fields": [ + { + "label": "Text for \"Submit\" button", + "name": "submitAnswer", + "importance": "low", + "type": "text", + "default": "Submit", + "optional": true + }, + { + "label": "Text for \"Placeholder\" button", + "importance": "low", + "name": "placeholderButton", + "type": "text", + "default": "Placeholder", + "optional": true + } + ] + } + ] + } + ]'; + } +}