+ );
+ });
+
+ this.setState({quizList: resList});
+ });
}
}
diff --git a/src/components/QuizContent/QuizContent.js b/src/components/QuizContent/QuizContent.js
index 063ce33..857873b 100644
--- a/src/components/QuizContent/QuizContent.js
+++ b/src/components/QuizContent/QuizContent.js
@@ -163,7 +163,7 @@ class QuizContent extends Component {
await that.recorder.startRecording();
}
- navigator.mediaDevices
+ /*navigator.mediaDevices
.getUserMedia({
video: true,
audio: true,
@@ -177,6 +177,7 @@ class QuizContent extends Component {
});
});
+ */
}
resetState() {
@@ -586,7 +587,7 @@ class QuizContent extends Component {
{this.state.data.title !== undefined &&
{this.state.data.title.replace(/_/g, ' ')}
}
- {this.state.description_recording &&
+ {/*this.state.description_recording &&
{(this.state.media_url == null || this.state.media_url == undefined) &&
@@ -601,10 +602,9 @@ class QuizContent extends Component {
this.stopRecording();
}}>
{(this.state.recording !== "description") ? "Begin Recording" : "Stop Recording"}
- }
+ */}
- }
-
+
({
closeButton: {
@@ -65,7 +68,16 @@ const initialState = {
class SignUpDialog extends Component {
constructor(props) {
super(props);
-
+ //Used for automatically assigning people to goal-setting or control groups
+ //See code related to signup below for more group assignment details
+ counterCollectionReference.doc('counter').get().then( (doc) => {
+ if (doc.exists) {
+ counter = doc.data()['count'];
+ console.log(counter);
+ } else {
+ console.log("Error getting count");
+ }
+ });
this.state = initialState;
}
@@ -111,7 +123,29 @@ class SignUpDialog extends Component {
collectionReference.doc(hash).set({email: "hidden"});
+ })
+ .then(value => {
+ //Group Assignment
+ //If 'count' is even then the person is assigned to the goal-setting group.
+ //If 'count' is odd then the person is assigned to the control group.
+ //The group wont do anything unless you use it elsewhere.
+ //See the commented out code in HomeContent for a group redirect solution.
+ let group = "";
+ if(counter % 2 === 0) {
+ group = "goal-setting";
+ }
+ else {
+ group = "control";
+ }
+
+ localStorage.setItem('group', group);
+ let hash = localStorage.getItem('hash');
+ collectionReference.doc(hash).set({group: group});
+ counter = counter +1;
+ counterCollectionReference.doc('counter').set({count: counter});
+
this.props.dialogProps.onClose();
+
})
.catch(reason => {
const code = reason.code;
diff --git a/src/services/authentication.js b/src/services/authentication.js
index 31ac1e1..4bdfe81 100644
--- a/src/services/authentication.js
+++ b/src/services/authentication.js
@@ -445,7 +445,7 @@ authentication.signOut = () => {
.signOut()
.then(value => {
analytics.logEvent("sign_out");
-
+ localStorage.clear();
resolve(value);
})
.catch(reason => {