Commit ac69321b by Usman Khalid

Fixed student training step tests.

TNL-708
parent d116de55
...@@ -101,7 +101,18 @@ ...@@ -101,7 +101,18 @@
{ {
"template": "openassessmentblock/student_training/student_training.html", "template": "openassessmentblock/student_training/student_training.html",
"context": { "context": {
"training_essay": "My special essay.", "training_essay": {
"answer": {
"parts": [
{
"prompt": {
"description": "Given the state of the world today, what do you think should be done to combat poverty?"
},
"text": "My special essay."
}
]
}
},
"training_rubric": { "training_rubric": {
"criteria": [ "criteria": [
{ {
...@@ -528,7 +539,12 @@ ...@@ -528,7 +539,12 @@
"training": { "training": {
"examples": [ "examples": [
{ {
"answer": "Test answer", "answer": {
"parts": [
{ "text": "Test answer 1"},
{ "text": "Test answer 2"}
]
},
"criteria": [ "criteria": [
{ {
"name": "criterion_with_two_options", "name": "criterion_with_two_options",
...@@ -569,7 +585,12 @@ ...@@ -569,7 +585,12 @@
} }
], ],
"template": { "template": {
"answer": "", "answer": {
"parts": [
{ "text": ""},
{ "text": ""}
]
},
"criteria": [ "criteria": [
{ {
"name": "criterion_with_two_options", "name": "criterion_with_two_options",
......
...@@ -180,7 +180,7 @@ describe("OpenAssessment edit assessment views", function() { ...@@ -180,7 +180,7 @@ describe("OpenAssessment edit assessment views", function() {
expect(view.description()).toEqual({ expect(view.description()).toEqual({
examples: [ examples: [
{ {
answer: 'Test answer', answer: ['Test answer 1', 'Test answer 2'],
options_selected: [ options_selected: [
{ {
criterion: 'criterion_with_two_options', criterion: 'criterion_with_two_options',
...@@ -197,7 +197,7 @@ describe("OpenAssessment edit assessment views", function() { ...@@ -197,7 +197,7 @@ describe("OpenAssessment edit assessment views", function() {
expect(view.description()).toEqual({ expect(view.description()).toEqual({
examples: [ examples: [
{ {
answer: 'Test answer', answer: ['Test answer 1', 'Test answer 2'],
options_selected: [ options_selected: [
{ {
criterion: 'criterion_with_two_options', criterion: 'criterion_with_two_options',
...@@ -206,7 +206,7 @@ describe("OpenAssessment edit assessment views", function() { ...@@ -206,7 +206,7 @@ describe("OpenAssessment edit assessment views", function() {
] ]
}, },
{ {
answer: '', answer: ['', ''],
options_selected: [ options_selected: [
{ {
criterion: 'criterion_with_two_options', criterion: 'criterion_with_two_options',
......
...@@ -4,6 +4,19 @@ Tests for OpenAssessment prompt editing view. ...@@ -4,6 +4,19 @@ Tests for OpenAssessment prompt editing view.
describe("OpenAssessment.EditPromptViews", function() { describe("OpenAssessment.EditPromptViews", function() {
// Use a stub notifier implementation that simply stores
// the notifications it receives.
var notifier = null;
var StubNotifier = function() {
this.notifications = [];
this.notificationFired = function(name, data) {
this.notifications.push({
name: name,
data: data
});
};
};
var view = null; var view = null;
beforeEach(function() { beforeEach(function() {
...@@ -12,7 +25,8 @@ describe("OpenAssessment.EditPromptViews", function() { ...@@ -12,7 +25,8 @@ describe("OpenAssessment.EditPromptViews", function() {
// Create the view // Create the view
var element = $("#oa_prompt_editor_wrapper").get(0); var element = $("#oa_prompt_editor_wrapper").get(0);
view = new OpenAssessment.EditPromptsView(element); notifier = new StubNotifier();
view = new OpenAssessment.EditPromptsView(element, notifier);
}); });
it("reads prompts from the editor", function() { it("reads prompts from the editor", function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment