Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
eduline
Commits
c7de1097
Commit
c7de1097
authored
May 20, 2020
by
陈超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A
parent
7dc091c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
11 deletions
+62
-11
apps/exams/Tpl/default/Index/examsroom_w3g.html
+62
-11
No files found.
apps/exams/Tpl/default/Index/examsroom_w3g.html
View file @
c7de1097
...
...
@@ -403,7 +403,8 @@
countDown
:
"00:00:00"
,
expand
:
false
,
//选项
currentOptions
:
[]
currentOptions
:
[],
finished
:
[]
}
},
computed
:
{
...
...
@@ -467,8 +468,6 @@
currentMyOptions
:
function
()
{
let
cur
=
this
.
currentRightOptions
return
this
.
currentOptions
.
filter
(
r
=>
{
return
r
.
selected
}).
map
(
r
=>
{
console
.
log
(
r
)
console
.
log
(
cur
.
hx_indexOf
(
k
=>
{
return
k
==
r
.
key
}))
return
{
right
:
cur
.
hx_indexOf
(
k
=>
{
return
k
==
r
.
key
})
!=
-
1
,
key
:
r
.
key
...
...
@@ -489,19 +488,44 @@
this
.
info
=
{:
json_encode
(
$paper
)};
this
.
temp
=
{:
json_encode
(
$tempData
)};
this
.
paperOptions
=
{:
json_encode
(
$paper_options
)};
for
(
let
k
in
this
.
currentQuestion
.
answer_options
)
{
let
value
=
this
.
currentQuestion
.
answer_options
[
k
]
this
.
currentOptions
.
push
({
key
:
k
,
value
:
value
,
selected
:
false
})
}
this
.
initAnswerMode
()
console
.
log
(
this
.
info
)
console
.
log
(
this
.
temp
)
console
.
log
(
this
.
paperOptions
)
},
watch
:
{
current
:
func
(
o
,
n
)
{
this
.
initAnswerMode
()
}
},
methods
:
{
initAnswerMode
:
function
()
{
let
q
=
this
.
currentQuestionTypeKey
switch
(
q
)
{
case
"radio"
:
this
.
currentOptions
=
[]
let
Q
=
this
.
currentQuestion
let
old
=
this
.
finished
.
hx_firstOf
(
r
=>
{
return
r
.
qId
==
Q
.
exams_question_id
})
for
(
let
k
in
Q
.
answer_options
)
{
let
value
=
Q
.
answer_options
[
k
]
let
select
=
old
?
old
.
option
==
k
:
false
this
.
currentOptions
.
push
({
key
:
k
,
value
:
value
,
selected
:
select
})
}
break
}
},
recordData
:
function
()
{
return
{
paperId
:
this
.
info
.
exams_paper_id
,
timeConsumed
:
1
,
questionIndex
:
this
.
current
,
finished
:
this
.
finished
}
},
countDown
:
function
()
{
let
time
=
1
let
hours
=
Math
.
floor
(
time
/
3600
)
...
...
@@ -530,6 +554,7 @@
},
onNextQuestion
:
function
()
{
if
(
this
.
current
<
this
.
totalQuestion
)
{
this
.
cacheQuestion
()
this
.
current
+=
1
}
else
{
ui
.
confirm
(
"已经是最后一题了,是否交卷?"
,
{
// 是否返回第一题
...
...
@@ -543,6 +568,32 @@
if
(
this
.
current
>
1
)
{
this
.
current
-=
1
}
},
cacheQuestion
:
function
()
{
let
q
=
this
.
currentQuestion
let
mode
=
this
.
finished
.
hx_firstOf
(
r
=>
{
return
r
.
qId
==
q
.
exams_question_id
})
if
(
mode
)
{
switch
(
this
.
currentQuestionTypeKey
)
{
case
"radio"
:
let
my
=
this
.
currentMyOptions
if
(
my
.
length
>
0
)
{
mode
.
option
=
my
[
0
].
key
}
break
}
}
else
{
switch
(
this
.
currentQuestionTypeKey
)
{
case
"radio"
:
let
my
=
this
.
currentMyOptions
if
(
my
.
length
>
0
)
{
this
.
finished
.
push
({
qId
:
q
.
exams_question_id
,
option
:
my
[
0
].
key
})
}
break
}
}
}
}
})
...
...
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