Skip to content

Commit

Permalink
Merge branch 'master' of github.com:atiti/OpenARMS
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacior committed Mar 20, 2012
2 parents c35a893 + 349bd74 commit 7916609
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 40 deletions.
11 changes: 6 additions & 5 deletions Service/app/controllers/Management.java
Expand Up @@ -55,7 +55,7 @@ public static void createQuestion() {
question.token = String.valueOf(new Random(System.currentTimeMillis()).nextInt(999999));
} while (!Poll.find("byToken", question.token).fetch().isEmpty());

question.generateAdminKey(8);
//question.generateAdminKey(8);
question.save();

// send mail to the creator of question
Expand All @@ -67,7 +67,7 @@ public static void createQuestion() {
new Choice(question, a).save();
}

renderJSON(new CreateResponseJSON(question.token, question.adminKey));
//renderJSON(new CreateResponseJSON(question.token, question.adminKey));

} catch (IOException ex) {
ex.printStackTrace();
Expand Down Expand Up @@ -104,13 +104,13 @@ public static void activation() {
}

// only when provided adminKey is correct
if (question.adminKey.equals(adminKey)) {
/*if (question.adminKey.equals(adminKey)) {
//question.activateFor(activationMsg.getDuration());
question.save();
renderJSON("activated");
} else {
renderJSON("not activated");
}
}*/

} catch (IOException ex) {
ex.printStackTrace();
Expand All @@ -126,7 +126,7 @@ public static void activation() {
* Parameter {id} - poll ID <br/>
* Parameter {adminKey} - randomly generated string at question creation <br/>
*/
public static void checkAdminLink() {
/* public static void checkAdminLink() {
long urlID = params.get("id", Long.class).longValue();
String adminKey = params.get("adminKey");
// retrieve and activate the question
Expand All @@ -139,4 +139,5 @@ public static void checkAdminLink() {
renderJSON(new BaseJSON("Invalid admin link"));
}
}
*/
}
33 changes: 0 additions & 33 deletions Service/app/controllers/Test.java

This file was deleted.

4 changes: 2 additions & 2 deletions Service/app/controllers/Voting.java
Expand Up @@ -133,11 +133,11 @@ public static void getResults() {
renderJSON("");
}
// return results when correct adminKey is provided or when question is not active
if ((adminKey != null && question.adminKey.equals(adminKey)) || !question.isActive()) {
/*if ((adminKey != null && question.adminKey.equals(adminKey)) || !question.isActive()) {
int[] votes = question.getVoteCounts();
ResultsJSON result = new ResultsJSON(urlID, question.id, question.question, question.getChoicesArray(), votes);
renderJSON(result);
}
}*/

// otherwise do not respond with results
if (question.isActive()) {
Expand Down

0 comments on commit 7916609

Please sign in to comment.