Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
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
lifo
Nicolas Ollinger
OpenBoard
Commits
ba1a392c
Commit
ba1a392c
authored
Oct 03, 2012
by
maximXbs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed 'Separe phrase' app
parent
c55f5747
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
57 deletions
+64
-57
app.js
.../library/interactivities/Separe phrase.wgt/scripts/app.js
+64
-57
No files found.
resources/library/interactivities/Separe phrase.wgt/scripts/app.js
View file @
ba1a392c
...
...
@@ -18,6 +18,15 @@ function createElements( phrase )
return
s
;
}
function
createChain
(
phrase
)
{
var
arr
=
phrase
.
split
(
" "
);
var
result
=
""
;
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
result
+=
'<div class="letterCont">'
+
createElements
(
arr
[
i
])
+
'</div>'
;
return
result
;
}
$
(
document
).
ready
(
function
()
{
...
...
@@ -135,9 +144,8 @@ $(document).ready(function()
// store the text
w
.
setData
(
"phrase"
,
phrase
);
// remove all dots (they are to be set during the exercise)
phrase
=
phrase
.
replace
(
/ /g
,
''
);
//
phrase = phrase.replace( / /g, '' );
// create the html
if
(
window
.
sankore
&&
sankore
.
preference
(
"ordSplPhrasesState"
,
""
)
==
"1"
&&
flag
){
...
...
@@ -147,7 +155,7 @@ $(document).ready(function()
flag
=
false
;
}
else
w
.
setViewContent
(
create
Elements
(
phrase
)
);
w
.
setViewContent
(
create
Chain
(
phrase
)
);
// the behaviour
...
...
@@ -241,7 +249,7 @@ $(document).ready(function()
if
(
this
.
className
.
indexOf
(
"fixed"
)
!=
-
1
){
phrase
+=
' '
;
}
else
if
(
this
.
className
.
indexOf
(
"dash"
)
!=
-
1
){
else
if
(
(
this
.
className
.
indexOf
(
"dash"
)
!=
-
1
)
||
(
this
.
className
.
indexOf
(
"letterCont"
)
!=
-
1
)
){
return
;
}
else
{
...
...
@@ -249,7 +257,6 @@ $(document).ready(function()
phrase
+=
ch
;
}
});
//alert(phrase + " | " + this.getData( "phrase" ))
if
(
phrase
==
this
.
getData
(
"phrase"
)
){
this
.
elements
.
containerView
.
addClass
(
"answerRight"
);
}
...
...
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