<commit_before>                    <article class="widget dashboard-tasks">
                        <section class="fluid clr">
                            <span class='strong'>To-do:</span> Complete <a href='/levels/main/1'>Main 1</a><br/>
                            <div class='tasks-progress-container'>
                                <div style='width: 63%'></div>
                            </div>
                        </section>
                    </article>


<?php
    if ($app->user->connect_msg):
?>
                        <div class='msg msg-info'>
                            <i class='icon-info'></i>
                            <?=$app->user->connect_msg;?>
                        </div>
<?php
    endif;
    if (!$app->user->connected):
?>
                        <a class='stop-external facebook-connect' href='https://www.facebook.com/dialog/oauth?client_id=<?php $fb = $app->config('facebook'); echo $fb['public'];?>&redirect_uri=http://dev.hackthis/?facebook&scope=email'><commit_msg>Logic for to-do list, need to add to-do medal<commit_after><?php
    // To do list
    $medal_id = 20;
    $todo_position = 0;
    $todo = array("Complete <a href='/levels/main/1'>Main 1</a>",
                  "Upload a <a href='/settings/image'>profile image</a>");
    
    // Does user have todo medal?
    $st = $app->db->prepare('SELECT medal_id FROM users_medals
                             WHERE user_id = :uid AND medal_id = :medal_id');
    $st->execute(array(':uid' => $app->user->uid, ':medal_id' => $medal_id));
    $result = $st->fetch();

    if (!$result):
        $levels = $app->levels->getList();
        if ($levels[0]->completed) {
            $todo_position = 1;

            // Does user have cheese medal?
            $st = $app->db->prepare('SELECT medal_id FROM users_medals
                                     WHERE user_id = :uid AND medal_id = :medal_id');
            $st->execute(array(':uid' => $app->user->uid, ':medal_id' => 11));
            $result = $st->fetch();
            if ($result) {
                $todo_position = 2;
            }
        }

        if ($todo_position == count($todo)):
            $app->awardMedal($medal_id, $app->user->uid);
        else:
?>

                    <article class="widget dashboard-tasks">
                        <section class="fluid clr">
                            <span class='strong'>To-do:</span> <?=$todo[$todo_position];?><br/>
                            <div class='tasks-progress-container'>
                                <div style='width: <?=($todo_position/count($todo)) * 100;?>%'></div>
                            </div>
                        </section>
                    </article>


<?php
        endif;
    endif;

    if ($app->user->connect_msg):
?>
                        <div class='msg msg-info'>
                            <i class='icon-info'></i>
                            <?=$app->user->connect_msg;?>
                        </div>
<?php
    endif;
    if (!$app->user->connected):
?>
                        <a class='stop-external facebook-connect' href='https://www.facebook.com/dialog/oauth?client_id=<?php $fb = $app->config('facebook'); echo $fb['public'];?>&redirect_uri=http://dev.hackthis/?facebook&scope=email'>
{'fraction_non_alphanumeric': 0.1712707182320442, 'fraction_numerical': 0.0052179251074278695, 'mean_word_length': 1.5166023166023166, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 88, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1992394', 'n_tokens_mistral': 972, 'n_tokens_neox': 915, 'n_words': 172}