Commit 9f4c4333 authored by 罗超's avatar 罗超
parents 47612654 98d410d9
/*可以在这里添加你自己的css*/
/*可以在这里添加你自己的css*/
.attach {vertical-align:middle; padding:3px 0;}
.attach img{ margin-right:5px; vertical-align:middle;}
img {max-width: 600px; }
/*
* 数学符号
*/
/*
* LaTeX Math in pure HTML and CSS -- No images whatsoever
* v0.xa
* by Jay and Han
* Lesser GPL Licensed: http: //www.gnu.org/licenses/lgpl.html
*
* This file is automatically included by mathquill.js
*
*/
@font-face {
font-family: Symbola;
src: url(font/Symbola.eot);
src: local("Symbola Regular"), local("Symbola"), url(font/Symbola.ttf) format("truetype"), url(font/Symbola.otf) format("opentype"), url(font/Symbola.svg) format("svg");
}
.mathquill-editable {
display: -moz-inline-box;
display: inline-block;
}
.mathquill-editable .cursor {
border-left: 1px solid black;
margin-right: -1px;
position: relative;
z-index: 1;
padding: 0;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-editable .cursor.blink {
visibility: hidden;
}
.mathquill-editable,
.mathquill-embedded-latex .mathquill-editable {
border: 1px solid gray;
padding: 2px;
}
.mathquill-embedded-latex .mathquill-editable {
margin: 1px;
}
.mathquill-editable.hasCursor,
.mathquill-editable .hasCursor {
-webkit-box-shadow: #68b4df 0 0 3px 2px;
-moz-box-shadow: #68b4df 0 0 3px 2px;
box-shadow: #68b4df 0 0 3px 2px;
}
.mathquill-editable .latex-command-input {
color: inherit;
font-family: "Courier New", monospace;
border: 1px solid gray;
padding-right: 1px;
margin-right: 1px;
margin-left: 2px;
}
.mathquill-editable .latex-command-input.empty {
background: transparent;
}
.mathquill-editable .latex-command-input.hasCursor {
border-color: ActiveBorder;
}
.mathquill-editable.empty:after,
.mathquill-textbox:after,
.mathquill-rendered-math .empty:after {
visibility: hidden;
content: 'c';
}
.mathquill-editable .cursor:only-child:after,
.mathquill-editable .textarea + .cursor:last-child:after {
visibility: hidden;
content: 'c';
}
.mathquill-textbox {
overflow-x: auto;
overflow-y: hidden;
}
.mathquill-rendered-math {
font-variant: normal;
font-weight: normal;
font-style: normal;
font-size: 115%;
line-height: 1;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .non-leaf,
.mathquill-rendered-math .scaled {
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math var,
.mathquill-rendered-math .text,
.mathquill-rendered-math .nonSymbola {
font-family: "Times New Roman", Symbola, serif;
line-height: .9;
}
.mathquill-rendered-math * {
font-size: inherit;
line-height: inherit;
margin: 0;
padding: 0;
border-color: black;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
white-space: pre-wrap;
}
.mathquill-rendered-math .empty {
background: #ccc;
}
.mathquill-rendered-math.empty {
background: transparent;
}
.mathquill-rendered-math .text {
font-size: 87%;
}
.mathquill-rendered-math .font {
font: 1em "Times New Roman", Symbola, serif;
}
.mathquill-rendered-math .font * {
font-family: inherit;
font-style: inherit;
}
.mathquill-rendered-math b,
.mathquill-rendered-math b.font {
font-weight: bolder;
}
.mathquill-rendered-math var,
.mathquill-rendered-math i,
.mathquill-rendered-math i.font {
font-syle: italic;
}
.mathquill-rendered-math var.florin {
margin: 0 -0.1em;
}
.mathquill-rendered-math big {
font-size: 125%;
}
.mathquill-rendered-math .roman {
font-style: normal;
}
.mathquill-rendered-math .sans-serif {
font-family: sans-serif, Symbola, serif;
}
.mathquill-rendered-math .monospace {
font-family: monospace, Symbola, serif;
}
.mathquill-rendered-math .overline {
border-top: 1px solid black;
margin-top: 1px;
}
.mathquill-rendered-math .underline {
border-bottom: 1px solid black;
margin-bottom: 1px;
}
.mathquill-rendered-math .binary-operator {
padding: 0 0.2em;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .unary-operator {
padding-left: 0.2em;
}
.mathquill-rendered-math sup,
.mathquill-rendered-math sub {
position: relative;
font-size: 90%;
}
.mathquill-rendered-math sup .binary-operator,
.mathquill-rendered-math sub .binary-operator {
padding: 0 .1em;
}
.mathquill-rendered-math sup .unary-operator,
.mathquill-rendered-math sub .unary-operator {
padding-left: .1em;
}
.mathquill-rendered-math sup.limit,
.mathquill-rendered-math sub.limit,
.mathquill-rendered-math sup.nthroot,
.mathquill-rendered-math sub.nthroot {
font-size: 80%;
}
.mathquill-rendered-math sup .fraction,
.mathquill-rendered-math sub .fraction {
font-size: 70%;
vertical-align: -0.4em;
}
.mathquill-rendered-math sup .numerator,
.mathquill-rendered-math sub .numerator {
padding-bottom: 0;
}
.mathquill-rendered-math sup .denominator,
.mathquill-rendered-math sub .denominator {
padding-top: 0;
}
.mathquill-rendered-math sup {
vertical-align: .5em;
}
.mathquill-rendered-math sup.limit,
.mathquill-rendered-math sup.nthroot {
vertical-align: 0.8em;
}
.mathquill-rendered-math sup.nthroot {
margin-right: -0.6em;
margin-left: .2em;
min-width: .5em;
}
.mathquill-rendered-math sub {
vertical-align: -0.4em;
}
.mathquill-rendered-math sub.limit {
vertical-align: -0.6em;
}
.mathquill-rendered-math .paren {
padding: 0 .1em;
vertical-align: bottom;
-webkit-transform-origin: bottom center;
-moz-transform-origin: bottom center;
-ms-transform-origin: bottom center;
-o-transform-origin: bottom center;
transform-origin: bottom center;
}
.mathquill-rendered-math .array {
vertical-align: middle;
text-align: center;
}
.mathquill-rendered-math .array > span {
display: block;
}
.mathquill-rendered-math .non-italicized-function {
font-family: Symbola, "Times New Roman", serif;
line-height: .9;
font-style: normal;
padding-right: .2em;
}
.mathquill-rendered-math .fraction {
font-size: 90%;
text-align: center;
vertical-align: -0.5em;
padding: 0 .2em;
}
.mathquill-rendered-math .fraction,
.mathquill-rendered-math x:-moz-any-link {
display: -moz-groupbox;
}
.mathquill-rendered-math .fraction,
.mathquill-rendered-math x:-moz-any-link,
.mathquill-rendered-math x:default {
display: inline-block;
}
.mathquill-rendered-math .numerator,
.mathquill-rendered-math .denominator {
display: block;
}
.mathquill-rendered-math .numerator {
padding: 0 0.1em;
margin-bottom: -0.1em;
}
.mathquill-rendered-math .denominator {
border-top: 1px solid;
float: right;
width: 100%;
padding: .1em .1em 0 .1em;
margin-right: -0.1em;
margin-left: -0.1em;
}
.mathquill-rendered-math .sqrt-prefix {
padding-top: 0;
position: relative;
top: .1em;
vertical-align: top;
-webkit-transform-origin: top;
-moz-transform-origin: top;
-ms-transform-origin: top;
-o-transform-origin: top;
transform-origin: top;
}
.mathquill-rendered-math .sqrt-stem {
border-top: 1px solid;
margin-top: 1px;
padding-left: .15em;
padding-right: .2em;
margin-right: .1em;
}
.mathquill-rendered-math,
.mathquill-rendered-math .mathquill-editable {
cursor: text;
font-family: Symbola, "Times New Roman", serif;
}
.mathquill-rendered-math .selection,
.mathquill-editable .selection,
.mathquill-rendered-math .selection .non-leaf,
.mathquill-editable .selection .non-leaf,
.mathquill-rendered-math .selection .scaled,
.mathquill-editable .selection .scaled {
background: #B4D5FE !important;
background: Highlight !important;
color: HighlightText;
border-color: HighlightText;
}
.mathquill-rendered-math .selection .matrixed,
.mathquill-editable .selection .matrixed {
background: #39F !important;
}
.mathquill-rendered-math .selection .matrixed-container,
.mathquill-editable .selection .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='#3399FF') !important;
}
.mathquill-rendered-math .selection.blur,
.mathquill-editable .selection.blur,
.mathquill-rendered-math .selection.blur .non-leaf,
.mathquill-editable .selection.blur .non-leaf,
.mathquill-rendered-math .selection.blur .matrixed,
.mathquill-editable .selection.blur .matrixed {
background: #D4D4D4 !important;
color: black;
border-color: black;
}
.mathquill-rendered-math .selection.blur .matrixed-container,
.mathquill-editable .selection.blur .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='#D4D4D4') !important;
}
.mathquill-editable .textarea,
.mathquill-rendered-math .textarea {
position: relative;
-webkit-user-select: text;
-moz-user-select: text;
user-select: text;
}
.mathquill-editable .textarea textarea,
.mathquill-rendered-math .textarea textarea,
.mathquill-editable .selectable,
.mathquill-rendered-math .selectable {
-webkit-user-select: text;
-moz-user-select: text;
user-select: text;
position: absolute;
clip: rect(1em 1em 1em 1em);
}
.mathquill-rendered-math .matrixed {
background: white;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='white');
margin-top: -0.1em;
}
......@@ -44,7 +44,8 @@
'fontsize', //字号
'bold', 'italic', 'underline',
'forecolor',//字体颜色
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
'justifyleft', 'justifycenter', 'justifyright',
'self-image','self-attachment','self-video'
//'music'
//'attachment', //附件
// 'source', '|',
......
......@@ -12,7 +12,7 @@ export default {
<style>
@import url('~assets/css/font.css');
@import url('//at.alicdn.com/t/font_2077629_6dh27k2xa4l.css');
@import url('//at.alicdn.com/t/font_2077629_zaei3cgua6b.css');
html,
body,
......
......@@ -62,38 +62,47 @@ export function UploadSelfFile(path, file, callback, configObj) {
/**
* 上传到当前站点
*/
export function UploadLocalSystem(configObj,fileObj,successCall)
{
var uploadLoadding = Loading;
uploadLoadding.show({
message: '正在上传文件,请稍后...'
})
let url = process.env.API + "/Upload/UploadFile";
let formData = new FormData()
if(configObj)
{
formData.append("params",configObj);
*/
export function UploadLocalSystem(configObj, fileObj, successCall) {
var uploadLoadding = Loading;
uploadLoadding.show({
message: '正在上传文件,请稍后...'
})
let url = process.env.API + "/Upload/UploadFile";
let formData = new FormData()
if (configObj) {
formData.append("params", configObj);
}
formData.append('myfile', fileObj)
let xhr = new XMLHttpRequest()
xhr.onload = function () {
uploadLoadding.hide();
var jsonObj = JSON.parse(xhr.responseText);
if (jsonObj && jsonObj.StatusCode && jsonObj.StatusCode == 1 && successCall) {
var uploadResult = {
Code: 1,
FileName: fileObj.name,
FileUrl: process.env.API + jsonObj.FilePath,
VideoCoverImg: process.env.API + jsonObj.VideoCoverImg,
Data: jsonObj.Data
}
if (successCall) {
successCall(uploadResult);
}
}
formData.append('myfile', fileObj)
let xhr = new XMLHttpRequest()
xhr.onload = function () {
uploadLoadding.hide();
var jsonObj = JSON.parse(xhr.responseText);
if (jsonObj.StatusCode == 1 && successCall) {
var uploadResult = {
Code: 1,
FileName: fileObj.name,
FileUrl: process.env.API + jsonObj.FilePath,
VideoCoverImg: process.env.API + jsonObj.VideoCoverImg,
}
if (successCall) {
successCall(uploadResult);
}
if (jsonObj && jsonObj.Code && jsonObj.Code == 1 && successCall) {
var uploadResult = {
Code: 1,
Data: jsonObj.Data,
Message: jsonObj.Message
}
if (successCall) {
successCall(uploadResult);
}
}
xhr.open('post', url, true)
xhr.send(formData)
}
xhr.open('post', url, true)
xhr.send(formData)
}
/**
......
......@@ -122,3 +122,15 @@ export function queryDifficultyType() {
data: {}
})
}
/**
* 批量添加问题
* @param {JSON参数} data
*/
export function saveQuestionBeatch(data) {
return request({
url: '/Question/SetQuestionBeatch',
method: 'post',
data
})
}
......@@ -84,13 +84,13 @@ export function CreateQuestion(questionKey) {
Name: "A",
Content: ""
}];
var array2 = [{
var array3 = [{
Name: "1",
Content: "A"
}];
AnswerList.push(array1);
AnswerList.push(array2);
AnswerList.push(array2);
AnswerList.push(array3);
break;
//排序题
case "sorting-problem":
......
......@@ -22,3 +22,69 @@
border:1px solid #2961fe!important;
color:#fff!important;
}
.common_TiTable{
width:100%;
border-collapse:separate;
border-spacing:0px 20px;
}
.common_TiTable td{
vertical-align: top;
}
.num_option_dx {
display: inline-block;
width: 30px;
height: 30px;
border: 1px solid #E1EAF4;
border-radius: 5px;
text-align: center;
line-height: 30px;
font-size: 14px;
color: #646873;
margin-top: 4px;
cursor: pointer;
}
.num_option_dx:hover {
border: 1px solid #94c1ff;
background: #e6f0ff;
color: #6BA9FF;
}
.InpDIV{
width: 765px;
height: 38px;
border-radius: 4px;
border: 1px solid #E1EAF4;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
font-size: 14px;
padding: 0 10px;
line-height: 38px;
padding-left: 10px;
font-size: 14px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.Tiku_DelIcon{
color:#c3c3c3;
font-weight: bold;
display: none;
font-size:18px;
cursor: pointer;
}
.Tiku_DelIcon:hover{
color:gray;
}
.common_TiTable tr:hover .Tiku_DelIcon{
display: block!important;
}
.addTiMuList{
cursor: pointer;
color:#3A8BFF;
font-size:13px;
height:40px;
}
.addTiMuList:hover{
opacity: 0.7;
}
\ No newline at end of file
<style scoped>
<style>
.el-dialog__wrapper{
z-index:99999!important;
}
.cloud_Table{
text-align: center;
}
</style>
<template id="app-attachment">
<div class="app-attachment" style="z-index:99999">
<el-dialog class="app-attachment-dialog" style="width:1000px;height:800px;margin:0 auto;"
<el-dialog class="app-attachment-dialog" style="width:1000px;height:800px;margin:0 auto;z-index:99999"
:title="title ? title : '选择文件'" :visible.sync="dialogVisible" @opened="dialogOpened"
:close-on-click-modal="false">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="本地文件" name="first">
<el-upload class="avatar-uploader" action="" :accept="accept" :show-file-list="false"
<el-upload class="upload-demo" action="" :accept="accept" :show-file-list="false"
:http-request="UploadAttachment" :multiple="uploadMultple">
<div class="app-upload" flex="main:center cross:center" style="width: 100px; height: 100px;">
<i class="el-icon-upload"></i>
<div class="app-upload" flex="main:center cross:center" style="width: 200px; height: 120px;font-size:67px;border:1px dashed #d1d1d1;">
<i class="el-icon-upload" style="font-size:64px;"></i>
</div>
</el-upload>
</el-tab-pane>
<el-tab-pane label="云盘文件" name="second">
<table style="width:100%">
<table style="width:100%" class="cloud_Table">
<tr>
<th width="8%">
选择
......@@ -120,7 +126,6 @@
break;
}
}
},
immediate: true
},
......@@ -165,6 +170,7 @@
fileUrl: res.FileUrl
})
this.$emit("selected", this.chooseFileArray);
this.chooseFileArray=[];
}
})
},
......
......@@ -113,7 +113,7 @@
methods: {
UploadAttachment(files) {
var fileParams = {
Excel: 1,
Word: 1,
Analysis: 1,
CourseId: this.CourseId,
Uid:this.getLocalStorage().Id
......
<style>
</style>
<template id="app-rich-text">
<div class="app-rich-text">
<textarea style="width: 100%" :id="id"></textarea>
<app-attachment v-show="attachmentDialogVisible" style="height:0" :uploadMultple="uploadMultple"
<app-attachment v-show="attachmentDialogVisible" style="height:0;" :uploadMultple="uploadMultple"
:openDialog="attachmentDialogVisible" :chooseMultple="chooseMultple" @closed="attachmentClosed"
@selected="attachmentSelected" :uploadType="uploadType">
</app-attachment>
......@@ -90,8 +92,17 @@
attachmentSelected(e) {
if (e.length) {
let html = '';
for (let i in e) {
html += '<img src="' + e[i].fileUrl + '" style="max-width: 100%;">';
if (this.uploadType == 1) {
for (let i in e) {
html += '<img src="' + e[i].fileUrl + '" style="max-width: 100%;">';
}
}
if (this.uploadType == 2) {
for (let i in e) {
html +=
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="${e[i].fileName}" data="xls" data="996d63ec05ac942608319958a0fa3480">` +
`<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/txt.png" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;">${e[i].fileName}</span></p>`
}
}
this.ue.execCommand('inserthtml', html);
}
......@@ -101,12 +112,10 @@
const _this = this;
//上传附件
if (_this.isShowInsertImage) {
UE.registerUI('appinsertimage', (editor, uiName) => {
UE.registerUI('self-image', (editor, uiName) => {
return new UE.ui.Button({
name: uiName,
title: _this.labelIcon,
//添加额外样式,指定icon图标,这里默认使用一个重复的icon
cssRules: 'background-position: -381px 0px;',
onclick() {
_this.ue = editor
_this.uploadType = "1"
......@@ -117,12 +126,10 @@
}
//上传附件
if (_this.isShowAttachment) {
UE.registerUI('Attachment', (editor, uiName) => {
UE.registerUI('self-attachment', (editor, uiName) => {
return new UE.ui.Button({
name: uiName,
title: "附件",
//添加额外样式,指定icon图标,这里默认使用一个重复的icon
cssRules: 'background-position: -620px -40px;',
onclick() {
_this.ue = editor
_this.uploadType = "2"
......@@ -133,12 +140,10 @@
}
//是否显示音频
if (_this.isShowVoice) {
UE.registerUI('music', (editor, uiName) => {
UE.registerUI('self-video', (editor, uiName) => {
return new UE.ui.Button({
name: uiName,
title: "音频",
//添加额外样式,指定icon图标,这里默认使用一个重复的icon
cssRules: 'background-position:-18px -40px;',
onclick() {
_this.ue = editor
_this.uploadType = "3"
......
......@@ -3,7 +3,7 @@
font-size: 14px;
color: #646873;
line-height: 34px;
margin-bottom: 16px;
/* margin-bottom: 16px; */
overflow: hidden;
padding: 4px 0;
cursor: default;
......@@ -82,6 +82,13 @@
right:-8px;
top:-10px;
}
.question_number{
color: #A8A8B3;
font-size: 12px;
margin-top: -8px;
padding-bottom: 12px;
display: inline-block;
}
</style>
<template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale">
......@@ -112,10 +119,9 @@
<div class="edit_stem">
{{questionName}}
</div>
<br />
<div class="col-12">
<template v-if="questionObj.Key=='cloze'">
选项处用##题号##替换,如##1##
<span class="question_number">选项处用##题号##替换,如##1##</span>
</template>
<UeEditor v-if="questionObj.Key!='sharing-choose'" v-model="objOption.Title" :config="config"
ref="UE_Title"></UeEditor>
......
<style>
</style>
<template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale">
<q-card style="width: 1400px;max-width:900px;min-height:100px;">
<q-card-section>
<div class="text-h6">{{importType==1?'模板导入(EXCEL)':'智能导入(WORD)'}}
<a style="color:blue;cursor:pointer;float:right;margin-right:5px;text-decoration:none;" :href="downLoadUrl"
:download="downLoadName">下载模板文件</a>
</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<table>
<thead>
<tr>
<td>
<el-upload class="upload-demo" action="" :accept="accept" :show-file-list="false"
:http-request="UploadAttachment">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</td>
</tr>
</thead>
<tr>
<td>
<template v-for="(item,index) in questionData">
<div style="margin-bottom:20px;">
<span>{{index+1}}. [{{item.QuestionTypeName}}]
<template v-if="IsEdit&&ClickIndex==index">
<input type="text" v-model="item.Title" />
</template>
<template v-else>
{{item.Title}}
</template>
<a style="cursor:pointer;color:blue;" @click="EditQuestion(item,index)">修改</a>&nbsp;
<a style="cursor:pointer;color:red;" @click="DeleteQuestion(index)">删除</a>
</span><br />
<!--选择题-->
<template v-if="item.QuestionTypeKey=='single'||item.QuestionTypeName=='multiple'"
v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Name}}.{{subItem.Content}} </span><br />
</template>
<!--判断题-->
<template v-if="item.QuestionTypeKey=='judge'" v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Name}}.{{subItem.Content}} </span><br />
</template>
<!--填空题-->
<template v-if="item.QuestionTypeKey=='fill-in'" v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Content}} </span><br />
</template>
<span>答案:{{item.Answer}} </span><br />
<template v-if="item.AnswerParse">
<span>答案解析:{{item.AnswerParse}} </span><br />
</template>
<template v-if="item.DifficultyTypeStr">
<span v-if="item.DifficultyTypeStr">难易程度:{{item.DifficultyTypeStr}} </span><br />
</template>
</div>
</template>
</td>
</tr>
</table>
</q-card-section>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeCourseForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCourseLoading"
@click="setQuestion" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
saveQuestionBeatch,
} from '../../api/question/question'
import {
UploadLocalSystem
} from '../../api/common/common'
import UeEditor from '../editor/UeEditor'
//知识点列表
import questionpoint from './questionpoint'
import single from '../questiontype/single'
import multiple from '../questiontype/multiple'
import fillIn from '../questiontype/fill-in'
import judge from '../questiontype/judge'
import shortAnswer from '../questiontype/short-answer'
import entryProblem from '../questiontype/entry-problem'
import matching from '../questiontype/matching'
import sortingProblem from '../questiontype/sorting-problem'
import cloze from '../questiontype/cloze'
import readingComprehensio from '../questiontype/reading-comprehensio'
import sharingChoose from '../questiontype/sharing-choose'
export default {
components: {
UeEditor,
questionpoint, //知识点
single, //单选题
multiple, //多选题
fillIn, //填空题
judge, //判断题
shortAnswer, //简答题
entryProblem, //分录题
matching, //连线题
sortingProblem, //排序题
cloze, //完型填空
readingComprehensio, //阅读理解
sharingChoose, //共用选择题
},
props: {
importType: {
type: Number,
default: 0 //1-模板导入(Excel),2-智能导入(Word)
},
CourseId: {
type: String,
default: "0",
}
},
data() {
return {
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
persistent: true,
saveCourseLoading: false,
IsEdit: false,
ClickIndex: 0,
questionData: [], //导入问题列表
chooseItem: {}, //当前选择的项
ExcelUrl: "http://imgfile.oytour.com/static/EduExcelTemplate.xls",
WordUrl: "http://imgfile.oytour.com/static/EduWordTemplate.doc",
}
},
computed: {
accept: {
get() {
if (this.importType == 1) {
return '.xls,.xlsx';
}
if (this.importType == 2) {
return '.doc,.docx';
}
return '*/*';
},
},
downLoadUrl: {
get() {
if (this.importType == 1) {
return this.ExcelUrl;
}
if (this.importType == 2) {
return this.WordUrl;
}
return '';
}
},
downLoadName: {
get() {
if (this.importType == 1) {
return "EduExcelTemplate.xls";
}
if (this.importType == 2) {
return "EduWordTemplate.doc";
}
return '';
}
},
},
created() {
},
mounted() {
},
methods: {
//修改问题
EditQuestion(item, index) {
this.chooseItem = item;
this.IsEdit = true;
this.ClickIndex = index;
},
//删除问题
DeleteQuestion(index) {
},
//上传文件
UploadAttachment(files) {
var fileParams = {
Analysis: 1,
CourseId: this.CourseId,
Uid: this.getLocalStorage().Id
}
if (this.importType == 2) {
fileParams.Word = 1;
} else {
fileParams.Excel = 1;
}
UploadLocalSystem(JSON.stringify(fileParams), files.file, res => {
if (res.Code == 1) {
this.questionData = res.Data;
console.log("this.questionData", this.questionData);
}
})
},
//关闭弹窗
closeCourseForm() {
this.$emit('close')
this.persistent = false
},
//保存问题
setQuestion() {
if (this.questionData && this.questionData.length > 0) {
this.questionData.forEach(item => {
item.CourseId = this.CourseId
})
}
this.saveCourseLoading = true;
saveQuestionBeatch(this.questionData).then(res => {
this.saveCourseLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
})
}
},
}
</script>
<!--完型填空-->
<style>
.clozeQuestion {
width: 100%;
}
.clozeQuestion .question_Title {
color: #A8A8B3;
font-size: 12px;
margin-top: 20px;
}
.clozeQuestion .clozeTest_question_tit {
width: 100%;
height: 40px;
background: #F7F8FA;
padding: 0 20px;
line-height: 40px;
font-size: 14px;
color: #646873;
display: flex;
justify-content: space-between;
align-items: center;
}
.clozeQuestion .clozeTest_question_tit i {
color: #acbfd9;
cursor: pointer;
}
.clozeQuestion .add_LiteBtn {
width: 100px;
height: 30px;
display: inline-block;
box-shadow: 0 3px 12px 0 rgba(39, 125, 255, 0.30);
color: #FFFFFF;
text-align: center;
line-height: 30px;
border-radius: 20px;
cursor: pointer;
background-color: #2961fe;
margin-bottom: 20px;
}
.clozeQuestion .add_LiteBtn:hover {
opacity: 0.8;
}
</style>
<template>
<div class="clozeQuestion">
<div class="question_Title">小题数:{{data.length}}</div>
<template v-if="data&&data.length>0" v-for="(item,index) in data">
<table>
<table class="common_TiTable">
<thead>
<tr>
<th colspan="3" style="text-align:left;">
{{index+1}}
<th colspan="3">
<div class="clozeTest_question_tit" @click="showNav(index)">
<div>
<i class="iconfont icon-arrowdown2" v-if="(commonIndex==index)&&!isShow"></i>
<i class="iconfont icon-arrowright" v-else></i>
{{index+1}}小题
</div>
<div>
<i class="iconfont icon-img_delete_small" @click.stop="deleteQuestion(index)"></i>
</div>
</div>
</th>
</tr>
</thead>
<tbody>
<tbody class="contant" v-if="(commonIndex==index)&&!isShow">
<tr v-for="(subItem,subIndex) in item">
<td>
<el-checkbox v-model="subItem.IsAnswer" @change="ChangeItem(item,subItem)">{{subItem.Name}}</el-checkbox>
<td style="width:40px;text-align:center;">
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
</td>
<td>
<UeEditor v-model="subItem.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="subItem.Content" v-if="childIndex!=subIndex" @click="changeEdit(subIndex)">
</div>
<UeEditor v-model="subItem.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(item,subIndex)">删除</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(item,subIndex)"></i>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption(item)">添加选项</a>
&nbsp;
<a style="cursor:pointer;" @click="deleteQuestion(index)">删除问题</a>
<a class="addTiMuList" @click="addOption(item)">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
</tr>
</tfoot>
</table>
</template>
<br />
<a style="cursor:pointer;color:blue;" @click="addQuestion()">添加问题</a>
<a class="add_LiteBtn" @click="addQuestion()">
+添加小题
</a>
</div>
</template>
<script>
......@@ -64,6 +124,11 @@
initialFrameHeight: 80,
},
optionTitleList: [],
showTag: true,
commonIndex: -1,
childIndex: -1,
isShow: true,
commonIndex2: -2,
};
},
created() {
......@@ -75,12 +140,43 @@
},
//删除小问题
deleteQuestion(index) {
this.data.splice(index, 1);
this.$q.dialog({
title: "删除小题",
message: "确实要删除该小题吗?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
this.data.splice(index, 1);
});
},
//删除选项
deleteOpion(item, index) {
item.splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: "删除小题",
message: "确实要删除该选项吗?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
item.splice(index, 1);
this.childIndex=-1;
this.calcOptionTitle();
});
},
//新增选项
addOption(item) {
......@@ -127,6 +223,21 @@
}
subItem.IsAnswer = true;
},
//点击展开收起
showNav(index) {
if (this.commonIndex2 == index) {
this.commonIndex = index;
this.isShow = !this.isShow;
} else {
this.commonIndex = index;
this.isShow = false;
this.commonIndex2 = index;
}
},
//点击切换输入
changeEdit(index) {
this.childIndex = index;
}
},
mounted() {
......
<!--分录题-->
<style>
.entryProblemQuestion{
width:100%;
}
.entrytk_info{
color: #A8A8B3;
font-size: 12px;
line-height: 24px;
cursor: default;
}
</style>
<template>
<div class="entryProblemQuestion">
<table v-if="data&&data.length>0">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td>
{{index+1}} </el-checkbox>
<td style="width:40px;text-align:center;padding-top:8px;">
{{index+1}}</el-checkbox>
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(index)">删除</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
<!-- <a style="cursor:pointer;" @click="deleteOpion(index)">删除</a> -->
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption()">添加选项</a>
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
<!-- <a style="cursor:pointer;" @click="addOption()">添加选项</a> -->
</td>
</tr>
<tr>
<td colspan="3">
1. 一个空有多种答案时请用";"隔开。如:水;H2O
<br />
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
<div class="entrytk_info">
1. 一个空有多种答案时请用";"隔开。如:水;H2O
<br />
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</div>
</td>
</tr>
</tfoot>
......@@ -51,14 +66,30 @@
initialFrameWidth: null,
initialFrameHeight: 80,
},
commonIndex:-1,
};
},
created() {},
methods: {
//删除选项
deleteOpion(index) {
this.data.splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: "删除小题",
message: "确实要删除该选项吗?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
this.data.splice(index, 1);
this.commonIndex=-1;
});
},
//新增选项
addOption() {
......@@ -70,6 +101,9 @@
returnDataToParent() {
this.$emit('getChild', this.data);
},
changeEdit(index){
this.commonIndex = index;
}
},
mounted() {
......
<!--填空题-->
<style>
.fillInQuestion{
width:100%;
}
.tk_info {
color: #A8A8B3;
font-size: 12px;
line-height: 24px;
cursor: default;
margin-top:20px;
}
</style>
<template>
<div class="fillInQuestion">
<table v-if="data&&data.length>0">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td>
{{index+1}} </el-checkbox>
<td style="width:50px;text-align:center;padding-top:8px;">
{{index+1}}</el-checkbox>
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(index)">删除</a>
<td style="width:30px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption()">添加选项</a>
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
</tr>
<tr>
<td colspan="3">
<el-checkbox v-model="setOption.IsMutex" :true-label="1" :false-label="0">答案顺序打乱也判正确</el-checkbox>
<br />
1. 一个空有多种答案时请用";"隔开。如:水;H2O
<br />
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
<el-checkbox v-model="setOption.IsMutex" :true-label="1" :false-label="0"><span style="font-size:12px;">答案顺序打乱也判正确</span></el-checkbox>
<div class="tk_info">
1. 一个空有多种答案时请用";"隔开。如:水;H2O
</br>
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</div>
</td>
</tr>
</tfoot>
......@@ -56,14 +69,25 @@
initialFrameWidth: null,
initialFrameHeight: 80,
},
commonIndex:-1,
};
},
created() {},
methods: {
//删除选项
deleteOpion(index) {
this.data.splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data.splice(index, 1);
}).onCancel(() => {
});
},
//新增选项
addOption() {
......@@ -75,6 +99,10 @@
returnDataToParent() {
this.$emit('getChild', this.data);
},
//点击切换输入
changeEdit(index){
this.commonIndex=index;
}
},
mounted() {
......
<!--判断题-->
<style>
.judgeQuestion{
width:100%;
}
</style>
<template>
<div class="judgeQuestion">
<table v-if="data&&data.length>0">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td>
<el-checkbox v-model="item.IsAnswer" @change="ChangeItem(item)">{{item.Name}}</el-checkbox>
<td style="width:50px;text-align:center;">
<div class="Answer_List" @click="ChangeItem(item)" :class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
</div>
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<td style="vertical-align:middle;">
<span v-if="index==0"></span>
<span v-if="index==1"></span>
<!-- <UeEditor v-model="item.Content" :config="config"></UeEditor> -->
</td>
</tr>
</table>
......
<!--连线题-->
<style>
.matchingQuestion {
width: 100%;
}
.team_tit {
display: inline-block;
font-size: 14px;
color: #A8A8B3;
padding-bottom: 20px;
margin-left: 13px;
}
.line_center {
display: inline-block;
width: 28px;
height: 10px;
border-top: 1px solid #E1E1E5;
margin: 13px 12px 0 0;
}
.selectBox2 {
display: inline-block;
vertical-align: top;
text-align: left;
position: relative;
cursor: pointer;
width: 58px;
line-height: 24px;
height: 24px;
background: #FFFFFF;
border: 1px solid #E1E1E5;
border-radius: 4px;
font-size: 12px;
color: #181E33;
outline: none;
}
</style>
<template>
<div class="matchingQuestion">
<span>第一组</span>
<table v-if="data&&data.length>0">
<span class="team_tit" style="margin-top:20px;padding-bottom:0;">第1组:</span>
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data[0]">
<td>
<td style="width:40px;text-align:center;padding-top:10px;">
{{item.Name}}
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(0,index)">删除</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(0,index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption(0)">添加选项</a>
<a class="addTiMuList" style="margin-left:13px;" @click="addOption(0)">
<i class="iconfont icon-add"></i>添加更多
</a>
</td>
</tr>
</tfoot>
</table>
<span>第二组</span>
<table v-if="data&&data.length>1">
<span class="team_tit">第2组:</span>
<table v-if="data&&data.length>1" class="common_TiTable">
<tr v-for="(item,index) in data[1]">
<td>
<td style="width:40px;text-align:center;padding-top:10px;">
{{item.Name}}
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex2!=index" @click="changeEdit2(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(0,index)">删除</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(1,index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption(1)">添加选项</a>
<a class="addTiMuList" style="margin-left:13px;" @click="addOption(1)">
<i class="iconfont icon-add"></i>添加更多
</a>
</td>
</tr>
</tfoot>
</table>
<span>答案</span>
<table v-if="data&&data.length>2">
<tr v-for="(item,index) in data[2]">
<td>
<span class="team_tit">答案</span>
<table v-if="data&&data.length>2" style="padding-left:13px;">
<tr v-for="(item,index) in data[0]">
<td style="width:30px;">
{{item.Name}}
</td>
<td>
-----
<span class="line_center"></span>
</td>
<td>
<select v-model="item.Content">
<select v-model="data[2][index].Content" class="selectBox2">
<template v-for="(cItem,cIndex) in data[1]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
......@@ -89,6 +131,8 @@
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex: -1,
commonIndex2: -1
};
},
computed: {
......@@ -103,8 +147,25 @@
},
//删除选项
deleteOpion(index, subIndex) {
this.data[index].splice(subIndex, 1);
this.calcOptionTitle();
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
//删除第一组是,也删除答案里面的
if (index == 0) {
this.data[2].splice(subIndex, 1);
}
this.data[index].splice(subIndex, 1);
this.commonIndex=-1;
this.commonIndex2=-1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//新增选项
addOption(index) {
......@@ -138,9 +199,17 @@
returnDataToParent() {
this.$emit('getChild', this.data);
},
//点击切换输入
changeEdit(index) {
this.commonIndex = index;
this.commonIndex2 = -1;
},
changeEdit2(index) {
this.commonIndex2 = index;
this.commonIndex = -1;
}
},
mounted() {
},
watch: {
data: {
......
<!--多选题-->
<style>
.multipleQuestion{
width:100%;
}
</style>
<template>
<div class="multipleQuestion">
<table v-if="data&&data.length>0">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td>
<el-checkbox v-model="item.IsAnswer">{{item.Name}}</el-checkbox>
<td style="width:40px;text-align:center;">
<div class="num_option_dx" @click="ChangeItem(item)" :class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
</div>
<!-- <el-checkbox v-model="item.IsAnswer">{{item.Name}}</el-checkbox> -->
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(index)">删除</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
<!-- <a style="cursor:pointer;" @click="deleteOpion(index)">删除</a> -->
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption()">添加选项</a>
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
</tr>
</tfoot>
......@@ -51,6 +60,7 @@
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex:-1,
};
},
created() {
......@@ -62,8 +72,20 @@
},
//删除选项
deleteOpion(index) {
this.data.splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data.splice(index, 1);
this.commonIndex=-1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//新增选项
addOption() {
......@@ -108,6 +130,14 @@
}
this.$emit('getChild', this.data);
},
//点击设为答案
ChangeItem(item){
item.IsAnswer = !item.IsAnswer;
},
//点击切换输入
changeEdit(index){
this.commonIndex=index;
}
},
mounted() {
......
<!--阅读理解-->
<style>
.readingComprehensioQuestion{
width:100%;
}
.edui-editor-toolbarbox{
text-align: left;
}
.readingComprehensioQuestion .clozeTest_question_tit {
width: 100%;
height: 40px;
background: #F7F8FA;
padding: 0 20px;
line-height: 40px;
font-size: 14px;
color: #646873;
display: flex;
justify-content: space-between;
align-items: center;
}
.clozeTest_question_tit i {
color: #acbfd9;
cursor: pointer;
}
</style>
<template>
<div class="readingComprehensioQuestion">
<template v-if="data&&data.length>0" v-for="(item,index) in data">
<table>
<table class="common_TiTable">
<thead>
<tr>
<th colspan="3" style="text-align:left;">
{{index+1}} 题 ({{item.QuestionName}})
<div class="clozeTest_question_tit" @click="showNav(index)">
<div>
<i class="iconfont icon-arrowdown2" v-if="(commonIndex==index)&&!isShow"></i>
<i class="iconfont icon-arrowright" v-else></i>
{{index+1}}小题<span style="color:#A8A8B3;">({{item.QuestionName}})</span>
</div>
<div>
<i class="iconfont icon-img_delete_small" @click.stop="deleteQuestion(index)"></i>
</div>
</div>
</th>
</tr>
<tr>
<!-- <tr>
<th colspan="3">
<UeEditor v-model="item.SubTitle" :config="config"></UeEditor>
</th>
</tr>
</tr> -->
</thead>
<tbody>
<tbody v-if="(commonIndex==index)&&!isShow">
<tr>
<td colspan="3">
<UeEditor v-model="item.SubTitle" :config="config"></UeEditor>
</td>
</tr>
<!--选择题-->
<template v-if="item.QuestionKey=='single' ||item.QuestionKey=='multiple'">
<tr v-for="(subItem,subIndex) in item.SubAnwser">
<td>
<td style="width:40px;text-align:center;">
<template v-if="item.QuestionKey=='single'">
<el-checkbox v-model="subItem.IsAnswer" @change="ChangeItem(item,subItem)">{{subItem.Name}}
</el-checkbox>
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
</template>
<template v-else-if="item.QuestionKey=='multiple'">
<el-checkbox v-model="subItem.IsAnswer">{{subItem.Name}}
</el-checkbox>
<div class="Answer_List" @click="changeMutile(subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
</template>
</td>
<td>
<UeEditor v-model="subItem.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="subItem.Content" v-if="childIndex!=subIndex"
@click="changeEdit(subIndex)"></div>
<UeEditor v-model="subItem.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(item,subIndex)">删除</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(item,subIndex)"></i>
</td>
</tr>
</template>
<!--填空题-->
<template v-if="item.QuestionKey=='fill-in'">
<tr v-for="(subItem,subIndex) in item.SubAnwser">
<td>
{{subIndex+1}}
<td style="width:50px;text-align:center;padding-top:8px;">
{{subIndex+1}}
</td>
<td>
<UeEditor v-model="subItem.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="subItem.Content" v-if="childIndex!=subIndex"
@click="changeEdit(subIndex)"></div>
<UeEditor v-model="subItem.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(item,subIndex)">删除</a>
<td style="width:30px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(item,subIndex)"></i>
</td>
</tr>
</template>
<!--判断题-->
<template v-if="item.QuestionKey=='judge'">
<tr v-for="(subItem,subIndex) in item.SubAnwser">
<td>
<el-checkbox v-model="subItem.IsAnswer" @change="ChangeItem(item,subItem)">{{subItem.Name}}
</el-checkbox>
<td style="width:50px;">
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
</td>
<td colspan="2" style="text-align:left;">
<td colspan="2" style="text-align:left;vertical-align:middle;">
{{subItem.Content}}
</td>
</tr>
......@@ -75,26 +117,29 @@
</tr>
</template>
</tbody>
<tfoot>
<tfoot v-if="item.QuestionKey=='single' ||item.QuestionKey=='multiple'||item.QuestionKey=='fill-in'">
<tr>
<td colspan="3">
<!--选择题-->
<template v-if="item.QuestionKey=='single' ||item.QuestionKey=='multiple'">
<a style="cursor:pointer;" @click="addOption(item)">添加选项</a>
<a class="addTiMuList" @click="addOption(item)">
<i class="iconfont icon-add"></i>添加选项
</a>
</template>
<!--填空题-->
<template v-if="item.QuestionKey=='fill-in'">
<a style="cursor:pointer;" @click="addFillIn(item)">添加更多</a>
<a class="addTiMuList" @click="addFillIn(item)">
<i class="iconfont icon-add"></i>添加更多
</a>
</template>
&nbsp;
<a style="cursor:pointer;" @click="deleteQuestion(index)">删除问题</a>
</td>
</tr>
</tfoot>
</table>
</template>
<br />
<q-btn-dropdown color="primary" label="添加小题" style="margin-left:5px;">
<q-btn-dropdown color="primary" label="添加小题" style="margin:0 0 20px 5px;">
<q-list>
<q-item v-for="(fItem,fIndex) in firstTypeList" @click="onItemClick(fItem)" clickable v-close-popup
:key="fIndex">
......@@ -134,6 +179,10 @@
},
optionTitleList: [],
firstTypeList: [], //问题类型
commonIndex:-1,
isShow:true,
commonIndex2:-2,
childIndex: -1,
};
},
created() {
......@@ -157,7 +206,18 @@
},
//删除小题
deleteQuestion(index) {
this.data.splice(index, 1);
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data.splice(index, 1);
}).onCancel(() => {
});
},
//添加小题
onItemClick(item) {
......@@ -180,8 +240,20 @@
},
//删除选项
deleteOpion(item, index) {
item.SubAnwser.splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
item.SubAnwser.splice(index, 1);
this.childIndex=-1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//新增选项
addOption(item) {
......@@ -236,6 +308,25 @@
}
subItem.IsAnswer = true;
},
//多选题
changeMutile(subItem){
subItem.IsAnswer = !subItem.IsAnswer;
},
//点击切换输入
changeEdit(index){
this.childIndex=index;
},
// //点击展开收起
showNav(index) {
if(this.commonIndex2==index){
this.commonIndex=index;
this.isShow=!this.isShow;
}else{
this.commonIndex=index;
this.isShow=false;
this.commonIndex2=index;
}
},
},
mounted() {
......
<!--共用选择题-->
<style>
.sharingChooseQuestion{
width:100%;
}
.B-info{
font-size: 14PX;
color: #A8A8B3;
padding-bottom: 10px;
margin-left:13px;
}
</style>
<template>
<div class="sharingChooseQuestion">
<table v-if="data&&data.length>0">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data[0]">
<td>
<td style="width:40px;text-align:center;padding-top:8px;">
{{item.Name}}
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(index)">删除</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption()">添加选项</a>
<a class="addTiMuList" style="margin-left:13px;" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
</tr>
</tfoot>
</table>
<br />
<table v-if="data&&data.length>0">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data[1]">
<td>
<td style="width:40px;text-align:center;padding-top:8px;">
{{index+1}}
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex2!=index" @click="changeEdit2(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteQuestion(index)">删除题干</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteQuestion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addQuestion()">添加题干</a>
<a class="addTiMuList" style="margin-left:13px;" @click="addQuestion()">
<i class="iconfont icon-add"></i>添加题干
</a>
</td>
</tr>
</tfoot>
</table>
<br />
答案:
<br />
<table v-if="data&&data.length>0">
<div class="B-info">答案:</div>
<table v-if="data&&data.length>0" style="margin-bottom:20px;">
<tr v-for="(item,index) in data[1]">
<td>
<td style="padding:12px 0 0 13px;">
{{index+1}}
</td>
<td>
<select v-model="item.Name">
<select v-model="item.Name" class="selectBox" style="margin:10px 0 0 0;outline:none;">
<template v-for="(cItem,cIndex) in data[0]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
......@@ -91,6 +101,8 @@
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex:-1,
commonIndex2:-2
};
},
created() {
......@@ -102,8 +114,20 @@
},
//删除选项
deleteOpion(index) {
this.data[0].splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data[0].splice(index, 1);
this.commonIndex=-1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//新增选项
addOption() {
......@@ -125,8 +149,20 @@
},
//删除题干
deleteQuestion(index) {
this.data[1].splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data[1].splice(index, 1);
this.commonIndex2=-1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//添加题干
addQuestion() {
......@@ -148,6 +184,14 @@
returnDataToParent() {
this.$emit('getChild', this.data);
},
changeEdit(index){
this.commonIndex=index;
this.commonIndex2=-1;
},
changeEdit2(index){
this.commonIndex=-1;
this.commonIndex2=index;
}
},
mounted() {
......
<!--简答题-->
<style>
.shortAnswerQuestion{
width:100%;
margin-bottom:20px;
}
</style>
<template>
<div class="shortAnswerQuestion">
......
......@@ -2,53 +2,11 @@
.singleQuestion{
width:100%;
}
.singleQuestion .InpDIV {
width: 765px;
height: 38px;
border-radius: 4px;
border: 1px solid #E1EAF4;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
font-size: 14px;
padding: 0 10px;
line-height: 38px;
padding-left: 10px;
font-size: 14px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.singleQuestion .delIcon{
color:#c3c3c3;
font-weight: bold;
display: none;
font-size:18px;
cursor: pointer;
}
.singleQuestion .delIcon:hover{
color:gray;
}
.singleQuestion table tr td{
vertical-align: top;
}
.singleQuestion table tr:hover .delIcon{
display: block!important;
}
.singleQuestion .addSingle{
cursor: pointer;
color:#3A8BFF;
font-size:13px;
height:40px;
}
.singleQuestion .addSingle:hover{
opacity: 0.7;
}
</style>
<!--单选题-->
<template>
<div class="singleQuestion">
<table v-if="data&&data.length>0" style="width:100%;border-collapse:separate; border-spacing:0px 20px;">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td style="width:40px;text-align:center;">
<div class="Answer_List" @click="ChangeItem(item)" :class="{'Is_Answer':item.IsAnswer}">
......@@ -60,13 +18,13 @@
<UeEditor v-model="item.Content" v-else :config="config"></UeEditor>
</td>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi delIcon" @click="deleteOpion(index)"></i>
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a class="addSingle" @click="addOption()">
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
......@@ -114,8 +72,20 @@
},
//删除选项
deleteOpion(index) {
this.data.splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data.splice(index, 1);
this.commonIndex=-1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//新增选项
addOption() {
......
<!--排序题-->
<style>
.sortingProblemQuestion{
width:100%
}
.team_tit{
font-size: 14px;
color: #A8A8B3;
padding-bottom: 20px;
}
.selectBox{
display: inline-block;
vertical-align: top;
text-align: left;
position: relative;
cursor: pointer;
width: 58px;
line-height: 24px;
height: 24px;
background: #FFFFFF;
border: 1px solid #E1E1E5;
border-radius: 4px;
font-size: 12px;
color: #181E33;
margin: 0 20px 14px 0;
}
.blue-border {
border: 1px solid #FFFFFF;
box-shadow: 0 0 7px 1px #75BAFF;
}
</style>
<template>
<div class="sortingProblemQuestion">
<table v-if="data&&data.length>0">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data[0]">
<td>
<td style="width:40px;text-align:center;">
{{item.Name}}
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(index)">删除</a>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption()">添加选项</a>
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
</tr>
</tfoot>
</table>
答案:请在下方下拉框中对选项进行排序(顺序从左到右)
<br />
<div class="team_tit">答案:请在下方下拉框中对选项进行排序(顺序从左到右)</div>
<table v-if="data&&data.length>0">
<tr>
<td>
<template v-for="(item,index) in data[1]">
<select v-model="item.Name">
<select v-model="item.Name" class="selectBox" :class="{'blue-border':index==clickIndex}" @click="clickIndex=index">
<template v-for="(cItem,cIndex) in data[0]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
......@@ -64,9 +93,11 @@
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex:-1,
clickIndex:-1,
};
},
created() {
created() {
this.initConfig();
},
methods: {
......@@ -75,8 +106,25 @@
},
//删除选项
deleteOpion(index) {
this.data[0].splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: "删除小题",
message: "确实要删除该选项吗?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
this.data[0].splice(index, 1);
this.data[1].splice(index, 1);
this.commonIndex=-1;
this.calcOptionTitle();
});
},
//新增选项
addOption() {
......@@ -112,6 +160,10 @@
returnDataToParent() {
this.$emit('getChild', this.data);
},
//点击切换输入
changeEdit(index){
this.commonIndex=index;
},
},
mounted() {
......
......@@ -29,13 +29,13 @@
<template v-slot:body-cell-CoverImg="props">
<q-td :props="props">
<q-avatar square size="100px">
<img :src="props.value" />
<img v-if="props.value" :src="props.value" />
</q-avatar>
</q-td>
</template>
<template v-slot:body-cell-CourseIntro="props">
<q-td :props="props">
<span v-html="props.value"></span>
<span v-html="props.value" ></span>
</q-td>
</template>
<template v-slot:body-cell-Status="props">
......@@ -105,12 +105,7 @@
field: 'CoverImg',
align: 'left'
},
{
name: 'CourseIntro',
label: '课程介绍',
field: 'CourseIntro',
align: 'left'
},
{
name: 'CreateByName',
label: '创建人',
......
<style>
.page-content p{
margin:16px 0 0 0!important;
.page-content p {
margin: 16px 0 0 0 !important;
}
</style>
<template>
<div class="page-body">
......@@ -35,6 +36,20 @@
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增题目" @click="EditQuestion(null)" />
<q-btn-dropdown color="accent" label="批量导入" size="sm" class="q-mr-md" style="margin-left:5px;">
<q-list>
<q-item clickable v-close-popup>
<q-item-section @click="importQuestion(1)">
<q-item-label>模板导入(EXCEL)</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup>
<q-item-section @click="importQuestion(2)">
<q-item-label>智能导入(WORD)</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</template>
<template v-slot:body-cell-Title="props">
......@@ -57,6 +72,9 @@
<question-form v-if="isShowQuestionForm" :CourseId="msg.CourseId" :seting-obj="questionObj" @close="closeQuestion"
@success="refreshQuestion">
</question-form>
<question-upload v-if="isShowImportUpload" :CourseId="msg.CourseId" :importType="importType"
@close="closeQuestion" @success="refreshQuestion">
</question-upload>
</div>
</div>
</template>
......@@ -68,12 +86,14 @@
queryDifficultyType
} from '../../api/question/question';
import questionForm from '../../components/question/question-form';
import questionUpload from '../../components/question/question-upload';
export default {
meta: {
title: "题库列表"
},
components: {
questionForm
questionForm,
questionUpload
},
data() {
return {
......@@ -130,6 +150,8 @@
questionDifficultyTypeList: [], //问题难易程度列表
isShowQuestionForm: false,
questionObj: null,
importType: 0, //导入类型(1-模板导入;2-智能导入)
isShowImportUpload: false, //是否显示导入模板
}
},
created() {
......@@ -143,6 +165,10 @@
this.getQuestionList();
},
methods: {
importQuestion(type) {
this.importType = type;
this.isShowImportUpload = true;
},
//获取题型列表
getQuestionType() {
queryQuestionTypeList({}).then(res => {
......@@ -220,6 +246,7 @@
//刷新页面
refreshQuestion() {
this.isShowQuestionForm = false;
this.isShowImportUpload = false;
this.getQuestionList();
},
//新增修改问题
......@@ -235,6 +262,8 @@
closeQuestion() {
this.isShowQuestionForm = false;
this.questionObj = null;
this.isShowImportUpload = false;
this.importType = 0;
},
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment