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
7f5b3634
Commit
7f5b3634
authored
May 19, 2014
by
Will Daly
Committed by
Stephen Sanchez
May 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup student training JS tests
parent
48545d08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
+23
-22
apps/openassessment/xblock/static/js/spec/oa_training.js
+23
-22
No files found.
apps/openassessment/xblock/static/js/spec/oa_training.js
View file @
7f5b3634
...
@@ -15,8 +15,16 @@ describe("OpenAssessment.StudentTrainingView", function() {
...
@@ -15,8 +15,16 @@ describe("OpenAssessment.StudentTrainingView", function() {
};
};
this
.
trainingAssess
=
function
()
{
this
.
trainingAssess
=
function
()
{
return
successPromise
;
var
server
=
this
;
return
$
.
Deferred
(
function
(
defer
)
{
defer
.
resolveWith
(
server
,
[
server
.
corrections
]);
}).
promise
();
};
};
// The corrections returned by the stub server.
// Tests can update this property to control
// the behavior of the stub.
this
.
corrections
=
{};
};
};
// Stub base view
// Stub base view
...
@@ -53,15 +61,12 @@ describe("OpenAssessment.StudentTrainingView", function() {
...
@@ -53,15 +61,12 @@ describe("OpenAssessment.StudentTrainingView", function() {
});
});
it
(
"submits an assessment for a training example"
,
function
()
{
it
(
"submits an assessment for a training example"
,
function
()
{
spyOn
(
server
,
'trainingAssess'
).
andCallFake
(
function
()
{
server
.
corrections
=
{
return
$
.
Deferred
(
function
(
defer
)
{
"Criterion 1"
:
"Good"
,
return
{
"Criterion 2"
:
"Poor"
,
"Criterion 1"
:
"Good"
,
"Criterion 3"
:
"Fair"
"Criterion 2"
:
"Poor"
,
};
"Criterion 3"
:
"Fair"
spyOn
(
server
,
'trainingAssess'
).
andCallThrough
();
};
}).
promise
();
});
// Select rubric options
// Select rubric options
var
optionsSelected
=
{};
var
optionsSelected
=
{};
...
@@ -78,15 +83,11 @@ describe("OpenAssessment.StudentTrainingView", function() {
...
@@ -78,15 +83,11 @@ describe("OpenAssessment.StudentTrainingView", function() {
});
});
it
(
"disable the assess button when the user submits"
,
function
()
{
it
(
"disable the assess button when the user submits"
,
function
()
{
spyOn
(
server
,
'trainingAssess'
).
andCallFake
(
function
()
{
server
.
corrections
=
{
return
$
.
Deferred
(
function
(
defer
)
{
"Criterion 1"
:
"Good"
,
return
{
"Criterion 2"
:
"Poor"
,
"Criterion 1"
:
"Good"
,
"Criterion 3"
:
"Fair"
"Criterion 2"
:
"Poor"
,
};
"Criterion 3"
:
"Fair"
};
}).
promise
();
});
// Initially, the button should be disabled
// Initially, the button should be disabled
expect
(
view
.
assessButtonEnabled
()).
toBe
(
false
);
expect
(
view
.
assessButtonEnabled
()).
toBe
(
false
);
...
@@ -109,10 +110,10 @@ describe("OpenAssessment.StudentTrainingView", function() {
...
@@ -109,10 +110,10 @@ describe("OpenAssessment.StudentTrainingView", function() {
});
});
it
(
"reloads the assessment steps when the user submits an assessment"
,
function
()
{
it
(
"reloads the assessment steps when the user submits an assessment"
,
function
()
{
// Simulate that the user answered the problem correctly, so there are no corrections
server
.
corrections
=
{};
spyOn
(
server
,
'trainingAssess'
).
andCallThrough
();
spyOn
(
baseView
,
'loadAssessmentModules'
).
andCallThrough
();
spyOn
(
baseView
,
'loadAssessmentModules'
).
andCallThrough
();
spyOn
(
server
,
'trainingAssess'
).
andCallFake
(
function
()
{
return
$
.
Deferred
(
function
(
defer
){
return
{};}).
promise
();
});
// Select rubric options
// Select rubric options
var
optionsSelected
=
{};
var
optionsSelected
=
{};
...
...
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