Closed Syxton closed 8 years ago
@Syxton Sorry for the delay in paying attention to this and attempting to merge it in. I just wanted to check that this is supposed to do what I think it is supposed to do and that is to get the Mass Actions block working with the OneTopic format. Is this correct?
@cdsmith-umn Sorry, I actually misunderstood the bug issue. This is a fix to better work with single section view and to work on sections that my not be in order. The second situation happens for instance when section 2 is empty and section 3 has content and you set the course sections to 1. Then section 1 will show, section 2 will be gone, and section 3 will be an "orphaned" section. This fix allows you to move content to that orphaned section even though there is a missing section in-between section 1 and the orphan.
I will take a look at the OneTopic format and see what it looks like there. sorry
@Syxton Thanks for the clarification. OneTopic is its own nightmare. From what I've been able to figure out, OneTopic format prevents the content from being written to tabs other than the default-selected tab on page load. That content's html is only written to the screen when you click on its tab.
Mass Actions can only add checkboxes and any other controls for content which html is present for on page load. From what I can see, I think the solution would be to have a JS function that performs the same function as the init function and add an onclick event to each of the tabs so that the JS function is called any time a tab is clicked. The other possibility would be to have clicking a tab cause a page reload, but this would increase the demand on the server since it would have to reload all the resources on the page.
@Syxton It doesn't seem we have the Single Section format installed in our Moodle instances. Where can I get a copy of this format to install in my developer instance? I have Single Activity format, but this is apparently quite different from Single Section. Thanks!
The core course formats. Look for Course Layout: one section per page
Hmmm. I'm having trouble getting the course set up correctly to test the changes. I've got a course in Topics format, with "Course layout" set to "Show one section per page" and "Hidden sections" set to "Hidden sections are completely invisible". I've also tried "Weekly format", "OneTopic format", and "Flexible sections format". What is it that I am missing?
here are the two tests.
@cdsmith-umn if you do these tests on unpatched vs patched you should see the issue.
@Syxton I see that unpatched only lets you select from or move/duplicate to the General section, while patched lets you select from or move/duplicate to the General section and the section you are currently on/in/have active. This seems sub-optimal to me, still, but I think the problem here is the same as the problem with OneTopic: the content in other sections is technically not in the HTML DOM and so cannot be interacted with by Mass Actions.
@cdsmith-umn I agree, it would be great if we could select and move content whether they are in the dom or not. This patch just makes the selection work the way it should (assuming current limitations of searching only the DOM)
@Syxton This has been added and credit given to you in README.txt for this change. Thank you for the bugfix!
The version number needs to be bumped if this pull is accepted so that the upgrade process will clear the cached javascript.