Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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
edx
edx-ora2
Commits
3b13c956
Commit
3b13c956
authored
Aug 06, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip validation for assessment views that are disabled
parent
a886d1b3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
openassessment/xblock/static/js/openassessment-studio.min.js
+0
-0
openassessment/xblock/static/js/spec/studio/oa_edit_settings.js
+19
-1
openassessment/xblock/static/js/src/studio/oa_edit_settings.js
+4
-2
No files found.
openassessment/xblock/static/js/openassessment-studio.min.js
View file @
3b13c956
This diff is collapsed.
Click to expand it.
openassessment/xblock/static/js/spec/studio/oa_edit_settings.js
View file @
3b13c956
...
...
@@ -161,10 +161,28 @@ describe("OpenAssessment.EditSettingsView", function() {
// Simulate one of the assessment views being invalid
assessmentViews
[
PEER
].
isValid
=
false
;
assessmentViews
[
PEER
].
setValidationErrors
([
"test error"
]);
assessmentViews
[
PEER
].
isEnabled
(
true
);
// Expect that the parent view is also invalid
expect
(
view
.
validate
()).
toBe
(
false
);
debugger
;
expect
(
view
.
validationErrors
()).
toContain
(
"test error"
);
});
it
(
"validates only assessments that are enabled"
,
function
()
{
// Simulate one of the assessment views being invalid but disabled
assessmentViews
[
PEER
].
isValid
=
false
;
assessmentViews
[
PEER
].
setValidationErrors
([
"test error"
]);
assessmentViews
[
PEER
].
isEnabled
(
false
);
// Spy on the assessment view's validate() method so we can
// verify that it doesn't get called (thus marking the DOM)
spyOn
(
assessmentViews
[
PEER
],
'validate'
).
andCallThrough
();
// Expect that the parent view is still valid
expect
(
view
.
validate
()).
toBe
(
true
);
// Check that the assessment view didn't get a chance
// to mark anything as invalid
expect
(
assessmentViews
[
PEER
].
validate
).
not
.
toHaveBeenCalled
();
});
});
openassessment/xblock/static/js/src/studio/oa_edit_settings.js
View file @
3b13c956
...
...
@@ -213,9 +213,11 @@ OpenAssessment.EditSettingsView.prototype = {
isValid
=
(
this
.
startDatetimeControl
.
validate
()
&&
isValid
);
isValid
=
(
this
.
dueDatetimeControl
.
validate
()
&&
isValid
);
// Validate each of the assessment views
// Validate each of the
*enabled*
assessment views
$
.
each
(
this
.
assessmentViews
,
function
()
{
isValid
=
(
this
.
validate
()
&&
isValid
);
if
(
this
.
isEnabled
())
{
isValid
=
(
this
.
validate
()
&&
isValid
);
}
});
return
isValid
;
...
...
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