|
@@ -69,27 +69,23 @@ export default defineComponent({
|
|
|
switch(props.listType){
|
|
|
//本地的错误保存
|
|
|
case "localWrong":
|
|
|
-
|
|
|
- Dialog.confirm({
|
|
|
- message: "确认交卷吗?",
|
|
|
+ submitResVisible.value = true
|
|
|
+ trueNum.value =0
|
|
|
+ falseNum.value =0
|
|
|
+ props.subjectList.forEach((item:any,index)=>{
|
|
|
+ let answers = item.answer.split("-")
|
|
|
+ if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
|
|
|
+ ++trueNum.value
|
|
|
+ }
|
|
|
+ else if(item.userAnswer.length==0){
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ ++falseNum.value
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- let wrongSet = props.subjectList.filter((item:any,index)=>{
|
|
|
- let answers = item.answer.split("-")
|
|
|
- return JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())
|
|
|
-
|
|
|
- })
|
|
|
- window.localStorage.setItem(vehicle+subject,JSON.stringify(wrongSet))
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- console.log(props.subjectList,"props")
|
|
|
- });
|
|
|
-
|
|
|
+
|
|
|
break;
|
|
|
//本地的错误保存
|
|
|
|
|
@@ -139,26 +135,26 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
};
|
|
|
- const showSubmitResVisible = ()=>{
|
|
|
- submitResVisible.value = true
|
|
|
- trueNum.value =0
|
|
|
- falseNum.value =0
|
|
|
- props.subjectList.forEach((item:any,index)=>{
|
|
|
- let answers = item.answer.split("-")
|
|
|
- if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
|
|
|
- ++trueNum.value
|
|
|
- }
|
|
|
- else if(item.userAnswer.length==0){
|
|
|
+ // const showSubmitResVisible = ()=>{
|
|
|
+ // submitResVisible.value = true
|
|
|
+ // trueNum.value =0
|
|
|
+ // falseNum.value =0
|
|
|
+ // props.subjectList.forEach((item:any,index)=>{
|
|
|
+ // let answers = item.answer.split("-")
|
|
|
+ // if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
|
|
|
+ // ++trueNum.value
|
|
|
+ // }
|
|
|
+ // else if(item.userAnswer.length==0){
|
|
|
|
|
|
- }
|
|
|
- else{
|
|
|
- ++falseNum.value
|
|
|
- }
|
|
|
+ // }
|
|
|
+ // else{
|
|
|
+ // ++falseNum.value
|
|
|
+ // }
|
|
|
|
|
|
- })
|
|
|
+ // })
|
|
|
|
|
|
|
|
|
- }
|
|
|
+ // }
|
|
|
const wrongReDo = ()=>{
|
|
|
|
|
|
let wrongSet = props.subjectList.filter((item:any,index)=>{
|
|
@@ -179,8 +175,10 @@ export default defineComponent({
|
|
|
_item.status =0
|
|
|
})
|
|
|
|
|
|
- })
|
|
|
- window.localStorage.setItem(vehicle+subject,JSON.stringify(wrongSet))
|
|
|
+ })
|
|
|
+ let localVuex = JSON.parse(window.localStorage.getItem('vuex')||'{}')
|
|
|
+ let tempUserWrongKey = localVuex.userData.openid+'_用户临时错题_'+subject
|
|
|
+ window.sessionStorage.setItem(tempUserWrongKey,JSON.stringify(wrongSet))
|
|
|
if(wrongSet.length){
|
|
|
emit('redo')
|
|
|
}
|
|
@@ -254,7 +252,7 @@ export default defineComponent({
|
|
|
|
|
|
<van-tabbar-item
|
|
|
onClick={() => {
|
|
|
- showSubmitResVisible()
|
|
|
+ goWrongPreviewScore()
|
|
|
}}
|
|
|
v-slots={{
|
|
|
icon: () => <m-icon type="jiaojuan" />,
|