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
c85101e1
Commit
c85101e1
authored
Jul 30, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All tests passing
parent
f66e07ac
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
26 deletions
+48
-26
openassessment/xblock/static/js/openassessment-studio.min.js
+0
-0
openassessment/xblock/static/js/spec/studio/oa_edit.js
+1
-3
openassessment/xblock/static/js/src/studio/oa_edit.js
+25
-13
openassessment/xblock/static/js/src/studio/oa_edit_validation_alert.js
+22
-10
No files found.
openassessment/xblock/static/js/openassessment-studio.min.js
View file @
c85101e1
This diff is collapsed.
Click to expand it.
openassessment/xblock/static/js/spec/studio/oa_edit.js
View file @
c85101e1
...
@@ -219,9 +219,6 @@ describe("OpenAssessment.StudioView", function() {
...
@@ -219,9 +219,6 @@ describe("OpenAssessment.StudioView", function() {
// Also expect that an error is displayed
// Also expect that an error is displayed
expect
(
server
.
receivedData
).
toBe
(
null
);
expect
(
server
.
receivedData
).
toBe
(
null
);
expect
(
view
.
validationAlert
.
isVisible
()).
toBe
(
true
);
expect
(
view
.
validationAlert
.
isVisible
()).
toBe
(
true
);
expect
(
runtime
.
notify
).
toHaveBeenCalledWith
(
"error"
,
{
msg
:
"The problem could not be saved."
}
);
// Expect that individual fields were highlighted
// Expect that individual fields were highlighted
expect
(
view
.
validationErrors
()).
toContain
(
expect
(
view
.
validationErrors
()).
toContain
(
...
@@ -230,6 +227,7 @@ describe("OpenAssessment.StudioView", function() {
...
@@ -230,6 +227,7 @@ describe("OpenAssessment.StudioView", function() {
// Fix the error and try to save again
// Fix the error and try to save again
view
.
settingsView
.
submissionStart
(
"2014-04-01"
,
"00:00"
);
view
.
settingsView
.
submissionStart
(
"2014-04-01"
,
"00:00"
);
view
.
save
();
// Expect that the validation errors were cleared
// Expect that the validation errors were cleared
// and that data was successfully sent to the server.
// and that data was successfully sent to the server.
...
...
openassessment/xblock/static/js/src/studio/oa_edit.js
View file @
c85101e1
...
@@ -124,20 +124,32 @@ OpenAssessment.StudioView.prototype = {
...
@@ -124,20 +124,32 @@ OpenAssessment.StudioView.prototype = {
save
:
function
()
{
save
:
function
()
{
var
view
=
this
;
var
view
=
this
;
this
.
saveTabState
();
this
.
saveTabState
();
// Check whether the problem has been released; if not,
// warn the user and allow them to cancel.
// Perform client-side validation
this
.
server
.
checkReleased
().
done
(
// TODO -- more explanation
function
(
isReleased
)
{
this
.
validationAlert
.
hide
();
if
(
isReleased
)
{
this
.
clearValidationErrors
();
view
.
confirmPostReleaseUpdate
(
$
.
proxy
(
view
.
updateEditorContext
,
view
));
if
(
!
this
.
validate
())
{
}
this
.
validationAlert
.
setMessage
(
else
{
gettext
(
"Validation errors! [TODO Sylvia please help!]"
)
view
.
updateEditorContext
();
).
show
();
}
else
{
// Check whether the problem has been released; if not,
// warn the user and allow them to cancel.
this
.
server
.
checkReleased
().
done
(
function
(
isReleased
)
{
if
(
isReleased
)
{
view
.
confirmPostReleaseUpdate
(
$
.
proxy
(
view
.
updateEditorContext
,
view
));
}
else
{
view
.
updateEditorContext
();
}
}
}
}
).
fail
(
function
(
errMsg
)
{
).
fail
(
function
(
errMsg
)
{
view
.
showError
(
errMsg
);
view
.
showError
(
errMsg
);
}
);
}
);
}
},
},
/**
/**
...
...
openassessment/xblock/static/js/src/studio/oa_edit_validation_alert.js
View file @
c85101e1
...
@@ -28,32 +28,44 @@ OpenAssessment.ValidationAlert.prototype = {
...
@@ -28,32 +28,44 @@ OpenAssessment.ValidationAlert.prototype = {
},
},
/**
/**
Hides the alert.
Hides the alert.
*/
Returns:
TODO
*/
hide
:
function
()
{
hide
:
function
()
{
this
.
element
.
addClass
(
'is--hidden'
);
this
.
element
.
addClass
(
'is--hidden'
);
this
.
rubricContentElement
.
removeClass
(
'openassessment_alert_shown'
);
this
.
rubricContentElement
.
removeClass
(
'openassessment_alert_shown'
);
return
this
;
},
},
/**
/**
Displays the alert.
Displays the alert.
*/
Returns:
TODO
*/
show
:
function
()
{
show
:
function
()
{
this
.
element
.
removeClass
(
'is--hidden'
);
this
.
element
.
removeClass
(
'is--hidden'
);
this
.
rubricContentElement
.
addClass
(
'openassessment_alert_shown'
);
this
.
rubricContentElement
.
addClass
(
'openassessment_alert_shown'
);
return
this
;
},
},
/**
/**
Sets the message of the alert.
Sets the message of the alert.
How will this work with internationalization?
How will this work with internationalization?
Args:
newTitle (str): the new title that the message will have
newMessage (str): the new text that the message's body will contain
Args:
Returns:
newTitle (str): the new title that the message will have
TODO
newMessage (str): the new text that the message's body will contain
*/
*/
setMessage
:
function
(
newTitle
,
newMessage
)
{
setMessage
:
function
(
newTitle
,
newMessage
)
{
this
.
title
.
text
(
newTitle
);
this
.
title
.
text
(
newTitle
);
this
.
message
.
text
(
newMessage
);
this
.
message
.
text
(
newMessage
);
return
this
;
},
},
/**
/**
...
...
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