<commit_before>{% extends 'crike_django/lesson_base.html' %}
{% load staticfiles %}

{% block subcontent %}
<script>
  $('.step-links').hide();

  var numoftry = 0;

  $(function(){
    var form = $('#ExamForm');
    var ques = [];
    $(form).find( "input[name^='ques']" )
           .each(function() { ques.push($(this).prop('value')) });
    var ans =  [];
    var timelimit = ques.length * 10;
    var time_s = timelimit % 60;
    var time_m = Math.floor(timelimit / 60);
    $('#counter').countdown({
       image: "{% static 'countdown/img/digits.png' %}",
       {% if time_m < 10 %}
       startTime: '0'+time_m+':'+time_s,
       {% else %}
       startTime: time_m+':'+time_s,
       {% endif %}
       timerEnd: function(){ 
        $('#popup')
        .html("<label style='font-size:300%'>时间到.. <i style='color:orange' class='fa fa-frown-o'/></label>")
        .show()
        $(form).find( "input:radio[name^='pickanswer']:checked" )
               .each(function() { var index = parseInt($(this).prop('name').substring(10)); ans[index-1]=$(this).prop('value') });
        $('#overlay').show();
        for (i=0;i<ques.length;i++)
          $('<input>').attr({name:'ques', value:ques[i], hidden:'true'}).appendTo(form);
        for (i=0;i<ques.length;i++)
          $('<input>').attr({name:'ans', value:ans[i], hidden:'true'}).appendTo(form);
        setTimeout( function () { $(form).submit(); }, 1000);
       },
       format: 'mm:ss'
    });
  });

  function onSubmit(e) {

    var form = $('#ExamForm');
    var pickcheck = $(form).find( "input:radio[name^='pickanswer']:checked" ).length;
    var ques = [];
    $(form).find( "input[name^='ques']" )
           .each(function() { ques.push($(this).prop('value')) });
    var ans =  [];
    $(form).find( "input:radio[name^='pickanswer']:checked" )
           .each(function() { ans.push($(this).prop('value')) });
    var words_num = {{words|length}};

    if (pickcheck != words_num)
    {
      e.preventDefault();
      var showtimer = null;
      var cb = "$('#popup').hide();$('#overlay').hide()"
      $('#popup')
      .html("<label style='font-size:250%'><i style='color:red' class='fa fa-minus-square'></i> 还没做完呢，又粗心了吧 <i style='color:orange' class='fa fa-frown-o'/></label>")
      .show()
      $('#overlay').show()
      shotimer = setTimeout(cb, 2000)
      return false;
    }
    for (i=0;i<ques.length;i++)
      $('<input>').attr({name:'ques', value:ques[i], hidden:'true'}).appendTo(form);
    for (i=0;i<ans.length;i++)
      $('<input>').attr({name:'ans', value:ans[i], hidden:'true'}).appendTo(form);
  };

  function onPick(pin) {
    $(pin).find("input:radio").prop('checked',true);
  }
</script>

<div id='overlay'></div>
<div id='popup'></div>

<form id='ExamForm' action='/exam/{{id}}/' method='post'>
  <div class='jumbotron subject-header-container2'>
    <label>{{name}}</label>
    <div id="counter" style='float:right;'></div>
    {% csrf_token %}
    <h1>
    </h1>
    <input name="score" value='{{score}}' hidden="true">
    <input type="submit" onClick='onSubmit(event);' value="submit" class="btn btn-primary btn-lg" style="margin-right:20px;margin-bottom:10px;">
    <strong id='feedback'>根据发音，填写完整单词并选择释义</strong>
  </div>

{% for word in words %}
  <div class='row e2c'>
    <h2>{{forloop.counter}}. {{word.name}}
    <a onmouseover="delayPlay('/media/audios/{{ word.name }}.mp3');"
        onmouseout ="clearTimeout(timer);" 
        onclick="playSound('/media/audios/{{ word.name }}.mp3');" 
        title="发音" href="javascript:;"><i class="fa fa-volume-up"></i></a>
    </h2>
    <input name="ques{{forloop.counter}}" value="{{word.name}}" hidden="true">
    {% for option in word.options %}
      <div class="pin" style="width:100%" onclick='onPick(this)'>
        <input type="radio" name="pickanswer{{forloop.parentloop.counter}}" value="{{option.name}}">
        {% for m in option.mean %}
          {{m}};
        {% endfor %}
      </div>
    {% endfor %}
  </div>
{% endfor %}
</form>

{% block body_footer %}
<script src="{% static 'countdown/js/jquery.countdown.js' %}" type="text/javascript" charset="utf-8"></script>
{% endblock %}

{% endblock %}

<commit_msg>Correct the notice of this exam<commit_after>{% extends 'crike_django/lesson_base.html' %}
{% load staticfiles %}

{% block subcontent %}
<script>
  $('.step-links').hide();

  var numoftry = 0;

  $(function(){
    var form = $('#ExamForm');
    var ques = [];
    $(form).find( "input[name^='ques']" )
           .each(function() { ques.push($(this).prop('value')) });
    var ans =  [];
    var timelimit = ques.length * 10;
    var time_s = timelimit % 60;
    var time_m = Math.floor(timelimit / 60);
    $('#counter').countdown({
       image: "{% static 'countdown/img/digits.png' %}",
       {% if time_m < 10 %}
       startTime: '0'+time_m+':'+time_s,
       {% else %}
       startTime: time_m+':'+time_s,
       {% endif %}
       timerEnd: function(){ 
        $('#popup')
        .html("<label style='font-size:300%'>时间到.. <i style='color:orange' class='fa fa-frown-o'/></label>")
        .show()
        $(form).find( "input:radio[name^='pickanswer']:checked" )
               .each(function() { var index = parseInt($(this).prop('name').substring(10)); ans[index-1]=$(this).prop('value') });
        $('#overlay').show();
        for (i=0;i<ques.length;i++)
          $('<input>').attr({name:'ques', value:ques[i], hidden:'true'}).appendTo(form);
        for (i=0;i<ques.length;i++)
          $('<input>').attr({name:'ans', value:ans[i], hidden:'true'}).appendTo(form);
        setTimeout( function () { $(form).submit(); }, 1000);
       },
       format: 'mm:ss'
    });
  });

  function onSubmit(e) {

    var form = $('#ExamForm');
    var pickcheck = $(form).find( "input:radio[name^='pickanswer']:checked" ).length;
    var ques = [];
    $(form).find( "input[name^='ques']" )
           .each(function() { ques.push($(this).prop('value')) });
    var ans =  [];
    $(form).find( "input:radio[name^='pickanswer']:checked" )
           .each(function() { ans.push($(this).prop('value')) });
    var words_num = {{words|length}};

    if (pickcheck != words_num)
    {
      e.preventDefault();
      var showtimer = null;
      var cb = "$('#popup').hide();$('#overlay').hide()"
      $('#popup')
      .html("<label style='font-size:250%'><i style='color:red' class='fa fa-minus-square'></i> 还没做完呢，又粗心了吧 <i style='color:orange' class='fa fa-frown-o'/></label>")
      .show()
      $('#overlay').show()
      shotimer = setTimeout(cb, 2000)
      return false;
    }
    for (i=0;i<ques.length;i++)
      $('<input>').attr({name:'ques', value:ques[i], hidden:'true'}).appendTo(form);
    for (i=0;i<ans.length;i++)
      $('<input>').attr({name:'ans', value:ans[i], hidden:'true'}).appendTo(form);
  };

  function onPick(pin) {
    $(pin).find("input:radio").prop('checked',true);
  }
</script>

<div id='overlay'></div>
<div id='popup'></div>

<form id='ExamForm' action='/exam/{{id}}/' method='post'>
  <div class='jumbotron subject-header-container2'>
    <label>{{name}}</label>
    <div id="counter" style='float:right;'></div>
    {% csrf_token %}
    <h1>
    </h1>
    <input name="score" value='{{score}}' hidden="true">
    <input type="submit" onClick='onSubmit(event);' value="submit" class="btn btn-primary btn-lg" style="margin-right:20px;margin-bottom:10px;">
    <strong id='feedback'>选择单词释义</strong>
  </div>

{% for word in words %}
  <div class='row e2c'>
    <h2>{{forloop.counter}}. {{word.name}}
    <a onmouseover="delayPlay('/media/audios/{{ word.name }}.mp3');"
        onmouseout ="clearTimeout(timer);" 
        onclick="playSound('/media/audios/{{ word.name }}.mp3');" 
        title="发音" href="javascript:;"><i class="fa fa-volume-up"></i></a>
    </h2>
    <input name="ques{{forloop.counter}}" value="{{word.name}}" hidden="true">
    {% for option in word.options %}
      <div class="pin" style="width:100%" onclick='onPick(this)'>
        <input type="radio" name="pickanswer{{forloop.parentloop.counter}}" value="{{option.name}}">
        {% for m in option.mean %}
          {{m}};
        {% endfor %}
      </div>
    {% endfor %}
  </div>
{% endfor %}
</form>

{% block body_footer %}
<script src="{% static 'countdown/js/jquery.countdown.js' %}" type="text/javascript" charset="utf-8"></script>
{% endblock %}

{% endblock %}


{'fraction_non_alphanumeric': 0.2417621776504298, 'fraction_numerical': 0.011222540592168099, 'mean_word_length': 3.32249742002064, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4230909', 'n_tokens_mistral': 3069, 'n_tokens_neox': 2952, 'n_words': 491}