You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
3.8 KiB

<page-meta>
<navigation-bar title="hihihi"/>
</page-meta>
<view class="container">
<view class="top">
<form class="exercise" bindsubmit="create_exercise">
<view class="form-wrap">
<input class="name" name="exercise_name" value="{{exercise.exercise_name}}" placeholder="试卷标题"></input>
</view>
<view class="form-wrap">
<textarea class="description" name="exercise_description" value="{{exercise.exercise_description}}" placeholder="试卷须知"></textarea>
</view>
<view class="flex-wrap">
<button class="submit" type="primary" form-type="submit" style="width:49%">保存</button>
<button class="publish" type="warn" bindtap="start_publish" style="width:49%">发布</button>
</view>
</form>
<view class="operations">
<button bindtap="create_question" data-type="0">+选择题</button>
</view>
</view>
<scroll-view class="questions" scroll-y="true">
<block wx:for="{{exercise_questions}}" wx:for-item="question" wx:key="question_id">
<view class="question">
<text class="hint">第{{question.q_position}}题</text>
<rich-text class="question-title" nodes="{{question.question_title}}" space="nbsp"></rich-text>
<view wx:if="{{question.question_type==0 || question.question_type==1 ||question.question_type==2}}">
<checkbox-group class="choices" bindchange="answer_choice_question" data-question_id="{{question.question_id}}">
<checkbox class="choice" disabled="1" wx:for="{{question.question_choices}}" wx:for-item="choice" wx:key="choice_id" checked="{{choice.standard_boolean}}" value="{{choice.choice_id}}">
<view class="choice">
<text class="choice-text">{{choice.choice_text}}</text>
</view>
</checkbox>
</checkbox-group>
</view>
<view wx:elif="{{question.question_type==3}}">
<text class="hint">暂不支持填空题...</text>
<!--block wx:for="{{question.null_inputs}}" wx:for-item="null_input">
<view class="null-input flex-wrap">
<text class="hint">填空{{null_input.choice_id}}</text>
<input disabled="1" class="null-input"
data-question_id="{{question.question_id}}"
data-exercise_choice_id="{{null_input.choice_id}}"
value="{{null_input.answer_text}}"
bindblur="answer_null_question">
</input>
</view>
</block>
<view wx:if="{{question.standard_answer}}" class="standard-null-inputs">
<view class="standard-null-input flex-wrap" wx:for="{{question.standard_answer}}" wx:for-item="answer">
<text class="hint">第{{answer.choice_id}}空答案:</text>
<text class="error" style="padding-top: 12rpx;">{{answer.answer_text}}</text>
</view>
</view-->
</view>
<view wx:elif="{{question.question_type==4}}">
<textarea disabled="1" class="main-input"
bindblur="answer_main_question"
value="{{question.standard_answer[0]||'暂无'}}"
data-question_id="{{question.question_id}}">
</textarea>
</view>
<view wx:elif="{{question.question_type==5}}">
<text class="hint">暂不支持实训题...</text>
</view>
</view>
</block>
</scroll-view>
</view>
<modal hidden="1">
<form bindsubmit="publish">
<view>
<text>发布时间</text>
<picker class="form-item"
name="end_date"
mode="date"
bindchange="updateEndDate"
value="{{publish_date}}"
start="{{current_date}}">{{publish_date||"请选择发布日期"}}
</picker>
</view>
<view>
<picker class="form-item"
name="end_time"
mode="time"
bindchange="updateEndDate"
value="{{publish_time}}"
start="{{current_time}}">{{publish_time||"请选择发布时间"}}
</picker>
</view>
</form>
</modal>