Commit 1d585e74 authored by Dave Griffiths's avatar Dave Griffiths
Browse files

editor history and unanswered/yes/no/not set for all previous toggles - breaks database

parent 43a6057f
......@@ -107,19 +107,21 @@
(msg "INCORRECT TYPE FOR" key ":" type ":" value))
(let ((existing-type (ktv-get-type (get-current 'entity-values '()) key)))
(if (equal? existing-type type)
(set-current!
'entity-values
(ktv-set
(get-current 'entity-values '())
(ktv key type value)))
;;
(begin
(msg "entity-set-value! - adding new " key "of type" type "to entity")
(entity-add-value-create! key type value)))
;; save straight to local db every time
(entity-update-single-value! (list key type value))
))
(cond
((equal? existing-type type)
;; save straight to local db every time (checks for modification)
(entity-update-single-value! (list key type value))
;; then save to memory
(set-current!
'entity-values
(ktv-set
(get-current 'entity-values '())
(ktv key type value))))
;;
(else
(msg "entity-set-value! - adding new " key "of type" type "to entity")
(entity-add-value-create! key type value))
)))
(define (date-time->string dt)
......@@ -179,6 +181,8 @@
(table (get-current 'table #f))
(unique-id (ktv-get (get-current 'entity-values '()) "unique_id")))
(cond
((ktv-eq? (ktv-get-whole (get-current 'entity-values '()) (ktv-key ktv)) ktv)
(msg "eusv: no change for" (ktv-key ktv)))
(unique-id
(update-entity db table (entity-id-from-unique db table unique-id) (list ktv)))
(else
......@@ -595,7 +599,7 @@
(vert
(text-view (symbol->id id)
(mtext-lookup id)
30 (layout 'wrap-content 'wrap-content 1 'centre 10))
30 (layout 'wrap-content 'wrap-content 1 'centre 0))
(spinner (make-id (string-append (symbol->string id) "-spinner"))
(map mtext-lookup types)
(layout 'wrap-content 'wrap-content 1 'centre 0)
......
......@@ -19,7 +19,7 @@
;; colours
(msg "starting up....")
(define entity-types (list "village" "household" "individual"))
(define entity-types (list "village" "household" "individual" "child" "crop"))
(define trans-col (list 0 0 0 0))
(define colour-one (list 0 0 255 100))
......@@ -62,18 +62,19 @@
;;(display (db-all db "local" "app-settings"))(newline)
(define tribes-list '(khasi other))
(define subtribe-list '(khynriam pnar bhoi war other))
(define education-list '(primary middle high secondary university))
(define married-list '(currently-married currently-single seperated))
(define residence-list '(birthplace spouse-village))
(define gender-list '(male female))
(define house-type-list '(concrete tin thatched other))
(define tribes-list '(not-set khasi other no-answered))
(define subtribe-list '(not-set khynriam pnar bhoi war other not-answered))
(define education-list '(not-set primary middle high secondary university not-answered))
(define married-list '(not-set currently-married currently-single seperated not-answered))
(define residence-list '(not-set birthplace spouse-village not-answered))
(define gender-list '(not-set male female not-answered))
(define house-type-list '(not-set concrete tin thatched other not-answered))
(define yesno-list '(not-set yes no not-answered))
(define social-types-list '(knowledge prestige))
(define social-relationship-list '(mother father sister brother spouse children co-wife spouse-mother spouse-father spouse-brother-wife spouse-sister-husband friend neighbour other))
(define social-residence-list '(same other))
(define social-strength-list '(daily weekly monthly less))
(define social-relationship-list '(not-set mother father sister brother spouse children co-wife spouse-mother spouse-father spouse-brother-wife spouse-sister-husband friend neighbour other not-answered))
(define social-residence-list '(not-set same other not-answered))
(define social-strength-list '(not-set daily weekly monthly less not-answered))
(define village-ktvlist
(list
......@@ -103,20 +104,22 @@
(define individual-ktvlist
(list
(ktv "edit-history" "varchar" "")
(ktv "social-edit-history" "varchar" "")
(ktv "name" "varchar" "")
(ktv "first-name" "varchar" "")
(ktv "family" "varchar" "")
(ktv "photo-id" "varchar" "")
(ktv "photo" "file" "")
(ktv "tribe" "varchar" "")
(ktv "subtribe" "varchar" "")
(ktv "tribe" "varchar" "not-set")
(ktv "subtribe" "varchar" "not-set")
(ktv "child" "int" -1)
(ktv "age" "int" -1)
(ktv "gender" "varchar" "")
(ktv "literate" "int" 0)
(ktv "education" "varchar" "")
(ktv "gender" "varchar" "not-set")
(ktv "literate" "varchar" "not-set")
(ktv "education" "varchar" "not-set")
(ktv "head-of-house" "varchar" "")
(ktv "marital-status" "varchar" "")
(ktv "marital-status" "varchar" "not-set")
(ktv "times-married" "int" -1)
(ktv "id-spouse" "varchar" "")
(ktv "children-living" "int" -1)
......@@ -131,22 +134,22 @@
(ktv "num-residence-changes" "int" -1)
(ktv "village-visits-month" "int" -1)
(ktv "village-visits-year" "int" -1)
(ktv "occupation-agriculture" "int" 0)
(ktv "occupation-gathering" "int" 0)
(ktv "occupation-labour" "int" 0)
(ktv "occupation-cows" "int" 0)
(ktv "occupation-fishing" "int" 0)
(ktv "occupation-agriculture" "varchar" "not-set")
(ktv "occupation-gathering" "varchar" "not-set")
(ktv "occupation-labour" "varchar" "not-set")
(ktv "occupation-cows" "varchar" "not-set")
(ktv "occupation-fishing" "varchar" "not-set")
(ktv "occupation-other" "varchar" "")
(ktv "contribute" "int" 0)
(ktv "own-land" "int" 0)
(ktv "rent-land" "int" 0)
(ktv "hire-land" "int" 0)
(ktv "house-type" "varchar" "")
(ktv "contribute" "varchar" "not-set")
(ktv "own-land" "varchar" "not-set")
(ktv "rent-land" "varchar" "not-set")
(ktv "hire-land" "varchar" "not-set")
(ktv "house-type" "varchar" "not-set")
(ktv "loan" "int" -1)
(ktv "earning" "int" -1)
(ktv "radio" "int" 0)
(ktv "tv" "int" 0)
(ktv "mobile" "int" 0)
(ktv "radio" "varchar" "not-set")
(ktv "tv" "varchar" "not-set")
(ktv "mobile" "varchar" "not-set")
(ktv "visit-market" "int" -1)
(ktv "town-sell" "int" -1)
(ktv "social-one" "varchar" "")
......@@ -212,10 +215,10 @@
(define child-ktvlist
(list
(ktv "name" "varchar" (mtext-lookup 'default-child-name))
(ktv "alive" "int" 1)
(ktv "gender" "varchar" "")
(ktv "alive" "varchar" "varchar" "not-set")
(ktv "gender" "varchar" "not-set")
(ktv "age" "int" -1)
(ktv "living-at-home" "int" 0)))
(ktv "living-at-home" "varchar" "not-set")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
......@@ -228,6 +231,50 @@
(update-widget 'debug-text-view (get-id "sync-debug") 'text
(get-current 'debug-text "")))
;; return last element from comma seperated list
(define (history-get-last txt)
(let ((l (string-split txt '(#\,))))
(if (null? l) ""
(car (reverse l)))))
(define (contains-social? ktv-list)
(foldl
(lambda (ktv r)
(if (and
(not r)
(> (string-length (ktv-key ktv)) 5)
(or
(equal? (substring (ktv-key ktv) 0 6) "friend")
(equal? (substring (ktv-key ktv) 0 6) "social")))
#t r))
#f ktv-list))
(define (update-edit-history db table user-id)
;; get dirty individual entities
(let ((de (db-select
db (string-append
"select entity_id from "
table "_entity where dirty=1 and entity_type='individual';"))))
(when (not (null? de))
(for-each
(lambda (i)
(msg i)
(let* ((entity-id (vector-ref i 0))
(dirty-items (dbg (get-entity-plain-for-sync db table entity-id))))
(when (not (null? dirty-items))
;; check if social change
(let ((type (if (contains-social? dirty-items) "social-edit-history" "edit-history")))
;; check if last editor is different
(let ((editors (car (get-value db table entity-id (list type "varchar")))))
(when (or (equal? editors "") (not (equal? (history-get-last editors) user-id)))
;; append user id
(msg "history - setting" type)
(if (equal? editors "")
(update-value db table entity-id (ktv type "varchar" (dbg user-id)))
(update-value db table entity-id (ktv type "varchar" (dbg (string-append editors "," user-id)))))))))))
(cdr de)))))
(define (debug-timer-cb)
(alog "debug timer cb")
(append
......@@ -242,6 +289,7 @@
(lambda ()
(msg "connected, going in...")
(alog "got here...")
(update-edit-history db "sync" (get-current 'user-id "no id"))
(append
(list (toast "Syncing"))
(upload-dirty db)
......@@ -1045,20 +1093,23 @@
(spacer 20)
(mtext 'photo-id-display)
))
(mbutton 'agreement-button (lambda () (list (start-activity "agreement" 0 ""))))
(mtext 'last-editor)
(horiz
(mbutton-scale 'details-button (lambda () (list (start-activity "details" 0 ""))))
(mbutton-scale 'family-button (lambda () (list (start-activity "family" 0 "")))))
(mbutton-scale 'agreement-button (lambda () (list (start-activity "agreement" 0 ""))))
(mbutton-scale 'details-button (lambda () (list (start-activity "details" 0 "")))))
(horiz
(mbutton-scale 'migration-button (lambda () (list (start-activity "migration" 0 ""))))
(mbutton-scale 'income-button (lambda () (list (start-activity "income" 0 "")))))
(mbutton-scale 'family-button (lambda () (list (start-activity "family" 0 ""))))
(mbutton-scale 'migration-button (lambda () (list (start-activity "migration" 0 "")))))
(horiz
(mbutton-scale 'genealogy-button (lambda () (list (start-activity "genealogy" 0 ""))))
(mbutton-scale 'friendship-button (lambda () (list (start-activity "friendship" 0 "")))))
(mbutton-scale 'income-button (lambda () (list (start-activity "income" 0 ""))))
(mbutton-scale 'genealogy-button (lambda () (list (start-activity "genealogy" 0 "")))))
(spacer 20)
(mtext 'last-social-editor)
(horiz
(mbutton-scale 'social-button (lambda () (list (start-activity "social" 0 ""))))
(mbutton-scale 'move-button (lambda () (list (start-activity "move" 0 "")))))
(mbutton-scale 'friendship-button (lambda () (list (start-activity "friendship" 0 ""))))
(mbutton-scale 'social-button (lambda () (list (start-activity "social" 0 "")))))
(spacer 20)
(mbutton-scale 'move-button (lambda () (list (start-activity "move" 0 ""))))
(delete-button))
(lambda (activity arg)
......@@ -1070,6 +1121,10 @@
(append
(update-top-bar)
(list
(update-widget 'text-view (get-id "last-editor") 'text
(string-append "Last edit by " (history-get-last (entity-get-value "edit-history"))))
(update-widget 'text-view (get-id "last-social-editor") 'text
(string-append "Last edit by " (history-get-last (entity-get-value "social-edit-history"))))
(mupdate 'text-view 'name-display "name")
(mupdate 'text-view 'first-name-display "first-name")
(mupdate 'text-view 'family-display "family")
......@@ -1106,7 +1161,8 @@
(medit-text 'age "numeric" (lambda (v) (entity-set-value! "age" "int" (string->number v)) '()))
(mspinner 'gender gender-list (lambda (v) (entity-set-value! "gender" "varchar" (spinner-choice gender-list v)) '())))
(horiz
(mtoggle-button-scale 'literate (lambda (v) (entity-set-value! "literate" "int" v) '()))
(mspinner 'literate yesno-list (lambda (v) (entity-set-value! "literate" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner 'education education-list
(lambda (v)
(entity-set-value! "education" "varchar"
......@@ -1129,7 +1185,7 @@
(mupdate 'image-view 'photo "photo")
(mupdate 'edit-text 'age "age")
(mupdate-spinner 'gender "gender" gender-list)
(mupdate 'toggle-button 'literate "literate")
(mupdate-spinner 'literate "literate" yesno-list)
(mupdate-spinner 'education "education" education-list)
)))
(lambda (activity) '())
......@@ -1289,20 +1345,20 @@
(vert
(mtitle 'occupation)
(horiz
(mtoggle-button-scale 'occupation-agriculture (lambda (v) (entity-set-value! "occupation-agriculture" "int" v) '()))
(mtoggle-button-scale 'occupation-gathering (lambda (v) (entity-set-value! "occupation-gathering" "int" v) '()))
(mtoggle-button-scale 'occupation-labour (lambda (v) (entity-set-value! "occupation-labour" "int" v) '())))
(mspinner 'occupation-agriculture yesno-list (lambda (v) (entity-set-value! "occupation-agriculture" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner 'occupation-gathering yesno-list (lambda (v) (entity-set-value! "occupation-gathering" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner 'occupation-labour yesno-list (lambda (v) (entity-set-value! "occupation-labour" "varchar" (spinner-choice yesno-list v)) '())))
(horiz
(mtoggle-button-scale 'occupation-cows (lambda (v) (entity-set-value! "occupation-cows" "int" v) '()))
(mtoggle-button-scale 'occupation-fishing (lambda (v) (entity-set-value! "occupation-fishing" "int" v) '()))
(mspinner 'occupation-cows yesno-list (lambda (v) (entity-set-value! "occupation-cows" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner 'occupation-fishing yesno-list (lambda (v) (entity-set-value! "occupation-fishing" "varchar" (spinner-choice yesno-list v)) '()))
(medit-text 'occupation-other "normal" (lambda (v) (entity-set-value! "occupation-other" "varchar" v) '()))))
(horiz
(mtoggle-button-scale 'contribute (lambda (v) (entity-set-value! "contribute" "int" v) '()))
(mtoggle-button-scale 'own-land (lambda (v) (entity-set-value! "own-land" "int" v) '())))
(mspinner 'contribute yesno-list (lambda (v) (entity-set-value! "contribute" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner 'own-land yesno-list (lambda (v) (entity-set-value! "own-land" "varchar" (spinner-choice yesno-list v)) '())))
(horiz
(mtoggle-button-scale 'rent-land (lambda (v) (entity-set-value! "rent-land" "int" v) '()))
(mtoggle-button-scale 'hire-land (lambda (v) (entity-set-value! "hire-land" "int" v) '())))
(mspinner 'rent-land yesno-list (lambda (v) (entity-set-value! "rend-land" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner 'hire-land yesno-list (lambda (v) (entity-set-value! "hire-land" "varchar" (spinner-choice yesno-list v)) '())))
(mtext 'crops-detail)
(build-list-widget
db "sync" 'crops "crop" "crop" (lambda () (get-current 'individual #f))
......@@ -1314,9 +1370,9 @@
(medit-text 'earning "numeric" (lambda (v) (entity-set-value! "earning" "int" (string->number v)) '())))
(mtext 'in-the-home)
(horiz
(mtoggle-button-scale 'radio (lambda (v) (entity-set-value! "radio" "int" v) '()))
(mtoggle-button-scale 'tv (lambda (v) (entity-set-value! "tv" "int" v) '()))
(mtoggle-button-scale 'mobile (lambda (v) (entity-set-value! "mobile" "int" v) '())))
(mspinner 'radio yesno-list (lambda (v) (entity-set-value! "radio" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner 'tv yesno-list (lambda (v) (entity-set-value! "tv" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner 'mobile yesno-list (lambda (v) (entity-set-value! "mobile" "varchar" (spinner-choice yesno-list v)) '())))
(horiz
(medit-text 'visit-market "numeric" (lambda (v) (entity-set-value! "visit-market" "int" (string->number v)) '()))
(medit-text 'town-sell "numeric" (lambda (v) (entity-set-value! "town-sell" "int" (string->number v)) '())))
......@@ -1334,21 +1390,21 @@
(mupdate-spinner-other 'house-type "house-type" house-type-list)
(list
(update-list-widget db "sync" "crop" "crop" (get-current 'individual #f))
(mupdate 'toggle-button 'occupation-agriculture "occupation-agriculture")
(mupdate 'toggle-button 'occupation-gathering "occupation-gathering")
(mupdate 'toggle-button 'occupation-labour "occupation-labour")
(mupdate 'toggle-button 'occupation-cows "occupation-cows")
(mupdate 'toggle-button 'occupation-fishing "occupation-fishing")
(mupdate-spinner 'occupation-agriculture "occupation-agriculture" yesno-list)
(mupdate-spinner 'occupation-gathering "occupation-gathering" yesno-list)
(mupdate-spinner 'occupation-labour "occupation-labour" yesno-list)
(mupdate-spinner 'occupation-cows "occupation-cows" yesno-list)
(mupdate-spinner 'occupation-fishing "occupation-fishing" yesno-list)
(mupdate 'edit-text 'occupation-other "occupation-other")
(mupdate 'toggle-button 'contribute "contribute")
(mupdate 'toggle-button 'own-land "own-land")
(mupdate 'toggle-button 'rent-land "rent-land")
(mupdate 'toggle-button 'hire-land "hire-land")
(mupdate 'edit-text 'loan "loan")
(mupdate-spinner 'contribute "contribute" yesno-list)
(mupdate-spinner 'own-land "own-land" yesno-list)
(mupdate-spinner 'rent-land "rent-land" yesno-list)
(mupdate-spinner 'hire-land "hire-land" yesno-list)
(mupdate 'edit-text 'loan "loan" )
(mupdate 'edit-text 'earning "earning")
(mupdate 'toggle-button 'radio "radio")
(mupdate 'toggle-button 'tv "tv")
(mupdate 'toggle-button 'mobile "mobile")
(mupdate-spinner 'radio "radio" yesno-list)
(mupdate-spinner 'tv "tv" yesno-list)
(mupdate-spinner 'mobile "mobile" yesno-list)
(mupdate 'edit-text 'visit-market "visit-market")
(mupdate 'edit-text 'town-sell "town-sell"))))
(lambda (activity) '())
......@@ -1398,8 +1454,8 @@
(mspinner 'child-gender gender-list (lambda (v) (entity-set-value! "gender" "varchar" (spinner-choice gender-list v)) '()))
(medit-text 'child-age "numeric" (lambda (v) (entity-set-value! "age" "int" (string->number v)) '())))
(horiz
(mtoggle-button-scale 'child-alive (lambda (v) (entity-set-value! "alive" "int" v) '()))
(mtoggle-button-scale 'child-home (lambda (v) (entity-set-value! "living-at-home" "int" v) '())))
(mspinner-other 'child-alive yesno-list (lambda (v) (entity-set-value! "alive" "varchar" (spinner-choice yesno-list v)) '()))
(mspinner-other 'child-home yesno-list (lambda (v) (entity-set-value! "living-at-home" "varchar" (spinner-choice yesno-list v)) '())))
(delete-button)))
(lambda (activity arg)
(activity-layout activity))
......@@ -1413,8 +1469,8 @@
(mupdate 'edit-text 'child-name "name")
(mupdate-spinner 'child-gender "gender" gender-list)
(mupdate 'edit-text 'child-age "age")
(mupdate 'toggle-button 'child-alive "alive")
(mupdate 'toggle-button 'child-home "living-at-home")
(mupdate-spinner 'child-alive "alive" yesno-list)
(mupdate-spnner 'child-home "living-at-home" yesno-list)
)))
(lambda (activity) '())
......@@ -1673,6 +1729,10 @@
"getting-db"
"http://192.168.2.1:8889/symbai.db"
(string-append "/sdcard/symbai/symbai.db"))
(http-download
"getting-log"
"http://192.168.2.1:8889/log.txt"
(string-append "/sdcard/symbai/server-log.txt"))
)
entity-types)
(list))))
......@@ -1683,8 +1743,10 @@
(send-mail
""
"From Symbai" "Please find attached your data"
(cons
"/sdcard/symbai/symbai.db"
(append
(list
"/sdcard/symbai/symbai.db"
"/sdcard/symbai/server-log.txt")
(map
(lambda (e)
(string-append "/sdcard/symbai/" e ".csv"))
......
test-num,1,1,1,
test-text, I am test text, I am test text, I am test text,
one, one, ,,
two, two, ,,
three, three, ,,
village, Village, ,,
household, Household, ,,
households, Households, ,,
individual, Individual, ,,
individuals, Individuals, ,,
add-item-to-list,0, ,,
default-village-name, New village, ,,
title, Symbai, Symbai, Symbai,
sync, Sync, Sync, Sync,
languages, Choose language, Choose language, Choose language,
english, English, English, English,
khasi, Khasi, Khasi, Khasi,
hindi, Hindi, Hindi, Hindi,
user-id, Your user ID, User ID, User ID,
save, Save, Save, Save,
back, Back, Back, Back,
off, Off, Off, Off,
villages, Villages, Villages, Villages,
list-empty, List empty, ,,
delete, Delete, ,,
delete-are-you-sure, Are you sure you want to delete this?, ,,
save-are-you-sure, Are you sure you want to save changes?, ,,
quick-name, New person name, ,,
quick-add, Quick add, ,,
find-individual, Find individual, ,,
filter, Filter, ,,
off, Off, Off, Off,
name, Name, ,,
sync-all, Sync me!, ,,
sync-syncall, Sync everything, ,,
export-data, Exporting data, ,,
sync-download, Download main DB, ,,
sync-export, Email main DB, ,,
email-local, Email local DB, ,,
debug, Debug, ,,
sync-back, Back, ,,
sync-prof, Profile, ,,
village-name, Village name, Village name, Village name,
block, Block, Block, Block,
district, District, District, District,
car, Accessible by car, ,,
household-list, Household list, ,,
amenities, Amenities, ,,
school, School, ,,
present, Present, ,,
closest-access, Closest place of access, ,,
house-gps, GPS, ,,
toilet-gps, GPS, ,,
school, School, ,,
school-closest-access, Closest access, ,,
school-gps, GPS, ,,
hospital, Hospital/Health care centre, ,,
hospital-closest-access, Closest access, ,,
hospital-gps, GPS, ,,
post-office, Post Office, ,,
post-office-closest-access, Closest access, ,,
post-office-gps, GPS, ,,
railway-station, Railway station, ,,
railway-station-closest-access, Closest access, ,,
railway-station-gps, GPS, ,,
state-bus-service, Inter-state bus service, ,,
state-bus-service-closest-access, Closest access, ,,
state-bus-service-gps, GPS, ,,
district-bus-service, Inter-village/district bus service, ,,
district-bus-service-closest-access, Closest access, ,,
district-bus-service-gps, GPS, ,,
panchayat, Village Panchayat Office, ,,
panchayat-closest-access, Closest access, ,,
panchayat-gps, GPS, ,,
NGO, Presence of NGO's working with them, ,,
NGO-closest-access, Closest access, ,,
NGO-gps, GPS, ,,
market, Market, ,,
market-closest-access, Closest access, ,,
market-gps, GPS, ,,
household-name, Household name, ,,
default-household-name, A household, ,,
location, House location, ,,
elevation, Elevation, ,,
toilet-location, Toilet location, ,,
children, Children, ,,
male, Male, ,,
female, Female, ,,
num-pots, Number of pots, ,,
adults, Adults, ,,
add-individual, Add individual, ,,
default-individual-name, A person, ,,
default-family-name, A family, ,,
default-photo-id, ???, ,,
name-display, Name, ,,
photo-id-display, Photo ID, ,,
family-display, Family, ,,
details-button, Details, ,,
family-button, Family, ,,
migration-button, Migration, ,,
income-button, Income, ,,
geneaology-button, Geneaology, ,,
social-button, Social, ,,
agreement-button, Agreement, ,,
is-a-child, Child, ,,
change-photo, Change photo, ,,
details-name, Name, ,,
details-photo-id, Photo ID, ,,
details-family, Family, ,,
tribe, Tribe, ,,
sub-tribe, Sub tribe, ,,
khasi, Khasi, ,,
khynriam, Khynriam, ,,
pnar, Pnar, ,,
bhoi, Bhoi, ,,
war, War, ,,
other, Other, ,,
age, Age, ,,
gender, Gender, ,,
education, Education, ,,
illiterate, Illiterate, ,,
literate, Literate, ,,
primary, Primary 1-5, ,,
middle, Middle 6-8, ,,
high, High 9-10, ,,
secondary, Higher Secondary, ,,
university, University, ,,
spouse, Spouse, ,,
change-id, Change, ,,
head-of-house, Head of house, ,,
marital-status, Marital status, ,,
ever-married, Ever married, ,,
currently-married, Currently married, ,,
currently-single, Currently single, ,,
seperated, Seperated/divorced, ,,
times-married, How many times married, ,,
change-spouse, Change/add spouse, ,,
children-living, Living, ,,
children-dead, Dead, ,,
children-together, Living together, ,,
children-apart, Living apart, ,,
residence-after-marriage, Residence after marriage, ,,
birthplace, Birthplace, ,,
spouse-village, Spouses natal village, ,,
num-siblings, Number of living siblings of the same sex born from same mother, ,,
birth-order, Birth order amoung currently living same sex siblings born from same mother, ,,
length-time, Length of time lived in this village (years), ,,
place-of-birth, Place of birth, ,,
num-residence-changes, Number of time place of residence changed since birth, ,,
village-visits-month, Number of times you have visited another village in the last month, ,,
village-visits-year, Number of times you have visited another village in the last year (i.e. betwen last summer and this summer), ,,
occupation, Occupation, ,,
occupation, Occupation, ,,
agriculture, Agriculture, ,,
gathering, Gathering, ,,
labour, Labour, ,,
cows, Cows, ,,
fishing, Fishing, ,,
num-people-in-house, People living in house, ,,
contribute, Contribute to family earnings?, ,,
own-land, Own land?, ,,
rent-land, Rent out your land?, ,,
hire-land, Hire land?, ,,
crops, Crops, ,,
unit, Unit, ,,
quantity, Quantity, ,,
used-or-eaten, Used/Eaten, ,,
sold, Sold, ,,
seed, Seed (hybrid/local), ,,
house-type, House type, ,,
concrete, Concrete, ,,
tin, Tin, ,,
thatched, Thatched, ,,
loan, Outstanding loans, ,,
earning, One day's earnings, ,,
in-the-home, In the home, ,,
radio, Radio, ,,
tv, TV, ,,
mobile, Mobile phone, ,,