diff --git a/answer/src/router/index.js b/answer/src/router/index.js index 909937c3f4912d06645fd5cac9eab96d4541c2fd..3916a96cc84d698ca3fff7e0c9b8901c2c32a288 100644 --- a/answer/src/router/index.js +++ b/answer/src/router/index.js @@ -36,6 +36,16 @@ const router = createRouter({ name: "ch", component: () => import("../views/ch/index.vue"), }, + { + path: "/shouye/ch1", + name: "ch1", + component: () => import("../views/ch/index1.vue"), + }, + { + path: "/shouye/ch2", + name: "ch2y", + component: () => import("../views/ch/index2.vue"), + }, //wmm { path: "/shouye/wmm", diff --git a/answer/src/views/Shouye.vue b/answer/src/views/Shouye.vue index eee7cea20f7ca762241330b895cd51dd92637b44..4e2fdcf84036726f4df93c40ec4405dac647f41a 100644 --- a/answer/src/views/Shouye.vue +++ b/answer/src/views/Shouye.vue @@ -50,6 +50,7 @@ + diff --git a/answer/src/views/ch/__VLS_template.js b/answer/src/views/ch/__VLS_template.js new file mode 100644 index 0000000000000000000000000000000000000000..2d743b96d9ad151634a8be56249ea69fd4452a70 --- /dev/null +++ b/answer/src/views/ch/__VLS_template.js @@ -0,0 +1,533 @@ +import { __VLS_internalComponent, __VLS_componentsOption, __VLS_name, title, xuanze, radio1, answerlist, score, input1, color, xuan, scrollToSection, jie, bao } from "./index2.vue"; + +function __VLS_template() { +let __VLS_ctx!: InstanceType<__VLS_PickNotAny {}>> & {}; +/* Components */ +let __VLS_otherComponents!: NonNullable & typeof __VLS_componentsOption; +let __VLS_own!: __VLS_SelfComponent { $slots: typeof __VLS_slots; })>; +let __VLS_localComponents!: typeof __VLS_otherComponents & Omit; +let __VLS_components!: typeof __VLS_localComponents & __VLS_GlobalComponents & typeof __VLS_ctx; +/* Style Scoped */ +type __VLS_StyleScopedClasses = {} & +{ 'con'?: boolean; } & +{ 'con1'?: boolean; } & +{ 'con2'?: boolean; } & +{ 'con3'?: boolean; } & +{ 'con2_2'?: boolean; } & +{ 'con2_2'?: boolean; } & +{ 'con2_2'?: boolean; } & +{ 'con2_2'?: boolean; } & +{ 'con2_2'?: boolean; } & +{ 'con'?: boolean; } & +{ 'red'?: boolean; } & +{ 'active-radio'?: boolean; }; +let __VLS_styleScopedClasses!: __VLS_StyleScopedClasses | keyof __VLS_StyleScopedClasses | (keyof __VLS_StyleScopedClasses)[]; +/* CSS variable injection */ +/* CSS variable injection end */ +let __VLS_resolvedLocalAndGlobalComponents!: {} & +__VLS_WithComponent<'ElRadioGroup', typeof __VLS_localComponents, "ElRadioGroup", "elRadioGroup", "el-radio-group"> & +__VLS_WithComponent<'ElRadioButton', typeof __VLS_localComponents, "ElRadioButton", "elRadioButton", "el-radio-button"> & +__VLS_WithComponent<'ElInput', typeof __VLS_localComponents, "ElInput", "elInput", "el-input"> & +__VLS_WithComponent<'ElButton', typeof __VLS_localComponents, "ElButton", "elButton", "el-button">; +__VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; __VLS_intrinsicElements.div; +__VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; __VLS_intrinsicElements.h1; +__VLS_intrinsicElements.table; __VLS_intrinsicElements.table; +__VLS_intrinsicElements.tr; __VLS_intrinsicElements.tr; __VLS_intrinsicElements.tr; __VLS_intrinsicElements.tr; +__VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; __VLS_intrinsicElements.td; +__VLS_components.ElRadioGroup; __VLS_components.ElRadioGroup; __VLS_components.elRadioGroup; __VLS_components.elRadioGroup; __VLS_components["el-radio-group"]; __VLS_components["el-radio-group"]; +// @ts-ignore +[ElRadioGroup, ElRadioGroup,]; +__VLS_components.ElRadioButton; __VLS_components.elRadioButton; __VLS_components["el-radio-button"]; +// @ts-ignore +[ElRadioButton,]; +__VLS_components.ElInput; __VLS_components.ElInput; __VLS_components.ElInput; __VLS_components.ElInput; __VLS_components.elInput; __VLS_components.elInput; __VLS_components.elInput; __VLS_components.elInput; __VLS_components["el-input"]; __VLS_components["el-input"]; __VLS_components["el-input"]; __VLS_components["el-input"]; +// @ts-ignore +[ElInput, ElInput, ElInput, ElInput,]; +__VLS_intrinsicElements.span; __VLS_intrinsicElements.span; +__VLS_components.ElButton; __VLS_components.ElButton; __VLS_components.elButton; __VLS_components.elButton; __VLS_components["el-button"]; __VLS_components["el-button"]; +// @ts-ignore +[ElButton, ElButton,]; +{ +const __VLS_0 = __VLS_intrinsicElements["div"]; +const __VLS_1 = __VLS_elementAsFunctionalComponent(__VLS_0); +const __VLS_2 = __VLS_1({ ...{}, class: ("con"), }, ...__VLS_functionalComponentArgsRest(__VLS_1)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, class: ("con"), }); +const __VLS_3 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2)!; +let __VLS_4!: __VLS_NormalizeEmits; +{ +const __VLS_5 = __VLS_intrinsicElements["div"]; +const __VLS_6 = __VLS_elementAsFunctionalComponent(__VLS_5); +const __VLS_7 = __VLS_6({ ...{}, class: ("con1"), }, ...__VLS_functionalComponentArgsRest(__VLS_6)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, class: ("con1"), }); +const __VLS_8 = __VLS_pickFunctionalComponentCtx(__VLS_5, __VLS_7)!; +let __VLS_9!: __VLS_NormalizeEmits; +} +{ +const __VLS_10 = __VLS_intrinsicElements["div"]; +const __VLS_11 = __VLS_elementAsFunctionalComponent(__VLS_10); +const __VLS_12 = __VLS_11({ ...{}, class: ("con2"), }, ...__VLS_functionalComponentArgsRest(__VLS_11)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, class: ("con2"), }); +const __VLS_13 = __VLS_pickFunctionalComponentCtx(__VLS_10, __VLS_12)!; +let __VLS_14!: __VLS_NormalizeEmits; +{ +const __VLS_15 = __VLS_intrinsicElements["div"]; +const __VLS_16 = __VLS_elementAsFunctionalComponent(__VLS_15); +const __VLS_17 = __VLS_16({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_16)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_18 = __VLS_pickFunctionalComponentCtx(__VLS_15, __VLS_17)!; +let __VLS_19!: __VLS_NormalizeEmits; +{ +const __VLS_20 = __VLS_intrinsicElements["h1"]; +const __VLS_21 = __VLS_elementAsFunctionalComponent(__VLS_20); +const __VLS_22 = __VLS_21({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_21)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_23 = __VLS_pickFunctionalComponentCtx(__VLS_20, __VLS_22)!; +let __VLS_24!: __VLS_NormalizeEmits; +(__VLS_ctx.title); +(__VLS_23.slots!).default; +} +{ +const __VLS_25 = __VLS_intrinsicElements["h1"]; +const __VLS_26 = __VLS_elementAsFunctionalComponent(__VLS_25); +const __VLS_27 = __VLS_26({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_26)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_28 = __VLS_pickFunctionalComponentCtx(__VLS_25, __VLS_27)!; +let __VLS_29!: __VLS_NormalizeEmits; +(__VLS_28.slots!).default; +} +{ +const __VLS_30 = __VLS_intrinsicElements["table"]; +const __VLS_31 = __VLS_elementAsFunctionalComponent(__VLS_30); +const __VLS_32 = __VLS_31({ ...{}, width: ("90%"), style: ({}), cellpadding: ("1"), cellspacing: ("0"), border: ("1"), }, ...__VLS_functionalComponentArgsRest(__VLS_31)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, width: ("90%"), style: ({}), cellpadding: ("1"), cellspacing: ("0"), border: ("1"), }); +const __VLS_33 = __VLS_pickFunctionalComponentCtx(__VLS_30, __VLS_32)!; +let __VLS_34!: __VLS_NormalizeEmits; +{ +const __VLS_35 = __VLS_intrinsicElements["tr"]; +const __VLS_36 = __VLS_elementAsFunctionalComponent(__VLS_35); +const __VLS_37 = __VLS_36({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_36)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_38 = __VLS_pickFunctionalComponentCtx(__VLS_35, __VLS_37)!; +let __VLS_39!: __VLS_NormalizeEmits; +{ +const __VLS_40 = __VLS_intrinsicElements["td"]; +const __VLS_41 = __VLS_elementAsFunctionalComponent(__VLS_40); +const __VLS_42 = __VLS_41({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_41)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_43 = __VLS_pickFunctionalComponentCtx(__VLS_40, __VLS_42)!; +let __VLS_44!: __VLS_NormalizeEmits; +(__VLS_43.slots!).default; +} +{ +const __VLS_45 = __VLS_intrinsicElements["td"]; +const __VLS_46 = __VLS_elementAsFunctionalComponent(__VLS_45); +const __VLS_47 = __VLS_46({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_46)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_48 = __VLS_pickFunctionalComponentCtx(__VLS_45, __VLS_47)!; +let __VLS_49!: __VLS_NormalizeEmits; +(__VLS_48.slots!).default; +} +{ +const __VLS_50 = __VLS_intrinsicElements["td"]; +const __VLS_51 = __VLS_elementAsFunctionalComponent(__VLS_50); +const __VLS_52 = __VLS_51({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_51)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_53 = __VLS_pickFunctionalComponentCtx(__VLS_50, __VLS_52)!; +let __VLS_54!: __VLS_NormalizeEmits; +(__VLS_53.slots!).default; +} +{ +const __VLS_55 = __VLS_intrinsicElements["td"]; +const __VLS_56 = __VLS_elementAsFunctionalComponent(__VLS_55); +const __VLS_57 = __VLS_56({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_56)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_58 = __VLS_pickFunctionalComponentCtx(__VLS_55, __VLS_57)!; +let __VLS_59!: __VLS_NormalizeEmits; +(__VLS_58.slots!).default; +} +{ +const __VLS_60 = __VLS_intrinsicElements["td"]; +const __VLS_61 = __VLS_elementAsFunctionalComponent(__VLS_60); +const __VLS_62 = __VLS_61({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_61)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_63 = __VLS_pickFunctionalComponentCtx(__VLS_60, __VLS_62)!; +let __VLS_64!: __VLS_NormalizeEmits; +(__VLS_63.slots!).default; +} +{ +const __VLS_65 = __VLS_intrinsicElements["td"]; +const __VLS_66 = __VLS_elementAsFunctionalComponent(__VLS_65); +const __VLS_67 = __VLS_66({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_66)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_68 = __VLS_pickFunctionalComponentCtx(__VLS_65, __VLS_67)!; +let __VLS_69!: __VLS_NormalizeEmits; +(__VLS_68.slots!).default; +} +(__VLS_38.slots!).default; +} +{ +const __VLS_70 = __VLS_intrinsicElements["tr"]; +const __VLS_71 = __VLS_elementAsFunctionalComponent(__VLS_70); +const __VLS_72 = __VLS_71({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_71)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_73 = __VLS_pickFunctionalComponentCtx(__VLS_70, __VLS_72)!; +let __VLS_74!: __VLS_NormalizeEmits; +{ +const __VLS_75 = __VLS_intrinsicElements["td"]; +const __VLS_76 = __VLS_elementAsFunctionalComponent(__VLS_75); +const __VLS_77 = __VLS_76({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_76)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_78 = __VLS_pickFunctionalComponentCtx(__VLS_75, __VLS_77)!; +let __VLS_79!: __VLS_NormalizeEmits; +} +{ +const __VLS_80 = __VLS_intrinsicElements["td"]; +const __VLS_81 = __VLS_elementAsFunctionalComponent(__VLS_80); +const __VLS_82 = __VLS_81({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_81)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_83 = __VLS_pickFunctionalComponentCtx(__VLS_80, __VLS_82)!; +let __VLS_84!: __VLS_NormalizeEmits; +} +{ +const __VLS_85 = __VLS_intrinsicElements["td"]; +const __VLS_86 = __VLS_elementAsFunctionalComponent(__VLS_85); +const __VLS_87 = __VLS_86({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_86)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_88 = __VLS_pickFunctionalComponentCtx(__VLS_85, __VLS_87)!; +let __VLS_89!: __VLS_NormalizeEmits; +} +{ +const __VLS_90 = __VLS_intrinsicElements["td"]; +const __VLS_91 = __VLS_elementAsFunctionalComponent(__VLS_90); +const __VLS_92 = __VLS_91({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_91)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_93 = __VLS_pickFunctionalComponentCtx(__VLS_90, __VLS_92)!; +let __VLS_94!: __VLS_NormalizeEmits; +} +{ +const __VLS_95 = __VLS_intrinsicElements["td"]; +const __VLS_96 = __VLS_elementAsFunctionalComponent(__VLS_95); +const __VLS_97 = __VLS_96({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_96)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_98 = __VLS_pickFunctionalComponentCtx(__VLS_95, __VLS_97)!; +let __VLS_99!: __VLS_NormalizeEmits; +} +{ +const __VLS_100 = __VLS_intrinsicElements["td"]; +const __VLS_101 = __VLS_elementAsFunctionalComponent(__VLS_100); +const __VLS_102 = __VLS_101({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_101)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_103 = __VLS_pickFunctionalComponentCtx(__VLS_100, __VLS_102)!; +let __VLS_104!: __VLS_NormalizeEmits; +} +(__VLS_73.slots!).default; +} +(__VLS_33.slots!).default; +} +(__VLS_18.slots!).default; +} +{ +const __VLS_105 = __VLS_intrinsicElements["div"]; +const __VLS_106 = __VLS_elementAsFunctionalComponent(__VLS_105); +const __VLS_107 = __VLS_106({ ...{}, class: ("con2_2"), }, ...__VLS_functionalComponentArgsRest(__VLS_106)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, class: ("con2_2"), }); +const __VLS_108 = __VLS_pickFunctionalComponentCtx(__VLS_105, __VLS_107)!; +let __VLS_109!: __VLS_NormalizeEmits; +{ +const __VLS_110 = __VLS_intrinsicElements["div"]; +const __VLS_111 = __VLS_elementAsFunctionalComponent(__VLS_110); +const __VLS_112 = __VLS_111({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_111)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_113 = __VLS_pickFunctionalComponentCtx(__VLS_110, __VLS_112)!; +let __VLS_114!: __VLS_NormalizeEmits; +{ +const __VLS_115 = __VLS_intrinsicElements["h1"]; +const __VLS_116 = __VLS_elementAsFunctionalComponent(__VLS_115); +const __VLS_117 = __VLS_116({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_116)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_118 = __VLS_pickFunctionalComponentCtx(__VLS_115, __VLS_117)!; +let __VLS_119!: __VLS_NormalizeEmits; +(__VLS_118.slots!).default; +} +{ +const __VLS_120 = __VLS_intrinsicElements["div"]; +const __VLS_121 = __VLS_elementAsFunctionalComponent(__VLS_120); +const __VLS_122 = __VLS_121({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_121)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_123 = __VLS_pickFunctionalComponentCtx(__VLS_120, __VLS_122)!; +let __VLS_124!: __VLS_NormalizeEmits; +for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.xuanze)!)) { +{ +const __VLS_125 = __VLS_intrinsicElements["h1"]; +const __VLS_126 = __VLS_elementAsFunctionalComponent(__VLS_125); +const __VLS_127 = __VLS_126({ ...{}, key: ((item._id)), }, ...__VLS_functionalComponentArgsRest(__VLS_126)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, key: ((item._id)), }); +const __VLS_128 = __VLS_pickFunctionalComponentCtx(__VLS_125, __VLS_127)!; +let __VLS_129!: __VLS_NormalizeEmits; +{ +const __VLS_130 = __VLS_intrinsicElements["h1"]; +const __VLS_131 = __VLS_elementAsFunctionalComponent(__VLS_130); +const __VLS_132 = __VLS_131({ ...{}, id: ((item.a2._id)), }, ...__VLS_functionalComponentArgsRest(__VLS_131)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, id: ((item.a2._id)), }); +const __VLS_133 = __VLS_pickFunctionalComponentCtx(__VLS_130, __VLS_132)!; +let __VLS_134!: __VLS_NormalizeEmits; +(index + 1); +(item.a2.name); +(__VLS_133.slots!).default; +} +for (const [items] of __VLS_getVForSourceType((item.a2.answer)!)) { +{ +const __VLS_135 = ({} as 'ElRadioGroup' extends keyof typeof __VLS_ctx ? { 'ElRadioGroup': typeof __VLS_ctx.ElRadioGroup; } : 'elRadioGroup' extends keyof typeof __VLS_ctx ? { 'ElRadioGroup': typeof __VLS_ctx.elRadioGroup; } : 'el-radio-group' extends keyof typeof __VLS_ctx ? { 'ElRadioGroup': (typeof __VLS_ctx)["el-radio-group"]; } : typeof __VLS_resolvedLocalAndGlobalComponents).ElRadioGroup; +const __VLS_136 = __VLS_asFunctionalComponent(__VLS_135, new __VLS_135({ ...{}, modelValue: ((__VLS_ctx.radio1[item.a2._id])), size: ("default"), key: ((items._id)), style: ({}), })); +({} as { ElRadioGroup: typeof __VLS_135; }).ElRadioGroup; +({} as { ElRadioGroup: typeof __VLS_135; }).ElRadioGroup; +const __VLS_137 = __VLS_136({ ...{}, modelValue: ((__VLS_ctx.radio1[item.a2._id])), size: ("default"), key: ((items._id)), style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_136)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, modelValue: ((__VLS_ctx.radio1[item.a2._id])), size: ("default"), key: ((items._id)), style: ({}), }); +const __VLS_138 = __VLS_pickFunctionalComponentCtx(__VLS_135, __VLS_137)!; +let __VLS_139!: __VLS_NormalizeEmits; +{ +const __VLS_140 = ({} as 'ElRadioButton' extends keyof typeof __VLS_ctx ? { 'ElRadioButton': typeof __VLS_ctx.ElRadioButton; } : 'elRadioButton' extends keyof typeof __VLS_ctx ? { 'ElRadioButton': typeof __VLS_ctx.elRadioButton; } : 'el-radio-button' extends keyof typeof __VLS_ctx ? { 'ElRadioButton': (typeof __VLS_ctx)["el-radio-button"]; } : typeof __VLS_resolvedLocalAndGlobalComponents).ElRadioButton; +const __VLS_141 = __VLS_asFunctionalComponent(__VLS_140, new __VLS_140({ ...{}, class: (({ 'active-color': item.a1 == item.a2.trueqest })), label: ((items.value + '.' + items.name)), })); +({} as { ElRadioButton: typeof __VLS_140; }).ElRadioButton; +const __VLS_142 = __VLS_141({ ...{}, class: (({ 'active-color': item.a1 == item.a2.trueqest })), label: ((items.value + '.' + items.name)), }, ...__VLS_functionalComponentArgsRest(__VLS_141)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, class: (({ 'active-color': item.a1 == item.a2.trueqest })), label: ((items.value + '.' + items.name)), }); +const __VLS_143 = __VLS_pickFunctionalComponentCtx(__VLS_140, __VLS_142)!; +let __VLS_144!: __VLS_NormalizeEmits; +__VLS_styleScopedClasses = ({ 'active-color': item.a1 == item.a2.trueqest }); +} +(__VLS_138.slots!).default; +} +// @ts-ignore +[title, xuanze, radio1, radio1, radio1,]; +} +(__VLS_128.slots!).default; +} +} +(__VLS_123.slots!).default; +} +{ +const __VLS_145 = __VLS_intrinsicElements["div"]; +const __VLS_146 = __VLS_elementAsFunctionalComponent(__VLS_145); +const __VLS_147 = __VLS_146({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_146)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_148 = __VLS_pickFunctionalComponentCtx(__VLS_145, __VLS_147)!; +let __VLS_149!: __VLS_NormalizeEmits; +{ +const __VLS_150 = __VLS_intrinsicElements["h1"]; +const __VLS_151 = __VLS_elementAsFunctionalComponent(__VLS_150); +const __VLS_152 = __VLS_151({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_151)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_153 = __VLS_pickFunctionalComponentCtx(__VLS_150, __VLS_152)!; +let __VLS_154!: __VLS_NormalizeEmits; +(__VLS_153.slots!).default; +} +for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.answerlist)!)) { +{ +const __VLS_155 = __VLS_intrinsicElements["h1"]; +const __VLS_156 = __VLS_elementAsFunctionalComponent(__VLS_155); +const __VLS_157 = __VLS_156({ ...{}, key: ((item._id)), }, ...__VLS_functionalComponentArgsRest(__VLS_156)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, key: ((item._id)), }); +const __VLS_158 = __VLS_pickFunctionalComponentCtx(__VLS_155, __VLS_157)!; +let __VLS_159!: __VLS_NormalizeEmits; +{ +const __VLS_160 = __VLS_intrinsicElements["div"]; +const __VLS_161 = __VLS_elementAsFunctionalComponent(__VLS_160); +const __VLS_162 = __VLS_161({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_161)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_163 = __VLS_pickFunctionalComponentCtx(__VLS_160, __VLS_162)!; +let __VLS_164!: __VLS_NormalizeEmits; +{ +const __VLS_165 = __VLS_intrinsicElements["h1"]; +const __VLS_166 = __VLS_elementAsFunctionalComponent(__VLS_165); +const __VLS_167 = __VLS_166({ ...{}, id: ((item.a2._id)), style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_166)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, id: ((item.a2._id)), style: ({}), }); +const __VLS_168 = __VLS_pickFunctionalComponentCtx(__VLS_165, __VLS_167)!; +let __VLS_169!: __VLS_NormalizeEmits; +(index + 1); +(item.a2.name); +(__VLS_168.slots!).default; +} +{ +const __VLS_170 = ({} as 'ElInput' extends keyof typeof __VLS_ctx ? { 'ElInput': typeof __VLS_ctx.ElInput; } : 'elInput' extends keyof typeof __VLS_ctx ? { 'ElInput': typeof __VLS_ctx.elInput; } : 'el-input' extends keyof typeof __VLS_ctx ? { 'ElInput': (typeof __VLS_ctx)["el-input"]; } : typeof __VLS_resolvedLocalAndGlobalComponents).ElInput; +const __VLS_171 = __VLS_asFunctionalComponent(__VLS_170, new __VLS_170({ ...{}, modelValue: ((__VLS_ctx.score[item.a2._id])), type: ("text"), style: ({}), placeholder: ("请输入分值"), })); +({} as { ElInput: typeof __VLS_170; }).ElInput; +({} as { ElInput: typeof __VLS_170; }).ElInput; +const __VLS_172 = __VLS_171({ ...{}, modelValue: ((__VLS_ctx.score[item.a2._id])), type: ("text"), style: ({}), placeholder: ("请输入分值"), }, ...__VLS_functionalComponentArgsRest(__VLS_171)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, modelValue: ((__VLS_ctx.score[item.a2._id])), type: ("text"), style: ({}), placeholder: ("请输入分值"), }); +const __VLS_173 = __VLS_pickFunctionalComponentCtx(__VLS_170, __VLS_172)!; +let __VLS_174!: __VLS_NormalizeEmits; +} +(__VLS_163.slots!).default; +} +{ +const __VLS_175 = ({} as 'ElInput' extends keyof typeof __VLS_ctx ? { 'ElInput': typeof __VLS_ctx.ElInput; } : 'elInput' extends keyof typeof __VLS_ctx ? { 'ElInput': typeof __VLS_ctx.elInput; } : 'el-input' extends keyof typeof __VLS_ctx ? { 'ElInput': (typeof __VLS_ctx)["el-input"]; } : typeof __VLS_resolvedLocalAndGlobalComponents).ElInput; +const __VLS_176 = __VLS_asFunctionalComponent(__VLS_175, new __VLS_175({ ...{}, modelValue: ((__VLS_ctx.input1[item._id])), disabled: ("true"), rows: ((2)), type: ("textarea"), placeholder: ((item.a1)), autosize: (({ minRows: 2, maxRows: 4 })), })); +({} as { ElInput: typeof __VLS_175; }).ElInput; +const __VLS_177 = __VLS_176({ ...{}, modelValue: ((__VLS_ctx.input1[item._id])), disabled: ("true"), rows: ((2)), type: ("textarea"), placeholder: ((item.a1)), autosize: (({ minRows: 2, maxRows: 4 })), }, ...__VLS_functionalComponentArgsRest(__VLS_176)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, modelValue: ((__VLS_ctx.input1[item._id])), disabled: ("true"), rows: ((2)), type: ("textarea"), placeholder: ((item.a1)), autosize: (({ minRows: 2, maxRows: 4 })), }); +const __VLS_178 = __VLS_pickFunctionalComponentCtx(__VLS_175, __VLS_177)!; +let __VLS_179!: __VLS_NormalizeEmits; +} +{ +const __VLS_180 = ({} as 'ElInput' extends keyof typeof __VLS_ctx ? { 'ElInput': typeof __VLS_ctx.ElInput; } : 'elInput' extends keyof typeof __VLS_ctx ? { 'ElInput': typeof __VLS_ctx.elInput; } : 'el-input' extends keyof typeof __VLS_ctx ? { 'ElInput': (typeof __VLS_ctx)["el-input"]; } : typeof __VLS_resolvedLocalAndGlobalComponents).ElInput; +const __VLS_181 = __VLS_asFunctionalComponent(__VLS_180, new __VLS_180({ ...{}, modelValue: ((__VLS_ctx.input1[item._id])), disabled: ("true"), rows: ((2)), type: ("textarea"), placeholder: ((item.a2.trueqest)), autosize: (({ minRows: 2, maxRows: 4 })), })); +({} as { ElInput: typeof __VLS_180; }).ElInput; +const __VLS_182 = __VLS_181({ ...{}, modelValue: ((__VLS_ctx.input1[item._id])), disabled: ("true"), rows: ((2)), type: ("textarea"), placeholder: ((item.a2.trueqest)), autosize: (({ minRows: 2, maxRows: 4 })), }, ...__VLS_functionalComponentArgsRest(__VLS_181)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, modelValue: ((__VLS_ctx.input1[item._id])), disabled: ("true"), rows: ((2)), type: ("textarea"), placeholder: ((item.a2.trueqest)), autosize: (({ minRows: 2, maxRows: 4 })), }); +const __VLS_183 = __VLS_pickFunctionalComponentCtx(__VLS_180, __VLS_182)!; +let __VLS_184!: __VLS_NormalizeEmits; +} +(__VLS_158.slots!).default; +} +// @ts-ignore +[answerlist, score, score, score, input1, input1, input1, input1, input1, input1,]; +} +(__VLS_148.slots!).default; +} +(__VLS_113.slots!).default; +} +(__VLS_108.slots!).default; +} +(__VLS_13.slots!).default; +} +{ +const __VLS_185 = __VLS_intrinsicElements["div"]; +const __VLS_186 = __VLS_elementAsFunctionalComponent(__VLS_185); +const __VLS_187 = __VLS_186({ ...{}, class: ("con3"), }, ...__VLS_functionalComponentArgsRest(__VLS_186)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, class: ("con3"), }); +const __VLS_188 = __VLS_pickFunctionalComponentCtx(__VLS_185, __VLS_187)!; +let __VLS_189!: __VLS_NormalizeEmits; +{ +const __VLS_190 = __VLS_intrinsicElements["div"]; +const __VLS_191 = __VLS_elementAsFunctionalComponent(__VLS_190); +const __VLS_192 = __VLS_191({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_191)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_193 = __VLS_pickFunctionalComponentCtx(__VLS_190, __VLS_192)!; +let __VLS_194!: __VLS_NormalizeEmits; +{ +const __VLS_195 = __VLS_intrinsicElements["h1"]; +const __VLS_196 = __VLS_elementAsFunctionalComponent(__VLS_195); +const __VLS_197 = __VLS_196({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_196)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_198 = __VLS_pickFunctionalComponentCtx(__VLS_195, __VLS_197)!; +let __VLS_199!: __VLS_NormalizeEmits; +(__VLS_198.slots!).default; +} +{ +const __VLS_200 = __VLS_intrinsicElements["div"]; +const __VLS_201 = __VLS_elementAsFunctionalComponent(__VLS_200); +const __VLS_202 = __VLS_201({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_201)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_203 = __VLS_pickFunctionalComponentCtx(__VLS_200, __VLS_202)!; +let __VLS_204!: __VLS_NormalizeEmits; +for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.xuan)!)) { +{ +const __VLS_205 = __VLS_intrinsicElements["div"]; +const __VLS_206 = __VLS_elementAsFunctionalComponent(__VLS_205); +const __VLS_207 = __VLS_206({ ...{ onClick: {} as any, }, key: ((item._id)), style: ({}), class: ((__VLS_ctx.color == item._id ? 'red' : '')), }, ...__VLS_functionalComponentArgsRest(__VLS_206)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{ onClick: {} as any, }, key: ((item._id)), style: ({}), class: ((__VLS_ctx.color == item._id ? 'red' : '')), }); +const __VLS_208 = __VLS_pickFunctionalComponentCtx(__VLS_205, __VLS_207)!; +let __VLS_209!: __VLS_NormalizeEmits; +__VLS_styleScopedClasses = (color == item._id ? 'red' : ''); +let __VLS_210 = { 'click': __VLS_pickEvent(__VLS_209['click'], ({} as __VLS_FunctionalComponentProps).onClick) }; +__VLS_210 = { +click: $event => { +__VLS_ctx.scrollToSection(item._id); +// @ts-ignore +[xuan, color, color, scrollToSection,]; +} +}; +(index + 1); +(__VLS_208.slots!).default; +} +} +(__VLS_203.slots!).default; +} +(__VLS_193.slots!).default; +} +{ +const __VLS_211 = __VLS_intrinsicElements["div"]; +const __VLS_212 = __VLS_elementAsFunctionalComponent(__VLS_211); +const __VLS_213 = __VLS_212({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_212)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_214 = __VLS_pickFunctionalComponentCtx(__VLS_211, __VLS_213)!; +let __VLS_215!: __VLS_NormalizeEmits; +{ +const __VLS_216 = __VLS_intrinsicElements["h1"]; +const __VLS_217 = __VLS_elementAsFunctionalComponent(__VLS_216); +const __VLS_218 = __VLS_217({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_217)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_219 = __VLS_pickFunctionalComponentCtx(__VLS_216, __VLS_218)!; +let __VLS_220!: __VLS_NormalizeEmits; +(__VLS_219.slots!).default; +} +{ +const __VLS_221 = __VLS_intrinsicElements["div"]; +const __VLS_222 = __VLS_elementAsFunctionalComponent(__VLS_221); +const __VLS_223 = __VLS_222({ ...{}, style: ({}), }, ...__VLS_functionalComponentArgsRest(__VLS_222)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, style: ({}), }); +const __VLS_224 = __VLS_pickFunctionalComponentCtx(__VLS_221, __VLS_223)!; +let __VLS_225!: __VLS_NormalizeEmits; +for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.jie)!)) { +{ +const __VLS_226 = __VLS_intrinsicElements["div"]; +const __VLS_227 = __VLS_elementAsFunctionalComponent(__VLS_226); +const __VLS_228 = __VLS_227({ ...{ onClick: {} as any, }, key: ((item._id)), style: ({}), class: ((__VLS_ctx.color == item._id ? 'red' : '')), }, ...__VLS_functionalComponentArgsRest(__VLS_227)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{ onClick: {} as any, }, key: ((item._id)), style: ({}), class: ((__VLS_ctx.color == item._id ? 'red' : '')), }); +const __VLS_229 = __VLS_pickFunctionalComponentCtx(__VLS_226, __VLS_228)!; +let __VLS_230!: __VLS_NormalizeEmits; +__VLS_styleScopedClasses = (color == item._id ? 'red' : ''); +let __VLS_231 = { 'click': __VLS_pickEvent(__VLS_230['click'], ({} as __VLS_FunctionalComponentProps).onClick) }; +__VLS_231 = { +click: $event => { +__VLS_ctx.scrollToSection(item._id); +// @ts-ignore +[jie, color, color, scrollToSection,]; +} +}; +{ +const __VLS_232 = __VLS_intrinsicElements["span"]; +const __VLS_233 = __VLS_elementAsFunctionalComponent(__VLS_232); +const __VLS_234 = __VLS_233({ ...{}, }, ...__VLS_functionalComponentArgsRest(__VLS_233)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{}, }); +const __VLS_235 = __VLS_pickFunctionalComponentCtx(__VLS_232, __VLS_234)!; +let __VLS_236!: __VLS_NormalizeEmits; +(index + 1); +(__VLS_235.slots!).default; +} +(__VLS_229.slots!).default; +} +} +(__VLS_224.slots!).default; +} +(__VLS_214.slots!).default; +} +{ +const __VLS_237 = ({} as 'ElButton' extends keyof typeof __VLS_ctx ? { 'ElButton': typeof __VLS_ctx.ElButton; } : 'elButton' extends keyof typeof __VLS_ctx ? { 'ElButton': typeof __VLS_ctx.elButton; } : 'el-button' extends keyof typeof __VLS_ctx ? { 'ElButton': (typeof __VLS_ctx)["el-button"]; } : typeof __VLS_resolvedLocalAndGlobalComponents).ElButton; +const __VLS_238 = __VLS_asFunctionalComponent(__VLS_237, new __VLS_237({ ...{ onClick: {} as any, }, style: ({}), text: (true), })); +({} as { ElButton: typeof __VLS_237; }).ElButton; +({} as { ElButton: typeof __VLS_237; }).ElButton; +const __VLS_239 = __VLS_238({ ...{ onClick: {} as any, }, style: ({}), text: (true), }, ...__VLS_functionalComponentArgsRest(__VLS_238)); +({} as (props: __VLS_FunctionalComponentProps & Record) => void)({ ...{ onClick: {} as any, }, style: ({}), text: (true), }); +const __VLS_240 = __VLS_pickFunctionalComponentCtx(__VLS_237, __VLS_239)!; +let __VLS_241!: __VLS_NormalizeEmits; +let __VLS_242 = { 'click': __VLS_pickEvent(__VLS_241['click'], ({} as __VLS_FunctionalComponentProps).onClick) }; +__VLS_242 = { click: (__VLS_ctx.bao) }; +(__VLS_240.slots!).default; +} +(__VLS_188.slots!).default; +} +(__VLS_3.slots!).default; +} +if (typeof __VLS_styleScopedClasses === 'object' && !Array.isArray(__VLS_styleScopedClasses)) { +__VLS_styleScopedClasses["con"]; +__VLS_styleScopedClasses["con1"]; +__VLS_styleScopedClasses["con2"]; +__VLS_styleScopedClasses["con2_2"]; +__VLS_styleScopedClasses["con3"]; +} +var __VLS_slots!: {}; +// @ts-ignore +[bao,]; +return __VLS_slots; +} diff --git a/answer/src/views/ch/index.vue b/answer/src/views/ch/index.vue index bd0be26921abdc98dcabe468d9bc8c1898599b68..01d9d88c27ee013c2021bd5d088c4592dea23097 100644 --- a/answer/src/views/ch/index.vue +++ b/answer/src/views/ch/index.vue @@ -1,10 +1,15 @@ @@ -105,17 +401,17 @@ onMounted(() => { diff --git a/answer/src/views/ch/index1.vue b/answer/src/views/ch/index1.vue new file mode 100644 index 0000000000000000000000000000000000000000..7ed70dda07f8412c684d56b8e4a9f406a1599bfd --- /dev/null +++ b/answer/src/views/ch/index1.vue @@ -0,0 +1,132 @@ + + + + + + \ No newline at end of file diff --git a/answer/src/views/ch/index2.vue b/answer/src/views/ch/index2.vue new file mode 100644 index 0000000000000000000000000000000000000000..2cf7a8b72aaf8b154b8c8019bbb67f706604d338 --- /dev/null +++ b/answer/src/views/ch/index2.vue @@ -0,0 +1,362 @@ + + + + + diff --git a/answer/src/views/ch/ti.vue b/answer/src/views/ch/ti.vue deleted file mode 100644 index e778fb85e76c9b2865c2081bb5d3265601cdc036..0000000000000000000000000000000000000000 --- a/answer/src/views/ch/ti.vue +++ /dev/null @@ -1,22 +0,0 @@ - - \ No newline at end of file diff --git a/node/model/model/kjq.js b/node/model/model/kjq.js index 2928bfa48e10721c1c7c54760b30420cde16bdee..f029198777610a8c9360e90c30932468bbe96e7a 100644 --- a/node/model/model/kjq.js +++ b/node/model/model/kjq.js @@ -62,7 +62,42 @@ let qestions = new mongoose.Schema({ score:{type:Number,default:''}, //分数 imgUrl:{type:String,default:''}, //图片地址 }) + +const answer=mongoose.Schema({ + a1:String,//回答 + a2:{ + type:mongoose.Types.ObjectId, + ref:'qestions' + },//题目id + user:{ + type:mongoose.Types.ObjectId, + ref:'users' + },//用户id + juanid:{ + type:mongoose.Types.ObjectId, + ref:'quebank' + }, + time:String +}) + +const score=mongoose.Schema({ + user:{ + type:mongoose.Types.ObjectId, + ref:'users' + },//用户id + types:{ + type:mongoose.Types.ObjectId, + ref:'quebank' + },//卷子id + score:Number,//得分 + wrong:{ + type:[mongoose.Types.ObjectId], + ref:'qestions' + }, + +}) let qestionsModel = mongoose.model('qestions',qestions,'qestions') +const answerModel = mongoose.model('answer',answer,'answer') // 意见管理: @@ -73,4 +108,6 @@ let goalModel = mongoose.model('goal',goal,'goal') -module.exports={dutiesModel,usersModel,classModel,quebankModel,qestypeModel,qestionsModel,goalModel} \ No newline at end of file +module.exports={dutiesModel,usersModel,classModel,quebankModel,qestypeModel,qestionsModel,goalModel} +const scoreModel = mongoose.model('score',score,'score') +module.exports={dutiesModel,usersModel,classModel,quebankModel,qestypeModel,qestionsModel,answerModel,scoreModel} diff --git a/node/routes/ch.js b/node/routes/ch.js index da0799527b2c234620e443eae6e6422e7363fee0..c7aa427dad8d3411444d9ad24698d7587dcd3718 100644 --- a/node/routes/ch.js +++ b/node/routes/ch.js @@ -1,13 +1,70 @@ var express = require('express'); var router = express.Router(); -let {qestionsModel,quebankModel }=require('../model/model/kjq.js') +let { qestionsModel, quebankModel, answerModel, scoreModel } = require('../model/model/kjq.js') /* GET home page. */ -router.get('/test', async(req,res)=>{ - let bank=await quebankModel.find() +router.get('/test', async (req, res) => { + let bank = await quebankModel.find() // const a=bank[Math.floor(Math.random()*bank.length)] - let data=await qestionsModel.find({qid:'659cb405c9d3506fc6bc9d6e'}).populate('qtype').populate('qid') + let data = await qestionsModel.find({ qid: '659cb405c9d3506fc6bc9d6e' }).populate('qtype').populate('qid') - res.send({data}) + res.send({ data }) }) +router.post('/val', async (req, res) => { + let { arr } = req.body + + let data = await answerModel.find() + + arr.forEach(async (item) => { + if (data.length == 0) { + await answerModel.create(item) + } else { + await answerModel.updateOne({ a2: item.a2 }, item) + } + + }) + res.send({ code: 200 }) +}) +router.get('/get', async (req, res) => { + let data = await answerModel.find().populate('a2') + res.send({ data }) +}) +router.post('/score', async (req, res) => { + let { arr } = req.body + let co = 0 + let gg = [] + const data = await answerModel.find().populate('a2') + const ff = data.filter(item => item.a2.qtype == '659e75bec93ae5a633057651') + + for (const item of ff) { + if (item.a1 == item['a2'].trueqest) { + co = co + 5 + } else { + gg.push(item.a2._id) + } + } + arr.forEach(item => { + item.score = Number(item.score) + }) + const vv = arr.reduce((a, b) => a + b.score, 0) + + arr.forEach(item => { + if (item.score < 10) { + gg.push(item.types) + } + }) + + console.log(gg); + // console.log({ user: arr[0].user, types: arr[0].juanid, score: vv + co, wrong: [...gg] }); + let datas = await scoreModel.find() + + if (datas.length == 0) { + await scoreModel.create({ user: arr[0].user, types: arr[0].juanid, score: vv + co, wrong: [...gg] }) + } else { + await scoreModel.updateOne({ types: arr[0].juanid }, { user: arr[0].user, types: arr[0].juanid, score: vv + co, wrong: [...gg] }) + } + + + res.send({ code: 200 }) +}) module.exports = router;