| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <template>
- <div class="tab-container">
- <el-card class="box-card">
- <h1 style="text-align: center">基本信息填写</h1>
- <el-form
- :model="ruleForm"
- :rules="rules"
- ref="ruleForm"
- label-width="180px"
- class="demo-ruleForm"
- >
- <el-form-item label="方向" prop="direction">
- <el-checkbox-group v-model="ruleForm.direction">
- <el-checkbox label="前端" name="front">前端开发</el-checkbox>
- <el-checkbox label="后端" name="back">后端开发</el-checkbox>
- <el-checkbox label="数据库" name="data">数据库开发</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <el-form-item label="学习过的知识点" prop="learned">
- <el-checkbox-group v-model="ruleForm.learned">
- <el-checkbox label="软件需求" name="SR">软件需求</el-checkbox>
- <el-checkbox label="软件设计" name="SD">软件设计</el-checkbox>
- <el-checkbox label="软件构造" name="SC">软件构造</el-checkbox>
- <el-checkbox label="软件测试" name="ST">软件测试</el-checkbox>
- <el-checkbox label="软件维护" name="SM">软件维护</el-checkbox>
- <el-checkbox label="软件配置管理" name="SCM"
- >软件配置管理</el-checkbox
- >
- <el-checkbox label="软件工程管理" name="SEM"
- >软件工程管理</el-checkbox
- >
- <el-checkbox label="软件工程过程" name="SEP"
- >软件工程过程</el-checkbox
- >
- <el-checkbox label="软件工程模型与方法" name="SEMM"
- >软件工程模型与方法</el-checkbox
- >
- <el-checkbox label="软件质量" name="SQ">软件质量</el-checkbox>
- <el-checkbox label="软件工程职业实践" name="SEPP"
- >软件工程职业实践</el-checkbox
- >
- <el-checkbox label="软件工程经济学" name="SEE"
- >软件工程经济学</el-checkbox
- >
- <el-checkbox label="计算基础" name="CF">计算基础</el-checkbox>
- <el-checkbox label="数学基础" name="MF">数学基础</el-checkbox>
- <el-checkbox label="工程基础" name="EF">工程基础</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <el-form-item label="感兴趣的知识点" prop="interested">
- <el-checkbox-group v-model="ruleForm.interested">
- <el-checkbox label="软件需求" name="SR">软件需求</el-checkbox>
- <el-checkbox label="软件设计" name="SD">软件设计</el-checkbox>
- <el-checkbox label="软件构造" name="SC">软件构造</el-checkbox>
- <el-checkbox label="软件测试" name="ST">软件测试</el-checkbox>
- <el-checkbox label="软件维护" name="SM">软件维护</el-checkbox>
- <el-checkbox label="软件配置管理" name="SCM"
- >软件配置管理</el-checkbox
- >
- <el-checkbox label="软件工程管理" name="SEM"
- >软件工程管理</el-checkbox
- >
- <el-checkbox label="软件工程过程" name="SEP"
- >软件工程过程</el-checkbox
- >
- <el-checkbox label="软件工程模型与方法" name="SEMM"
- >软件工程模型与方法</el-checkbox
- >
- <el-checkbox label="软件质量" name="SQ">软件质量</el-checkbox>
- <el-checkbox label="软件工程职业实践" name="SEPP"
- >软件工程职业实践</el-checkbox
- >
- <el-checkbox label="软件工程经济学" name="SEE"
- >软件工程经济学</el-checkbox
- >
- <el-checkbox label="计算基础" name="CF">计算基础</el-checkbox>
- <el-checkbox label="数学基础" name="MF">数学基础</el-checkbox>
- <el-checkbox label="工程基础" name="EF">工程基础</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="submitForm('ruleForm')"
- >提交</el-button
- >
- <el-button @click="resetForm('ruleForm')">重置</el-button>
- <el-button @click="goBack()">返回</el-button>
- </el-form-item>
- </el-form>
- </el-card>
- </div>
- </template>
- <style>
- .text {
- font-size: 14px;
- }
- .item {
- padding: 18px 0px;
- }
- .box-card {
- width: 100%;
- height: 80%;
- padding: 20px 20px;
- }
- .tab-container {
- padding: 20px 20px;
- }
- </style>
- <script>
- export default {
- data() {
- return {
- ruleForm: {
- learned: ["软件需求", "软件设计", "软件构造"],
- interested: ["计算基础", "数学基础", "工程基础"],
- direction: ["前端"],
- },
- rules: {
- learned: [
- {
- type: "array",
- required: true,
- message: "请至少选择一个课程",
- trigger: "change",
- },
- ],
- interested: [
- {
- type: "array",
- required: true,
- message: "请至少选择一个课程",
- trigger: "change",
- },
- ],
- },
- examId: "",
- questionScoreMap: {},
- redirect_uri: encodeURIComponent(
- "http://p.seec.seecoder.cn/rookie/basicResult"
- ),
- teacher_token: "",
- redirect_test_uri: encodeURIComponent(
- "http://localhost:3000/rookie/basicResult"
- ),
- };
- },
- methods: {
- submitForm(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- let paramObj = this.ruleForm;
- localStorage.setItem("learned", JSON.stringify(paramObj.learned));
- localStorage.setItem(
- "interested",
- JSON.stringify(paramObj.interested)
- );
- alert("submit!");
- this.$api.post("/rookie/info", paramObj);
- //this.$api.get("/rookie/virtualTeacher").then((res) => {
- // console.log(res.data.content.token);
- // console.log(this.$store.state.token);
- // this.teacher_token = res.data.content.token;
- this.$api.post("/rookie/basicTest", paramObj).then((res) => {
- console.log(res.data.content);
- this.questionScoreMap = res.data.content;
- var date = new Date();
- var year = date.getFullYear(); //月份从0~11,所以加一
- var dateArr = [
- date.getMonth() + 1,
- date.getDate(),
- date.getHours(),
- date.getMinutes(),
- date.getSeconds(),
- ];
- var endDateArr=[
- date.getMonth() + 1,
- date.getDate(),
- date.getHours()+2,
- date.getMinutes()+1,
- date.getSeconds(),
- ];;
- for (var i = 0; i < dateArr.length; i++) {
- if (dateArr[i] >= 0 && dateArr[i] <= 9) {
- dateArr[i] = "0" + dateArr[i];
-
- }
- if(endDateArr[i]>=0 && endDateArr[i]<=9){
- endDateArr[i]="0"+endDateArr[i];
- }
- }
- var startTime =
- year +
- "-" +
- dateArr[0] +
- "-" +
- dateArr[1] +
- " " +
- dateArr[2] +
- ":" +
- dateArr[3] +
- ":" +
- dateArr[4];
- var endTime=year +
- "-" +
- endDateArr[0] +
- "-" +
- endDateArr[1] +
- " " +
- endDateArr[2] +
- ":" +
- endDateArr[3] +
- ":" +
- endDateArr[4];
- let examObj = {
- antiCheating: true,
- comment: "通关模式基础测试",
- difficulty: 1,
- endTime: endTime,
- examName: "通关模式基础测试",
- isPublic: true,
- position: "string",
- skills: [],
- startTime: startTime,
- };
- console.log(examObj)
- this.$apiss.post("/exam", examObj).then((res1) => {
- console.log(res1.data.result.examId);
- this.examId = res1.data.result.examId;
- localStorage.setItem("examId", res1.data.result.examId);
- console.log(this.questionScoreMap);
- let questionMap={
- questionScoreMap:this.questionScoreMap
- }
- console.log(questionMap)
- //window.location.href = 'http://localhost:8000/exam/935/exam-pane?redirect_uri='+this.redirect_test_uri
- this.$apiss
- .put("/exam/" + this.examId + "/questions/", questionMap)
- .then((res2) => {
- //window.location.href = 'http://localhost:8000/exam/935/exam-pane?redirect_uri=http%3A%2F%2Fwww.baidu.com'
- //window.location.href='http://testeval.seec.seecoder.cn/exam/'+this.examId+'/exam-pane?'+this.redirect_uri+'&id_token='+this.$store.state.token
- window.location.href =
- "http://eval.seec.seecoder.cn/exam/" +
- this.examId +
- "/exam-pane?redirect_uri=" +
- this.redirect_uri +
- "&id_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJwLnNlZWNvZGVyLmNuIiwic3ViIjoiMTc3NjE3MDgxODEiLCJhdWQiOiJzZWVjLW1vb2MiLCJhdXRoX3RpbWUiOjE2MjE1OTYxNjUsImlhdCI6MTYyMTU5NjE2NSwiZXhwIjoxNjIxNjgyNTY1LCJ1c2VyX2luZm8iOnsicGhvbmUiOiIxNzc2MTcwODE4MSIsImVtYWlsIjoiMTE1ODQ5NDMxOEBxcS5jb20iLCJpZCI6MTM3MiwibmFtZSI6ImxpaGUiLCJyb2xlIjoiU1RVREVOVCJ9fQ.QEsRq8uSJRxFUmEpaGBrsdp1sy5CMVdtLIY5g5RkYyQ"
- //+this.$store.state.token;
- });
- });
- });
- //});
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- resetForm(formName) {
- this.$refs[formName].resetFields();
- },
- goBack() {
- this.$router.push("/rookie");
- },
- },
- };
- </script>
|