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
216a6987
Commit
216a6987
authored
Aug 07, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly update the label for student training if called multiple times
parent
bb8bb0cd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
openassessment/xblock/static/js/openassessment-studio.min.js
+0
-0
openassessment/xblock/static/js/spec/studio/oa_edit_listeners.js
+43
-1
openassessment/xblock/static/js/src/studio/oa_container_item.js
+2
-2
No files found.
openassessment/xblock/static/js/openassessment-studio.min.js
View file @
216a6987
This diff is collapsed.
Click to expand it.
openassessment/xblock/static/js/spec/studio/oa_edit_listeners.js
View file @
216a6987
...
...
@@ -45,7 +45,7 @@ describe("OpenAssessment.StudentTrainingListener", function() {
listener
=
new
OpenAssessment
.
StudentTrainingListener
();
});
it
(
"updates the label of an option"
,
function
()
{
it
(
"updates the label
and points
of an option"
,
function
()
{
// Initial state, set by the fixture
assertExampleLabels
(
listener
.
examplesOptionsLabels
(),
...
...
@@ -79,6 +79,48 @@ describe("OpenAssessment.StudentTrainingListener", function() {
);
});
it
(
"updates an option twice"
,
function
()
{
// Initial state, set by the fixture
assertExampleLabels
(
listener
.
examplesOptionsLabels
(),
{
criterion_with_two_options
:
{
""
:
"Not Selected"
,
option_1
:
"Fair - 1 points"
,
option_2
:
"Good - 2 points"
}
}
);
// Update the option label and points,
listener
.
optionUpdated
({
criterionName
:
"criterion_with_two_options"
,
name
:
"option_1"
,
label
:
"This is a new label!"
,
points
:
42
});
// Update the option again
listener
.
optionUpdated
({
criterionName
:
"criterion_with_two_options"
,
name
:
"option_1"
,
label
:
"This is YET ANOTHER label!"
,
points
:
18
});
// Verify the final state
assertExampleLabels
(
listener
.
examplesOptionsLabels
(),
{
criterion_with_two_options
:
{
""
:
"Not Selected"
,
option_1
:
"This is YET ANOTHER label! - 18 points"
,
option_2
:
"Good - 2 points"
}
}
);
});
it
(
"updates the label of an option with invalid points"
,
function
()
{
// If an option has invalid points, the points will be set to NaN
listener
.
optionUpdated
({
...
...
openassessment/xblock/static/js/src/studio/oa_container_item.js
View file @
216a6987
...
...
@@ -31,8 +31,8 @@ OpenAssessment.ItemUtilities = {
element (Jquery Element): The element that represents the object.
**/
refreshOptionString
:
function
(
element
)
{
var
points
=
$
(
element
).
data
(
'
points'
);
var
label
=
$
(
element
).
data
(
'
label'
);
var
points
=
$
(
element
).
attr
(
'data-
points'
);
var
label
=
$
(
element
).
attr
(
'data-
label'
);
var
name
=
$
(
element
).
val
();
// We don't want the lack of a label to make it look like - 1 points.
if
(
label
===
""
){
...
...
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