<template>
	<div :style="{backgroundColor:(StandardAnswer === '' || StandardAnswer === null) || disabled == true?'':'#F2F6FC'}" style="padding: 20px;">
		<div style="font-size: 16px;">
			<span>{{content.tihao+". "}}{{getContent.TestContent}}</span><span style="color: #F56C6C;">（{{getContent.TestMark
}}分）</span>
		</div>
		<div style="padding-left: 20px;margin-top:20px">
			<el-radio-group v-model="StandardAnswer" @change="chooseXx">
				<el-radio :label="'正确'" :disabled="disabled" ><span style="font-size: 16px;">正确</span></el-radio>
				<el-radio :label="'错误'"  :disabled="disabled"  ><span style="font-size: 16px;">错误</span></el-radio>
			</el-radio-group>
		</div>
		<div style="color: #0000FF;margin-top: 20px;" v-if="show">
			标准答案：{{getContent.StandardAnswer}}
		</div>
		<div v-if="disabled">
			<div style="color: #0000FF;margin-top: 5px;">
				考生答案：{{getContent.userAnswer}}
			</div>
			<div :style="{color: getContent.userAnswer == getContent.StandardAnswer ?'#0000FF':'#F56C6C'}" style=" margin-top: 5px;">
				本题得分：{{getContent.userScore}}
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		name:"Panduan",
		props: {
			content: { // 传入的地址
				type: Object,
				default:null,
			},
			index:{
				type:Number,
				default:null,
			},
			show:{
				type:Boolean,
				default:true
			},
			fIndex:{
				type:Number,
				default:null,
			},
			disabled:{
				type:Boolean,
				default:false
			}
			
			
		},
		data() {
			return {
				StandardAnswer:"",
				
			};
		},
		computed: {
			getContent(){
				this.tmInfo = null
				this.tmInfo = {...this.content}
				this.StandardAnswer = this.tmInfo.userAnswer
				return this.tmInfo
			}
		},
		mounted() {
			
		},
		methods: {
			chooseXx(e){ 
				let obj = {
					fIndex:this.fIndex,
					index:this.index,
					xx:e,
					tihao:this.content.tihao
				}
				this.$emit("chooseXx",obj)
			}
		},
	};
</script>

<style scoped lang="scss">
	::v-deep .el-radio__input.is-disabled + span.el-radio__label{
		color:#606266 !important;
	}
	::v-deep .el-radio__input.is-disabled.is-checked .el-radio__inner{
		background-color:  #1890ff !important;
	}
</style>