Improved condition assignment

1. rationalized global variables for turk and non turk situations in
index.html. Got condition and subcondition assignment working with
database.
2. only assign_subcondition actually makes a record in the database, to
avoid redundant records.
3. data recording slightly revised