Esempio n. 1
0
<?php

require_once "../../config.php";
require_once $CFG->dirroot . "/pdo.php";
require_once $CFG->dirroot . "/lib/lms_lib.php";
use Tsugi\Core\LTIX;
use Tsugi\Util\LTI;
use Tsugi\Util\Mersenne_Twister;
require_once "sql_util.php";
$LTI = LTIX::requireData();
// Compute the stuff for the output
$code = $USER->id + $LINK->id + $CONTEXT->id;
header('Content-Disposition: attachment; filename="roster_data.json"');
header('Content-Type: application/json; charset=utf-8');
$roster = makeRoster($code);
echo jsonIndent(json_encode($roster));
Esempio n. 2
0
<?php

use Tsugi\Core\LTIX;
use Tsugi\Util\LTI;
use Tsugi\Util\Mersenne_Twister;
$MAX_UPLOAD_FILE_SIZE = 1024 * 1024;
require_once "sql_util.php";
$oldgrade = $RESULT->grade;
// Compute the stuff for the output
$code = $USER->id + $LINK->id + $CONTEXT->id;
$roster = makeRoster($code, 3, 5);
function compare_func($a, $b)
{
    // Course
    if ($a[1] < $b[1]) {
        return -1;
    }
    if ($a[1] > $b[1]) {
        return 1;
    }
    // Role (1 comes first)
    if ($a[2] < $b[2]) {
        return 1;
    }
    if ($a[2] > $b[2]) {
        return -1;
    }
    // User
    if ($a[0] < $b[0]) {
        return -1;
    }