import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {Observable} from "rxjs/Observable";
import {AppGlobal} from "../../../service/appHttpService";
import {CommonService} from "../../../service/common.service";

@Injectable()
export class LearnService{

    constructor(private http:HttpClient,private commonSer:CommonService){}

    //测试列表
    getLearnTestList(data): Observable<any>{
       return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/learnTest/getLearnTestList',this.commonSer.toFormData(data) );
    }

    //获取测试信息
    startTest(data): Observable<any>{
        return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/learnTest/startTest',this.commonSer.toFormData(data) )
    }

    //提交测试结果
    submitPaper(data): Observable<any>{
        return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/learnTest/submitPaper',data)
    }

    //查看测试页面
    viewTestResult(data): Observable<any>{
        return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/learnTest/viewTestResult',this.commonSer.toFormData(data));
    }

    //查看题目页面
    viewAnswerDetail(data): Observable<any>{
        return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/learnTest/viewAnswerDetail',this.commonSer.toFormData(data));
    }
}