仓库地址修改

This commit is contained in:
mindskip
2020-09-01 22:58:28 +08:00
parent a8d9b11da0
commit c5a5a1f039
294 changed files with 75 additions and 5581 deletions

View File

@@ -1,104 +0,0 @@
import {
formatSeconds
} from '../../../utils/util.js'
let app = getApp()
Page({
data: {
spinShow: false,
paperId: null,
form: {},
timer: null,
doTime: 0,
remainTime: 0,
remainTimeStr: '',
modalShow: false,
result: 0,
timeOutShow: false
},
onLoad: function(options) {
let paperId = options.id
let _this = this
_this.setData({
spinShow: true
});
app.formPost('/api/wx/student/exampaper/select/' + paperId, null)
.then(res => {
_this.setData({
spinShow: false
});
if (res.code === 1) {
_this.setData({
form: res.response,
paperId: paperId,
remainTime: res.response.suggestTime * 60
});
_this.timeReduce()
}
}).catch(e => {
_this.setData({
spinShow: false
});
app.message(e, 'error')
})
},
timeReduce() {
let _this = this
let timer = setInterval(function() {
let remainTime = _this.data.remainTime
if (remainTime <= 0) {
_this.timeOut()
} else {
_this.setData({
remainTime: remainTime - 1,
remainTimeStr: formatSeconds(remainTime),
doTime: _this.data.doTime + 1
});
}
}, 1000)
_this.setData({
timer: timer
});
},
onUnload() {
clearInterval(this.data.timer)
},
returnRecord() {
wx.reLaunch({
url: '/pages/record/index',
});
},
timeOut() {
clearInterval(this.data.timer)
this.setData({
timeOutShow: true
});
},
formSubmit: function(e) {
let _this = this
if (this.data.timer) {
clearInterval(this.data.timer)
}
wx.showLoading({
title: '提交中',
mask: true
})
e.detail.value.id = this.data.paperId
e.detail.value.doTime = this.data.doTime
app.formPost('/api/wx/student/exampaper/answer/answerSubmit', e.detail.value)
.then(res => {
if (res.code === 1) {
_this.setData({
modalShow: true,
result: res.response
});
} else {
app.message(res.response, 'error')
}
wx.hideLoading()
}).catch(e => {
wx.hideLoading()
app.message(e, 'error')
})
}
})

View File

@@ -1,16 +0,0 @@
{
"usingComponents": {
"i-panel": "/component/iView/panel/index",
"i-cell-group": "/component/iView/cell-group/index",
"i-cell": "/component/iView/cell/index",
"i-radio-group": "/component/iView/radio-group/index",
"i-radio": "/component/iView/radio/index",
"i-row": "/component/iView/row/index",
"i-col": "/component/iView/col/index",
"i-input": "/component/iView/input/index",
"i-action-sheet": "/component/iView/action-sheet/index",
"i-modal": "/component/iView/modal/index",
"i-message": "/component/iView/message/index",
"i-spin": "/component/iView/spin/index"
}
}

View File

@@ -1,80 +0,0 @@
<view class="exam-page">
<view class="view-wrap">
<view class="exam-count-down">{{remainTimeStr}}</view>
</view>
<view class="view-wrap-hidden">
</view>
<view>
<view class="exam-name-title">
<h1>{{form.name}}</h1>
</view>
<form bindsubmit='formSubmit'>
<i-panel title="{{titleItem.name}}" wx:for="{{form.titleItems}}" wx:for-item="titleItem" wx:key="{{titleItem.name}}" i-class="exam-panel-title">
<i-cell-group i-class="exam-cell">
<i-cell wx:for="{{titleItem.questionItems}}" wx:key="{{titleItem.id}}" wx:for-item="questionItem">
<view wx:if="{{questionItem.questionType === 1}}">
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" />
<radio-group class="radio-group" name="{{questionItem.itemOrder}}_{{questionItem.id}}_{{questionItem.questionType}}">
<label class="radio" wx:for="{{questionItem.items}}" wx:key="{{questionItem.prefix}}" wx:for-item="radioItem" class="exam-radio-item-label">
<radio color="#2d8cf0" value="{{radioItem.prefix}}" checked="{{radioItem.checked}}" class="exam-item-left" />
<rich-text nodes="{{radioItem.prefix}}. {{radioItem.content}}" class="exam-item-left" />
</label>
</radio-group>
</view>
<view wx:elif="{{questionItem.questionType === 2}}">
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" class="exam-item-left" style="line-height:35px" />
<checkbox-group class="exam-item-left" style="margin-left:10px" name="{{questionItem.itemOrder}}_{{questionItem.id}}_{{questionItem.questionType}}">
<label wx:for="{{questionItem.items}}" wx:key="{{questionItem.prefix}}" wx:for-item="radioItem" class="exam-radio-item-label">
<checkbox color="#2d8cf0" value="{{radioItem.prefix}}" checked="{{radioItem.checked}}" class="exam-item-left" />
<rich-text nodes="{{radioItem.prefix}}. {{radioItem.content}}" class="exam-item-left" />
</label>
</checkbox-group>
</view>
<view wx:elif="{{questionItem.questionType === 3}}">
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" class="exam-item-left" style="line-height:35px" />
<radio-group class="radio-group" class="exam-item-left" style="margin-left:10px" name="{{questionItem.itemOrder}}_{{questionItem.id}}_{{questionItem.questionType}}">
<label class="radio" wx:for="{{questionItem.items}}" wx:key="{{questionItem.prefix}}" wx:for-item="radioItem" class="exam-radio-item-label">
<radio color="#2d8cf0" value="{{radioItem.prefix}}" checked="{{radioItem.checked}}" class="exam-item-left" />
<rich-text nodes="{{radioItem.content}}" class="exam-item-left" />
</label>
</radio-group>
</view>
<view wx:elif="{{questionItem.questionType === 4}}">
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" />
<view class="exam-input-contain" wx:for="{{questionItem.items}}" wx:key="{{questionItem.prefix}}" wx:for-item="inputItem" wx:for-index="idx">
<view class="exam-input-contain-label">{{inputItem.prefix}}</view>
<input class="exam-input-contain-content" maxlength="-1" name="{{questionItem.itemOrder}}_{{questionItem.id}}_{{questionItem.questionType}}_{{idx}}" />
</view>
</view>
<view wx:else>
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" />
<view class="exam-textarea-contain">
<textarea placeholder="答案" maxlength="-1" name="{{questionItem.itemOrder}}_{{questionItem.id}}_{{questionItem.questionType}}"></textarea>
</view>
</view>
</i-cell>
</i-cell-group>
</i-panel>
<view>
<button class="i-btn i-btn-primary i-btn-square" form-type='submit'>提交</button>
</view>
<i-action-sheet visible="true" visible="{{timeOutShow}}" mask-closable="{{ false }}">
<view slot="header" style="padding: 16px">
<view class="exam-timeout-title">考试试卷结束,请提交试卷!</view>
<button class="i-btn i-btn-primary i-btn-square" form-type='submit'>提交</button>
</view>
</i-action-sheet>
</form>
<i-modal title="考试结果" visible="{{modalShow}}" bind:ok="returnRecord" bind:cancel="returnRecord">
<view>得分:{{result}}</view>
</i-modal>
<i-spin size="large" fix wx:if="{{ spinShow }}"></i-spin>
<i-message id="message" />
</view>
</view>

View File

@@ -1,76 +0,0 @@
.exam-page {
background: white;
}
.exam-count-down {
font-size: 15px;
line-height: 35px;
}
.view-wrap {
position: fixed;
width: 100%;
background: #fff6f6;
text-align: center;
height: 35px;
z-index: 999;
}
.view-wrap-hidden {
height: 35px;
}
.exam-name-title {
text-align: center;
margin-top: 10px;
font-size: 17px;
}
.exam-panel-title {
margin-top: 30px;
}
.exam-radio-item-label {
float: left;
margin-left: 10px;
line-height: 35px;
}
.exam-item-left {
float: left;
}
.exam-input-contain {
margin: 10px 2px !important;
border-width: 1px;
border-color: #dddee1;
border-style: solid;
width: 95%;
height: 40px;
}
.exam-input-contain-label {
float: left;
padding: 0px 15px;
line-height: 40px;
}
.exam-input-contain-content {
float: left;
height: 40px;
}
.exam-textarea-contain {
margin: 10px 2px !important;
border-width: 1px;
border-color: #dddee1;
border-style: solid;
width: 100%;
}
.exam-timeout-title{
font-size: 16px;
color: red;
margin-top: 10px;
margin-bottom: 20px;
}

View File

@@ -1,66 +0,0 @@
// pages/exam/edit/index.js
Page({
/**
* Page initial data
*/
data: {
},
/**
* Lifecycle function--Called when page load
*/
onLoad: function (options) {
},
/**
* Lifecycle function--Called when page is initially rendered
*/
onReady: function () {
},
/**
* Lifecycle function--Called when page show
*/
onShow: function () {
},
/**
* Lifecycle function--Called when page hide
*/
onHide: function () {
},
/**
* Lifecycle function--Called when page unload
*/
onUnload: function () {
},
/**
* Page event handler function--Called when user drop down
*/
onPullDownRefresh: function () {
},
/**
* Called when page reach bottom
*/
onReachBottom: function () {
},
/**
* Called when user click on the top right corner to share
*/
onShareAppMessage: function () {
}
})

View File

@@ -1,3 +0,0 @@
{
"usingComponents": {}
}

View File

@@ -1,2 +0,0 @@
<!--pages/exam/edit/index.wxml-->
<text>pages/exam/edit/index.wxml</text>

View File

@@ -1 +0,0 @@
/* pages/exam/edit/index.wxss */

View File

@@ -1,91 +0,0 @@
// pages/exam/index/index.js
let app = getApp()
Page({
data: {
paperType: 1,
spinShow: false,
loadMoreLoad: false,
loadMoreTip: '暂无数据',
queryParam: {
paperType: 1,
pageIndex: 1,
pageSize: app.globalData.pageSize
},
tableData: [],
total: 1
},
onLoad: function(options) {
this.setData({
spinShow: true
});
this.search(true)
},
tabChange({
detail
}) {
this.setData({
spinShow: true
});
let size = app.globalData.pageSize
this.setData({
paperType: detail.key,
queryParam: {
paperType: detail.key,
pageIndex: 1,
pageSize: app.globalData.pageSize
}
});
this.search(true)
},
onPullDownRefresh() {
this.setData({
spinShow: true
});
if (!this.loading) {
this.setData({
['queryParam.pageIndex']: 1
});
this.search(true)
}
},
onReachBottom() {
if (!this.loading && this.data.queryParam.pageIndex < this.data.total) {
this.setData({
loadMoreLoad: true,
loadMoreTip: '正在加载'
});
this.setData({
['queryParam.pageIndex']: this.data.queryParam.pageIndex + 1
});
this.search(false)
}
},
search: function(override) {
let _this = this
app.formPost('/api/wx/student/exampaper/pageList', this.data.queryParam).then(res => {
_this.setData({
spinShow: false
});
wx.stopPullDownRefresh()
if (res.code === 1) {
const re = res.response
_this.setData({
['queryParam.pageIndex']: re.pageNum,
tableData: override ? re.list : this.data.tableData.concat(re.list),
total: re.pages
});
if (re.pageNum >= re.pages) {
this.setData({
loadMoreLoad: false,
loadMoreTip: '暂无数据'
});
}
}
}).catch(e => {
_this.setData({
spinShow: false
});
app.message(e, 'error')
})
}
})

View File

@@ -1,13 +0,0 @@
{
"usingComponents": {
"i-tabs": "/component/iView/tabs/index",
"i-tab": "/component/iView/tab/index",
"i-cell-group": "/component/iView/cell-group/index",
"i-cell": "/component/iView/cell/index",
"i-load-more": "/component/iView/load-more/index",
"i-button": "/component/iView/button/index",
"i-message": "/component/iView/message/index",
"i-spin": "/component/iView/spin/index"
},
"enablePullDownRefresh": true
}

View File

@@ -1,15 +0,0 @@
<!--pages/exam/index/index.wxml-->
<view>
<i-tabs current="{{ paperType }}" bindchange="tabChange" fixed="true">
<i-tab key="1" title="固定试卷" />
<i-tab key="4" title="时段试卷" />
</i-tabs>
<view class="exam-tab-view">
<i-cell-group>
<i-cell wx:for="{{tableData}}" data-item="item" wx:key="{{item.id}}" title="{{item.name}}" is-link url="/pages/exam/do/index?id={{item.id}}" value="{{item.subjectName}}"></i-cell>
</i-cell-group>
</view>
<i-load-more tip="{{loadMoreTip}}" loading="{{loadMoreLoad}}" i-class="xzs-load-more" />
<i-spin size="large" fix wx:if="{{ spinShow }}"></i-spin>
<i-message id="message" />
</view>

View File

@@ -1,7 +0,0 @@
.exam-tab-view {
margin-top: 42px;
}
.xzs-load-more {
margin-top: 60px !important;
}

View File

@@ -1,59 +0,0 @@
import {
formatSeconds,
} from '../../../utils/util.js'
let app = getApp()
Page({
data: {
spinShow: false,
paperId: null,
paper: {},
answer: {},
timer: null,
doTime: 0,
remainTime: 0,
remainTimeStr: '',
modalShow: false,
result: 0,
timeOutShow: false
},
onLoad: function(options) {
let paperId = options.id
let _this = this
_this.setData({
spinShow: true
});
app.formPost('/api/wx/student/exampaper/answer/read/' + paperId, null)
.then(res => {
_this.setData({
spinShow: false
});
if (res.code === 1) {
_this.setData({
paper: res.response.paper,
answer: res.response.answer,
paperId: paperId,
});
}
}).catch(e => {
_this.setData({
spinShow: false
});
app.message(e, 'error')
})
},
onUnload() {
clearInterval(this.data.timer)
},
returnRecord() {
wx.reLaunch({
url: '/pages/record/index',
});
},
timeOut() {
clearInterval(this.data.timer)
this.setData({
timeOutShow: true
});
}
})

View File

@@ -1,17 +0,0 @@
{
"usingComponents": {
"i-panel": "/component/iView/panel/index",
"i-cell-group": "/component/iView/cell-group/index",
"i-cell": "/component/iView/cell/index",
"i-radio-group": "/component/iView/radio-group/index",
"i-radio": "/component/iView/radio/index",
"i-row": "/component/iView/row/index",
"i-col": "/component/iView/col/index",
"i-input": "/component/iView/input/index",
"i-action-sheet": "/component/iView/action-sheet/index",
"i-modal": "/component/iView/modal/index",
"i-message": "/component/iView/message/index",
"i-spin": "/component/iView/spin/index",
"i-rate": "/component/iView/rate/index"
}
}

View File

@@ -1,86 +0,0 @@
<wxs module="filter" src="../../../wxs/exam-fun.wxs"></wxs>
<view class="exam-page">
<view class="view-wrap-hidden">
</view>
<view>
<view class="exam-name-title">
<h1>{{paper.name}}</h1>
</view>
<view class="exam-result">
<h1 class="">试卷得分: {{answer.score}}</h1>
<h1 class="exam-result-detail">试卷耗时: {{answer.doTime}}秒</h1>
</view>
<i-panel title="{{titleItem.name}}" wx:for="{{paper.titleItems}}" wx:for-item="titleItem" wx:key="{{titleItem.name}}" i-class="exam-panel-title">
<i-cell-group i-class="exam-cell">
<i-cell wx:for="{{titleItem.questionItems}}" wx:key="{{titleItem.id}}" wx:for-item="questionItem">
<view wx:if="{{questionItem.questionType === 1}}">
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" />
<radio-group class="radio-group">
<label class="radio" wx:for="{{questionItem.items}}" wx:key="{{questionItem.prefix}}" wx:for-item="radioItem" class="exam-radio-item-label">
<radio color="#2d8cf0" value="{{radioItem.prefix}}" checked="{{radioItem.prefix == answer.answerItems[questionItem.itemOrder-1].content}}" class="exam-item-left" />
<rich-text nodes="{{radioItem.prefix}}. {{radioItem.content}}" class="exam-item-left {{radioItem.prefix == answer.answerItems[questionItem.itemOrder-1].content ? 'item-content-selected' : ''}}" />
</label>
</radio-group>
</view>
<view wx:elif="{{questionItem.questionType === 2}}">
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" class="exam-item-left" style="line-height:35px" />
<checkbox-group class="exam-item-left" style="margin-left:10px">
<label wx:for="{{questionItem.items}}" wx:key="{{questionItem.prefix}}" wx:for-item="radioItem" class="exam-radio-item-label">
<checkbox color="#2d8cf0" value="{{radioItem.prefix}}" checked="{{filter.indexOf(answer.answerItems[questionItem.itemOrder-1].content,radioItem.prefix)}}" class="exam-item-left" />
<rich-text nodes="{{radioItem.prefix}}. {{radioItem.content}}" class="exam-item-left {{filter.indexOf(answer.answerItems[questionItem.itemOrder-1].content,radioItem.prefix) ? 'item-content-selected' : ''}}" />
</label>
</checkbox-group>
</view>
<view wx:elif="{{questionItem.questionType === 3}}">
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" class="exam-item-left" style="line-height:35px" />
<radio-group class="radio-group" class="exam-item-left" style="margin-left:10px">
<label class="radio" wx:for="{{questionItem.items}}" wx:key="{{questionItem.prefix}}" wx:for-item="radioItem" class="exam-radio-item-label">
<radio color="#2d8cf0" value="{{radioItem.prefix}}" checked="{{radioItem.prefix == answer.answerItems[questionItem.itemOrder-1].content}}" class="exam-item-left" />
<rich-text nodes="{{radioItem.content}}" class="exam-item-left" />
</label>
</radio-group>
</view>
<view wx:elif="{{questionItem.questionType === 4}}">
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" />
<view class="exam-input-contain" wx:for="{{questionItem.items}}" wx:key="{{questionItem.prefix}}" wx:for-item="inputItem" wx:for-index="idx">
<view class="exam-input-contain-label">{{inputItem.prefix}}</view>
<input class="exam-input-contain-content" maxlength="-1" value="{{answer.contentArray[inputItem.prefix-1]}}" />
</view>
</view>
<view wx:else>
<rich-text nodes="{{questionItem.itemOrder}}. {{questionItem.title}}" />
<view class="exam-textarea-contain">
<textarea placeholder="" maxlength="-1">{{answer.answerItems[questionItem.itemOrder-1].content}}</textarea>
</view>
</view>
<view class="exam-clear">
<view class="exam-extend-item" style="padding-left:0px">
结果:
<text class="question-answer-right question-answer-result" wx:if="{{answer.answerItems[questionItem.itemOrder-1].doRight==true}}">正确</text>
<text class="question-answer-error question-answer-result" wx:elif="{{answer.answerItems[questionItem.itemOrder-1].doRight==false}}">错误</text>
<text class="question-answer-judge question-answer-result" wx:elif="{{answer.answerItems[questionItem.itemOrder-1].doRight===null}}">待批改</text>
</view>
<view class="exam-extend-item">得分: {{answer.answerItems[questionItem.itemOrder-1].score}}</view>
<view class="exam-extend-item">分数: {{questionItem.score}}</view>
<view class="exam-extend-item" style="padding-left:0px">
难度:
<i-rate value="{{questionItem.difficult}}" i-class="exam-item-rate" />
</view>
<view class="exam-extend-item">
<rich-text nodes="解析: {{questionItem.analyze}}" />
</view>
<view class="exam-extend-item">
<rich-text nodes="正确答案: {{questionItem.correct}}" wx:if="{{questionItem.questionType==1||questionItem.questionType==2 ||questionItem.questionType==5}}" />
<rich-text nodes="正确答案: {{filter.trueFalseFormatter(questionItem)}}" wx:elif="{{questionItem.questionType==3}}" />
<rich-text nodes="正确答案: {{questionItem.correctArray}}" wx:elif="{{questionItem.questionType==4}}" />
</view>
</view>
</i-cell>
</i-cell-group>
</i-panel>
<i-spin size="large" fix wx:if="{{ spinShow }}"></i-spin>
<i-message id="message" />
</view>
</view>

View File

@@ -1,134 +0,0 @@
.exam-page {
background: white;
}
.view-wrap {
position: fixed;
width: 100%;
background: #fff6f6;
text-align: center;
height: 35px;
z-index: 999;
}
.view-wrap-hidden {
height: 15px;
}
.exam-name-title {
text-align: center;
margin-top: 5px;
font-size: 20px;
}
.exam-result {
text-align: center;
margin-top: 5px;
font-size: 15px;
}
.exam-result-detail {
margin-left: 25px;
}
.exam-panel-title {
margin-top: 20px;
}
.exam-radio-item-label {
float: left;
margin-left: 10px;
line-height: 35px;
}
.exam-item-left {
float: left;
}
.item-content-selected {
color: #409eff;
}
.exam-input-contain {
margin: 10px 2px !important;
border-width: 1px;
border-color: #dddee1;
border-style: solid;
width: 95%;
height: 40px;
}
.exam-input-contain-label {
float: left;
padding: 0px 15px;
line-height: 40px;
}
.exam-input-contain-content {
float: left;
height: 40px;
}
.exam-textarea-contain {
margin: 10px 2px !important;
border-width: 1px;
border-color: #dddee1;
border-style: solid;
width: 100%;
}
.exam-timeout-title {
font-size: 16px;
color: red;
margin-top: 10px;
margin-bottom: 20px;
}
.gapfilling-span {
color: red;
padding: 0px 30px;
margin: 0px 5px;
border-bottom: 3px double red;
}
.ueditor-p {
display: inline !important;
}
.question-answer-result {
text-align: center;
height: 28px;
width: 60px;
line-height: 26px;
display: inline-block;
}
.question-answer-error {
background-color: #fef0f0;
border-color: #fde2e2;
color: #f56c6c;
}
.question-answer-right {
background-color: #f0f9eb;
border-color: #e1f3d8;
color: #67c23a;
}
.question-answer-judge {
background-color: #fdf6ec;
border-color: #faecd8;
color: #e6a23c;
}
.exam-clear {
clear: both;
}
.exam-extend-item {
padding: 4px;
}
.exam-item-rate {
line-height: 0px;
}