{:uriI"file:///home/franco/Documents/mumuki/laboratory/app/assets/javascripts/application/bridge.js?type=application/javascript&pipeline=self&id=9031be0a984f75bd084002ba093c8a9a53aca2073a4c9a64a2ef15bb73c2c4e1:ET:load_pathI"D/home/franco/Documents/mumuki/laboratory/app/assets/javascripts;T: filenameI"Z/home/franco/Documents/mumuki/laboratory/app/assets/javascripts/application/bridge.js;T: nameI"application/bridge;T:logical_pathI"application/bridge.self.js;T:content_typeI"application/javascript;T: sourceI"[var mumuki = mumuki || {}; (function (mumuki) { var lastSubmission = {}; function Laboratory(exerciseId){ this.exerciseId = exerciseId; } function asString(json){ return JSON.stringify(json); } function sameAsLastSolution(newSolution){ return asString(lastSubmission.content) === asString(newSolution); } function lastSubmissionFinishedSuccessfully(){ return lastSubmission.result && lastSubmission.result.status !== 'aborted'; } function sendNewSolution(solution){ var token = new mumuki.CsrfToken(); var request = token.newRequest({ type: 'POST', url: window.location.origin + window.location.pathname + '/solutions' + window.location.search, data: solution }); return $.ajax(request).done(function (result) { lastSubmission = { content: solution, result: result }; }); } mumuki.load(function () { lastSubmission = {}; }); Laboratory.prototype = { runLocalTests: function (solution) { if(lastSubmissionFinishedSuccessfully() && sameAsLastSolution(solution)){ return $.Deferred().resolve(lastSubmission.result); } else { return sendNewSolution(solution); } }, runTests: function(content) { return this.runLocalTests({ solution: content }); } }; mumuki.bridge = { Laboratory: Laboratory }; }(mumuki)); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"hfile-digest:///home/franco/Documents/mumuki/laboratory/app/assets/javascripts/application/bridge.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"% `FG7 -y.gY: lengthi[:dependencies_digest"%'2t=*q;A޾Dh\3qg:idI"E9031be0a984f75bd084002ba093c8a9a53aca2073a4c9a64a2ef15bb73c2c4e1;F: mtimel+DK[