Commit ac69321b by Usman Khalid

Fixed student training step tests.

TNL-708
parent d116de55
......@@ -101,7 +101,18 @@
{
"template": "openassessmentblock/student_training/student_training.html",
"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": {
"criteria": [
{
......@@ -528,7 +539,12 @@
"training": {
"examples": [
{
"answer": "Test answer",
"answer": {
"parts": [
{ "text": "Test answer 1"},
{ "text": "Test answer 2"}
]
},
"criteria": [
{
"name": "criterion_with_two_options",
......@@ -569,7 +585,12 @@
}
],
"template": {
"answer": "",
"answer": {
"parts": [
{ "text": ""},
{ "text": ""}
]
},
"criteria": [
{
"name": "criterion_with_two_options",
......
......@@ -180,7 +180,7 @@ describe("OpenAssessment edit assessment views", function() {
expect(view.description()).toEqual({
examples: [
{
answer: 'Test answer',
answer: ['Test answer 1', 'Test answer 2'],
options_selected: [
{
criterion: 'criterion_with_two_options',
......@@ -197,7 +197,7 @@ describe("OpenAssessment edit assessment views", function() {
expect(view.description()).toEqual({
examples: [
{
answer: 'Test answer',
answer: ['Test answer 1', 'Test answer 2'],
options_selected: [
{
criterion: 'criterion_with_two_options',
......@@ -206,7 +206,7 @@ describe("OpenAssessment edit assessment views", function() {
]
},
{
answer: '',
answer: ['', ''],
options_selected: [
{
criterion: 'criterion_with_two_options',
......
......@@ -4,6 +4,19 @@ Tests for OpenAssessment prompt editing view.
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;
beforeEach(function() {
......@@ -12,7 +25,8 @@ describe("OpenAssessment.EditPromptViews", function() {
// Create the view
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() {
......
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