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
a83a8cde
Commit
a83a8cde
authored
Oct 05, 2011
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgraded Choisir app
parent
d041bdd7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
basic.css
resources/library/interactive/Choisir.wgt/css/basic.css
+7
-1
index.html
resources/library/interactive/Choisir.wgt/index.html
+1
-1
selQuestionApp.js
...library/interactive/Choisir.wgt/scripts/selQuestionApp.js
+10
-14
No files found.
resources/library/interactive/Choisir.wgt/css/basic.css
View file @
a83a8cde
...
@@ -217,7 +217,7 @@ body{
...
@@ -217,7 +217,7 @@ body{
margin-left
:
5px
;
margin-left
:
5px
;
font-family
:
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
font-family
:
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
font-size
:
small
;
font-size
:
small
;
width
:
9
0%
;
width
:
8
0%
;
float
:
left
;
float
:
left
;
-webkit-border-radius
:
5px
;
-webkit-border-radius
:
5px
;
border-radius
:
5px
;
border-radius
:
5px
;
...
@@ -363,3 +363,9 @@ body{
...
@@ -363,3 +363,9 @@ body{
box-shadow
:
#dadada
-1px
0
4px
;
box-shadow
:
#dadada
-1px
0
4px
;
z-index
:
100
;
z-index
:
100
;
}
}
#answerText
{
padding
:
3px
;
-webkit-border-radius
:
3px
;
border-radius
:
3px
;
}
\ No newline at end of file
resources/library/interactive/Choisir.wgt/index.html
View file @
a83a8cde
resources/library/interactive/Choisir.wgt/scripts/selQuestionApp.js
View file @
a83a8cde
...
@@ -52,9 +52,6 @@ function init(){
...
@@ -52,9 +52,6 @@ function init(){
for
(
var
j
in
questionArray
[
i
].
answers
)
for
(
var
j
in
questionArray
[
i
].
answers
)
addAnsBlock
(
questionArray
[
i
].
answers
[
j
].
id
,
questionArray
[
i
].
id
,
questionArray
[
i
].
answers
[
j
].
text
,
true
,
questionArray
[
i
].
rightAns
,
questionArray
[
i
].
type
);
addAnsBlock
(
questionArray
[
i
].
answers
[
j
].
id
,
questionArray
[
i
].
id
,
questionArray
[
i
].
answers
[
j
].
text
,
true
,
questionArray
[
i
].
rightAns
,
questionArray
[
i
].
type
);
}
}
/*for(var i in questionArray)
setInputSelected(questionArray[i].id, questionArray[i].type, questionArray[i].rightAns);
alert(2); */
}
}
}
}
...
@@ -260,15 +257,14 @@ function init(){
...
@@ -260,15 +257,14 @@ function init(){
}
else
{
}
else
{
if
(
event
.
target
.
type
==
"radio"
){
if
(
event
.
target
.
type
==
"radio"
){
if
(
event
.
target
.
value
==
getNeededElement
(
questionArray
,
currentQstId
).
rightAns
)
if
(
event
.
target
.
value
==
getNeededElement
(
questionArray
,
currentQstId
).
rightAns
)
$
(
event
.
target
).
next
().
next
().
css
(
"background-color"
,
"#6c0"
);
$
(
event
.
target
).
next
().
next
().
find
(
"span"
).
css
(
"background-color"
,
"#6c0"
);
else
else
$
(
event
.
target
).
next
().
next
().
css
(
"background-color"
,
"#f66
"
);
$
(
event
.
target
).
next
().
next
().
find
(
"span"
).
css
(
"background-color"
,
"red
"
);
}
else
{
}
else
{
//alert(event.target.value + " | " + getNeededElement(questionArray, currentQstId).rightAns + " | " + getNeededElement(questionArray, currentQstId).rightAns.replace(/,/g,"") + " | " + getNeededElement(questionArray, currentQstId).rightAns.replace(",","").indexOf(event.target.value + " ", 0) )
if
(
getNeededElement
(
questionArray
,
currentQstId
).
rightAns
.
replace
(
/,/g
,
""
).
indexOf
(
event
.
target
.
value
+
" "
,
0
)
!=
-
1
)
if
(
getNeededElement
(
questionArray
,
currentQstId
).
rightAns
.
replace
(
/,/g
,
""
).
indexOf
(
event
.
target
.
value
+
" "
,
0
)
!=
-
1
)
$
(
event
.
target
).
next
().
next
().
css
(
"background-color"
,
"#6c0"
);
$
(
event
.
target
).
next
().
next
().
find
(
"span"
).
css
(
"background-color"
,
"#6c0"
);
else
else
$
(
event
.
target
).
next
().
next
().
css
(
"background-color"
,
"#f66
"
);
$
(
event
.
target
).
next
().
next
().
find
(
"span"
).
css
(
"background-color"
,
"red
"
);
}
}
}
}
});
});
...
@@ -336,11 +332,10 @@ function init(){
...
@@ -336,11 +332,10 @@ function init(){
$
(
"select"
).
live
(
'change'
,
function
(
evt
){
$
(
"select"
).
live
(
'change'
,
function
(
evt
){
if
(
mode
){
if
(
mode
){
//alert(currentQstId + " | " + event.target.value + " | " + getNeededElement(questionArray, currentQstId).rightAns)
if
(
event
.
target
.
value
==
getNeededElement
(
questionArray
,
currentQstId
).
rightAns
)
if
(
event
.
target
.
value
==
getNeededElement
(
questionArray
,
currentQstId
).
rightAns
)
$
(
event
.
target
).
parent
().
css
(
"background-color"
,
"#6c0"
);
$
(
event
.
target
).
parent
().
css
(
"background-color"
,
"#6c0"
);
else
else
$
(
event
.
target
).
parent
().
css
(
"background-color"
,
"
#f66
"
);
$
(
event
.
target
).
parent
().
css
(
"background-color"
,
"
red
"
);
flagForSelect
=
false
;
flagForSelect
=
false
;
}
}
});
});
...
@@ -386,7 +381,8 @@ function init(){
...
@@ -386,7 +381,8 @@ function init(){
if
(
type
==
3
){
if
(
type
==
3
){
var
newAnswer
=
$
(
"<div class='newAnswer'>"
);
var
newAnswer
=
$
(
"<div class='newAnswer'>"
);
newAnswer
.
appendTo
(
ansDiv
);
newAnswer
.
appendTo
(
ansDiv
);
selInput
.
appendTo
(
newAnswer
);
var
selectSpan
=
$
(
"<span id='answerText'>"
).
appendTo
(
newAnswer
);
selInput
.
appendTo
(
selectSpan
);
$
(
"<option value='0'>Choise the right answer</option>"
).
appendTo
(
selInput
);
$
(
"<option value='0'>Choise the right answer</option>"
).
appendTo
(
selInput
);
}
}
for
(
var
j
in
array
[
i
].
answers
){
for
(
var
j
in
array
[
i
].
answers
){
...
@@ -395,14 +391,14 @@ function init(){
...
@@ -395,14 +391,14 @@ function init(){
newAnswer
=
$
(
"<div class='newAnswer'>"
);
newAnswer
=
$
(
"<div class='newAnswer'>"
);
var
ansInput
=
$
(
"<input type='radio' name='"
+
counter
+
"' value='"
+
array
[
i
].
answers
[
j
].
value
+
"' style='float: left; margin-right: 10px;'/>"
).
appendTo
(
newAnswer
);
var
ansInput
=
$
(
"<input type='radio' name='"
+
counter
+
"' value='"
+
array
[
i
].
answers
[
j
].
value
+
"' style='float: left; margin-right: 10px;'/>"
).
appendTo
(
newAnswer
);
var
ansSpan
=
$
(
"<span class='ansSpanDisplay'>"
+
ansCount
+
".</span>"
).
appendTo
(
newAnswer
);
var
ansSpan
=
$
(
"<span class='ansSpanDisplay'>"
+
ansCount
+
".</span>"
).
appendTo
(
newAnswer
);
var
ansContent
=
$
(
"<div class='ansContentDisplay'>
"
+
array
[
i
].
answers
[
j
].
text
+
"
</div>"
).
appendTo
(
newAnswer
);
var
ansContent
=
$
(
"<div class='ansContentDisplay'>
<span id='answerText'>"
+
array
[
i
].
answers
[
j
].
text
+
"</span>
</div>"
).
appendTo
(
newAnswer
);
newAnswer
.
appendTo
(
ansDiv
);
newAnswer
.
appendTo
(
ansDiv
);
break
;
break
;
case
"2"
:
case
"2"
:
newAnswer
=
$
(
"<div class='newAnswer'>"
);
newAnswer
=
$
(
"<div class='newAnswer'>"
);
ansInput
=
$
(
"<input type='checkbox' value='"
+
array
[
i
].
answers
[
j
].
value
+
"' style='float: left; margin-right: 10px;'/>"
).
appendTo
(
newAnswer
);
ansInput
=
$
(
"<input type='checkbox' value='"
+
array
[
i
].
answers
[
j
].
value
+
"' style='float: left; margin-right: 10px;'/>"
).
appendTo
(
newAnswer
);
ansSpan
=
$
(
"<span class='ansSpanDisplay'>"
+
ansCount
+
".</span>"
).
appendTo
(
newAnswer
);
ansSpan
=
$
(
"<span class='ansSpanDisplay'>"
+
ansCount
+
".</span>"
).
appendTo
(
newAnswer
);
ansContent
=
$
(
"<div class='ansContentDisplay'>
"
+
array
[
i
].
answers
[
j
].
text
+
"
</div>"
).
appendTo
(
newAnswer
);
ansContent
=
$
(
"<div class='ansContentDisplay'>
<span id='answerText'>"
+
array
[
i
].
answers
[
j
].
text
+
"</span>
</div>"
).
appendTo
(
newAnswer
);
newAnswer
.
appendTo
(
ansDiv
);
newAnswer
.
appendTo
(
ansDiv
);
break
;
break
;
case
"3"
:
case
"3"
:
...
...
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