summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/frontend
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2014-08-28 07:34:22 -0700
committerJesse Morgan <jesse@jesterpm.net>2014-08-28 07:34:22 -0700
commit66469ff2f76ac916e289e066377570b38554fdcc (patch)
tree98c576775605bb46b012cc28646ca023f38da319 /src/com/p4square/grow/frontend
parent6eba410e5eb53ee887e430f4f98ba03ffaa2a474 (diff)
Rough outline of the F1 attribute logic.
Parts of addAttribute have been implemented in F1User, but I may move it out into a general F1 API class.
Diffstat (limited to 'src/com/p4square/grow/frontend')
-rw-r--r--src/com/p4square/grow/frontend/AssessmentResultsPage.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/p4square/grow/frontend/AssessmentResultsPage.java b/src/com/p4square/grow/frontend/AssessmentResultsPage.java
index 9c69c69..95c3f6a 100644
--- a/src/com/p4square/grow/frontend/AssessmentResultsPage.java
+++ b/src/com/p4square/grow/frontend/AssessmentResultsPage.java
@@ -82,6 +82,9 @@ public class AssessmentResultsPage extends FreeMarkerPageResource {
return new StringRepresentation("Redirecting to " + nextPage);
}
+ // Publish results in F1
+ publishScoreInF1(response.getMap());
+
root.put("stage", score);
return new TemplateRepresentation(t, root, MediaType.TEXT_HTML);
@@ -92,6 +95,17 @@ public class AssessmentResultsPage extends FreeMarkerPageResource {
}
}
+ private void publishScoreInF1(Map results) {
+ if (!(getRequest().getClientInfo().getUser() instanceof F1User)) {
+ // Only useful if the user is from F1.
+ return;
+ }
+
+ F1User user = (F1User) getRequest().getClientInfo().getUser();
+
+ // TODO: Update the attribute.
+ }
+
/**
* @return The backend endpoint URI
*/