diff --git a/public/assets/fonts/SF-Pro-Text-Regular.otf b/public/assets/fonts/SF-Pro-Text-Regular.otf
new file mode 100755
index 0000000..06dbe85
Binary files /dev/null and b/public/assets/fonts/SF-Pro-Text-Regular.otf differ
diff --git a/public/assets/forms.js b/public/assets/forms.js
index f12c3eb..beb0c27 100644
--- a/public/assets/forms.js
+++ b/public/assets/forms.js
@@ -26,22 +26,20 @@ export const psychForm = {
}
+/* Dummy algo for demo purposes, simply takes average of fields. */
+export const psychAlgo = (form, res) => {
- // algo: () => {
+ const vals = [];
- // const values = [];
+ form.steps.forEach(s => {
- // steps.forEach(s => {
+ s.fields.forEach(f => {
- // s.fields.forEach(f => {
+ vals.push(f.value);
- // values.push(f.value);
+ });
- // });
+ });
- // });
-
- // const sum = values.reduce((p, c) => p + c, 0);
-
- // return sum / values.length;
- // }
+ res.value = Math.floor(vals.reduce((a, b) => a + b) / vals.length);
+}
diff --git a/public/components/form.js b/public/components/form.js
index 7f46657..5269593 100644
--- a/public/components/form.js
+++ b/public/components/form.js
@@ -13,9 +13,16 @@ const Form =
const curr = Vue.ref(0);
function next() {
- curr.value < props.steps.length - 1 ?
- curr.value += 1 :
+
+ console.log(props.steps);
+
+ if (curr.value > props.steps.length - 2) {
props.submit();
+ return;
+ }
+
+ curr.value += 1;
+
}
return { curr, next };
@@ -26,20 +33,15 @@ const Form =