summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/frontend
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2014-09-27 11:05:43 -0700
committerJesse Morgan <jesse@jesterpm.net>2014-09-27 11:05:43 -0700
commitbdf47fc7340ec2a3ecaa6b11bbf87f0f5eaaeea1 (patch)
treeb0faa7efb72587f99cd742caffcfb00d3f625cd9 /src/com/p4square/grow/frontend
parent8fa4f1fb4f122ee1e27c6015479bcd883b4b0671 (diff)
Adding support to fetch attributes for a user.
Diffstat (limited to 'src/com/p4square/grow/frontend')
-rw-r--r--src/com/p4square/grow/frontend/AssessmentResultsPage.java4
-rw-r--r--src/com/p4square/grow/frontend/ChapterCompletePage.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/com/p4square/grow/frontend/AssessmentResultsPage.java b/src/com/p4square/grow/frontend/AssessmentResultsPage.java
index ff1832c..2035ce8 100644
--- a/src/com/p4square/grow/frontend/AssessmentResultsPage.java
+++ b/src/com/p4square/grow/frontend/AssessmentResultsPage.java
@@ -113,12 +113,12 @@ public class AssessmentResultsPage extends FreeMarkerPageResource {
String attributeName = "Assessment Complete - " + results.get("result");
try {
- Attribute attribute = new Attribute();
+ Attribute attribute = new Attribute(attributeName);
attribute.setStartDate(new Date());
attribute.setComment(JsonEncodedProvider.MAPPER.writeValueAsString(results));
F1API f1 = mGrowFrontend.getF1Access().getAuthenticatedApi(user);
- if (!f1.addAttribute(user.getIdentifier(), attributeName, attribute)) {
+ if (!f1.addAttribute(user.getIdentifier(), attribute)) {
LOG.error("addAttribute failed for " + user.getIdentifier()
+ " with attribute " + attributeName);
}
diff --git a/src/com/p4square/grow/frontend/ChapterCompletePage.java b/src/com/p4square/grow/frontend/ChapterCompletePage.java
index a2c4ebe..f07a870 100644
--- a/src/com/p4square/grow/frontend/ChapterCompletePage.java
+++ b/src/com/p4square/grow/frontend/ChapterCompletePage.java
@@ -169,11 +169,11 @@ public class ChapterCompletePage extends FreeMarkerPageResource {
String attributeName = "Training Complete - " + mChapter;
try {
- Attribute attribute = new Attribute();
+ Attribute attribute = new Attribute(attributeName);
attribute.setStartDate(new Date());
F1API f1 = mGrowFrontend.getF1Access().getAuthenticatedApi(user);
- if (!f1.addAttribute(user.getIdentifier(), attributeName, attribute)) {
+ if (!f1.addAttribute(user.getIdentifier(), attribute)) {
LOG.error("addAttribute failed for " + user.getIdentifier()
+ " with attribute " + attributeName);
}