示例#1
0
	$('#code').height($ih - ($ct - $it)-15);$
} );
</script>
</head>
<body>
<div style="padding: 0px 15px 0px 15px;">
<div id="inputs" style="height:300px; min-height:200px;">
<div class="well">
<?php 
echo $QTEXT;
?>
</div>
<form style="height:100%;">
<button onclick="runit()" type="button">Check Code</button>
<?php 
if ($context->valid && $context->getOutcomeService() !== false) {
    ?>
<button id="grade" onclick="gradeit()" type="button" style="display:none">Submit Grade</button>
<?php 
}
if (!$context->valid && isset($_GET["done"])) {
    $url = $_GET['done'];
    echo "<button onclick=\"window.location='{$url}';\" type=\"button\">Done</button>\n";
}
?>
<img id="spinner" src="dist/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="check" style="color:green;display:none"> Congratulations the exercise is complete. </span>
<span id="gradegood" style="color:green;display:none"> Grade Updated. </span>
<span id="gradebad" style="color:red;display:none"> Error storing grade. </span>
<br/>
示例#2
0
<?php

require_once "setup.php";
// Load up the LTI Support code
require_once 'util/lti_util.php';
session_start();
// Initialize, no secret, pull from session, and do not redirect
$context = new BLTI(false, true, false);
if (!$context->valid) {
    echo json_encode(array("status" => "failure", "detail" => "No context in session"));
    return;
}
$endpoint = $context->getOutcomeService();
if ($endpoint === false) {
    echo json_encode(array("status" => "failure", "detail" => "No grade service available"));
    return;
}
$sourcedid = $context->getOutcomeSourceDID();
if ($sourcedid === false) {
    echo json_encode(array("status" => "failure", "detail" => "No grade entry available"));
    return;
}
if (isset($_SESSION['oauth_consumer_key']) && isset($_SESSION['oauth_consumer_secret'])) {
    $oauth_consumer_key = $_SESSION['oauth_consumer_key'];
    $oauth_consumer_secret = $_SESSION['oauth_consumer_secret'];
} else {
    echo json_encode(array("status" => "failure", "detail" => "No key/secret in session"));
    return;
}
$method = "POST";
$content_type = "application/xml";