In version 1.8 I’ve added support for adding custom fields to an assignment, If you’ve ever felt the need to add more details for an assignment, you can now do it.
Here’s an example of an assignment with four extra properties:
This assignment has four custom properties:
- String Value: A simple one line of text.
- MultiString: A text value over multiple lines.
- Choice: A drop down list of values.
- Url: A url.
Here’s the student view of the same assignment:
The implementation is based on storing the custom properties in a list on the site the assignment is assigned to. You configure the name of the list in the SLK settings, then SLK will look for a list of that name in the site. If it finds it, then it adds the columns in the default view as custom properties.
The name of the property is the name of the column and the columns types supported are:
- Single line of text
- Multiple lines of text
These will be rendered as above, with the url type rendered as a url to the student. All other column types will be ignored, as will the Title property.
If there isn’t a list in the site with the configured title, then assignments for that site won’t have any custom properties. This allows you to have different custom properties for each site.
If the column is marked as required in the list, then the custom property will be required.
SLK will handle access to the list so you don’t need to give your users permissions to access it, in fact it’s probably preferable for them not to have access to it directly.
The ordering of the custom properties is controlled by the order of the columns in the view. So if I change the view to:
then the student view will be
and the instructor view will change similarly.
To set up and enable custom properties:
Download and install the latest version of SLK 1.8.
Set the name of the list which will hold the properties in SlkSettings.xml and update it in Central Administration. This is set in the CustomPropertyList attribute on the root Settings element.
Here it will look for a list called SLK in the assignment’s site.
Then create the lists in each of the sites where you want the assignments to have custom properties. Add a column to the list and default view for each custom property you want, and order the view to get the desired display order. Set required on any columns that you want to be required.
And that’s it, from now on the custom properties will be added to every assignment in those sites with appropriate lists.