Commit 7c0680f3 by Will Daly

Merge pull request #146 from edx/will/js-cleanup

Clean up unused parameter to JS render functions
parents e508f871 297176cd
...@@ -51,19 +51,16 @@ OpenAssessment.BaseUI.prototype = { ...@@ -51,19 +51,16 @@ OpenAssessment.BaseUI.prototype = {
* Asynchronously load each sub-view into the DOM. * Asynchronously load each sub-view into the DOM.
*/ */
load: function() { load: function() {
this.renderSubmissionStep(true); this.renderSubmissionStep();
this.renderPeerAssessmentStep(false); this.renderPeerAssessmentStep();
this.renderSelfAssessmentStep(false); this.renderSelfAssessmentStep();
this.renderGradeStep(); this.renderGradeStep();
}, },
/** /**
Render the submission step. Render the submission step.
Args:
expanded (bool): If true, expand the step.
**/ **/
renderSubmissionStep: function(expand) { renderSubmissionStep: function() {
var ui = this; var ui = this;
this.server.render('submission').done( this.server.render('submission').done(
function(html) { function(html) {
...@@ -119,11 +116,8 @@ OpenAssessment.BaseUI.prototype = { ...@@ -119,11 +116,8 @@ OpenAssessment.BaseUI.prototype = {
/** /**
Render the peer-assessment step. Render the peer-assessment step.
Args:
expand (bool): If true, expand the step.
**/ **/
renderPeerAssessmentStep: function(expand) { renderPeerAssessmentStep: function() {
var ui = this; var ui = this;
this.server.render('peer_assessment').done( this.server.render('peer_assessment').done(
function(html) { function(html) {
...@@ -208,11 +202,8 @@ OpenAssessment.BaseUI.prototype = { ...@@ -208,11 +202,8 @@ OpenAssessment.BaseUI.prototype = {
/** /**
Render the self-assessment step. Render the self-assessment step.
Args:
expand (bool): If true, expand the step.
**/ **/
renderSelfAssessmentStep: function(expand) { renderSelfAssessmentStep: function() {
var ui = this; var ui = this;
this.server.render('self_assessment').done( this.server.render('self_assessment').done(
function(html) { function(html) {
...@@ -304,7 +295,7 @@ OpenAssessment.BaseUI.prototype = { ...@@ -304,7 +295,7 @@ OpenAssessment.BaseUI.prototype = {
// When we have successfully sent the submission, expand the next step // When we have successfully sent the submission, expand the next step
function(studentId, attemptNum) { function(studentId, attemptNum) {
ui.renderSubmissionStep(); ui.renderSubmissionStep();
ui.renderPeerAssessmentStep(true); ui.renderPeerAssessmentStep();
} }
).fail(function(errCode, errMsg) { ).fail(function(errCode, errMsg) {
ui.toggleActionError('submit', errMsg); ui.toggleActionError('submit', errMsg);
...@@ -317,11 +308,8 @@ OpenAssessment.BaseUI.prototype = { ...@@ -317,11 +308,8 @@ OpenAssessment.BaseUI.prototype = {
peerAssess: function() { peerAssess: function() {
var ui = this; var ui = this;
ui.peerAssessRequest(function() { ui.peerAssessRequest(function() {
// We leave the peer assessment step expanded, because (a) there might ui.renderPeerAssessmentStep();
// be more peers for the student to grade, and (b) the "completed" state ui.renderSelfAssessmentStep();
// contains no content, so it will look collapsed anyway.
ui.renderPeerAssessmentStep(true);
ui.renderSelfAssessmentStep(true);
ui.renderGradeStep(); ui.renderGradeStep();
}); });
}, },
...@@ -386,10 +374,8 @@ OpenAssessment.BaseUI.prototype = { ...@@ -386,10 +374,8 @@ OpenAssessment.BaseUI.prototype = {
this.toggleActionError('self', null); this.toggleActionError('self', null);
this.server.selfAssess(submissionId, optionsSelected).done( this.server.selfAssess(submissionId, optionsSelected).done(
function() { function() {
// When we have successfully sent the assessment, ui.renderPeerAssessmentStep();
// collapse the current and previous steps and expand the next step ui.renderSelfAssessmentStep();
ui.renderPeerAssessmentStep(false);
ui.renderSelfAssessmentStep(false);
ui.renderGradeStep(); ui.renderGradeStep();
} }
).fail(function(errMsg) { ).fail(function(errMsg) {
......
...@@ -65,7 +65,7 @@ OpenAssessment.Server.prototype = { ...@@ -65,7 +65,7 @@ OpenAssessment.Server.prototype = {
defer.resolveWith(this, [data]); defer.resolveWith(this, [data]);
}).fail(function(data) { }).fail(function(data) {
defer.rejectWith(this, ['Could not contact server.']); defer.rejectWith(this, ['Could not contact server.']);
}) });
}).promise(); }).promise();
}, },
...@@ -96,7 +96,7 @@ OpenAssessment.Server.prototype = { ...@@ -96,7 +96,7 @@ OpenAssessment.Server.prototype = {
defer.resolveWith(this, [data]); defer.resolveWith(this, [data]);
}).fail(function(data) { }).fail(function(data) {
defer.rejectWith(this, ['Could not contact server.']); defer.rejectWith(this, ['Could not contact server.']);
}) });
}).promise(); }).promise();
}, },
...@@ -203,7 +203,7 @@ OpenAssessment.Server.prototype = { ...@@ -203,7 +203,7 @@ OpenAssessment.Server.prototype = {
).fail(function(data) { ).fail(function(data) {
defer.rejectWith(this, ['Could not contact server.']); defer.rejectWith(this, ['Could not contact server.']);
}); });
}).promise() }).promise();
}, },
/** /**
......
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