<commit_before><?php
// In the top frame, we use cookies for session.
define('COOKIE_SESSION', true);
require_once("config.php");
require_once("pdo.php");
require_once("lib/lms_lib.php");

use \Tsugi\Util\LTI;

session_start();

// We must be an administrator or in developer mode
if ( ! ( isset($_SESSION["admin"]) || $CFG->DEVELOPER )  ) {
    header("Location: index.php");
    return;
}

$key = '12345';
if ( is_string($CFG->DEVELOPER) ) $key = $CFG->DEVELOPER;
$row = $PDOX->rowDie(
    "SELECT secret FROM {$CFG->dbprefix}lti_key WHERE key_key = :DKEY",
    array(':DKEY' => $key));
$secret = $row ? $row['secret'] : false;
if ( $secret === false ) {
    $_SESSION['error'] = 'Developer mode not properly configured';
    header("Location: index.php");
    return;
}

if ( isset($_POST['loginsecret']) ) {
    if ( $_POST['loginsecret'] == $secret ) {
        $_SESSION['developer'] = 'yes';
        header("Location: dev.php");
        return;
    }
    $_SESSION['error'] = 'Incorrect secret';
    header("Location: index.php");
    return;
}

if ( ! isset($_SESSION['developer'] ) ) {
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->topNav();
?>
<p>Please enter the developer password (default is 'secret'):</p>
<form method="post">
<input type="text" name="loginsecret" size="40">
<input type="submit" value="Login">
</form>
</body>
<?php
$OUTPUT->footer();
    return;
}

header('Content-Type: text/html; charset=utf-8');

// Load tools from various folders
$tools = array();
findTools("mod",$tools);
findTools("solutions",$tools);
findTools("samples",$tools);
findTools("tmp",$tools);

$cur_url = curPageURL();

require_once("dev-data.php");

// Merge post data into  data
foreach ($lmsdata as $k => $val ) {
    if ( isset($_POST[$k]) ) {
        $lmsdata[$k] = $_POST[$k];
    }<commit_msg>Convince the dev interface to look at the configutation value.<commit_after><?php
// In the top frame, we use cookies for session.
define('COOKIE_SESSION', true);
require_once("config.php");
require_once("pdo.php");
require_once("lib/lms_lib.php");

use \Tsugi\Util\LTI;

session_start();

// We must be an administrator or in developer mode
if ( ! ( isset($_SESSION["admin"]) || $CFG->DEVELOPER )  ) {
    header("Location: index.php");
    return;
}

$key = '12345';
if ( is_string($CFG->DEVELOPER) ) $key = $CFG->DEVELOPER;
$row = $PDOX->rowDie(
    "SELECT secret FROM {$CFG->dbprefix}lti_key WHERE key_key = :DKEY",
    array(':DKEY' => $key));
$secret = $row ? $row['secret'] : false;
if ( $secret === false ) {
    $_SESSION['error'] = 'Developer mode not properly configured';
    header("Location: index.php");
    return;
}

if ( isset($_POST['loginsecret']) ) {
    if ( $_POST['loginsecret'] == $secret ) {
        $_SESSION['developer'] = 'yes';
        header("Location: dev.php");
        return;
    }
    $_SESSION['error'] = 'Incorrect secret';
    header("Location: index.php");
    return;
}

if ( ! isset($_SESSION['developer'] ) ) {
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->topNav();
?>
<p>Please enter the developer password (default is 'secret'):</p>
<form method="post">
<input type="text" name="loginsecret" size="40">
<input type="submit" value="Login">
</form>
</body>
<?php
$OUTPUT->footer();
    return;
}

header('Content-Type: text/html; charset=utf-8');

// Load tools from various folders
$tools = array();
foreach( $CFG->tool_folders AS $tool_folder) {
    if ( $tool_folder == 'core' ) continue;
    findTools($tool_folder,$tools);
}

$cur_url = curPageURL();

require_once("dev-data.php");

// Merge post data into  data
foreach ($lmsdata as $k => $val ) {
    if ( isset($_POST[$k]) ) {
        $lmsdata[$k] = $_POST[$k];
    }
{'fraction_non_alphanumeric': 0.20298913043478262, 'fraction_numerical': 0.004347826086956522, 'mean_word_length': 4.228693181818182, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6547941', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1252, 'n_words': 294}