-
+
-
Task {i + 1}
@@ -181,16 +180,16 @@
- ERROR: Submission is a parent, but has no children. There was an error during creation.
+ ERROR: Submission is a parent, but has no children. There was an error
+ during creation.
+
+ show_visualization="{opts.competition.enable_detailed_results}"
+ submission="{child}">
@@ -214,6 +213,7 @@
$(self.refs.status).dropdown()
$(self.refs.phase).dropdown()
$(self.refs.rerun_button).dropdown()
+ $(self.refs.submission_handling_operation).dropdown()
$(self.refs.submission_table).tablesort()
})
@@ -233,11 +233,11 @@
self.loading = true
self.update()
if (opts.admin) {
- filters = filters || {phase__competition: opts.competition.id}
+ filters = filters || { phase__competition: opts.competition.id }
} else {
- filters = filters || {phase: self.selected_phase.id}
+ filters = filters || { phase: self.selected_phase.id }
}
- filters = filters || {phase: self.selected_phase.id}
+ filters = filters || { phase: self.selected_phase.id }
CODALAB.api.get_submissions(filters)
.done(function (submissions) {
// TODO: should be able to do this with a serializer?
@@ -292,7 +292,7 @@
event.stopPropagation()
}
self.rerun_phase = function (phase) {
- if(confirm("Are you sure? This could take hours .. you are re-running all of the submissions in a phase.")) {
+ if (confirm("Are you sure? This could take hours .. you are re-running all of the submissions in a phase.")) {
CODALAB.api.re_run_phase_submissions(phase.id)
.done(function (response) {
toastr.success(`Rerunning ${response.count} submissions`)
@@ -335,14 +335,14 @@
self.update_submissions()
})
.fail(function (response) {
- if(response.responseJSON.detail){
+ if (response.responseJSON.detail) {
toastr.error(response.responseJSON.detail)
} else {
toastr.error(response.responseText)
}
})
event.stopPropagation()
-
+
}
self.rerun_submission = function (submission) {
@@ -352,10 +352,10 @@
self.update_submissions()
})
.fail(function (response) {
- if(response.responseJSON.detail){
+ if (response.responseJSON.detail) {
toastr.error(response.responseJSON.detail)
- }
- else if(response.responseJSON.error_msg){
+ }
+ else if (response.responseJSON.error_msg) {
toastr.error(response.responseJSON.error_msg)
}
else {
@@ -404,11 +404,11 @@
toastr.success('Submissions deleted')
self.update_submissions()
})
- .fail(function (response){
+ .fail(function (response) {
toastr.error('Something went wrong')
})
}
- }
+ }
self.get_score_details = function (submission, column) {
try {
@@ -422,9 +422,9 @@
}
self.get_score = function (submission) {
- try{
+ try {
return parseFloat(submission.scores[0].score).toFixed(2)
-
+
} catch {
return ""
}
@@ -447,7 +447,7 @@
}
}
- self.on_submission_checked = function(event){
+ self.on_submission_checked = function (event) {
event.stopPropagation()
self.submission_checked()
}
@@ -457,23 +457,30 @@
let checked_boxes = inputs.not(':first').filter('input:checked')
let unchecked_boxes = inputs.not(':first').filter('input:not(:checked)')
inputs.first().prop('checked', unchecked_boxes.length === 0)
- self.checked_submissions = checked_boxes.serializeArray().map((x) => {return x.name})
+ self.checked_submissions = checked_boxes.serializeArray().map((x) => { return x.name })
}
self.select_all_pressed = function () {
let check_boxes = $(self.refs.submission_table).find('input')
// Set checkboxes to be equal to Select_All checkbox
check_boxes.prop('checked', check_boxes.first().is(':checked'))
+
+
+ let inputs = $(self.refs.submission_table).find('input')
+ let checked_boxes = inputs.not(':first').filter('input:checked')
+ self.checked_submissions = checked_boxes.serializeArray().map((x) => { return x.name })
}
+
+
self.submission_clicked = function (submission) {
// stupid workaround to not modify the original submission object
submission = _.defaultsDeep({}, submission)
if (submission.has_children) {
submission.children = _.map(_.sortBy(submission.children), child => {
- return {id: child}
+ return { id: child }
})
CODALAB.api.get_submission_details(submission.id)
.done(function (data) {
@@ -509,6 +516,41 @@
CODALAB.events.trigger('submission_clicked')
}
+
+ self.bulk_download = function () {
+ CODALAB.api.download_many_submissions(self.checked_submissions)
+ .catch(function (error) {
+ console.error('Error:', error);
+ });
+ }
+
+
+
+ self.submission_handling = function () {
+ // console.log(self.checked_submissions)
+ if (self.checked_submissions.length === 0) {
+ console.log("no submission is selected");
+ } else {
+ var submission_operation = self.refs.submission_handling_operation.value
+ switch (submission_operation) {
+ case "delete":
+ // console.log("delete")
+ self.delete_selected_submissions()
+ break;
+ case "download":
+ // console.log("download")
+ self.bulk_download()
+ break;
+ case "rerun":
+ // console.log("rerun")
+ self.rerun_selected_submissions()
+ break
+ default:
+ console.log("should never be in this state of default..")
+ }
+ }
+ }
+
CODALAB.events.on('phase_selected', function (selected_phase) {
self.selected_phase = selected_phase
self.selected_phase.hide_output = selected_phase.hide_output && !CODALAB.state.user.has_competition_admin_privileges(self.opts.competition)
@@ -565,4 +607,4 @@
.failed.question.circle.icon
color #2c3f4c
-
+
\ No newline at end of file