diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2013-08-27 08:42:40 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2013-08-27 08:42:40 -0700 |
commit | a1dfbf19b5e88897b46f4095ff3ef730eba26ba6 (patch) | |
tree | 65b49afabd2d199f4125833dc7df4f4e2fde410b | |
parent | 01d252469b0c68422e6bb0dbb7a63217732bc56c (diff) |
Adding devfiles: various scripts and data files
33 files changed, 429 insertions, 0 deletions
diff --git a/devfiles/questionimages/frame-hover.png b/devfiles/questionimages/frame-hover.png Binary files differnew file mode 100644 index 0000000..3a474f1 --- /dev/null +++ b/devfiles/questionimages/frame-hover.png diff --git a/devfiles/questionimages/frame.png b/devfiles/questionimages/frame.png Binary files differnew file mode 100644 index 0000000..cb5ebc4 --- /dev/null +++ b/devfiles/questionimages/frame.png diff --git a/devfiles/questionimages/frame.sh b/devfiles/questionimages/frame.sh new file mode 100755 index 0000000..34b96ef --- /dev/null +++ b/devfiles/questionimages/frame.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +INPUT=$1 +NAME=$(basename $INPUT .jpg) +TMP=tmp/ +OUT=out/ + +mkdir -p $TMP $OUT + +convert -scale x134 -crop 134x155+0+0 -gravity center -extent 134x155 -background white $INPUT $TMP/$NAME.jpg +composite -gravity center frame.png $TMP/$NAME.jpg $OUT/$NAME.jpg +composite -gravity center frame-hover.png $TMP/$NAME.jpg $OUT/$NAME-hover.jpg + + diff --git a/devfiles/questions/1.json b/devfiles/questions/1.json new file mode 100644 index 0000000..30899e1 --- /dev/null +++ b/devfiles/questions/1.json @@ -0,0 +1,12 @@ +{ + "id": "1", + "type": "slider", + "question": "I Believe God", + "answers": { + "a1": { "text": "Is a figure in religious teaching, but not personally significant to me", "score": "1" }, + "a2": { "text": "Created the earth and us, and from that point His not actively involved in our lives", "score": "2" }, + "a3": { "text": "Created the earth and everything in it, and is involved to some extent", "score": "3" }, + "a4": { "text": "Is creator and ultimate authority in all things, and holds the future of all creation in His hands", "score": "4" } + }, + "nextQuestion": "2" +} diff --git a/devfiles/questions/10.json b/devfiles/questions/10.json new file mode 100644 index 0000000..1a84b84 --- /dev/null +++ b/devfiles/questions/10.json @@ -0,0 +1,13 @@ +{ + "id": "10", + "type": "slider", + "question": "How I feel about Church:", + "answers": { + "a1": { "text": "Unnecessary", "score": "1" }, + "a2": { "text": "An Obligation", "score": "2" }, + "a3": { "text": "Enjoyable", "score": "3" }, + "a4": { "text": "Lifestyle", "score": "4" } + }, + "previousQuestion": "9", + "nextQuestion": "11" +} diff --git a/devfiles/questions/11.json b/devfiles/questions/11.json new file mode 100644 index 0000000..a773d67 --- /dev/null +++ b/devfiles/questions/11.json @@ -0,0 +1,13 @@ +{ + "id": "11", + "type": "text", + "question": "Prayer. Fasting. Daily Bible Reading, Stewardship, Solitude, and Worship are:", + "answers": { + "a1": { "text": "Essential to my life as a follower of Jesus", "score": "4" }, + "a2": { "text": "Important in the life of a follower of Jesus, but I am not consistent with them", "score": "3" }, + "a3": { "text": "A good idea, I do some of them sometimes", "score": "2" }, + "a4": { "text": "Somebody else\'s idea of busy Christian stuaff", "score": "1" } + }, + "previousQuestion": "10", + "nextQuestion": "12" +} diff --git a/devfiles/questions/12.json b/devfiles/questions/12.json new file mode 100644 index 0000000..fa44efa --- /dev/null +++ b/devfiles/questions/12.json @@ -0,0 +1,13 @@ +{ + "id": "12", + "type": "text", + "question": "I give money to my Church:", + "answers": { + "a1": { "text": "Regularly, 10% of my income and offerings as the Lord leads", "score": "4" }, + "a2": { "text": "Regularly, 10% of my income", "score": "3" }, + "a3": { "text": "Occasionally, I give what is convenient", "score": "2" }, + "a4": { "text": "I don\'t give at all, the church does not need my money", "score": "1" } + }, + "previousQuestion": "11", + "nextQuestion": "13" +} diff --git a/devfiles/questions/13.json b/devfiles/questions/13.json new file mode 100644 index 0000000..b60e3e0 --- /dev/null +++ b/devfiles/questions/13.json @@ -0,0 +1,19 @@ +{ + "id": "13", + "type": "circle", + "question": "Those closest to me are:", + "topleft": "Outside the church", + "topright": "Inside the church but don\'t know my secrets", + "bottomleft": "Inside the church and know me a bit", + "bottomright": "Church family, know me well, and pray for me", + + "answers": { + "1.00,1.00": { "score": "2" }, + "1.00,-1.00": { "score": "4" }, + "-1.00,-1.00": { "score": "3" }, + "-1.00,1.00": { "score": "1" } + }, + + "previousQuestion": "12", + "nextQuestion": "14" +} diff --git a/devfiles/questions/14.json b/devfiles/questions/14.json new file mode 100644 index 0000000..54b996a --- /dev/null +++ b/devfiles/questions/14.json @@ -0,0 +1,13 @@ +{ + "id": "14", + "type": "slider", + "question": "Participation in Small Groups", + "answers": { + "a1": { "text": "Not Important", "score": "1" }, + "a2": { "text": "Only if Convienient", "score": "2" }, + "a3": { "text": "Important", "score": "3" }, + "a4": { "text": "Very Important", "score": "4" } + }, + "previousQuestion": "13", + "nextQuestion": "15" +} diff --git a/devfiles/questions/15.json b/devfiles/questions/15.json new file mode 100644 index 0000000..99220b5 --- /dev/null +++ b/devfiles/questions/15.json @@ -0,0 +1,15 @@ +{ + "id": "15", + "type": "slider", + "question": "Meeting with Followers of Jesus Outside of Church", + "answers": { + "a1": { "text": "Never", "score": "1" }, + "a2": { "text": "Less than Monthly", "score": "2" }, + "a3": { "text": "Monthly", "score": "2.25" }, + "a4": { "text": "Twice a Month", "score": "2.5" }, + "a5": { "text": "Weekly", "score": "3" }, + "a6": { "text": "I lead others Weekly", "score": "4" } + }, + "previousQuestion": "14", + "nextQuestion": "16" +} diff --git a/devfiles/questions/16.json b/devfiles/questions/16.json new file mode 100644 index 0000000..14e7b9c --- /dev/null +++ b/devfiles/questions/16.json @@ -0,0 +1,14 @@ +{ + "id": "16", + "type": "text", + "question": "Helping others grow in their faith is...", + "answers": { + "a1": { "text": "Essential in the life of a mature follower of Jesus", "score": "4" }, + "a2": { "text": "Important, but for now I need a mentor", "score": "3" }, + "a3": { "text": "Probably a good idea", "score": "2" }, + "a4": { "text": "Not my business. This is a personal issue.", "score": "1" } + }, + "previousQuestion": "15", + "nextQuestion": "17" +} + diff --git a/devfiles/questions/17.json b/devfiles/questions/17.json new file mode 100644 index 0000000..6118d9c --- /dev/null +++ b/devfiles/questions/17.json @@ -0,0 +1,19 @@ +{ + "id": "17", + "type": "circle", + "question": "Character, Integrity, and Excellent Personal Conduct are:", + "topleft": "I want this, but work in progress", + "topright": "Old Fashioned and not realistic", + "bottomleft": "Important and you can lead others if you\'re trying hard", + "bottomright": "Essential to me personally and in order to lead others", + + "answers": { + "1.00,1.00": { "score": "1" }, + "1.00,-1.00": { "score": "4" }, + "-1.00,-1.00": { "score": "2" }, + "-1.00,1.00": { "score": "3" } + }, + + "previousQuestion": "16", + "nextQuestion": "18" +} diff --git a/devfiles/questions/18.json b/devfiles/questions/18.json new file mode 100644 index 0000000..a9203c7 --- /dev/null +++ b/devfiles/questions/18.json @@ -0,0 +1,12 @@ +{ + "id": "18", + "type": "slider", + "question": "My Behaviour and How I Live my Life", + "answers": { + "a1": { "text": "Is my own business", "score": "1" }, + "a2": { "text": "Is not important as long as I don\'t hurt anyone", "score": "2" }, + "a4": { "text": "Is something I should allow input on", "score": "3" }, + "a4": { "text": "Is something I an accountable for", "score": "4" } + }, + "previousQuestion": "17" +} diff --git a/devfiles/questions/2.json b/devfiles/questions/2.json new file mode 100644 index 0000000..f619cdd --- /dev/null +++ b/devfiles/questions/2.json @@ -0,0 +1,15 @@ +{ + "id": "2", + "type": "image", + "question": "I see God this way", + "answers": { + "a1": { "score": "2" }, + "a2": { "score": "1" }, + "a3": { "score": "3" }, + "a4": { "score": "1" }, + "a5": { "score": "1" }, + "a6": { "score": "1" } + }, + "previousQuestion": "1", + "nextQuestion": "3" +} diff --git a/devfiles/questions/3.json b/devfiles/questions/3.json new file mode 100644 index 0000000..cedfc79 --- /dev/null +++ b/devfiles/questions/3.json @@ -0,0 +1,19 @@ +{ + "id": "3", + "type": "circle", + "question": "In my life, Jesus is", + "topleft": "Leader & Savior and I generally apply his teaching", + "topright": "Leader & Savior and obedience is essential", + "bottomleft": "The Son of God, and I\'m learning more about him", + "bottomright": "An important person or figure in history", + + "answers": { + "1.00,1.00": { "score": "4" }, + "1.00,-1.00": { "score": "1" }, + "-1.00,-1.00": { "score": "2" }, + "-1.00,1.00": { "score": "3" } + }, + + "previousQuestion": "2", + "nextQuestion": "4" +} diff --git a/devfiles/questions/4.json b/devfiles/questions/4.json new file mode 100644 index 0000000..da83cd1 --- /dev/null +++ b/devfiles/questions/4.json @@ -0,0 +1,13 @@ +{ + "id": "4", + "type": "text", + "question": "I accepted Jesus Christ as my Savior...", + "answers": { + "a1": { "text": "In my current church.", "type": "none" }, + "a2": { "text": "Somewhere else.", "type": "none" }, + "a3": { "text": "I have not accepted Jesus Christ as my savior.", "score": "0", "type": "trump", + "nextQuestion": "5" } + }, + "previousQuestion": "3", + "nextQuestion": "4a" +} diff --git a/devfiles/questions/4a.json b/devfiles/questions/4a.json new file mode 100644 index 0000000..a9036e1 --- /dev/null +++ b/devfiles/questions/4a.json @@ -0,0 +1,13 @@ +{ + "id": "4a", + "type": "text", + "question": "I accepted Jesus Christ as my Savior...", + "answers": { + "a1": { "text": "1 - 2 years ago", "type": "none" }, + "a2": { "text": "3 - 4 years ago", "type": "none" }, + "a3": { "text": "5 - 6 years ago", "type": "none" }, + "a4": { "text": "7+ years ago", "type": "none" } + }, + "previousQuestion": "3", + "nextQuestion": "5" +} diff --git a/devfiles/questions/5.json b/devfiles/questions/5.json new file mode 100644 index 0000000..6070acb --- /dev/null +++ b/devfiles/questions/5.json @@ -0,0 +1,13 @@ +{ + "id": "5", + "type": "slider", + "question": "I share my faith in Jesus...", + "answers": { + "a1": { "text": "Never", "score": "1" }, + "a2": { "text": "Rarely", "score": "2" }, + "a3": { "text": "Sometimes", "score": "3" }, + "a4": { "text": "Frequently", "score": "4" } + }, + "previousQuestion": "4", + "nextQuestion": "6" +} diff --git a/devfiles/questions/6.json b/devfiles/questions/6.json new file mode 100644 index 0000000..1965bfb --- /dev/null +++ b/devfiles/questions/6.json @@ -0,0 +1,19 @@ +{ + "id": "6", + "type": "circle", + "question": "I believe the Bible is:", + "topleft": "Inspired word of God and I try to read it regularly", + "topright": "Authoritative and essential to my life and I read it daily", + "bottomleft": "Pretty good wisdome, compiled that I occasionally read", + "bottomright": "A collection of moral stories, but generally not relevant to me", + + "answers": { + "1.00,1.00": { "score": "4" }, + "1.00,-1.00": { "score": "1" }, + "-1.00,-1.00": { "score": "2" }, + "-1.00,1.00": { "score": "3" } + }, + + "previousQuestion": "5", + "nextQuestion": "7" +} diff --git a/devfiles/questions/7.json b/devfiles/questions/7.json new file mode 100644 index 0000000..3386137 --- /dev/null +++ b/devfiles/questions/7.json @@ -0,0 +1,13 @@ +{ + "id": "7", + "type": "slider", + "question": "I believe following the Bible\'s teachings is", + "answers": { + "a1": { "text": "Outdated", "score": "1" }, + "a2": { "text": "Good Idea", "score": "2" }, + "a3": { "text": "Encouraged by God", "score": "3" }, + "a4": { "text": "Essential", "score": "4" } + }, + "previousQuestion": "6", + "nextQuestion": "8" +} diff --git a/devfiles/questions/8.json b/devfiles/questions/8.json new file mode 100644 index 0000000..3c0f07c --- /dev/null +++ b/devfiles/questions/8.json @@ -0,0 +1,12 @@ +{ + "id": "8", + "type": "image", + "question": "My spiritual life resembles...", + "answers": { + "a1": { "score": "3", "type": "none" }, + "a2": { "score": "2", "type": "none" }, + "a3": { "score": "1", "type": "none" } + }, + "previousQuestion": "7", + "nextQuestion": "9" +} diff --git a/devfiles/questions/9.json b/devfiles/questions/9.json new file mode 100644 index 0000000..c49dd56 --- /dev/null +++ b/devfiles/questions/9.json @@ -0,0 +1,19 @@ +{ + "id": "9", + "type": "circle", + "question": "Prayer for me is:", + "topleft": "Important and I pray regularly", + "topright": "Constant, conversational, a lifestyle, and absolutely indespensible in my life", + "bottomleft": "Helpful I think, and I pray occassionally", + "bottomright": "Not important, I don\'t believe it\'s helpful or useful", + + "answers": { + "1.00,1.00": { "score": "4" }, + "1.00,-1.00": { "score": "1" }, + "-1.00,-1.00": { "score": "2" }, + "-1.00,1.00": { "score": "3" } + }, + + "previousQuestion": "8", + "nextQuestion": "10" +} diff --git a/devfiles/scripts/bootstrap-cassandra.sh b/devfiles/scripts/bootstrap-cassandra.sh new file mode 100755 index 0000000..220bd03 --- /dev/null +++ b/devfiles/scripts/bootstrap-cassandra.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +## +## This script deletes all Cassandra data and creates and populates the +## ColumnFamilies needed to start the Growth Process. +## + +export TOOLS=`awk -F= '/jesterpm\.buildtools\.root/ { print $2 }' $HOME/.jesterpm-build-tools.properties` +export DEVFILES=$(dirname $0) + +$TOOLS/scripts/setup-cassandra.sh + +# Bootstrap keyspace +TEMPFILE=`mktemp` +cat $DEVFILES/cassandra-bootstrap.cql > $TEMPFILE + +# Fill with questions +./compile-questions.sh >> $TEMPFILE + +# Fill with videos +./compile-videos.sh >> $TEMPFILE + +# GO! +#cat $TEMPFILE | less +cassandra-cli < $TEMPFILE +rm $TEMPFILE diff --git a/devfiles/scripts/bootstrap-strings.sh b/devfiles/scripts/bootstrap-strings.sh new file mode 100755 index 0000000..9552dcb --- /dev/null +++ b/devfiles/scripts/bootstrap-strings.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +## +## This script clears the strings ColumnFamily and then rebuilds it. +## + +export TOOLS=`awk -F= '/jesterpm\.buildtools\.root/ { print $2 }' $HOME/.jesterpm-build-tools.properties` +export DEVFILES=$(dirname $0) + +TEMPFILE=`mktemp` + +cat > $TEMPFILE << EOF +use GROW; + +drop column family strings; + +create column family strings + with key_validation_class = 'UTF8Type' + and comparator = 'UTF8Type' + and default_validation_class = 'UTF8Type'; +EOF + +# Fill with questions +./compile-questions.sh >> $TEMPFILE + + +# Fill with videos +./compile-videos.sh >> $TEMPFILE + +# GO! +cassandra-cli < $TEMPFILE +rm $TEMPFILE diff --git a/devfiles/scripts/cassandra-bootstrap.cql b/devfiles/scripts/cassandra-bootstrap.cql new file mode 100644 index 0000000..c7d6de8 --- /dev/null +++ b/devfiles/scripts/cassandra-bootstrap.cql @@ -0,0 +1,22 @@ +drop keyspace GROW; + +create keyspace GROW + with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' + and strategy_options = {replication_factor:1}; + +use GROW; + +create column family strings + with key_validation_class = 'UTF8Type' + and comparator = 'UTF8Type' + and default_validation_class = 'UTF8Type'; + +create column family assessments + with key_validation_class = 'UTF8Type' + and comparator = 'UTF8Type' + and default_validation_class = 'UTF8Type'; + +create column family training + with key_validation_class = 'UTF8Type' + and comparator = 'UTF8Type' + and default_validation_class = 'UTF8Type'; diff --git a/devfiles/scripts/compile-questions.sh b/devfiles/scripts/compile-questions.sh new file mode 100755 index 0000000..16be5b1 --- /dev/null +++ b/devfiles/scripts/compile-questions.sh @@ -0,0 +1,9 @@ +# Dump Cassandra commands to setup questions +for i in $DEVFILES/questions/*.json; do + id=`basename $i .json` + echo "set strings['/questions/${id}']['value'] = '" + cat $i + echo "';" +done + + diff --git a/devfiles/scripts/compile-videos.sh b/devfiles/scripts/compile-videos.sh new file mode 100755 index 0000000..4ed8ad0 --- /dev/null +++ b/devfiles/scripts/compile-videos.sh @@ -0,0 +1,12 @@ +# Dump video data into Cassandra form. + +for i in $DEVFILES/videos/*; do + level=`basename $i` + for j in $i/*.json; do + id=`basename $j .json` + echo "set strings['/training/${level}']['${id}'] = '" + cat $j + echo "';" + done +done + diff --git a/devfiles/videos.xls b/devfiles/videos.xls Binary files differnew file mode 100644 index 0000000..7df55cb --- /dev/null +++ b/devfiles/videos.xls diff --git a/devfiles/videos/believer/believer-1.json b/devfiles/videos/believer/believer-1.json new file mode 100644 index 0000000..07169ab --- /dev/null +++ b/devfiles/videos/believer/believer-1.json @@ -0,0 +1,7 @@ +{ + "id": "believer-1", + "number": 1, + "title": "Star Trek Voyager: Caretaker", + "length": 6000, + "urls": [{"type": "video/x-msvideo", "src": "http://localhost/~jesterpm/videos/Star%20Trek/Voyager/Season%201/Star%20Trek%20Voyager%20-%20101-102%20-%20Caretaker.avi"}] +} diff --git a/devfiles/videos/disciple/disciple-1.json b/devfiles/videos/disciple/disciple-1.json new file mode 100644 index 0000000..e5f9d75 --- /dev/null +++ b/devfiles/videos/disciple/disciple-1.json @@ -0,0 +1,7 @@ +{ + "id": "disciple-1", + "number": 1, + "title": "Star Trek Voyager: Caretaker", + "length": 6000, + "urls": [{"type": "video/x-msvideo", "src": "http://localhost/~jesterpm/videos/Star%20Trek/Voyager/Season%201/Star%20Trek%20Voyager%20-%20101-102%20-%20Caretaker.avi"}] +} diff --git a/devfiles/videos/seeker/seeker-1.json b/devfiles/videos/seeker/seeker-1.json new file mode 100644 index 0000000..dc5216e --- /dev/null +++ b/devfiles/videos/seeker/seeker-1.json @@ -0,0 +1,7 @@ +{ + "id": "seeker-1", + "number": 1, + "title": "The Basics", + "length": 330, + "urls": [{"src":"seeker-the-basics.mp4", "type":"video/mp4"}, {"src":"seeker-the-basics.webm", "type":"video/webm"}] +} diff --git a/devfiles/videos/seeker/seeker-2.json b/devfiles/videos/seeker/seeker-2.json new file mode 100644 index 0000000..22d9b51 --- /dev/null +++ b/devfiles/videos/seeker/seeker-2.json @@ -0,0 +1,7 @@ +{ + "id": "seeker-2", + "number": 2, + "title": "Star Trek Voyager: Caretaker", + "length": 6000, + "urls": [{"type": "video/x-msvideo", "src": "http://localhost/~jesterpm/videos/Star%20Trek/Voyager/Season%201/Star%20Trek%20Voyager%20-%20101-102%20-%20Caretaker.avi"}] +} diff --git a/devfiles/videos/teacher/teacher-1.json b/devfiles/videos/teacher/teacher-1.json new file mode 100644 index 0000000..68f9741 --- /dev/null +++ b/devfiles/videos/teacher/teacher-1.json @@ -0,0 +1,7 @@ +{ + "id": "teacher-1", + "number": 1, + "title": "Star Trek Voyager: Caretaker", + "length": 6000, + "urls": [{"type": "video/x-msvideo", "src": "http://localhost/~jesterpm/videos/Star%20Trek/Voyager/Season%201/Star%20Trek%20Voyager%20-%20101-102%20-%20Caretaker.avi"}] +} |