Index: mod/choice/report.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/choice/report.php,v
retrieving revision 1.60.2.8
diff -u -r1.60.2.8 report.php
--- mod/choice/report.php	30 Nov 2009 17:12:18 -0000	1.60.2.8
+++ mod/choice/report.php	21 Jun 2010 14:10:14 -0000
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php  // $Id: report.php,v 1.60.2.6 2009-02-09 09:26:47 danmarsden Exp $
 
     require_once("../../config.php");
     require_once("lib.php");
@@ -6,7 +6,7 @@
     $id         = required_param('id', PARAM_INT);   //moduleid
     $format     = optional_param('format', CHOICE_PUBLISH_NAMES, PARAM_INT);
     $download   = optional_param('download', '', PARAM_ALPHA);
-    $action     = optional_param('action', '', PARAM_ALPHA);
+    $action     = optional_param('action', '', PARAM_ALPHANUM);
     $attemptids = optional_param('attemptid', array(), PARAM_INT); //get array of responses to delete.
 
     if (! $cm = get_coursemodule_from_id('choice', $id)) {
@@ -38,8 +38,14 @@
         redirect("report.php?id=$cm->id");
     }
         
-    if (!$download) {
+    // Move selected responses to new option
+    if (preg_match('/^\d+$/', $action, $matches) && has_capability('mod/choice:deleteresponses',$context)) {
+        $attemptids = isset($_POST['attemptid']) ? $_POST['attemptid'] : array(); //get array of repsonses to move.
+        choice_move_responses($attemptids, $choice->id, $matches[0]); //move responses.
+        redirect("report.php?id=$cm->id");
+    }
 
+    if (!$download) {
         $navigation = build_navigation($strresponses, $cm);
         print_header_simple(format_string($choice->name).": $strresponses", "", $navigation, "", '', true,
                   update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
@@ -225,4 +231,4 @@
     }
     print_footer($course);
 
-?>
\ No newline at end of file
+?>
