+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class reorder extends external_api {
+
+ /**
+ * Describes the parameters for reorder.
+ *
+ * @return external_function_parameters
+ */
+ public static function execute_parameters(): external_function_parameters {
+ return new external_function_parameters(
+ [
+ 'cmid' => new external_value(PARAM_INT, 'Feedback course module id'),
+ 'itemorder' => new external_value(PARAM_SEQUENCE, 'Feedback question item order'),
+ ]
+ );
+ }
+
+ /**
+ * External function to reorder feedback questions.
+ *
+ * @param int $cmid
+ * @param string $itemorder
+ * @return bool
+ */
+ public static function execute(int $cmid, string $itemorder): bool {
+ global $DB;
+ [
+ 'cmid' => $cmid,
+ 'itemorder' => $itemorder,
+ ] = self::validate_parameters(self::execute_parameters(), [
+ 'cmid' => $cmid,
+ 'itemorder' => $itemorder,
+ ]);
+
+ $cm = get_coursemodule_from_id('feedback', $cmid, 0, false, MUST_EXIST);
+ $feedback = $DB->get_record('feedback', ['id' => $cm->instance], '*', MUST_EXIST);
+ $context = context_module::instance($cm->id);
+
+ self::validate_context($context);
+ require_capability('mod/feedback:edititems', $context);
+
+ $itemlist = explode(',', trim($itemorder, ',')) ?: '';
+ if (count($itemlist) > 0) {
+ return feedback_ajax_saveitemorder($itemlist, $feedback);
+ }
+
+ return false;
+ }
+
+ /**
+ * Describes the data returned from the external function.
+ *
+ * @return external_value
+ */
+ public static function execute_returns(): external_value {
+ return new external_value(PARAM_BOOL, '', VALUE_REQUIRED);
+ }
+}
diff --git a/mod/feedback/db/services.php b/mod/feedback/db/services.php
index 6866beab60501..0e5c456a22992 100644
--- a/mod/feedback/db/services.php
+++ b/mod/feedback/db/services.php
@@ -141,4 +141,12 @@
'capabilities' => 'mod/feedback:view',
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
),
+ 'mod_feedback_questions_reorder' => [
+ 'classname' => 'mod_feedback\external\questions\reorder',
+ 'description' => 'Saves the new order of the questions in the feedback.',
+ 'type' => 'write',
+ 'ajax' => true,
+ 'capabilities' => 'mod/feedback:edititems',
+ 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE]
+ ],
);
diff --git a/mod/feedback/edit.php b/mod/feedback/edit.php
index 1f0ddfa99c747..a251a936efeb4 100644
--- a/mod/feedback/edit.php
+++ b/mod/feedback/edit.php
@@ -86,21 +86,7 @@
'description' => ''
]);
$PAGE->add_body_class('limitedwidth');
-$PAGE->requires->js_call_amd('mod_feedback/edit', 'init');
-
-//Adding the javascript module for the items dragdrop.
-if (count($feedbackitems) > 1) {
- $PAGE->requires->strings_for_js([
- 'pluginname',
- 'move_item',
- 'position',
- ], 'feedback');
- $PAGE->requires->yui_module(
- 'moodle-mod_feedback-dragdrop',
- 'M.mod_feedback.init_dragdrop',
- [['cmid' => $cm->id]]
- );
-}
+$PAGE->requires->js_call_amd('mod_feedback/edit', 'init', [$cm->id]);
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('edit_items', 'mod_feedback'), 3);
@@ -110,8 +96,6 @@
echo $renderer->main_action_bar($actionbar);
$form = new mod_feedback_complete_form(mod_feedback_complete_form::MODE_EDIT,
$feedbackstructure, 'feedback_edit_form');
-echo ''; // The container for the dragging area.
$form->display();
-echo '
';
echo $OUTPUT->footer();
diff --git a/mod/feedback/lang/en/feedback.php b/mod/feedback/lang/en/feedback.php
index e67380f80ea31..946ffbb06b038 100644
--- a/mod/feedback/lang/en/feedback.php
+++ b/mod/feedback/lang/en/feedback.php
@@ -244,6 +244,7 @@
$string['public'] = 'Public';
$string['question'] = 'Question';
$string['questionandsubmission'] = 'Question and submission settings';
+$string['questionmoved'] = 'Question moved';
$string['questions'] = 'Questions';
$string['questionslimited'] = 'Showing only {$a} first questions, view individual answers or download table data to view all.';
$string['radio'] = 'Multiple choice - single answer';
diff --git a/mod/feedback/tests/behat/behat_mod_feedback.php b/mod/feedback/tests/behat/behat_mod_feedback.php
index eb3ecf46d7ca6..9e877fad13398 100644
--- a/mod/feedback/tests/behat/behat_mod_feedback.php
+++ b/mod/feedback/tests/behat/behat_mod_feedback.php
@@ -237,7 +237,8 @@ protected function compare_exports($expected, $actual) {
public static function get_partial_named_selectors(): array {
return [
new behat_component_named_selector('Question', [
- ".//*[starts-with(@id, 'fitem_feedback_item_')][.//*[contains(text(), %locator%)]]",
+ ".//*[starts-with(@id, 'fitem_feedback_item_') or starts-with(@id, 'fgroup_feedback_item_')]" .
+ "[.//*[contains(text(), %locator%)]]",
]),
];
}
diff --git a/mod/feedback/tests/behat/multichoice.feature b/mod/feedback/tests/behat/multichoice.feature
index d71d3fb3860c7..418762b4e7b16 100644
--- a/mod/feedback/tests/behat/multichoice.feature
+++ b/mod/feedback/tests/behat/multichoice.feature
@@ -151,7 +151,7 @@ Feature: Testing multichoice questions in feedback
# Change the settings so we don't analyse empty submits
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Questions" in current page administration
- And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
+ And I click on "Edit" "link" in the "this is a multiple choice 1" "mod_feedback > Question"
And I choose "Edit question" in the open action menu
And I set the field "Omit empty submits in analysis" to "Yes"
And I press "Save changes to question"
@@ -290,7 +290,7 @@ Feature: Testing multichoice questions in feedback
# Change the settings so we don't analyse empty submits
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Questions" in current page administration
- And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
+ And I click on "Edit" "link" in the "this is a multiple choice 1" "mod_feedback > Question"
And I choose "Edit question" in the open action menu
And I set the field "Omit empty submits in analysis" to "Yes"
And I press "Save changes to question"
@@ -408,7 +408,7 @@ Feature: Testing multichoice questions in feedback
# Change the settings so we don't analyse empty submits
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Questions" in current page administration
- And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
+ And I click on "Edit" "link" in the "this is a multiple choice 1" "mod_feedback > Question"
And I choose "Edit question" in the open action menu
And I set the field "Omit empty submits in analysis" to "Yes"
And I press "Save changes to question"
diff --git a/mod/feedback/tests/behat/questions.feature b/mod/feedback/tests/behat/questions.feature
index 4ed942a73be37..86b64eabd86a8 100644
--- a/mod/feedback/tests/behat/questions.feature
+++ b/mod/feedback/tests/behat/questions.feature
@@ -17,23 +17,24 @@ Feature: Managing feedback questions
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience course 1 | C1 | feedback1 |
+ And the following "mod_feedback > question" exists:
+ | activity | feedback1 |
+ | name | Is it me you're looking for? |
+ | label | q1 |
Scenario: Teacher can create a new feedback question
Given I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "region-main" "region"
When I add a "Short text answer" question to the feedback with:
- | Question | Is it me you're looking for? |
- | Label | q1 |
- Then I should see "(q1) Is it me you're looking for?"
+ | Question | I can see it in your eyes |
+ | Label | q2 |
+ Then I should see "(q2) I can see it in your eyes"
@javascript
Scenario: Teacher can edit feedback questions
Given I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "region-main" "region"
- And I add a "Short text answer" question to the feedback with:
- | Question | Is it me you're looking for? |
- | Label | q1 |
- When I open the action menu in "Is it me you're looking for?" "mod_feedback > Question"
+ When I click on "Edit" "link" in the "Is it me you're looking for?" "mod_feedback > Question"
And I choose "Edit question" in the open action menu
And I set the field "Question" to "Can you see it in my eyes?"
And I press "Save changes to question"
@@ -44,10 +45,7 @@ Feature: Managing feedback questions
Scenario: Teacher can edit and save as new feedback questions
Given I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "region-main" "region"
- And I add a "Short text answer" question to the feedback with:
- | Question | Is it me you're looking for? |
- | Label | q1 |
- When I open the action menu in "Is it me you're looking for?" "mod_feedback > Question"
+ When I click on "Edit" "link" in the "Is it me you're looking for?" "mod_feedback > Question"
And I choose "Edit question" in the open action menu
And I set the field "Question" to "You can se it in my eyes?"
And I press "Save as new question"
@@ -58,10 +56,7 @@ Feature: Managing feedback questions
Scenario: Teacher can delete feedback questions
Given I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "region-main" "region"
- And I add a "Short text answer" question to the feedback with:
- | Question | Is it me you're looking for? |
- | Label | q1 |
- When I open the action menu in "Is it me you're looking for?" "mod_feedback > Question"
+ When I click on "Edit" "link" in the "Is it me you're looking for?" "mod_feedback > Question"
And I choose "Delete question" in the open action menu
And I click on "Yes" "button" in the "Confirmation" "dialogue"
Then I should not see "(q1) Is it me you're looking for?"
@@ -70,18 +65,29 @@ Feature: Managing feedback questions
Scenario: Teacher can mark as required feedback questions
Given I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "region-main" "region"
- And I add a "Short text answer" question to the feedback with:
- | Question | Is it me you're looking for? |
- | Label | q1 |
- | Required | 0 |
- When I open the action menu in "Is it me you're looking for?" "mod_feedback > Question"
+ When I click on "Edit" "link" in the "Is it me you're looking for?" "mod_feedback > Question"
And I choose "Set as required" in the open action menu
- And I open the action menu in "Is it me you're looking for?" "mod_feedback > Question"
+ And I click on "Edit" "link" in the "Is it me you're looking for?" "mod_feedback > Question"
And I choose "Edit question" in the open action menu
Then the field "Required" matches value "1"
And I press "Cancel"
- And I open the action menu in "Is it me you're looking for?" "mod_feedback > Question"
+ And I click on "Edit" "link" in the "Is it me you're looking for?" "mod_feedback > Question"
And I choose "Set as not required" in the open action menu
- And I open the action menu in "Is it me you're looking for?" "mod_feedback > Question"
+ And I click on "Edit" "link" in the "Is it me you're looking for?" "mod_feedback > Question"
And I choose "Edit question" in the open action menu
And the field "Required" matches value "0"
+
+ @javascript
+ Scenario: Teacher can move questions
+ Given the following "mod_feedback > questions" exist:
+ | activity | label | name |
+ | feedback1 | q2 | I can see it in your eyes |
+ | feedback1 | q3 | I can see it in your smile |
+ And I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
+ And I click on "Edit questions" "link" in the "region-main" "region"
+ When I click on "Move this question" "button" in the "Is it me you're looking for?" "mod_feedback > Question"
+ Then I should see "After \"(q2) I can see it in your eyes\"" in the "Move this question" "dialogue"
+ And I should not see "To the top of the list" in the "Move this question" "dialogue"
+ And I click on "After \"(q3) I can see it in your smile\"" "link" in the "Move this question" "dialogue"
+ And I click on "Move this question" "button" in the "Is it me you're looking for?" "mod_feedback > Question"
+ And I click on "To the top of the list" "link" in the "Move this question" "dialogue"
diff --git a/mod/feedback/version.php b/mod/feedback/version.php
index d4d3e0eb9d19e..74f8191eefea6 100644
--- a/mod/feedback/version.php
+++ b/mod/feedback/version.php
@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2024100700; // The current module version (Date: YYYYMMDDXX).
+$plugin->version = 2024100701; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2024100100; // Requires this Moodle version.
$plugin->component = 'mod_feedback'; // Full name of the plugin (used for diagnostics)
$plugin->cron = 0;
diff --git a/mod/feedback/yui/dragdrop/dragdrop.js b/mod/feedback/yui/dragdrop/dragdrop.js
deleted file mode 100644
index cdb194a8150e6..0000000000000
--- a/mod/feedback/yui/dragdrop/dragdrop.js
+++ /dev/null
@@ -1,265 +0,0 @@
-YUI.add('moodle-mod_feedback-dragdrop', function(Y) {
- var DRAGDROPNAME = 'mod_feedback_dragdrop';
- var CSS = {
- DRAGAREA: '#feedback_dragarea',
- DRAGITEMCLASS: 'feedback_itemlist',
- DRAGITEM: '.row.feedback_itemlist',
- DRAGLIST: '#feedback_dragarea form',
- DRAGHANDLE: 'itemhandle'
- };
-
- var DRAGDROP = function() {
- DRAGDROP.superclass.constructor.apply(this, arguments);
- };
-
- Y.extend(DRAGDROP, M.core.dragdrop, {
-
- initializer : function(params) {
- //Static Vars
- this.cmid = params.cmid;
- this.goingUp = false, lastY = 0;
-
- var groups = ['feedbackitem'];
-
- var handletitle = M.util.get_string('move_item', 'feedback');
-
- //Get the list of li's in the lists and add the drag handle.
- basenode = Y.Node.one(CSS.DRAGLIST);
- listitems = basenode.all(CSS.DRAGITEM).each(function(v) {
- var item_id = this.get_node_id(v.get('id')); //Get the id of the feedback item.
- var mydraghandle = this.get_drag_handle(handletitle, CSS.DRAGHANDLE, 'icon');
- v.append(mydraghandle); // Insert the new handle into the item box.
- }, this);
-
- //We use a delegate to make all items draggable
- var del = new Y.DD.Delegate({
- container: CSS.DRAGLIST,
- nodes: CSS.DRAGITEM,
- target: {
- padding: '0 0 0 20'
- },
- handles: ['.' + CSS.DRAGHANDLE],
- dragConfig: {groups: groups}
- });
-
- //Add plugins to the delegate
- del.dd.plug(Y.Plugin.DDProxy, {
- // Don't move the node at the end of the drag
- moveOnEnd: false,
- cloneNode: true
- });
- del.dd.plug(Y.Plugin.DDConstrained, {
- // Keep it inside the .course-content
- constrain: CSS.DRAGAREA
- });
- del.dd.plug(Y.Plugin.DDWinScroll);
-
- //Listen for all drop:over events
- del.on('drop:over', this.drop_over_handler, this);
- //Listen for all drag:drag events
- del.on('drag:drag', this.drag_drag_handler, this);
- //Listen for all drag:start events
- del.on('drag:start', this.drag_start_handler, this);
- //Listen for a drag:end events
- del.on('drag:end', this.drag_end_handler, this);
- //Listen for all drag:drophit events
- del.on('drag:drophit', this.drag_drophit_handler, this);
- //Listen for all drag:dropmiss events
- del.on('drag:dropmiss', this.drag_dropmiss_handler, this);
-
- //Create targets for drop.
- var droparea = Y.Node.one(CSS.DRAGLIST);
- var tar = new Y.DD.Drop({
- groups: groups,
- node: droparea
- });
-
- },
-
- /**
- * Handles the drop:over event.
- *
- * @param e the event
- * @return void
- */
- drop_over_handler : function(e) {
- //Get a reference to our drag and drop nodes
- var drag = e.drag.get('node'),
- drop = e.drop.get('node');
-
- //Are we dropping on an li node?
- if (drop.hasClass(CSS.DRAGITEMCLASS)) {
- //Are we not going up?
- if (!this.goingUp) {
- drop = drop.get('nextSibling');
- }
- //Add the node to this list
- e.drop.get('node').get('parentNode').insertBefore(drag, drop);
- //Resize this nodes shim, so we can drop on it later.
- e.drop.sizeShim();
- }
- },
-
- /**
- * Handles the drag:drag event.
- *
- * @param e the event
- * @return void
- */
- drag_drag_handler : function(e) {
- //Get the last y point
- var y = e.target.lastXY[1];
- //Is it greater than the lastY var?
- if (y < this.lastY) {
- //We are going up
- this.goingUp = true;
- } else {
- //We are going down.
- this.goingUp = false;
- }
- //Cache for next check
- this.lastY = y;
- },
-
- /**
- * Handles the drag:start event.
- *
- * @param e the event
- * @return void
- */
- drag_start_handler : function(e) {
- //Get our drag object
- var drag = e.target;
-
- //Set some styles here
- drag.get('node').addClass('drag_target_active');
- drag.get('dragNode').set('innerHTML', drag.get('node').get('innerHTML'));
- drag.get('dragNode').addClass('drag_item_active');
- drag.get('dragNode').setStyles({
- borderColor: drag.get('node').getStyle('borderColor'),
- backgroundColor: drag.get('node').getStyle('backgroundColor')
- });
- },
-
- /**
- * Handles the drag:end event.
- *
- * @param e the event
- * @return void
- */
- drag_end_handler : function(e) {
- var drag = e.target;
- //Put our styles back
- drag.get('node').removeClass('drag_target_active');
- },
-
- /**
- * Handles the drag:drophit event.
- *
- * @param e the event
- * @return void
- */
- drag_drophit_handler : function(e) {
- var drop = e.drop.get('node'),
- drag = e.drag.get('node');
- dragnode = Y.one(drag);
- if (!drop.hasClass(CSS.DRAGITEMCLASS)) {
- if (!drop.contains(drag)) {
- drop.appendChild(drag);
- }
- var childElement;
- var elementId;
- var elements = [];
- drop.all(CSS.DRAGITEM).each(function(v) {
- childElement = v.one('.felement')?.one('[id^="feedback_item_"]');
- if (childElement) {
- elementId = this.get_node_id(childElement.get('id'));
- if (elements.indexOf(elementId) == -1) {
- elements.push(elementId);
- }
- }
- }, this);
- var spinner = M.util.add_spinner(Y, dragnode);
- this.save_item_order(this.cmid, elements.toString(), spinner);
- }
- },
-
- /**
- * Save the new item order.
- *
- * @param cmid the coursemodule id
- * @param itemorder A comma separated list with item ids
- * @param spinner The spinner icon shown while saving
- * @return void
- */
- save_item_order : function(cmid, itemorder, spinner) {
-
- Y.io(M.cfg.wwwroot + '/mod/feedback/ajax.php', {
- //The needed paramaters
- data: {action: 'saveitemorder',
- id: cmid,
- itemorder: itemorder,
- sesskey: M.cfg.sesskey
- },
-
- timeout: 5000, //5 seconds for timeout I think it is enough.
-
- //Define the events.
- on: {
- start : function(transactionid) {
- spinner.show();
- },
- success : function(transactionid, xhr) {
- var response = xhr.responseText;
- var ergebnis = Y.JSON.parse(response);
- window.setTimeout(function(e) {
- spinner.hide();
- }, 250);
- require(['core/notification', 'core/str', 'core/toast'], function(Notification, Strings, Toast) {
- Strings.get_string('changessaved', 'core').then(function(saveString) {
- return Toast.add(saveString);
- }).catch(Notification.exception);
- });
- },
- failure : function(transactionid, xhr) {
- var msg = {
- name : xhr.status+' '+xhr.statusText,
- message : xhr.responseText
- };
- return new M.core.exception(msg);
- //~ this.ajax_failure(xhr);
- spinner.hide();
- }
- },
- context:this
- });
- },
-
- /**
- * Returns the numeric id from the dom id of an item.
- *
- * @param id The dom id, f.g.: feedback_item_22
- * @return int
- */
- get_node_id : function(id) {
- return Number(id.replace(/^.*feedback_item_/i, ''));
- }
-
- }, {
- NAME : DRAGDROPNAME,
- ATTRS : {
- cmid : {
- value : 0
- }
- }
-
- });
-
- M.mod_feedback = M.mod_feedback || {};
- M.mod_feedback.init_dragdrop = function(params) {
- return new DRAGDROP(params);
- }
-
-}, '@VERSION@', {
- requires:['io', 'json-parse', 'dd-constrain', 'dd-proxy', 'dd-drop', 'dd-scroll', 'moodle-core-dragdrop', 'moodle-core-notification']
-});
diff --git a/theme/boost/scss/moodle/modules.scss b/theme/boost/scss/moodle/modules.scss
index d3f6945027abd..ff68d17f7389d 100644
--- a/theme/boost/scss/moodle/modules.scss
+++ b/theme/boost/scss/moodle/modules.scss
@@ -1589,12 +1589,6 @@ $popout-header-height: 4rem;
border: 0;
margin: 0;
}
- .drag_target_active {
- opacity: .25;
- }
- .drag_item_active {
- opacity: .5;
- }
.feedback_bar_image {
height: 10px;
}
@@ -1611,39 +1605,44 @@ $popout-header-height: 4rem;
width: 10%;
}
}
- .feedback_form {
- .itemactions {
- display: inline-block;
- margin: 0 map-get($spacers, 2);
- }
- }
.feedback-item-label {
width: 100%;
}
// Feedback edit form.
#feedback_edit_form {
- [id*=_feedback_item_].feedback_itemlist {
+ [id*=_feedback_item_].feedback_itemlist,
+ .feedback_itemlist.sortable-list-is-dragged {
padding: map-get($spacers, 3);
border: $border-width solid $border-color;
+ background-color: $white;
+ position: relative;
@include border-radius();
- .itemhandle {
- position: absolute;
- width: 32px;
- height: 32px;
- text-align: center;
- align-content: center;
+ .itemname {
+ margin-right: map-get($spacers, 5);
}
- .action-menu {
+ .itemactions {
position: absolute;
top: 0;
right: 0;
+ .dropdown-toggle {
+ @include border-radius(.5rem);
+ width: $icon-medium-width;
+ height: $icon-medium-height;
+ }
}
- .dropdown-toggle {
- border-radius: .5rem;
- width: 32px;
- height: 32px;
+ &.sortable-list-current-position {
+ background-color: $light;
}
}
+ .sortable-list-is-dragged {
+ opacity: .75;
+ max-width: $course-content-maxwidth;
+ }
+ .loading-icon {
+ position: absolute;
+ left: 50%;
+ top: calc(50% - .5rem);
+ }
}
// Analysis page.
diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css
index 8bd634a2a84f5..55d5a5f45d13a 100644
--- a/theme/boost/style/moodle.css
+++ b/theme/boost/style/moodle.css
@@ -35070,12 +35070,6 @@ img.userpicture {
border: 0;
margin: 0;
}
-.path-mod-feedback .drag_target_active {
- opacity: 0.25;
-}
-.path-mod-feedback .drag_item_active {
- opacity: 0.5;
-}
.path-mod-feedback .feedback_bar_image {
height: 10px;
}
@@ -35088,35 +35082,46 @@ img.userpicture {
.path-mod-feedback .templateslist th.header.action {
width: 10%;
}
-.path-mod-feedback .feedback_form .itemactions {
- display: inline-block;
- margin: 0 0.5rem;
-}
.path-mod-feedback .feedback-item-label {
width: 100%;
}
-.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist {
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged {
padding: 1rem;
border: 1px solid #dee2e6;
+ background-color: #fff;
+ position: relative;
border-radius: 0.5rem;
}
-.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .itemhandle {
- position: absolute;
- width: 32px;
- height: 32px;
- text-align: center;
- align-content: center;
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .itemname,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged .itemname {
+ margin-right: 2rem;
}
-.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .action-menu {
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .itemactions,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged .itemactions {
position: absolute;
top: 0;
right: 0;
}
-.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .dropdown-toggle {
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .itemactions .dropdown-toggle,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged .itemactions .dropdown-toggle {
border-radius: 0.5rem;
width: 32px;
height: 32px;
}
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist.sortable-list-current-position,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged.sortable-list-current-position {
+ background-color: #f8f9fa;
+}
+.path-mod-feedback #feedback_edit_form .sortable-list-is-dragged {
+ opacity: 0.75;
+ max-width: 830px;
+}
+.path-mod-feedback #feedback_edit_form .loading-icon {
+ position: absolute;
+ left: 50%;
+ top: calc(50% - 0.5rem);
+}
.path-mod-feedback table.analysis {
width: 100%;
border-top: 1px solid #dee2e6;
diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css
index 2f87f80c6d428..d10e0246fd673 100644
--- a/theme/classic/style/moodle.css
+++ b/theme/classic/style/moodle.css
@@ -35070,12 +35070,6 @@ img.userpicture {
border: 0;
margin: 0;
}
-.path-mod-feedback .drag_target_active {
- opacity: 0.25;
-}
-.path-mod-feedback .drag_item_active {
- opacity: 0.5;
-}
.path-mod-feedback .feedback_bar_image {
height: 10px;
}
@@ -35088,35 +35082,46 @@ img.userpicture {
.path-mod-feedback .templateslist th.header.action {
width: 10%;
}
-.path-mod-feedback .feedback_form .itemactions {
- display: inline-block;
- margin: 0 0.5rem;
-}
.path-mod-feedback .feedback-item-label {
width: 100%;
}
-.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist {
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged {
padding: 1rem;
border: 1px solid #dee2e6;
+ background-color: #fff;
+ position: relative;
border-radius: 0.25rem;
}
-.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .itemhandle {
- position: absolute;
- width: 32px;
- height: 32px;
- text-align: center;
- align-content: center;
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .itemname,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged .itemname {
+ margin-right: 2rem;
}
-.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .action-menu {
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .itemactions,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged .itemactions {
position: absolute;
top: 0;
right: 0;
}
-.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .dropdown-toggle {
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist .itemactions .dropdown-toggle,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged .itemactions .dropdown-toggle {
border-radius: 0.5rem;
width: 32px;
height: 32px;
}
+.path-mod-feedback #feedback_edit_form [id*=_feedback_item_].feedback_itemlist.sortable-list-current-position,
+.path-mod-feedback #feedback_edit_form .feedback_itemlist.sortable-list-is-dragged.sortable-list-current-position {
+ background-color: #f8f9fa;
+}
+.path-mod-feedback #feedback_edit_form .sortable-list-is-dragged {
+ opacity: 0.75;
+ max-width: 830px;
+}
+.path-mod-feedback #feedback_edit_form .loading-icon {
+ position: absolute;
+ left: 50%;
+ top: calc(50% - 0.5rem);
+}
.path-mod-feedback table.analysis {
width: 100%;
border-top: 1px solid #dee2e6;