<commit_before>{{#question}}
{{! FIXME: Put this somewhere else.}}
<style>
    .popover{max-width: 50%;}
</style>

{{! FIXME: Put this somewhere else.}}
<script>
    $(document).ready(function(){
        $('[data-toggle="popover"]').popover({container: 'body'});
    });
</script>

<div class="input-group">
    {{#label}}<label class="input-group-addon" id="basic-addon2">{{label}}</label>{{/label}}
    <input name="{{name}}" type="text" class="form-control" {{^editable}}disabled{{/editable}} {{#raw_submitted_answer}}value="{{raw_submitted_answer}}"{{/raw_submitted_answer}} aria-describedby="basic-addon1" placeholder="{{shortinfo}}" />
    <div class="input-group-btn" id="basic-addon1">
        <button class="btn btn-light border" type="button" data-toggle="popover" data-html="true" title="Matrix" data-content="{{info}}" data-placement="auto" data-trigger="focus" tabindex="0">
            <i class="fa fa-question-circle" aria-hidden="true"></i>
            {{#correct}}&nbsp;<span class="badge badge-success"><i class="fa fa-check" aria-hidden="true"></i> 100%</span>{{/correct}}
            {{#partial}}&nbsp;<span class="badge badge-warning"><i class="fa fa-circle-o" aria-hidden="true"></i> {{partial}}%</span>{{/partial}}
            {{#incorrect}}&nbsp;<span class="badge badge-danger"><i class="fa fa-times" aria-hidden="true"></i> 0%</span>{{/incorrect}}
        </a>
    </div>
</div>
{{/question}}

{{#submission}}
{{#parse_error}}
{{! FIXME: Put this somewhere else.}}
<style>
    .popover{max-width: 50%;}
</style>

{{! FIXME: Put this somewhere else.}}
<script>
    $(document).ready(function(){
        $('[data-toggle="popover"]').popover({container: 'body'});
    });
</script>

{{#label}}<span>{{label}}</span>{{/label}}
<a class="btn btn-default" type="button" data-placement="auto" data-trigger="focus" data-toggle="popover" data-html="true" title="Error" tabindex="0" data-content="{{parse_error}}{{#raw_submitted_answer}}<hr><h5><small class='text-uppercase'>What you submitted</small></h5><pre>{{raw_submitted_answer}}</pre>{{/raw_submitted_answer}}">INVALID <span><i class="fa fa-question-circle" aria-hidden="true"></i></span></a>
{{/parse_error}}
{{^parse_error}}
{{#label}}<span>{{label}}</span>{{/label}}
<samp>{{a_sub}}</samp>
{{#correct}}<span class="badge badge-success"><i class="fa fa-check" aria-hidden="true"></i> 100%</span>{{/correct}}
{{#partial}}<span class="badge badge-warning"><i class="fa fa-circle-o" aria-hidden="true"></i> {{partial}}%</span>{{/partial}}
{{#incorrect}}<span class="badge badge-danger"><i class="fa fa-times" aria-hidden="true"></i> 0%</span>{{/incorrect}}
{{/parse_error}}
{{/submission}}

{{#answer}}
<script>
    (function(){
        new Clipboard('.copy-button');
    })();
</script>

<div class="panel panel-default">
    <div class="panel-heading">
        <ul class="nav nav-pills" role="tablist">
            <li role="presentation" {{#default_is_matlab}}class="active"{{/default_is_matlab}}><a href="#matlab-{{element_index}}" aria-controls="matlab-{{element_index}}" role="tab" data-toggle="pill">matlab</a></li>
            <li role="presentation" {{#default_is_python}}class="active"{{/default_is_python}}><a href="#python-{{element_index}}" aria-controls="python-{{element_index}}" role="tab" data-toggle="pill">python</a></li>
        </ul>
    </div>
    <div class="panel-body">
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane {{#default_is_matlab}}active{{/default_is_matlab}}" id="matlab-{{element_index}}">
                <p>
                    {{#label}}<span>{{label}}</span>{{/label}}
                    <samp id="matlab-data-{{element_index}}">{{matlab_data}}</samp>
                </p>
                <button type="button" class="btn btn-default btn-xs copy-button" data-clipboard-target="#matlab-data-{{element_index}}">
                    copy this answer
                </button>
            </div>
            <div role="tabpanel" class="tab-pane {{#default_is_python}}active{{/default_is_python}}" id="python-{{element_index}}">
                <p>
                    {{#label}}<span>{{label}}</span>{{/label}}
                    <samp id="python-data-{{element_index}}">{{python_data}}</samp>
                </p>
                <button type="button" class="btn btn-default btn-xs copy-button" data-clipboard-target="#python-data-{{element_index}}">
                    copy this answer
                </button>
            </div>
        </div>
    </div>
</div>
{{/answer}}

{{#format}}
<p>
Your answer must be a matrix (i.e., a 2D array). It can be expressed in one of two ways:<commit_msg>Convert pl_matrix_input to BS4<commit_after>{{#question}}
{{! FIXME: Put this somewhere else.}}
<style>
    .popover{max-width: 50%;}
</style>

{{! FIXME: Put this somewhere else.}}
<script>
    $(document).ready(function(){
        $('[data-toggle="popover"]').popover({container: 'body'});
    });
</script>

<div class="input-group">
    {{#label}}<label class="input-group-addon" id="basic-addon2">{{label}}</label>{{/label}}
    <input name="{{name}}" type="text" class="form-control" {{^editable}}disabled{{/editable}} {{#raw_submitted_answer}}value="{{raw_submitted_answer}}"{{/raw_submitted_answer}} aria-describedby="basic-addon1" placeholder="{{shortinfo}}" />
    <div class="input-group-btn" id="basic-addon1">
        <button class="btn btn-light border" type="button" data-toggle="popover" data-html="true" title="Matrix" data-content="{{info}}" data-placement="auto" data-trigger="focus" tabindex="0">
            <i class="fa fa-question-circle" aria-hidden="true"></i>
            {{#correct}}&nbsp;<span class="badge badge-success"><i class="fa fa-check" aria-hidden="true"></i> 100%</span>{{/correct}}
            {{#partial}}&nbsp;<span class="badge badge-warning"><i class="fa fa-circle-o" aria-hidden="true"></i> {{partial}}%</span>{{/partial}}
            {{#incorrect}}&nbsp;<span class="badge badge-danger"><i class="fa fa-times" aria-hidden="true"></i> 0%</span>{{/incorrect}}
        </a>
    </div>
</div>
{{/question}}

{{#submission}}
{{#parse_error}}
{{! FIXME: Put this somewhere else.}}
<style>
    .popover{max-width: 50%;}
</style>

{{! FIXME: Put this somewhere else.}}
<script>
    $(document).ready(function(){
        $('[data-toggle="popover"]').popover({container: 'body'});
    });
</script>

{{#label}}<span>{{label}}</span>{{/label}}
<a class="btn btn-default" type="button" data-placement="auto" data-trigger="focus" data-toggle="popover" data-html="true" title="Error" tabindex="0" data-content="{{parse_error}}{{#raw_submitted_answer}}<hr><h5><small class='text-uppercase'>What you submitted</small></h5><pre>{{raw_submitted_answer}}</pre>{{/raw_submitted_answer}}">INVALID <span><i class="fa fa-question-circle" aria-hidden="true"></i></span></a>
{{/parse_error}}
{{^parse_error}}
{{#label}}<span>{{label}}</span>{{/label}}
<samp>{{a_sub}}</samp>
{{#correct}}<span class="badge badge-success"><i class="fa fa-check" aria-hidden="true"></i> 100%</span>{{/correct}}
{{#partial}}<span class="badge badge-warning"><i class="fa fa-circle-o" aria-hidden="true"></i> {{partial}}%</span>{{/partial}}
{{#incorrect}}<span class="badge badge-danger"><i class="fa fa-times" aria-hidden="true"></i> 0%</span>{{/incorrect}}
{{/parse_error}}
{{/submission}}

{{#answer}}
<script>
    (function(){
        new Clipboard('.copy-button');
    })();
</script>

<div class="card mb-4">
    <div class="card-header">
        <ul class="nav nav-pills" role="tablist">
            <li class="nav-item" role="presentation"><a class="nav-link{{#default_is_matlab}} active{{/default_is_matlab}}" href="#matlab-{{element_index}}" aria-controls="matlab-{{element_index}}" role="tab" data-toggle="pill">matlab</a></li>
            <li class="nav-item" role="presentation"><a class="nav-link{{#default_is_python}} active{{/default_is_python}}" href="#python-{{element_index}}" aria-controls="python-{{element_index}}" role="tab" data-toggle="pill">python</a></li>
        </ul>
    </div>
    <div class="card-body">
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane {{#default_is_matlab}}active{{/default_is_matlab}}" id="matlab-{{element_index}}">
                <p>
                    {{#label}}<span>{{label}}</span>{{/label}}
                    <samp id="matlab-data-{{element_index}}">{{matlab_data}}</samp>
                </p>
                <button type="button" class="btn btn-secondary btn-sm copy-button" data-clipboard-target="#matlab-data-{{element_index}}">
                    copy this answer
                </button>
            </div>
            <div role="tabpanel" class="tab-pane {{#default_is_python}}active{{/default_is_python}}" id="python-{{element_index}}">
                <p>
                    {{#label}}<span>{{label}}</span>{{/label}}
                    <samp id="python-data-{{element_index}}">{{python_data}}</samp>
                </p>
                <button type="button" class="btn btn-secondary btn-sm copy-button" data-clipboard-target="#python-data-{{element_index}}">
                    copy this answer
                </button>
            </div>
        </div>
    </div>
</div>
{{/answer}}

{{#format}}
<p>
Your answer must be a matrix (i.e., a 2D array). It can be expressed in one of two ways:
{'fraction_non_alphanumeric': 0.23185613359023763, 'fraction_numerical': 0.00449582530507386, 'mean_word_length': 3.9173684210526316, 'pattern_counts': {'":': 0, '<': 209, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6264783', 'n_tokens_mistral': 3157, 'n_tokens_neox': 3028, 'n_words': 502}