import http from "@/utils/http";
import keyboard from "uview-ui/libs/config/props/keyboard";
//获取题目
export const getQuestion= (type)=>{
    if(type==null||type==undefined){
        type="refresh";
    }
    return http({
        url:"/question/getQuestion",
        method:"get",
        params:{
            type
        },
    })
}
//验证题目是否正确
export const checkQuestion= ({
    questionId,
    answer
})=>{
    return http({
        url:"/question/validationAnswer",
        method:"get",
        params:{
            questionId,
            answer
        }
    })
}
//获取题目
export const getQuestionByTagName= (tagName)=>{
    return http({
        url:"/question/getQuestionByTagName",
        method:"get",
        params:{
            tagName
        },
    })
}
//获取题目答案
export const validationAnswer = ({questionId,answer})=>{
    return http({
        url:"/question/validationAnswer",
        method:"get",
        params:{
            questionId,
            answer
        }
    })
}
export const answered = (questionId)=>{
    return http({
        url:"/question/answered",
        method:"get",
        params:{
            questionId
        }
    })
}

export const searchQuestion = (data)=>{
    return http({
        url:"/search",
        method:"get",
        params:data
    })
}