Exemple #1
0
include '../../../../config.php';
global $CFG, $USER;
$cmid = required_param('cmid', PARAM_INT);
$ids = required_param('ids', PARAM_INT);
$cm = get_coursemodule_from_id('emarking', $cmid);
if (!$cm) {
    throw new Exception("Invalid cm");
}
include $CFG->dirroot . '/mod/emarking/crowd/crowdlib.php';
$context = context_module::instance($cm->id);
$crowdmod = new emarking_crowd($cm, $context);
$icanmarkhere = true;
$delphiactive = false;
if ($crowdmod->is_active()) {
    $delphiactive = true;
    if (!$crowdmod->is_mine()) {
        $icanmarkhere = false;
    }
    $mysub = $crowdmod->get_my_correct_submissionid($ids);
}
include_once $CFG->dirroot . '/mod/emarking/crowd/vendor/FirebaseToken.php';
//Esto es temporal para el experimento de la Prueba 1
$secret = isset($CFG->emarking_crowdexperiment_rtm_secret) ? $CFG->emarking_crowdexperiment_rtm_secret : "";
$appid = isset($CFG->emarking_crowdexperiment_rtm_appid) ? $CFG->emarking_crowdexperiment_rtm_appid : "";
$rtmtoken = null;
$loggedIn = false;
if (isloggedin()) {
    $loggedIn = true;
    if (strlen($secret) > 5 && strlen($appid) > 5) {
        $expire = 0;
        if (isset($_SESSION[$USER->sesskey . "rtmtoken" . $crowdmod->get_parent_id()])) {