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
32f0c4ff
Commit
32f0c4ff
authored
Jul 17, 2014
by
gradyward
Committed by
Stephen Sanchez
Jul 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First draft
parent
7af5a24c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
1 deletions
+89
-1
openassessment/templates/openassessmentblock/edit/oa_training_example.html
+1
-1
openassessment/xblock/static/js/src/lms/oa_container.js
+3
-0
openassessment/xblock/static/js/src/lms/oa_container_item.js
+6
-0
openassessment/xblock/static/js/src/studio/oa_rubric_validation.js
+79
-0
No files found.
openassessment/templates/openassessmentblock/edit/oa_training_example.html
View file @
32f0c4ff
...
...
@@ -19,7 +19,7 @@
<h2>
{% trans "Scored Rubric" %}
</h2>
<ol
class=
"openassessment_training_example_criteria_selections list-input settings-list"
>
{% for criterion in example.criteria %}
<li
class=
"field comp-setting-entry
"
>
<li
class=
"field comp-setting-entry
openassessment_training_example_criterion"
data-criterion=
{{criterion.name}}
>
<div
class=
"wrapper-comp-setting"
>
<label
class=
"openassessment_training_example_criterion_name setting-label"
>
{{criterion.label}}
...
...
openassessment/xblock/static/js/src/lms/oa_container.js
View file @
32f0c4ff
...
...
@@ -83,6 +83,8 @@ OpenAssessment.Container = function(containerItem, kwargs) {
$
(
"."
+
this
.
containerItemClass
,
this
.
containerElement
).
each
(
function
(
index
,
element
)
{
new
container
.
containerItem
(
element
);
}
);
this
.
modificationHandler
=
new
OpenAssessment
.
RubricValidationEventHandler
(
'#oa_student_training_editor'
);
};
OpenAssessment
.
Container
.
prototype
=
{
...
...
@@ -129,6 +131,7 @@ OpenAssessment.Container.prototype = {
**/
remove
:
function
(
item
)
{
$
(
item
.
element
).
closest
(
"."
+
this
.
containerItemClass
).
remove
();
this
.
containerItem
.
removeHandler
(
this
.
modificationHandler
);
},
/**
...
...
openassessment/xblock/static/js/src/lms/oa_container_item.js
View file @
32f0c4ff
...
...
@@ -47,6 +47,12 @@ OpenAssessment.RubricOption.prototype = {
if
(
nameString
!==
""
)
{
fields
.
name
=
nameString
;
}
return
fields
;
},
removeHandler
:
function
(
rubricValidationHandler
){
var
criterionName
=
$
(
this
.
element
).
data
(
'criterion'
);
var
optionName
=
$
(
this
.
element
).
data
(
'option'
);
rubricValidationHandler
.
optionRemove
(
criterionName
,
optionName
);
}
};
...
...
openassessment/xblock/static/js/src/studio/oa_rubric_validation.js
0 → 100644
View file @
32f0c4ff
var
generateOptionString
=
function
(
name
,
points
){
return
gettext
(
name
+
' - '
+
points
+
' points'
)
};
OpenAssessment
.
RubricValidationEventHandler
=
function
()
{
this
.
element
=
$
(
'#oa_student_training_editor'
);
this
.
alert
=
new
OpenAssessment
.
ValidationAlert
(
$
(
'#openassessment_rubric_validation_alert'
,
this
.
element
));
};
OpenAssessment
.
RubricValidationEventHandler
.
prototype
=
{
optionRefresh
:
function
(
criterionName
,
oldName
,
newName
,
newPoints
){
$
(
'.openassessment_training_example_criterion'
,
this
.
element
).
each
(
function
(){
if
(
$
(
this
).
data
(
'criterion'
)
==
criterionName
&&
$
(
this
).
val
()
==
oldName
)
{
$
(
this
).
val
(
newName
);
$
(
this
).
text
(
generateOptionString
(
newName
,
newPoints
));
}
});
},
optionAdd
:
function
(
criterionName
){
$
(
'.openassessment_training_example_criterion_option'
,
this
.
element
).
each
(
function
(){
if
(
$
(
this
).
data
(
'criterion'
)
==
criterionName
)
{
$
(
this
).
append
(
"<option value=''> </option>"
);
}
});
},
optionRemove
:
function
(
criterionName
,
optionName
){
var
removed
=
0
;
$
(
'.openassessment_training_example_criterion_option'
,
this
.
element
).
each
(
function
(){
if
(
$
(
this
).
data
(
'criterion'
)
==
criterionName
&&
$
(
this
).
val
()
==
optionName
)
{
$
(
this
).
val
(
""
);
$
(
this
).
addClass
(
"openassessment_highlighted_field"
);
removed
++
;
}
});
if
(
removed
>
0
){
var
title
=
"Option Deletion Led to Invalidation"
;
var
msg
=
"Because you deleted an option, there were "
+
removed
+
" instance(s) of training examples"
+
"where the choice had to be reset."
;
this
.
alert
.
setMessage
(
title
,
msg
);
}
},
criterionRename
:
function
(
criterionName
,
newValue
){
$
(
'.openassessment_training_example_criterion'
,
this
.
element
).
each
(
function
(){
if
(
$
(
this
).
data
(
'criterion'
)
==
criterionName
){
$
(
".openassessment_training_example_criterion_name_wrapper"
,
this
).
text
(
newValue
);
}
});
},
criterionAdd
:
function
()
{
$
(
".openassessment_training_example_criterion"
,
this
.
element
).
each
(
function
(){
$
(
this
).
append
(
'<li class="field comp-setting-entry openassessment_training_example_criterion" data-criterion=APPLES>'
+
'<div class="wrapper-comp-setting">'
+
'<label class="openassessment_training_example_criterion_name setting-label">'
+
'<div class="openassessment_training_example_criterion_name_wrapper">'
+
'Banannas!'
+
'</div>'
+
'<select class="openassessment_training_example_criterion_option setting-input" data-criterion=APPLES>'
+
'</select>'
+
'</label>'
+
'</div>'
+
'</li>'
);
});
}
};
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