$paramone = optional_param('paramone', "", PARAM_TEXT);
// nature of value depends on datatype, maybe path
$paramtwo = optional_param('paramtwo', "", PARAM_TEXT);
// nature of value depends on datatype, maybe protocol
$paramthree = optional_param('paramthree', "", PARAM_TEXT);
// nature of value depends on datatype, maybe filearea
switch ($datatype) {
    case "xmlpairs":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = fetch_xmlpairs($courseid);
        break;
    case "unassignedusers":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = fetch_unassigned_users(5, $courseid, null);
        break;
    case "offlineusers":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = "";
        break;
    case "courseusers":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = fetch_course_users($courseid);
        break;
    case "coursemenu":
        header("Content-type: text/xml");
        echo "<?xml version=\"1.0\"?>\n";
        $returnxml = fetch_course_menu($courseid);
Example #2
0
            error("Could not delete PoodLL Pairwork session");
        }
        //fetch all users online from the course containing this module, that have not yet been put into a pair session
        $users = fetch_unassigned_users($ttl, $course->id, $context);
        //lets init our oairs array.
        $pairs = array();
        break;
        //clear an individual pair from a session
    //clear an individual pair from a session
    case 'clearpair':
        if ($pairid != '0') {
            $pairid = trim($pairid);
            delete_records_select('poodllpairwork_usermap', " username = '******' AND course = {$course->id} ");
            delete_records_select('poodllpairwork_usermap', " partnername = '{$pairid}' AND course = {$course->id}");
            //if (!(delete_records_select('poodllpairwork_usermap', " username = '******' ") &&
            //			delete_records_select('poodllpairwork_usermap', " partnername = '$pairid' "))){
            //       error ("Could not delete pair");
            //}
        }
        //fetch our updated pairs array
        $pairs = fetch_pairs($course->id);
        //fetch all users online from the course containing this module, that have not yet been put into a pair session
        $users = fetch_unassigned_users($ttl, $course->id, $context);
        break;
    case 'refreshsession':
    default:
        //fetch our pairs array
        $pairs = fetch_pairs($course->id);
        //fetch all users online from the course containing this module, that have not yet been put into a pair session
        $users = fetch_unassigned_users($ttl, $course->id, $context);
}