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
83b2f7b4
Commit
83b2f7b4
authored
Apr 04, 2014
by
Alan Boudreault
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
various minor fix
parent
347af2e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
mentoring/mentoring.py
+1
-1
mentoring/public/js/mentoring.js
+4
-4
No files found.
mentoring/mentoring.py
View file @
83b2f7b4
...
@@ -160,7 +160,7 @@ class MentoringBlock(XBlockWithLightChildren):
...
@@ -160,7 +160,7 @@ class MentoringBlock(XBlockWithLightChildren):
self
.
completed
=
bool
(
completed
)
self
.
completed
=
bool
(
completed
)
if
not
self
.
completed
and
max_attempts
>
0
:
if
not
self
.
completed
and
max_attempts
>
0
:
se
tattr
(
self
,
'num_attempts'
,
self
.
num_attempts
+
1
)
se
lf
.
num_attempts
+=
1
return
{
return
{
'submitResults'
:
submit_results
,
'submitResults'
:
submit_results
,
...
...
mentoring/public/js/mentoring.js
View file @
83b2f7b4
...
@@ -143,12 +143,12 @@ function MentoringBlock(runtime, element) {
...
@@ -143,12 +143,12 @@ function MentoringBlock(runtime, element) {
// validate all children
// validate all children
function
validateXBlock
()
{
function
validateXBlock
()
{
var
submit_dom
=
$
(
element
).
find
(
'.submit .input-main'
);
var
submit_dom
=
$
(
element
).
find
(
'.submit .input-main'
);
var
children_are
_valid
=
true
;
var
is
_valid
=
true
;
var
data
=
$
(
'.attempts'
,
element
).
data
();
var
data
=
$
(
'.attempts'
,
element
).
data
();
var
children
=
getChildren
(
element
);
var
children
=
getChildren
(
element
);
if
((
data
.
max_attempts
>
0
)
&&
(
data
.
num_attempts
>=
data
.
max_attempts
))
{
if
((
data
.
max_attempts
>
0
)
&&
(
data
.
num_attempts
>=
data
.
max_attempts
))
{
children_are
_valid
=
false
;
is
_valid
=
false
;
}
}
else
{
else
{
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
...
@@ -156,13 +156,13 @@ function MentoringBlock(runtime, element) {
...
@@ -156,13 +156,13 @@ function MentoringBlock(runtime, element) {
if
(
child
.
name
!==
undefined
)
{
if
(
child
.
name
!==
undefined
)
{
var
child_validation
=
callIfExists
(
child
,
'validate'
);
var
child_validation
=
callIfExists
(
child
,
'validate'
);
if
(
_
.
isBoolean
(
child_validation
))
{
if
(
_
.
isBoolean
(
child_validation
))
{
children_are_valid
=
children_are_valid
&&
child_validation
is_valid
=
is_valid
&&
child_validation
;
}
}
}
}
}
}
}
}
if
(
!
children_are
_valid
)
{
if
(
!
is
_valid
)
{
submit_dom
.
attr
(
'disabled'
,
'disabled'
);
submit_dom
.
attr
(
'disabled'
,
'disabled'
);
}
}
else
{
else
{
...
...
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