diff --git a/templates/list_verbalfeedback_items.mustache b/templates/list_verbalfeedback_items.mustache index e83183b..684cdf8 100644 --- a/templates/list_verbalfeedback_items.mustache +++ b/templates/list_verbalfeedback_items.mustache @@ -911,9 +911,9 @@ "weight": "0.20" }], "verbalfeedbackid": 21, - "viewurl": {}, - "makeavailableurl": {}, - "previewurl": {}, + "viewurl": "http://example.org/mod/verbalfeedback/view.php?id=1073", + "makeavailableurl": "http://example.org/mod/verbalfeedback/view.php?id=1073&makeavailable=1", + "previewurl": "http://example.org/mod/verbalfeedback/questionnaire.php?instance=2&preview=1", "maxgrade": "15.00", "cmid": 465, "sesskey": "BABEgbUslM" @@ -959,88 +959,74 @@ {{/previewurl}}
- {{#str}}totalpercentage, mod_verbalfeedback{{/str}} - - % + {{#str}}totalpercentage, mod_verbalfeedback{{/str}} + + %
- - {{# categories }} - - - - - - - - - - - - - - - - {{# criteria }} - - - - - - - {{/ criteria }} - - {{/ categories }} -
{{ header }} - {{#str}}percentage, mod_verbalfeedback{{/str}}:  -
- - - {{#js}} - require(['jquery'], function($) { - $('#category-{{id}}-percentage option[value="{{weight}}"]').prop('selected', true); - }); - {{/js}} + {{# categories }} +
+
{{ header }}
+
+ {{#str}}percentage, mod_verbalfeedback{{/str}}:  +
+ + + {{#js}} + require(['jquery'], function($) { + $('#category-{{id}}-percentage option[value="{{weight}}"]').prop('selected', true); + }); + {{/js}} + + +
+
+
+
+
+
{{#str}}multiplier, mod_verbalfeedback{{/str}}
+
+ {{# criteria }} +
+
+ {{ text }} +
+
+
+ + +
-
 {{#str}}multiplier, mod_verbalfeedback{{/str}}  
- {{ text }} - -
- - - - - -
-
- -
+
+ + {{/ criteria }} + {{/ categories }} {{#js}} - require(['jquery', 'mod_verbalfeedback/edit_items'], function($, EditItems) { + require(['mod_verbalfeedback/edit_items'], function(EditItems) { let editItems = new EditItems({{verbalfeedbackid}}); editItems.updatePercentageSum(); }); diff --git a/templates/questionnaire.mustache b/templates/questionnaire.mustache index cb10857..5a45d41 100644 --- a/templates/questionnaire.mustache +++ b/templates/questionnaire.mustache @@ -258,7 +258,14 @@ saveandreturn, mod_verbalfeedback{{/str}} {{#js}} - require(['mod_verbalfeedback/questionnaire', 'jquery', 'core/yui', 'core/templates', 'core/notification', 'core/str'], function(Questionnaire, $) { + require([ + 'mod_verbalfeedback/questionnaire', + 'jquery', + 'core/yui', + 'core/templates', + 'core/notification', + 'core/str' + ], function(Questionnaire) { new Questionnaire(); }); {{/js}} diff --git a/templates/report.mustache b/templates/report.mustache index 4d16c8d..95ba0d9 100644 --- a/templates/report.mustache +++ b/templates/report.mustache @@ -183,31 +183,5 @@ - - \ No newline at end of file diff --git a/tests/behat/configure_verbalfeedback.feature b/tests/behat/configure_verbalfeedback.feature index 98559ec..c84947b 100644 --- a/tests/behat/configure_verbalfeedback.feature +++ b/tests/behat/configure_verbalfeedback.feature @@ -43,12 +43,13 @@ Feature: Configure a verbal feedback activity And I am on the "Test verbal feedback" "verbalfeedback activity" page logged in as teacher1 And I follow "Edit verbal feedback items" And I should see "Edit verbal feedback items" - And I set the field "Percentage" in the "Structure" "table_row" to "0%" - And I set the field "Percentage" in the "Body language" "table_row" to "25%" - And I set the field "Percentage" in the "Content" "table_row" to "25%" - And I set the field "Percentage" in the "Speech" "table_row" to "25%" - And I set the field "Percentage" in the "Media" "table_row" to "25%" - And I set the field "Multiplier" in the "The main points build on each other and are in line with your purpose." "table_row" to "0.00" + And I set the field with xpath "//*[text()='Structure']/../..//select" to "0.00" + And I set the field with xpath "//*[text()='Body language']/../..//select" to "0.25" + And I set the field with xpath "//*[text()='Content']/../..//select" to "0.25" + And I set the field with xpath "//*[text()='Speech']/../..//select" to "0.25" + And I set the field with xpath "//*[text()='Media']/../..//select" to "0.25" + # And I set the field "Multiplier" in the "The main points build on each other and are in line with your purpose." "table_row" to "0.00" + And I set the field with xpath "(//input[@data-action='change-item-multiplier'])[9]" to "0.00" And I follow "Preview" And I should not see "Structure" Then I should not see "The main parts build on each other and are purposeful."