common.js 1.17 KB
var prefix = ctx==undefined?"":ctx+"api";


var prefixPc = ctx+"exam/answerForPc";

function goBack(type){
    window.location.href = ctx+"exam/answerForPc?type="+type;
}

function updateStatusOne(type){
    var id=$("#answerId").val();
    if(id==''||id==undefined){
        return;
    }
    var ids=id.split(",")
    layer.confirm("请确认合格?",{
        title:false,
        btn:["合格","不合格"]
    },function(){
        var url = ctx + "exam/answerForPc/updateStatus";
        var data = { "ids": ids,"status":1 };
        $.ajax({
            type: "post",
            dataType: "json",
            url:url,
            data: data,
            success:function(r) {
                if (r.code == 200) {
                    goBack(type)
                }
            }
            })

    },function(){
        var url = ctx + "exam/answerForPc/updateStatus";
        var data = { "ids": ids,"status":2 };
        $.ajax({
            type: "post",
            dataType: "json",
            url:url,
            data: data,
            success:function(r) {
                if (r.code == 200) {
                    goBack(type)
                }
            }
        })
    })
}