Tuesday, May 21, 2013

Achievement Items



Hello everyone,  Geoff Goehle here on Mike's blog (again).  I wanted to write a post about a new feature which should be coming to the 
develop branch sometime.  Its the ability for the achievement system to reward students with "items" which they can use to change the parameters of their homework in a limited fashion, i.e. extend a due date or get partial credit on a question. I'll say more about what items are below, and will leave off with a quick description of how they are implemented.  


In the current set-up students get an item every level.  Each level gives a different item and each item can be used once.  Students can see what items they currently have, and use those times, by visiting the existing Achievements page. The below screenshot shows the achievements page in the background (with the updated snazzy math4 theme) and the popup for using an item in the foreground.

The items that students can earn, and a description of what they do follow:
  • Lesser Rod of Revelation - Gives a student an automatic 50% on a single homework problem.
  • Greater Rod of Revelation - Gives a student an automatic 100% on a single homework problem.
  • Box of Transmogrification - Allows a student to change the source file of a single problem to that of a different problem on the same homework set.
  • Potion of Forgetfulness - Resets the incorrect attempts counter to zero for a single problem.
  • Cupcake of Enlargement - Doubles the weight of a single problem on a single homework set (usually from 1 to 2).
  • Ring of Reduction - This uses the reduced credit system to allow a student to extend the due date of a currently open homework set by a certain amount of time (usually 24 hours), but for reduced credit.
  • Tunic of Extension - This allows a student to extend the due date of a currently open homework for 24 hours for full credit.
  • Cake of Enlargement - This doubles the weight of all of the problems on a currently open homework assignment.
  • Scroll of Resurrection - This reopens any homework set (even a closed one) for an additional 24 hours.
  • Mystery Package (with Ribbons) - This simply displays a message to students and can be used to do anything from giving away physical rewards to simply saying congratulations.
There are a couple of ideas driving this feature.  The primary one is that it would be nice to reward students for leveling.  Since we cannot simply "give" them additional mathematical ability an alternative is to instead give them the ability to affect their grade/homework in some way.  I had been using a simple extra credit scheme, but this seems more interesting.  Secondly, Webwork can be frustrating for students and, while the net effect of all of these items on a student's grade will be relatively minor, the ability for students to get a little extra time on a particularly tough homework, or to skip a problem that they just can't solve will hopefully go a long ways to alleviating said frustration.  In general (with the exception of the "Rod of Revelation" items) I've tried to make items which encourage students to put extra work into a homework, or reward them for work they have already done.  
Of course, not everyone will want to use this system, which is why it is optional.  Achievement Items will be turned off by default.  In order to turn them on you should enable the achievement system and in the course.conf file set the parameter $achievementItemsEnabled = 1.   In addition you will also need an updated set of level achievements.  These may already be included in the default list, or you may need to download them from here.  (You can tell by clicking the edit icon next to one of the level achievements.  If there is a message about earning an item in the "description" field then you have the latest version.)  This should be enough to get you started with the default setup.  For those interested I will describe more about how the achievement item system works below.
Achievement Items are actually subclasses of the WeBWorK::AchievementItem class.  In order to make an achievement item you need to do four things
  1. Create the subclass and the constructor, including the achievement item ID, the name and the description.  These are all kept in the AchievementItems.pm file.  The name and description can be whatever you want them to be, but the ID should be the same as the name of the subclass.  You also need to to add the ID to the constant list at the beginning of the file.
  2. Create the print_form function.  This outputs all of the fields needed to collect the information needed to use the item.  For example, for the Rod of Revelation item the form prints two dropdowns.  The first is a list of open sets and the second is a list of problem numbers.  The problem numbers are kept in sync with the currently selected set via javascript.
  3. Create the use_item function.  This should use the information gleaned from the forms in the previous function to actually implement whatever the item does.  For the Rod of Revelation it simply calls up the appropriate userProblem object and sets the score.   In addition this is where you "remove" the item from the students "inventory".  The system uses the hash in the globalUserAchievement object to keep track of what items a student has.  A student has an item if the $globalData{"Item ID"} is set to one.  The use_item function should set it back to zero.
  4. Choose how the item gets rewarded.  Generally this will be through an achievement, either a level or a normal achievement.  All you need to do is set $globalData{"Item ID"} to be 1 in the achievement code.  You should also change the description to let the student know they earned an item.
Unfortunately, as you can see, right now you need administrator access to create/change achievement items and doing so requires the usual server restart.  If there is interest then a possible future project would be to modify the system so that achievement items are defined using files stored in the templates folder and as such would be editable by instructors on a per course basis.  There are also other possibilities.  Achievements Items could be set up to have multiple uses and there is definitely room for clever/interesting ideas for new items.  

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.