text: define("bundles/programming/models/submissionHistory",["require","exports","module","underscore","backbone","bundles/programming/models/submissionSummary"],function(require,exports,module){"use strict";var _=require("underscore"),Backbone=require("backbone"),t=require("bundles/programming/models/submissionSummary"),e=Backbone.Collection.extend({model:t,comparator:"-submittedAt",getBestSubmission:function getBestSubmission(){if(0===this.length)return null;return this.max(function(t){return t.get("evaluation").get("score")})},getLatestSubmission:function getLatestSubmission(){if(0===this.length)return null;return this.at(0)},getLatestForPart:function getLatestForPart(e){var t=_(this.models).find(function(t){return null!==t.getEvaluationForPart(e)});if(void 0===t)return null;return{evaluation:t.getEvaluationForPart(e),submittedAt:t.get("submittedAt")}},getHistoryForPart:function getHistoryForPart(t){return _(this.models).map(function(e){return{evaluation:e.getEvaluationForPart(t),submittedAt:e.get("submittedAt")}}).filter(function(t){return null!==t.evalution})},doesSubmissionExist:function doesSubmissionExist(){return 0!==this.length}});module.exports=e});