Index: moodle/mod/choice/lang/en/choice.php
--- moodle/mod/choice/lang/en/choice.php Base (1.11)
+++ moodle/mod/choice/lang/en/choice.php Locally Modified (Based On 1.11)
@@ -52,6 +52,7 @@
 $string['choice:readresponses'] = 'Read responses';
 $string['choicesaved'] = 'Your choice has been saved';
 $string['choicetext'] = 'Choice text';
+$string['chooseaction'] = 'Choose an action ...';
 $string['limit'] = 'Limit';
 $string['limitanswers'] = 'Limit the number of responses allowed';
 $string['modulename'] = 'Choice';
Index: moodle/mod/choice/lib.php
--- moodle/mod/choice/lib.php Base (1.141)
+++ moodle/mod/choice/lib.php Locally Modified (Based On 1.141)
@@ -221,19 +221,22 @@
             }
             if ( $choice->limitanswers && ($option->countanswers >= $option->maxanswers) && empty($option->attributes->checked)) {
                 $option->attributes->disabled = true;
-                }
-            $cdisplay['options'][] = $option;
             }
+            $cdisplay['options'][] = $option;
         }
+    }

-    $cdisplay['hascapability'] = is_enrolled($context, NULL, 'mod/choice:choose'); //only enrolled users are allowed to make a choice
+    //only enrolled users are allowed to make a choice
+    if (is_enrolled($context, NULL, 'mod/choice:choose') || has_capability('mod/choice:choose', $context, $user)) {
+        $cdisplay['hascapability'] = true;
+    }

     if ($choice->allowupdate && $DB->record_exists('choice_answers', array('choiceid'=> $choice->id, 'userid'=> $user->id))) {
         $cdisplay['allowupdate'] = true;
-                }
+    }

     return $cdisplay;
-                    }
+}

 /**
  * @global object
@@ -358,7 +361,7 @@
         $display->options[$optionid]->maxanswer = $choice->maxanswers[$optionid];

         if (array_key_exists($optionid, $allresponses)) {
-            $display->options[$optionid]->user = $allresponses[$optionid]; //->user;
+            $display->options[$optionid]->user = $allresponses[$optionid];
             $totaluser += count($allresponses[$optionid]);
         }
     }
@@ -841,7 +844,7 @@
     $choice = $DB->get_record('choice', array('id'=>$cm->instance), '*',
             MUST_EXIST);

-    // If completion option is enabled, evaluate it and return true/false
+    // If completion option is enabled, evaluate it and return true/false
     if($choice->completionsubmit) {
         return $DB->record_exists('choice_answers', array(
                 'choiceid'=>$choice->id, 'userid'=>$userid));
Index: moodle/mod/choice/renderer.php
--- moodle/mod/choice/renderer.php Base (1.4)
+++ moodle/mod/choice/renderer.php Locally Modified (Based On 1.4)
@@ -122,9 +122,14 @@
         $html .= html_writer::tag('h2',format_string(get_string("responses", "choice")), array('class'=>'main'));

         $attributes = array('method'=>'POST');
-        $attributes['action'] = new moodle_url('/mod/choice/view.php');
         $attributes['id'] = 'attemptsform';

+        if (!empty($choices->url)) {
+            $attributes['action'] = $choices->url;
+        } else {
+            $attributes['action'] = new moodle_url('/mod/choice/view.php');
+        }
+
         if ($choices->viewresponsecapability) {
             $html .= html_writer::start_tag('form', $attributes);
             $html .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'id', 'value'=> $choices->coursemoduleid));
@@ -214,7 +219,7 @@
             $actiondata .= html_writer::tag('label', ' ' . get_string('withselected', 'quiz') . ' ', array('for'=>'menuaction'));

             $actionurl = new moodle_url('/mod/choice/view.php', array('sesskey'=>sesskey(), 'action'=>'delete_confirmation()'));
-            $select = new single_select($actionurl, 'action', array('delete'=>get_string('delete')), null, array(''=>get_string('moveselectedusersto', 'choice')), 'attemptsform');
+            $select = new single_select($actionurl, 'action', array('delete'=>get_string('delete')), null, array(''=>get_string('chooseaction', 'choice')), 'attemptsform');

             $actiondata .= $this->output->render($select);
         }
Index: moodle/mod/choice/report.php
--- moodle/mod/choice/report.php Base (1.83)
+++ moodle/mod/choice/report.php Locally Modified (Based On 1.83)
@@ -2,6 +2,7 @@

     require_once("../../config.php");
     require_once("lib.php");
+    require_once($CFG->libdir . '/completionlib.php');

     $id         = required_param('id', PARAM_INT);   //moduleid
     $format     = optional_param('format', CHOICE_PUBLISH_NAMES, PARAM_INT);
@@ -47,7 +48,7 @@

     if (data_submitted() && $action == 'delete' && has_capability('mod/choice:deleteresponses',$context) && confirm_sesskey()) {
         choice_delete_responses($attemptids, $choice, $cm, $course); //delete responses.
-        redirect("report.php?id=$cm->id");
+        redirect($PAGE->url);
     }

     if (!$download) {
@@ -217,9 +218,10 @@
     }

     $results = prepare_choice_show_results($choice, $course, $cm, $users);
+    $results->url = $PAGE->url;
     $renderer = $PAGE->get_renderer('mod_choice');
     echo $renderer->display_result($results, has_capability('mod/choice:readresponses', $context));
-
+
    //now give links for downloading spreadsheets.
     if (!empty($users) && has_capability('mod/choice:downloadresponses',$context)) {
         $downloadoptions = array();
Index: moodle/mod/choice/view.php
--- moodle/mod/choice/view.php Base (1.143)
+++ moodle/mod/choice/view.php Locally Modified (Based On 1.143)
@@ -7,6 +7,7 @@
     $id         = required_param('id', PARAM_INT);                 // Course Module ID
     $action     = optional_param('action', '', PARAM_ALPHA);
     $attemptids = optional_param('attemptid', array(), PARAM_INT); // array of attempt ids for delete action
+    $userenrollnotice = false;

     $url = new moodle_url('/mod/choice/view.php', array('id'=>$id));
     if ($action !== '') {
@@ -35,7 +36,8 @@
         print_error('badcontext');
     }

-    if ($action == 'delchoice' and confirm_sesskey() and is_enrolled($context, NULL, 'mod/choice:choose') and $choice->allowupdate) {
+    if ($action == 'delchoice' && confirm_sesskey() &&
+       ((is_enrolled($context, NULL, 'mod/choice:choose') && $choice->allowupdate) || has_capability('mod/choice:deleteresponses', $context))) {
         if ($answer = $DB->get_record('choice_answers', array('choiceid' => $choice->id, 'userid' => $USER->id))) {
             $DB->delete_records('choice_answers', array('id' => $answer->id));

@@ -51,27 +53,26 @@
     $PAGE->set_heading($course->fullname);

 /// Submit any new data if there is any
-    if ($form = data_submitted() && is_enrolled($context, NULL, 'mod/choice:choose') && confirm_sesskey()) {
-        $timenow = time();
-        if (has_capability('mod/choice:deleteresponses', $context)) {
-            if ($action == 'delete') { //some responses need to be deleted
-                choice_delete_responses($attemptids, $choice, $cm, $course); //delete responses.
-                redirect("view.php?id=$cm->id");
-            }
-        }
-        $answer = optional_param('answer', '', PARAM_INT);
+    $notification = null;
+    if ($form = data_submitted() && confirm_sesskey()) {
+        if (is_enrolled($context, NULL, 'mod/choice:choose')) {
+            $answer = optional_param('answer', '', PARAM_INT);

-        if (empty($answer)) {
-            redirect("view.php?id=$cm->id", get_string('mustchooseone', 'choice'));
+            if (empty($answer)) {
+                redirect($PAGE->url, get_string('mustchooseone', 'choice'));
+            } else {
+                choice_user_submit_response($answer, $choice, $USER->id, $course, $cm);
+            }
+            $notification = get_string('choicesaved', 'choice');
         } else {
-            choice_user_submit_response($answer, $choice, $USER->id, $course, $cm);
+            $userenrollnotice = true;
         }
-        echo $OUTPUT->header();
-        echo $OUTPUT->notification(get_string('choicesaved', 'choice'),'notifysuccess');
-    } else {
-        echo $OUTPUT->header();
     }

+    echo $OUTPUT->header();
+    if (!empty($notification)) {
+        echo $OUTPUT->notification($notification,'notifysuccess');
+    }

 /// Display the choice and possibly results
     add_to_log($course->id, "choice", "view", "view.php?id=$cm->id", $choice->id, $cm->id);
@@ -92,6 +93,15 @@

     echo '<div class="clearer"></div>';

+    if ($userenrollnotice) {
+        echo $OUTPUT->box_start('generalbox', 'notice');
+        echo '<p align="center">'. get_string('notenrolledchoose', 'choice') .'</p>';
+        echo $OUTPUT->container_start('continuebutton');
+        echo $OUTPUT->single_button(new moodle_url('/enrol/index.php?', array('id'=>$course->id)), get_string('enrolme', 'core_enrol', format_string($course->shortname)));
+        echo $OUTPUT->container_end();
+        echo $OUTPUT->box_end();
+    }
+
     if ($choice->intro) {
         echo $OUTPUT->box(format_module_intro('choice', $choice, $cm->id), 'generalbox', 'intro');
     }
@@ -117,8 +127,9 @@
         }
     }

-    if ( (!$current or $choice->allowupdate) and $choiceopen and is_enrolled($context, NULL, 'mod/choice:choose')) {
-    // They haven't made their choice yet or updates allowed and choice is open
+    if ( (!$current or $choice->allowupdate) && $choiceopen &&
+         (is_enrolled($context, NULL, 'mod/choice:choose') || has_capability('mod/choice:choose', $context))) {
+        // They haven't made their choice yet or updates allowed and choice is open

         $options = choice_prepare_options($choice, $USER, $cm, $allresponses);
         $renderer = $PAGE->get_renderer('mod_choice');
@@ -135,7 +146,7 @@
             // Guest account
             echo $OUTPUT->confirm(get_string('noguestchoose', 'choice').'<br /><br />'.get_string('liketologin'),
                          get_login_url(), new moodle_url('/course/view.php', array('id'=>$course->id)));
-        } else if (!is_enrolled($context)) {
+        } else if (!is_enrolled($context) && !has_capability('mod/choice:choose', $context)) {
             // Only people enrolled can make a choice
             $SESSION->wantsurl = $FULLME;
             $SESSION->enrolcancel = (!empty($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : '';
