Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gk-online-teacher
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huanglu
gk-online-teacher
Commits
0f8703bb
Commit
0f8703bb
authored
Dec 23, 2020
by
甘瑞文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学生
parent
fd305480
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
43 deletions
+57
-43
index.vue
src/views/answer-screen/cmps/quick-response/index.vue
+5
-3
index.vue
src/views/answer-screen/cmps/select-question/index.vue
+28
-27
index.vue
src/views/answer-screen/index.vue
+24
-13
No files found.
src/views/answer-screen/cmps/quick-response/index.vue
View file @
0f8703bb
...
@@ -23,7 +23,6 @@ export default {
...
@@ -23,7 +23,6 @@ export default {
// 检测类型 + 其他验证
// 检测类型 + 其他验证
eventId
:
{
eventId
:
{
type
:
String
,
type
:
String
,
default
:
0
,
required
:
true
required
:
true
}
}
},
},
...
@@ -57,6 +56,9 @@ export default {
...
@@ -57,6 +56,9 @@ export default {
this
.
stage
=
'submitted'
this
.
stage
=
'submitted'
console
.
log
(
'回执'
,
data
);
console
.
log
(
'回执'
,
data
);
});
});
},
onMsg
(){
},
},
startCountdown
()
{
startCountdown
()
{
if
(
this
.
intervalId
)
{
if
(
this
.
intervalId
)
{
...
@@ -79,12 +81,12 @@ export default {
...
@@ -79,12 +81,12 @@ export default {
this
.
counttimes
--
;
this
.
counttimes
--
;
},
},
},
},
beforeDestroy
()
{
beforeDestroy
()
{
socket
.
onMsg
(
this
.
onMsg
);
},
},
mounted
()
{
mounted
()
{
this
.
startCountdown
();
this
.
startCountdown
();
socket
.
onMsg
(
this
.
onMsg
);
// this.$emit('register', );
// this.$emit('register', );
}
}
};
};
...
...
src/views/answer-screen/cmps/select-question/index.vue
View file @
0f8703bb
<
template
>
<
template
>
<div
class=
"gk-screen-std"
>
<div
class=
"gk-screen-std"
>
<el-card
class=
"select-card"
v-show=
"
this.stage === 'unsubmit'"
v-loading=
"this.
submitting"
>
<el-card
class=
"select-card"
v-show=
"
step === 'unsubmit'"
v-loading=
"
submitting"
>
<div
slot=
"header"
class=
"clearfix select-card-header"
>
<div
slot=
"header"
class=
"clearfix select-card-header"
>
<span>
请选择
</span>
<span>
请选择
</span>
<el-button
@
click=
"handleSubmit"
>
确定
</el-button>
</div>
</div>
<div
class=
"ans-wrap"
>
<div
class=
"ans-wrap"
>
<el-radio-group
v-model=
"answer"
>
<el-radio-group
v-model=
"answer"
@
change=
"handleSubmit"
>
<el-radio
:label=
"itm.value"
:key=
"itm.value"
v-for=
"itm in Options"
>
{{
itm
.
title
}}
</el-radio>
<el-radio
:label=
"itm.value"
:key=
"itm.value"
v-for=
"itm in Options"
>
{{
itm
.
title
}}
</el-radio>
</el-radio-group>
</el-radio-group>
</div>
</div>
</el-card>
</el-card>
<el-card
class=
"result-card"
v-show=
"
this.stage
=== 'submitted'"
>
<el-card
class=
"result-card"
v-show=
"
step
=== 'submitted'"
>
<div
slot=
"header"
>
<div
slot=
"header"
>
<span>
你的选择是
</span>
<span>
你的选择是
</span>
</div>
</div>
<h2
>
{{
this
.
answer
}}
</h2>
<h2
>
{{
answer
}}
</h2>
</el-card>
<el-card
class=
"result-card"
v-show=
"step === 'stopped'"
>
<div
slot=
"header"
>
<span>
已经结束
</span>
</div>
<h2
>
{{
!!
answer
?
'未作答'
:
'你的选择是 '
+
answer
+
' '
}}
</h2>
</el-card>
</el-card>
</div>
</div>
</
template
>
</
template
>
...
@@ -36,38 +41,20 @@ export default {
...
@@ -36,38 +41,20 @@ export default {
// 检测类型 + 其他验证
// 检测类型 + 其他验证
eventId
:
{
eventId
:
{
type
:
String
,
type
:
String
,
default
:
0
,
required
:
true
required
:
true
}
}
},
},
data
()
{
data
()
{
return
{
return
{
st
age
:
'unsubmit'
,
st
ep
:
'unsubmit'
,
//unsubmit submitted stopped
answer
:
''
,
answer
:
''
,
Options
,
Options
,
submitting
:
false
,
submitting
:
false
,
};
};
},
},
computed
:
{
// state: function () {
// if(this.finish){
// return 'finish'
// }
// if(this.counttimes > 3){
// return 'ready'
// }
// if(this.counttimes > 0){
// return 'counting'
// }
// return 'active'
// },
countingText
()
{
return
this
.
counttimes
>
4
?
'Ready'
:
(
this
.
counttimes
>
3
?
'Go!'
:
this
.
counttimes
)
}
},
methods
:
{
methods
:
{
handleSubmit
()
{
handleSubmit
()
{
console
.
log
(
'===handleS
elec
t==='
);
console
.
log
(
'===handleS
ubmi
t==='
);
console
.
log
(
`answer:
${
this
.
answer
}
`
)
console
.
log
(
`answer:
${
this
.
answer
}
`
)
this
.
submitting
=
true
this
.
submitting
=
true
socket
.
sendGroupMsg
({
socket
.
sendGroupMsg
({
...
@@ -80,16 +67,30 @@ export default {
...
@@ -80,16 +67,30 @@ export default {
}
}
},
},
(
data
)
=>
{
(
data
)
=>
{
this
.
st
age
=
'submitted'
this
.
st
ep
=
'submitted'
this
.
submitting
=
false
this
.
submitting
=
false
console
.
log
(
'回执'
,
data
)
console
.
log
(
'回执'
,
data
)
});
});
},
},
onMsg
(
msg
)
{
console
.
log
(
'select-question onmsg: '
,
msg
);
if
(
!
msg
||
!
msg
.
from
||
msg
.
from
.
indexOf
(
'teacher'
)
<
0
||
!
msg
.
payload
)
{
return
}
if
(
!
msg
.
payload
.
eventId
||
!
msg
.
payload
.
type
||
msg
.
payload
.
type
<
0
)
{
return
}
if
(
msg
.
type
===
'question-stop'
&&
msg
.
payload
.
eventId
===
this
.
eventId
){
this
.
step
=
'stopped'
return
}
}
},
},
beforeDestroy
()
{
beforeDestroy
()
{
socket
.
offMsg
(
this
.
onMsg
);
},
},
mounted
()
{
mounted
()
{
socket
.
onMsg
(
this
.
onMsg
);
}
}
};
};
</
script
>
</
script
>
...
...
src/views/answer-screen/index.vue
View file @
0f8703bb
...
@@ -26,7 +26,7 @@ export default {
...
@@ -26,7 +26,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
currentComponment
:
'
locker
'
,
currentComponment
:
'
select-question
'
,
eventId
:
0
eventId
:
0
};
};
},
},
...
@@ -55,24 +55,35 @@ export default {
...
@@ -55,24 +55,35 @@ export default {
);
);
},
},
onMsg
(
msg
)
{
onMsg
(
msg
)
{
console
.
log
(
'
msg
'
,
msg
);
console
.
log
(
'
home onmsg:
'
,
msg
);
if
(
!
msg
||
!
msg
.
from
||
!
msg
.
from
.
indexOf
(
'teacher'
)
||
!
msg
.
payload
)
{
if
(
!
msg
||
!
msg
.
from
||
msg
.
from
.
indexOf
(
'teacher'
)
<
0
||
!
msg
.
payload
)
{
return
return
}
}
if
(
!
msg
.
payload
.
eventId
||
msg
.
payload
.
type
<
0
||
!
msg
.
payload
.
questionType
)
{
if
(
!
msg
.
payload
.
eventId
||
!
msg
.
payload
.
type
||
msg
.
payload
.
type
<
0
)
{
return
return
}
}
this
.
eventId
=
msg
.
payload
.
eventId
;
if
(
msg
.
type
===
'finish'
){
const
{
questionType
}
=
msg
.
payload
;
if
(
questionType
===
3
)
{
this
.
currentComponment
=
'select-question'
}
else
if
(
questionType
===
1
)
{
this
.
currentComponment
=
'drawing-board'
}
else
if
(
questionType
===
2
)
{
this
.
currentComponment
=
'quick-response'
}
else
{
this
.
currentComponment
=
'locker'
this
.
currentComponment
=
'locker'
return
}
}
if
(
msg
.
type
!==
'question'
){
return
}
this
.
eventId
=
msg
.
payload
.
eventId
;
this
.
currentComponment
=
'locker'
;
this
.
$nextTick
(
()
=>
{
const
{
type
}
=
msg
.
payload
;
if
(
type
===
3
)
{
this
.
currentComponment
=
'select-question'
}
else
if
(
type
===
1
)
{
this
.
currentComponment
=
'drawing-board'
}
else
if
(
type
===
2
)
{
this
.
currentComponment
=
'quick-response'
}
else
{
this
.
currentComponment
=
'locker'
}
console
.
log
(
type
,
this
.
currentComponment
)
})
}
}
},
},
beforeDestroy
()
{
beforeDestroy
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment