SharePoint Learning Kit : Limit Assignments Shown to This Year's Assignments

14 June, 2009 · 1 minute to read

SharePoint Learning Kit : Limit Assignments Shown to This Year's Assignments

By default the SLK Assignment List Web Part shows all assignments ever associated with a learner or instructor. Now that schools are starting to get to the point where they will have been using it for more than one academic year, they do not want the previous year’s assignments showing.

Fortunately there is a built in way in SLK to handle this. The items shown in the web part are completely configurable and are described in the SlkSettings.xml file associated with a site collection.

As an example let’s view the web part for a test instructor.

slkDateBefore

As you can see he has 8 active assignments. Now we decide that we want to only display assignments which have a start date greater than 01 June 2009.

So first of all we download the SlkSettings.xml through the "Configure SharePoint Learning Kit" page in central administration, change it and then upload it again (click for a larger view).

configureSlk

The change you need to make is to add the following line to the ActiveInstructor query.

<Condition ViewColumnName="AssignmentStartDate" Operator="GreaterThan" Value="2009-06-01" />

The image shows where it should go (click for a larger view).

slkDateSettings

What this does is add a new condition to the query so that it only brings back assignments whose start date is greater than the Value. You need to use the start date rather than the due date because I haven't found a way to bring back assignments with due dates greater than the value, and ones without a due date. If I add a condition for due date in, none of the assignments without a due date are returned. As the start date is a mandatory field this is not a problem.

Once you've made the change and uploaded the new settings file back up, this is what the web part looks like.

slkDateAfter

As you can see the four assignments whose start date were less than 02 June 2009 are not returned. They are still present in the other queries though as so far we have only altered the active query for instructors. To complete the job you will need to add the condition to all the queries for instructors, learners and observers.

Finally, if you would like to display assignments outside of those dates somewhere in your portal, you can have different instances of the web part display different queries by defining custom query sets in the settings file. I'll leave that until another time if there's a demand for it though.

Richard Willis headshot

Written by Richard Willis

Managing Director / Founder

Richard started SalamanderSoft in 2007 after a successful career as a software developer. Wanting to start his own company and with experience in integrating school systems he set out to build the best integration system for schools and to exceed customer expectations. He starting out on his own, doing all the coding, support and sales until finally the growing number of customers meant he needed to start growing the team. He is still heavily involved in coding the core Integration Suite product in addition to running the company and being the first point of contact for prospective customers.

Copyright © 2020 SalamanderSoft Limited