protected function display_associate_prompt(&$mform, $usage_id, $associated_user, $enrolled_students)
 {
     global $DB;
     //if a user is associated, display their name, and allow for disassociation
     if ($associated_user !== false) {
         //get the user's name
         // TODO: get rid of this dependency?
         $username = quiz_papercopy_report::get_user_name($associated_user);
         //and output the disassociation prompt
         $mform->addElement('html', $username);
     } else {
         //and display a list of names to select
         $mform->addElement('select', 'associate[' . $usage_id . ']', '', $enrolled_students);
     }
 }
                    exit;
                }
            }
            // If the pre-render option is set, then begin executing the "interactive pre-renderer", which
            // updates the user on progress instead of sending the rendered file. The file can then be downloaded later.
            // (This is excellent for starting a long render operation from a mobile phone.)
            if ($prerender) {
                // Compose the URL at which this page is located...
                $url = quiz_papercopy_report::get_paper_copy_url(array('id' => $cm_id, 'batch' => $batch_id, 'mode' => $batch_mode, 'prerender' => '1'));
                // ... and inform the page's renderer. Note that the pre-renderer does not use the render-to-PDF theme
                $PAGE->set_url($url) . $printer->interactive_prerender($batch_id, $batch_mode, true);
                // Once pre-render has completed, abort; so we do not continue to the render-to-pdf theme.
                // TODO: force this to the
                exit;
            } else {
                $PAGE->set_url(quiz_papercopy_report::get_paper_copy_url(array('id' => $cm_id, 'batch' => $batch_id, 'mode' => $batch_mode, 'prerender' => '0')));
                //print the entire batch
                $printer->print_batch($batch_id, $batch_mode, $as_zip, false);
                exit;
            }
            //if we just finished printing a zip,
            if ($as_zip) {
                exit;
            }
        } else {
            throw new moodle_exception('missingparam', 'error', '', 'usage');
        }
    }
} else {
    //if neither was provided, throw a missing parameter error
    throw new moodle_exception('missingparam', 'error', '', 'id');