Example #1
0
    include $assn;
    return;
}
// View
$OUTPUT->header();
$OUTPUT->bodyStart();
// Settings button and dialog
echo '<span style="position: fixed; right: 10px; top: 5px;">';
if ($USER->instructor) {
    echo '<a href="grades.php" target="_blank"><button class="btn btn-info">Grade detail</button></a> ' . "\n";
}
SettingsForm::button();
$OUTPUT->exitButton();
echo '</span>';
SettingsForm::start();
SettingsForm::select("exercise", __('Please select an assignment'), $assignments);
SettingsForm::dueDate();
SettingsForm::done();
SettingsForm::end();
$OUTPUT->flashMessages();
$OUTPUT->welcomeUserCourse();
if ($assn && isset($assignments[$assn])) {
    include $assn;
} else {
    if ($USER->instructor) {
        echo "<p>Please use settings to select an assignment for this tool.</p>\n";
    } else {
        echo "<p>This tool needs to be configured - please see your instructor.</p>\n";
    }
}
$OUTPUT->footer();
Example #2
0
echo getLocalStatic(__FILE__);
?>
/static/prism.css" rel="stylesheet"/>
<?php 
$OUTPUT->bodyStart();
$OUTPUT->flashMessages();
if ($USER->instructor) {
    SettingsForm::start();
    SettingsForm::dueDate();
    SettingsForm::done();
    SettingsForm::end();
}
$OUTPUT->welcomeUserCourse();
if ($USER->instructor) {
    echo '<p><a href="configure.php" class="btn btn-default">Configure this Assignment</a> ';
    SettingsForm::button();
    echo '<a href="admin.php" class="btn btn-default">Explore Grade Data</a> ';
    echo '<a href="maint.php" target="_new" class="btn btn-default">Grade Maintenance</a> ';
    echo '<a href="debug.php" class="btn btn-default">Session Dump</a></p>';
}
if ($assn_json != null) {
    echo '<div style="border: 1px solid black">';
    echo "<p><h4>" . $assn_json->title . "</h4></p>\n";
    echo '<p>' . htmlent_utf8($assn_json->description) . "</p>\n";
    echo '</div>';
}
if ($assn_json == null) {
    echo '<p>This assignment is not yet configured</p>';
    $OUTPUT->footer();
    return;
}
Example #3
0
}
?>
<?php echo($QTEXT); ?>
</div>
<form id="forminput">
<?php
    if ( $EX !== false ) {
        echo('<button onclick="runit()" class="btn btn-primary" type="button">Check Code</button>'."\n");
    } else {
        echo('<button onclick="runit()" class="btn btn-primary" type="button">Run Python</button>'."\n");
    }
    if ( strlen($CODE) > 0 ) {
        echo('<button onclick="resetcode()" class="btn btn-default" type="button">Reset Code</button> ');
    }
    echo('<button onclick="$(\'#info\').modal();return false;" class="btn btn-default" type="button"><span class="glyphicon glyphicon-info-sign"></span></button>'."\n");
    if ( $USER->instructor ) SettingsForm::button();
    $OUTPUT->exitButton();
    if ( $USER->instructor ) {
        if ( $EX === false ) {
            echo(' <a href="grades.php" class="btn btn-default" target="_blank">View Student Code</a>'."\n");
        } else {
            echo(' <a href="grades.php" class="btn btn-default" target="_blank">View Grades</a>'."\n");
        }
    }
?>
<img id="spinner" src="static/spinner.gif" style="vertical-align: middle;display: none">
<span id="redo" style="color:red;display:none"> Please correct your code and re-run. </span>
<span id="complete" style="color:green;display:none"> Execution complete. </span>
<span id="gradegood" style="color:green;display:none"> Grade updated on server. </span>
<span id="gradelow" style="color:green;display:none"> Grade updated on server. </span>
<span id="gradebad" style="color:red;display:none"> Error storing grade on server. </span>
Example #4
0
<?php

require_once $CFG->dirroot . "/pdo.php";
require_once $CFG->dirroot . "/lib/lms_lib.php";
require_once $CFG->dirroot . "/core/gradebook/lib.php";
// A library for webscraping graders
require_once "lib/goutte/vendor/autoload.php";
require_once "lib/goutte/Goutte/Client.php";
use Tsugi\UI\SettingsForm;
use Tsugi\Core\LTIX;
// Get any due date information
$dueDate = SettingsForm::getDueDate();
$penalty = $dueDate->penalty;
if ($dueDate->message) {
    echo '<p style="color:red;">' . $dueDate->message . '</p>' . "\n";
}
function getUrl($sample)
{
    global $USER;
    if (isset($_GET['url'])) {
        echo '<p><a href="#" onclick="window.location.href = window.location.href; return false;">Re-run this test</a></p>' . "\n";
        if (isset($_SESSION['lti'])) {
            $retval = gradeUpdateJson(array("url" => $_GET['url']));
        }
        return $_GET['url'];
    }
    echo '<form>
        Please enter the URL of your web site to grade:<br/>
        <input type="text" name="url" value="' . $sample . '" size="100"><br/>
        <input type="submit" class="btn btn-primary" value="Evaluate">
        </form>';