Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
problem-builder
Commits
e039d7fc
Commit
e039d7fc
authored
May 10, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34 from anantasty/MRQ/MCQ_validators
Mrq/mcq validators
parents
643041bf
7b010fea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
mentoring/public/js/questionnaire.js
+24
-0
No files found.
mentoring/public/js/questionnaire.js
View file @
e039d7fc
...
@@ -45,6 +45,10 @@ function MessageView(element) {
...
@@ -45,6 +45,10 @@ function MessageView(element) {
function
MCQBlock
(
runtime
,
element
)
{
function
MCQBlock
(
runtime
,
element
)
{
return
{
return
{
init
:
function
(
options
)
{
$
(
'input[type=radio]'
,
element
).
on
(
'change'
,
options
.
blockValidator
);
},
submit
:
function
()
{
submit
:
function
()
{
var
checkedRadio
=
$
(
'input[type=radio]:checked'
,
element
);
var
checkedRadio
=
$
(
'input[type=radio]:checked'
,
element
);
...
@@ -104,12 +108,24 @@ function MCQBlock(runtime, element) {
...
@@ -104,12 +108,24 @@ function MCQBlock(runtime, element) {
messageView
.
clearPopupEvents
();
messageView
.
clearPopupEvents
();
}
}
}
}
},
validate
:
function
(){
var
checked
=
$
(
'input[type=radio]:checked'
,
element
);
if
(
checked
.
length
)
{
return
true
;
}
return
false
;
}
}
};
};
}
}
function
MRQBlock
(
runtime
,
element
)
{
function
MRQBlock
(
runtime
,
element
)
{
return
{
return
{
init
:
function
(
options
)
{
$
(
'input[type=checkbox]'
,
element
).
on
(
'change'
,
options
.
blockValidator
);
},
submit
:
function
()
{
submit
:
function
()
{
var
checkedCheckboxes
=
$
(
'input[type=checkbox]:checked'
,
element
),
var
checkedCheckboxes
=
$
(
'input[type=checkbox]:checked'
,
element
),
checkedValues
=
[];
checkedValues
=
[];
...
@@ -161,6 +177,14 @@ function MRQBlock(runtime, element) {
...
@@ -161,6 +177,14 @@ function MRQBlock(runtime, element) {
});
});
});
});
},
validate
:
function
(){
var
checked
=
$
(
'input[type=checkbox]:checked'
,
element
);
if
(
checked
.
length
)
{
return
true
;
}
return
false
;
}
}
};
};
...
...
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