$v ) {
$comments[] = array('name' => $k, 'count' => $v ) ;
}
$arr['comments'] = $comments;
echo(LTI::jsonIndent(json_encode($arr)));
return;
} else if ( strpos($local_path, "known_by_") === 0 ) {
header('Content-Type: text/html');
$code = 12345;
$name = $NAMES[0];
$pieces = preg_split('/[_.]/',$local_path);
if ( count($pieces) == 4 ) {
$where = array_search($pieces[2], $NAMES);
if ( $where !== false ) {
$name = $NAMES[$where];
$code = $where;
} else {
$name = $pieces[2];
$code = 12345;
}
}
?>
People that <?= htmlentities($name) ?> knows
People that knows
This screen randomly changes the height between list items and vanishes
after a while to make sure that you retrieve and process the data
in a Python program rather than simply counting down pressing links, and
doing the assignment without writing a Python program :).
The names are in the same order in the HTML even though they
shift around on the screen visually.
Your Python program can look at the page as long as it likes.
\n");
echo("getCurrentUrl(): ".$CFG->getCurrentUrl()."\n");
echo("LTIX::curPageUrlScript: ".LTIX::curPageUrlScript()."\n");
var_dump($_SERVER);
echo("\n");
return;
}
if ( strlen($local_path) > 0 ) {
echo('File not found '.htmlentities($local_path).'
');
} else {
?>
Data Sources
Test data sources
This application has a number of test data sources for
Python for Informatics: Exploring Information written by
@DrChuck /
www.dr-chuck.com.
This data is set up to be served by a Content Data Network (CDN) product like
CloudFlare to
conserve bandwidth and provide quicker access to a worldwide learner
population. There is a cloud-hosted copy of this data at
py4e-data.dr-chuck.net
that you may be able to use.