<%= stylesheet_link_tag  'polls', :media => 'all' %>
<script type="text/javascript">
    $(function(){
        $("#RSide").css("width","730px");
        $("#homework_page_right").css("min-height",$("#LSide").height()-30);
        $("#Container").css("width","1000px");
    });
    function republish_exercise(exercise_id,index)
    {
        $('#ajax-modal').html("<div id='popbox02'>" +
                "<div class='upload_con'>" +
                "<div class='upload_box'>" +
                "<p class='polls_box_p'>取消发布后学生答题将会被清空<br />是否确定取消发布该测验？</p>" +
                "<div class='polls_btn_box'>" +
                "<a href='/exercise/"+ exercise_id +"/republish_exercise?index="+index+"' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
                "<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
                "</div>" +
                "<div class='cl'></div>" +
                "</div>" +
                "</div>" +
                "</div>");
        showModal('ajax-modal', '310px');
        $('#ajax-modal').css('height','120px');
        $('#ajax-modal').siblings().remove();
        $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
                "<a onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
        $('#ajax-modal').parent().removeClass("alert_praise");
        $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
        $('#ajax-modal').parent().addClass("popbox_polls");
    }

    function clickCanel(){hideModal("#popbox02");}

    function exercise_submit(exercise_id,exercise_name,index)
    {
        if(exercise_name == 0)
        {
            alert("试卷标题不能为空");
        }
        else
        {
            $('#ajax-modal').html("<div id='popbox02'>" +
                    "<div class='upload_con'>" +
                    "<div class='upload_box'>" +
                    "<p class='polls_box_p'>测验发布后将不能对测验进行修改，<br />是否确定发布该测验？</p>" +
                    "<div class='polls_btn_box'>" +
                    "<a href='/exercise/"+ exercise_id +"/publish_exercise?index="+index+"' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
                    "<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
                    "</div>" +
                    "<div class='cl'></div>" +
                    "</div>" +
                    "</div>" +
                    "</div>");
            showModal('ajax-modal', '310px');
            $('#ajax-modal').css('height','120px');
            $('#ajax-modal').siblings().remove();
            $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
                    "<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
            $('#ajax-modal').parent().removeClass("alert_praise");
            $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
            $('#ajax-modal').parent().addClass("popbox_polls");
        }
    }

</script>
<div class="polls_content02" id="exercise" style="width: 730px;">
  <%= render :partial => 'exercises_list'%>
</div><!--问卷内容end-->