Commit b60fe912 authored by dave griffiths's avatar dave griffiths

Merge branch 'master' of github.com:nebogeo/symbai

parents ff97b3c8 8dd940f8
......@@ -212,6 +212,40 @@
r))
'() ktvlist))
;; redundant second pass to syncronise files - independant of the
;; rest of the syncing system
(define (sync-files server-list)
(let ((local-files (dir-list "/sdcard/symbai/files/")))
;; search for all local files in server list
(append
(foldl
(lambda (file r)
;; send files not present
(if (find file server-list)
r (cons
(http-upload
(string-append "upload-" file)
"http://192.168.2.1:8889/symbai?fn=upload"
(string-append "/sdcard/symbai/files/" file)) r)))
local-list)
;; search for all server files in local list
(foldl
(lambda (file r)
;; request files not present
(if (find file local-list)
r (cons
(http-download
(string-append "download-" file)
(string-append "http://192.168.2.1:8889/files/" file)
(string-append "/sdcard/symbai/files/" file)) r)))
server-list))))
(define (start-sync-files)
(http-request
(string-append "file-list")
(string-append "http://192.168.2.1:8889/")
;; spit all dirty entities to server
(define (spit db table entities)
(foldl
......@@ -317,6 +351,19 @@
'()
version-data))
(define (mark-unlisted-entities-dirty! db table version-data)
;; load all local entities
(let ((ids (all-unique-ids db table))
(server-ids (map car version-data)))
;; look for each one in data
(for-each
(lambda (id)
(when ((not (find id server-ids)))
(msg "can't find " id " in server data, marking dirty")
;; mark those not present as dirty for next spit cycle
(update-entity-dirty db table id)))
ids)))
;; repeatedly read version and request updates
(define (suck-new db table)
(debug! "Requesting new entities")
......@@ -326,6 +373,9 @@
(string-append url "fn=entity-versions&table=" table)
(lambda (data)
(let ((new-entity-requests (build-entity-requests db table data)))
(alog "suck-new: marking dirty")
(mark-unlisted-entities-dirty! db table data)
(alog "suck-new: done marking dirty")
(cond
((null? new-entity-requests)
(debug! "No new data to download")
......@@ -470,20 +520,30 @@
50 (layout 'fill-parent 'wrap-content 1 'centre 5)))
(define (medit-text id type fn)
(vert
(text-view 0 (mtext-lookup id)
30 (layout 'wrap-content 'wrap-content -1 'centre 0))
(edit-text (symbol->id id) "" 30 type
(layout 'fill-parent 'wrap-content -1 'centre 0)
fn)))
(linear-layout
(make-id (string-append (symbol->string id) "-container"))
'vertical
(layout 'fill-parent 'wrap-content 1 'centre 20)
(list 0 0 0 0)
(list
(text-view 0 (mtext-lookup id)
30 (layout 'wrap-content 'wrap-content -1 'centre 0))
(edit-text (symbol->id id) "" 30 type
(layout 'fill-parent 'wrap-content -1 'centre 0)
fn))))
(define (medit-text-scale id type fn)
(vert
(text-view 0 (mtext-lookup id)
30 (layout 'wrap-content 'wrap-content 1 'centre 0))
(edit-text (symbol->id id) "" 30 type
(layout 'fill-parent 'wrap-content 1 'centre 0)
fn)))
(linear-layout
(make-id (string-append (symbol->string id) "-container"))
'vertical
(layout 'fill-parent 'wrap-content 1 'centre 20)
(list 0 0 0 0)
(list
(text-view 0 (mtext-lookup id)
30 (layout 'wrap-content 'wrap-content 1 'centre 0))
(edit-text (symbol->id id) "" 30 type
(layout 'fill-parent 'wrap-content 1 'centre 0)
fn))))
(define (mspinner id types fn)
(vert
......@@ -496,25 +556,30 @@
(lambda (c) (fn c)))))
(define (mspinner-other id types fn)
(horiz
(vert
(text-view (symbol->id id)
(mtext-lookup id)
30 (layout 'wrap-content 'wrap-content 1 'centre 10))
(spinner (make-id (string-append (symbol->string id) "-spinner"))
(map mtext-lookup types)
(layout 'wrap-content 'wrap-content 1 'centre 0)
(lambda (c)
;; dont call if set to "other"
(if (< c (- (length types) 1))
(fn c)
'()))))
(vert
(mtext-scale 'other)
(edit-text (make-id (string-append (symbol->string id) "-edit-text"))
"" 30 "normal"
(layout 'fill-parent 'wrap-content 1 'centre 0)
(lambda (t) (fn t))))))
(linear-layout
(make-id (string-append (symbol->string id) "-container"))
'horizontal
(layout 'fill-parent 'wrap-content 1 'centre 5)
(list 0 0 0 0)
(list
(vert
(text-view (symbol->id id)
(mtext-lookup id)
30 (layout 'wrap-content 'wrap-content 1 'centre 10))
(spinner (make-id (string-append (symbol->string id) "-spinner"))
(map mtext-lookup types)
(layout 'wrap-content 'wrap-content 1 'centre 0)
(lambda (c)
;; dont call if set to "other"
(if (< c (- (length types) 1))
(fn c)
'()))))
(vert
(mtext-scale 'other)
(edit-text (make-id (string-append (symbol->string id) "-edit-text"))
"" 30 "normal"
(layout 'fill-parent 'wrap-content 1 'centre 0)
(lambda (t) (fn t)))))))
(define (mspinner-other-vert id text-id types fn)
(linear-layout
......@@ -631,20 +696,36 @@
(list-ref d 5)))))
(define (do-gps display-id key-prepend)
(let ((loc (get-current 'location '(0 0))))
(entity-set-value! (string-append key-prepend "-lat") "real" (car loc))
(entity-set-value! (string-append key-prepend "-lon") "real" (cadr loc))
(list
(update-widget
'text-view
(get-id (string-append (symbol->string display-id) "-lat"))
'text
(number->string (car loc)))
(update-widget
'text-view
(get-id (string-append (symbol->string display-id) "-lon"))
'text
(number->string (cadr loc))))))
(list
(alert-dialog
"gps-check"
(mtext-lookup 'gps-are-you-sure)
(lambda (v)
(cond
((eqv? v 1)
(list
(alert-dialog
"gps-check2"
(mtext-lookup 'gps-are-you-sure-2)
(lambda (v)
(cond
((eqv? v 1)
(let ((loc (get-current 'location '(0 0))))
(entity-set-value! (string-append key-prepend "-lat") "real" (car loc))
(entity-set-value! (string-append key-prepend "-lon") "real" (cadr loc))
(list
(update-widget
'text-view
(get-id (string-append (symbol->string display-id) "-lat"))
'text
(number->string (car loc)))
(update-widget
'text-view
(get-id (string-append (symbol->string display-id) "-lon"))
'text
(number->string (cadr loc))))))
(else '()))))))
(else '()))))))
(define (mupdate-gps display-id key-prepend)
(let ((lat (entity-get-value (string-append key-prepend "-lat")))
......
This diff is collapsed.
test-num,1,1,1,
test-text, I am test text, I am test text, I am test text,
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, ,,
......@@ -10,17 +10,17 @@ 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,
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?, ,,
......@@ -29,7 +29,7 @@ quick-name, New person name, ,,
quick-add, Quick add, ,,
find-individual, Find individual, ,,
filter, Filter, ,,
off, Off, Off, Off,
off, Off, Off, Off,
name, Name, ,,
sync-all, Sync me!, ,,
sync-syncall, Sync everything, ,,
......@@ -40,9 +40,9 @@ 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,
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, ,,
......@@ -52,31 +52,31 @@ closest-access, Closest place of access, ,,
house-gps, GPS, ,,
toilet-gps, GPS, ,,
school, School, ,,
school-closest-access, Access, ,,
school-closest-access, Closest access, ,,
school-gps, GPS, ,,
hospital, Hospital/Health care centre, ,,
hospital-closest-access, Access, ,,
hospital-closest-access, Closest access, ,,
hospital-gps, GPS, ,,
post-office, Post Office, ,,
post-office-closest-access, Access, ,,
post-office-closest-access, Closest access, ,,
post-office-gps, GPS, ,,
railway-station, Railway station, ,,
railway-station-closest-access, Access, ,,
railway-station-closest-access, Closest access, ,,
railway-station-gps, GPS, ,,
state-bus-service, Inter-state bus service, ,,
state-bus-service-closest-access, Access, ,,
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, Access, ,,
district-bus-service-closest-access, Closest access, ,,
district-bus-service-gps, GPS, ,,
panchayat, Village Panchayat Office, ,,
panchayat-closest-access, Access, ,,
panchayat-closest-access, Closest access, ,,
panchayat-gps, GPS, ,,
NGO, Presence of NGO's working with them, ,,
NGO-closest-access, Access, ,,
NGO-closest-access, Closest access, ,,
NGO-gps, GPS, ,,
market, Market, ,,
market-closest-access, Access, ,,
market-closest-access, Closest access, ,,
market-gps, GPS, ,,
household-name, Household name, ,,
default-household-name, A household, ,,
......
(define i18n-text
(list
(list 'test-num (list "1" "1" "1" "" ))
(list 'test-text (list "I am test text" "I am test text" "I am test text" "" ))
(list 'one (list "one" "" ))
......@@ -11,7 +12,7 @@
(list 'households (list "Households" "" ))
(list 'individual (list "Individual" "" ))
(list 'individuals (list "Individuals" "" ))
(list 'add-item-to-list (list "+" "" ))
(list 'add-item-to-list (list "0" "" ))
(list 'default-village-name (list "New village" "" ))
(list 'title (list "Symbai" "Symbai" "Symbai" "" ))
(list 'sync (list "Sync" "Sync" "Sync" "" ))
......@@ -54,32 +55,41 @@
(list 'closest-access (list "Closest place of access" "" ))
(list 'house-gps (list "GPS" "" ))
(list 'toilet-gps (list "GPS" "" ))
(list 'school-in-village (list "In Village" ))
(list 'school (list "School" "" ))
(list 'school-closest-access (list "Access" "" ))
(list 'school-closest-access (list "Closest access" "" ))
(list 'school-gps (list "GPS" "" ))
(list 'hospital-in-village (list "In Village" ))
(list 'hospital (list "Hospital/Health care centre" "" ))
(list 'hospital-closest-access (list "Access" "" ))
(list 'hospital-closest-access (list "Closest access" "" ))
(list 'hospital-gps (list "GPS" "" ))
(list 'Post-office-in-village (list "In Village" ))
(list 'post-office (list "Post Office" "" ))
(list 'post-office-closest-access (list "Access" "" ))
(list 'post-office-closest-access (list "Closest access" "" ))
(list 'post-office-gps (list "GPS" "" ))
(list 'railway-station-in-village (list "In Village" ))
(list 'railway-station (list "Railway station" "" ))
(list 'railway-station-closest-access (list "Access" "" ))
(list 'railway-station-closest-access (list "Closest access" "" ))
(list 'railway-station-gps (list "GPS" "" ))
(list 'State-bus-service-in-village (list "In Village" ))
(list 'state-bus-service (list "Inter-state bus service" "" ))
(list 'state-bus-service-closest-access (list "Access" "" ))
(list 'state-bus-service-closest-access (list "Closest access" "" ))
(list 'state-bus-service-gps (list "GPS" "" ))
(list 'District-bus-service-in-village (list "In Village" ))
(list 'district-bus-service (list "Inter-village/district bus service" "" ))
(list 'district-bus-service-closest-access (list "Access" "" ))
(list 'district-bus-service-closest-access (list "Closest access" "" ))
(list 'district-bus-service-gps (list "GPS" "" ))
(list 'Panchayat-in-village (list "In Village" ))
(list 'panchayat (list "Village Panchayat Office" "" ))
(list 'panchayat-closest-access (list "Access" "" ))
(list 'panchayat-closest-access (list "Closest access" "" ))
(list 'panchayat-gps (list "GPS" "" ))
(list 'NGO-in-village (list "In Village" ))
(list 'NGO (list "Presence of NGO's working with them" "" ))
(list 'NGO-closest-access (list "Access" "" ))
(list 'NGO-closest-access (list "Closest access" "" ))
(list 'NGO-gps (list "GPS" "" ))
(list 'market-in-village (list "In Village" ))
(list 'market (list "Market" "" ))
(list 'market-closest-access (list "Access" "" ))
(list 'market-closest-access (list "Closest access" "" ))
(list 'market-gps (list "GPS" "" ))
(list 'household-name (list "Household name" "" ))
(list 'default-household-name (list "A household" "" ))
......@@ -154,34 +164,30 @@
(list 'village-visits-year (list "Number of times you have visited another village in the last year (i.e. betwen last summer and this summer)" "" ))
(list 'occupation (list "Occupation" "" ))
(list 'occupation (list "Occupation" "" ))
(list 'agriculture (list "Agriculture" "" ))
(list 'gathering (list "Gathering" "" ))
(list 'labour (list "Labour" "" ))
(list 'cows (list "Cows" "" ))
(list 'fishing (list "Fishing" "" ))
(list 'num-people-in-house (list "People living in house" "" ))
(list 'contribute (list "Contribute to family earnings?" "" ))
(list 'own-land (list "Own land?" "" ))
(list 'rent-land (list "Rent out your land?" "" ))
(list 'hire-land (list "Hire land?" "" ))
(list 'contribute (list "Do you contribute to the family earnings?" "" ))
(list 'own-land (list "Do you own land?" "" ))
(list 'rent-land (list "Do you rent out your land?" "" ))
(list 'hire-land (list "Do you hire someone else's land to work on?" "" ))
(list 'crops-detail (list "List the crops you grew last year:" ))
(list 'crops (list "Crops" "" ))
(list 'unit (list "Unit" "" ))
(list 'quantity (list "Quantity" "" ))
(list 'used-or-eaten (list "Used/Eaten" "" ))
(list 'sold (list "Sold" "" ))
(list 'seed (list "Seed (hybrid/local)" "" ))
(list 'house-type (list "House type" "" ))
(list 'house-type (list "Type of house" "" ))
(list 'concrete (list "Concrete" "" ))
(list 'tin (list "Tin" "" ))
(list 'thatched (list "Thatched" "" ))
(list 'loan (list "Outstanding loans" "" ))
(list 'earning (list "One day's earnings" "" ))
(list 'earning (list "How much do you earn for one day's labour?" "" ))
(list 'in-the-home (list "In the home" "" ))
(list 'radio (list "Radio" "" ))
(list 'tv (list "TV" "" ))
(list 'mobile (list "Mobile phone" "" ))
(list 'visit-market (list "Tribal market visits" "" ))
(list 'town-sell (list "Town or city visits" "" ))
(list 'visit-market (list "How many times do you visit the tribal market?" "" ))
(list 'town-sell (list "How many times a month do you visit your nearest city or town to buy or sell something?" "" ))
(list 'default-crop-name (list "A crop" "" ))
(list 'crop-name (list "Crop name" "" ))
(list 'crop-unit (list "Crop unit" "" ))
......@@ -235,4 +241,15 @@
(list 'house-id (list "House ID" ))
(list 'photo-id (list "Photo ID" ))
(list 'add-are-you-sure (list "Are you sure you want to add this individual?" ))
(list 'gps-are-you-sure (list "Are you sure you want to record your current position?" ))
(list 'gps-are-you-sure-2 (list "Please confirm again..." ))
(list 'current-village (list "Your current village" ))
(list 'num-children (list "Number of children" ))
(list 'occupation-agriculture (list "Agriculture" ))
(list 'occupation-gathering (list "Gathering" ))
(list 'occupation-labour (list "Labour" ))
(list 'occupation-cows (list "Cows" ))
(list 'occupation-fishing (list "Fishing" ))
(list 'occupation-other (list "Other" ))
))
......@@ -153,6 +153,17 @@
(vector-ref i 0))
(cdr s)))))
(define (all-unique-ids db table)
(let ((s (db-select
db (string-append "select e.unique_id from " table "_entity as e "))))
(if (null? s)
'()
(map
(lambda (i)
(vector-ref i 0))
(cdr s)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; doing things with unique ids
......
......@@ -41,15 +41,19 @@
entity-id))
(define (update-entity-clean db table unique-id)
;;(msg "cleaning")
;; clean entity table
(db-exec
db (string-append "update " table "_entity set dirty=? where unique_id = ?")
0 unique-id)
;; clean value tables for this entity
;;(msg "cleaning values")
(clean-entity-values db table (entity-id-from-unique db table unique-id)) )
;; for when remote entities don't exist for whatever reason
(define (update-entity-dirty db table unique-id)
(db-exec
db (string-append "update " table "_entity set dirty=? where unique_id = ?")
1 unique-id)
;; simpler path than cleaning - should use the same as this???
(dirty-all-values db table (entity-id-from-unique db table unique-id)))
(define (have-dirty? db table)
(not (zero?
(select-first
......@@ -80,20 +84,20 @@
;; todo: BROKEN...
;; used for sync-all
(define (dirty-and-all-entities db table)
(let ((de (db-select
db (string-append
"select entity_id, entity_type, unique_id, dirty, version from " table "_entity"))))
(if (null? de)
'()
(map
(lambda (i)
(list
;; build according to url ([table] entity-type unique-id dirty version)
(cdr (vector->list i))
;; data entries (todo - only dirty values!)???????????
(get-entity-plain db table (vector-ref i 0))))
(cdr de)))))
;(define (dirty-and-all-entities db table)
; (let ((de (db-select
; db (string-append
; "select entity_id, entity_type, unique_id, dirty, version from " table "_entity"))))
; (if (null? de)
; '()
; (map
; (lambda (i)
; (list
; ;; build according to url ([table] entity-type unique-id dirty version)
; (cdr (vector->list i))
; ;; data entries (todo - only dirty values!)???????????
; (get-entity-plain db table (vector-ref i 0))))
; (cdr de)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
......
......@@ -61,7 +61,6 @@
(else
(for-each
(lambda (kt)
;;(msg "cleaning" kt)
(clean-value db table entity-id (list (ktv-key kt) (ktv-type kt))))
(get-attribute-ids/types db table entity-type))))))
......
......@@ -121,3 +121,9 @@
(db-exec db (string-append "update " table "_value_" (ktv-type kt)
" set dirty=0 where entity_id = ? and attribute_id = ?")
entity-id (ktv-key kt)))
;; simpler path than cleaning - should use the same as this???
(define (dirty-all-values db table entity-id)
(db-exec db (string-append "update " table "_value_" (ktv-type kt)
" set dirty=1 where entity_id = ?")
entity-id))
......@@ -38,3 +38,18 @@
((equal? (ktv-key (car ktv-list)) (ktv-key ktv))
(cons ktv (cdr ktv-list)))
(else (cons (car ktv-list) (ktv-set (cdr ktv-list) ktv)))))
;; replace or insert a ktv
(define (ktvlist-replace ktv ktvlist)
(cond
((null? ktvlist)
(list ktv))
((equal? (ktv-key (car ktvlist)) (ktv-key ktv))
(cons ktv (cdr ktvlist)))
(else (cons (car ktvlist) (ktvlist-replace ktv (cdr ktvlist))))))
(define (ktvlist-merge a b)
(foldl
(lambda (ktv r)
(ktvlist-replace ktv r))
a b))
......@@ -8,7 +8,7 @@
"households"," Households"," ",,
"individual"," Individual"," ",,
"individuals"," Individuals"," ",,
"add-item-to-list","+"," ",,
"add-item-to-list",0," ",,
"default-village-name"," New village"," ",,
"title"," Symbai"," Symbai"," Symbai"," "
"sync"," Sync"," Sync"," Sync"," "
......@@ -51,32 +51,41 @@
"closest-access"," Closest place of access"," ",,
"house-gps"," GPS"," ",,
"toilet-gps"," GPS"," ",,
"school-in-village","In Village",,,
"school"," School"," ",,
"school-closest-access"," Access"," ",,
"school-closest-access"," Closest access"," ",,
"school-gps"," GPS"," ",,
"hospital-in-village","In Village",,,
"hospital"," Hospital/Health care centre"," ",,
"hospital-closest-access"," Access"," ",,
"hospital-closest-access"," Closest access"," ",,
"hospital-gps"," GPS"," ",,
"Post-office-in-village","In Village",,,
"post-office"," Post Office"," ",,
"post-office-closest-access"," Access"," ",,
"post-office-closest-access"," Closest access"," ",,
"post-office-gps"," GPS"," ",,
"railway-station-in-village","In Village",,,
"railway-station"," Railway station"," ",,
"railway-station-closest-access"," Access"," ",,
"railway-station-closest-access"," Closest access"," ",,
"railway-station-gps"," GPS"," ",,
"State-bus-service-in-village","In Village",,,
"state-bus-service"," Inter-state bus service"," ",,
"state-bus-service-closest-access"," Access"," ",,
"state-bus-service-closest-access"," Closest access"," ",,
"state-bus-service-gps"," GPS"," ",,
"District-bus-service-in-village","In Village",,,
"district-bus-service"," Inter-village/district bus service"," ",,
"district-bus-service-closest-access"," Access"," ",,
"district-bus-service-closest-access"," Closest access"," ",,
"district-bus-service-gps"," GPS"," ",,
"Panchayat-in-village","In Village",,,
"panchayat"," Village Panchayat Office"," ",,
"panchayat-closest-access"," Access"," ",,
"panchayat-closest-access"," Closest access"," ",,
"panchayat-gps"," GPS"," ",,
"NGO-in-village","In Village",,,
"NGO"," Presence of NGO's working with them"," ",,
"NGO-closest-access"," Access"," ",,
"NGO-closest-access"," Closest access"," ",,
"NGO-gps"," GPS"," ",,
"market-in-village","In Village",,,
"market"," Market"," ",,
"market-closest-access"," Access"," ",,
"market-closest-access"," Closest access"," ",,
"market-gps"," GPS"," ",,
"household-name"," Household name"," ",,
"default-household-name"," A household"," ",,
......@@ -148,37 +157,33 @@
"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)"," ",,
"village-visits-year"," Number of times you have visited another village in the last year (i.e. between 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?"," ",,
"contribute"," Do you contribute to the family earnings?"," ",,
"own-land"," Do you own land?"," ",,
"rent-land"," Do you rent out your land?"," ",,
"hire-land"," Do you hire someone else's land to work on?"," ",,
"crops-detail","List the crops you grew last year:",,,
"crops"," Crops"," ",,
"unit"," Unit"," ",,
"quantity"," Quantity"," ",,
"used-or-eaten"," Used/Eaten"," ",,
"sold"," Sold"," ",,
"seed"," Seed (hybrid/local)"," ",,
"house-type"," House type"," ",,
"house-type"," Type of house"," ",,