From 31d7283fb1ac4337e7480bdaae53e281d33839e2 Mon Sep 17 00:00:00 2001 From: Jarmo Isotalo Date: Thu, 25 Sep 2014 23:01:06 +0200 Subject: [PATCH] Allow paste bin to be used regardless of the deadline --- .../src/fi/helsinki/cs/tmc/actions/PastebinAction.java | 5 +++++ tmc-plugin/src/fi/helsinki/cs/tmc/data/Exercise.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/tmc-plugin/src/fi/helsinki/cs/tmc/actions/PastebinAction.java b/tmc-plugin/src/fi/helsinki/cs/tmc/actions/PastebinAction.java index f46eded2..90dbee3d 100644 --- a/tmc-plugin/src/fi/helsinki/cs/tmc/actions/PastebinAction.java +++ b/tmc-plugin/src/fi/helsinki/cs/tmc/actions/PastebinAction.java @@ -77,6 +77,11 @@ public boolean enable(Project... projects) { } } + @Override + protected boolean enabledFor(Exercise exercise) { + return exercise.getReturnable(); + } + @Override protected void performAction(Node[] nodes) { List project = projectsFromNodes(nodes); diff --git a/tmc-plugin/src/fi/helsinki/cs/tmc/data/Exercise.java b/tmc-plugin/src/fi/helsinki/cs/tmc/data/Exercise.java index 67615fe9..2951888d 100644 --- a/tmc-plugin/src/fi/helsinki/cs/tmc/data/Exercise.java +++ b/tmc-plugin/src/fi/helsinki/cs/tmc/data/Exercise.java @@ -194,6 +194,10 @@ public void setReturnable(boolean returnable) { this.returnable = returnable; } + public boolean getReturnable() { + return this.returnable; + } + public boolean requiresReview() { return requiresReview; }