Moodle Plugins directory: Upload block settings | Moodle.org
Upload block settings
The Upload Block settings plugin allows administrators to add multiple blocks to a set of courses in a single batch operation. This is particularly useful for existing sites with a large number of courses, where you can delete obsolete blocks and add new default blocks to every course.
You can also reset course blocks to the defined default set for the course type, see Block Layout.
Use the command Site administration > Courses > Upload block settings to upload a CSV file containing lines of the form:
operation, course shortname, block name, region, weight
Lines beginning with a '#' or ';' character are comments, and skipped.
Each line of the file contains one record.
Each record is a series of data in a fixed order separated by commas.
The required fields are operation, course shortname, block, region, weight.
The allowed operations are add, del(ete), and res(et).
The allowed regions are side-pre and side-post.
The allowed weights are -10 to 10 (0 is neutral).
Thanks Eoin for sharing the plugin with the community. Please refer to the to feedback provided in the tracker approval issue.
Thanks again Eoin. Please note the master branch on your Github repository seems to contain some important recent fixes. Please consider releasing a new version of your plugin ASAP.
The first error with no spaces around the commas are:
Line 1 [{$a->oplabel}]: Too few columns, expecting 5. Skipped.
Line 2 [Add]: Fields cannot be blank: block ( carlresources), course ($a->coursename), region ($a->region), weight ($a->weight). Skipped.
Line 3 [Add]: Fields cannot be blank: block ( carlresources), course ($a->coursename), region ($a->region), weight ($a->weight). Skipped.
When I add a space after the commas, I get this error:
Line 1 [{$a->oplabel}]: Too few columns, expecting 5. Skipped.
Line 2 [Add]: Course " AFST100-00-f20" not found. Skipped.
Line 3 [Add]: Course " AFST400-00-f20" not found. Skipped.
Line 4 [Add]: Course " AMST115-00-f20" not found. Skipped.
Line 5 [Add]: Course " AMST225-00-f20" not found. Skipped.
I don't see a way to attached a file here, but I did attempt to find hidden characters in a plain text editor. Here is a sample of what I'm attempting to use. The block is one that I've made for our own instance.
add,AFST100-00-f20,carlresources,side-post,0
add,AFST400-00-f20,carlresources,side-post,0
add,AMST115-00-f20,carlresources,side-post,0
add,AMST225-00-f20,carlresources,side-post,0
add,AMST256-00-f20,carlresources,side-post,0
add,AMST398-00-f20,carlresources,side-post,0
add,ARBC101-01-f20,carlresources,side-post,0