Your Community is getting an upgrade!
Read about our partnership with Higher Logic and how we will build the next generation of the Instructure Community.
Found this content helpful? Log in or sign up to leave a like!
There appears to be a limit to the number of custom columns that can be shown in the gradebook. I have created a set of custom columns to be used to keep administrative information about thesis projects, but only the first 10 are showing up in the gradebook via the GUI. However, the rest are there as can be confirmed via the API. Is it possible to change this limit?
The custom columns are:
[{'position': 1, 'teacher_notes': False, 'id': 21, 'title': 'Course_code', 'hidden': False}, {'position': 2, 'teacher_notes': False, 'id': 19, 'title': 'Examiner', 'hidden': False}, {'position': 3, 'teacher_notes': False, 'id': 20, 'title': 'Supervisor', 'hidden': False}, {'position': 4, 'teacher_notes': False, 'id': 22, 'title': 'Planned_start_date', 'hidden': False}, {'position': 5, 'teacher_notes': False, 'id': 23, 'title': 'Tenative_title', 'hidden': False}, {'position': 6, 'teacher_notes': False, 'id': 24, 'title': 'KTH_unit', 'hidden': False}, {'position': 7, 'teacher_notes': False, 'id': 25, 'title': 'Company', 'hidden': False}, {'position': 8, 'teacher_notes': False, 'id': 26, 'title': 'Outside_Sweden', 'hidden': False}, {'position': 9, 'teacher_notes': False, 'id': 27, 'title': 'Other_university', 'hidden': False}, {'position': 10, 'teacher_notes': False, 'id': 28, 'title': 'External_Contact', 'hidden': False}, {'position': 11, 'teacher_notes': False, 'id': 29, 'title': 'GA_Approval', 'hidden': False}, {'position': 12, 'teacher_notes': False, 'id': 30, 'title': 'Ladok_Registration_start', 'hidden': False}, {'position': 13, 'teacher_notes': False, 'id': 31, 'title': 'Ladok_Registration_Final', 'hidden': False}, {'position': 14, 'teacher_notes': False, 'id': 32, 'title': 'DiVA_URN', 'hidden': False}]
Note that there will be other columns for assignments, but this is the basic information that needs to be kept track of - without it being visible to the student or other students in the same course.
Solved! Go to Solution.
the source code file to change is ./lib/api.rb where it says:
def self.per_page
Setting.get('api_per_page', '10').to_i
end
change to 20 for example:
def self.per_page
Setting.get('api_per_page', '20').to_i
end
Once can see that works successfully by looking at the output after this change:
To verify that the problem is really due to a limit about which custom columns are displayed, I made a simple program to set a given column_id to be hidden. (Details and code at Setting a custom column to be hidden: Chip sandbox .) The result of hiding column_id = 28 is
This demonstrates that the problem is due to a fixed number of columns being shown by the GUI.
Curiously, you can toggle on and off the (Teacher's) notes column without affecting the custom columns that are displayed:
Toggling column 28 to be visible again produces:
I have been able to track this down to the fact that the return value from the call to the API: /api/v1/courses/1586/custom_gradebook_columns is paginated, but the system seems not to be processing the next page of results!
One can even see this via the doc/api/live response to:
https://kth.instructure.com:443/api/v1/courses/1586/custom_gradebook_columns
Where the response shows only:
[ { "id": 34, "title": "Notes", "position": 1, "teacher_notes": true, "hidden": false }, { "id": 21, "title": "Course_code", "position": 2, "teacher_notes": false, "hidden": false }, { "id": 19, "title": "Examiner", "position": 3, "teacher_notes": false, "hidden": false }, { "id": 20, "title": "Supervisor", "position": 4, "teacher_notes": false, "hidden": false }, { "id": 22, "title": "Planned_start_date", "position": 5, "teacher_notes": false, "hidden": false }, { "id": 23, "title": "Tenative_title", "position": 6, "teacher_notes": false, "hidden": false }, { "id": 24, "title": "KTH_unit", "position": 7, "teacher_notes": false, "hidden": false }, { "id": 25, "title": "Company", "position": 8, "teacher_notes": false, "hidden": false }, { "id": 26, "title": "Outside_Sweden", "position": 9, "teacher_notes": false, "hidden": false }, { "id": 27, "title": "Other_university", "position": 10, "teacher_notes": false, "hidden": false }]
200
Looing at the response headers, one can see
"Link": "; rel=\"current\",; rel=\"next\",; rel=\"first\",; rel=\"last\"",
Using python code to make the call (the first lines below are the columns from the next part of the paginated response):
('getting paginated custom_gradebook_columns: '
'[{"id":29,"title":"GA_Approval","position":11,"teacher_notes":false,"hidden":false},{"id":28,"title":"External_Contact","position":12,"teacher_notes":false,"hidden":false},{"id":32,"title":"DiVA_URN","position":14,"teacher_notes":false,"hidden":false},{"id":67,"title":"TRITA '
'number","position":15,"teacher_notes":false,"hidden":false},{"id":69,"title":"Student_approves_fulltext","position":17,"teacher_notes":false,"hidden":false},{"id":70,"title":"Ladok_Final_grade_entered","position":18,"teacher_notes":false,"hidden":false},{"id":71,"title":"Oral '
'proposal","position":19,"teacher_notes":false,"hidden":false}]')
Here are all the columns:
[{'teacher_notes': True, 'position': 1, 'id': 34, 'title': 'Notes', 'hidden': False}, {'teacher_notes': False, 'position': 2, 'id': 21, 'title': 'Course_code', 'hidden': False}, {'teacher_notes': False, 'position': 3, 'id': 19, 'title': 'Examiner', 'hidden': False}, {'teacher_notes': False, 'position': 4, 'id': 20, 'title': 'Supervisor', 'hidden': False}, {'teacher_notes': False, 'position': 5, 'id': 22, 'title': 'Planned_start_date', 'hidden': False}, {'teacher_notes': False, 'position': 6, 'id': 23, 'title': 'Tenative_title', 'hidden': False}, {'teacher_notes': False, 'position': 7, 'id': 24, 'title': 'KTH_unit', 'hidden': False}, {'teacher_notes': False, 'position': 8, 'id': 25, 'title': 'Company', 'hidden': False}, {'teacher_notes': False, 'position': 9, 'id': 26, 'title': 'Outside_Sweden', 'hidden': False}, {'teacher_notes': False, 'position': 10, 'id': 27, 'title': 'Other_university', 'hidden': False}, {'teacher_notes': False, 'position': 11, 'id': 29, 'title': 'GA_Approval', 'hidden': False}, {'teacher_notes': False, 'position': 12, 'id': 28, 'title': 'External_Contact', 'hidden': False}, {'teacher_notes': False, 'position': 14, 'id': 32, 'title': 'DiVA_URN', 'hidden': False}, {'teacher_notes': False, 'position': 15, 'id': 67, 'title': 'TRITA number', 'hidden': False}, {'teacher_notes': False, 'position': 17, 'id': 69, 'title': 'Student_approves_fulltext', 'hidden': False}, {'teacher_notes': False, 'position': 18, 'id': 70, 'title': 'Ladok_Final_grade_entered', 'hidden': False}, {'teacher_notes': False, 'position': 19, 'id': 71, 'title': 'Oral proposal', 'hidden': False}]
So it would see that the doc/api/live and code that gets the columns of the gradebook to feed to the rendering of the GUI fail to handle a paginated response!
the source code file to change is ./lib/api.rb where it says:
def self.per_page
Setting.get('api_per_page', '10').to_i
end
change to 20 for example:
def self.per_page
Setting.get('api_per_page', '20').to_i
end
Once can see that works successfully by looking at the output after this change:
To interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign InTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign In