Jum ping around in Blaise I S Maurice Martens m.g.j.martens@uvt.nl - - PowerPoint PPT Presentation
Jum ping around in Blaise I S Maurice Martens m.g.j.martens@uvt.nl - - PowerPoint PPT Presentation
Jum ping around in Blaise I S Maurice Martens m.g.j.martens@uvt.nl CentERdata 10/ 17/ 2013 Jum ping around in Blaise I S Online life history calendar Technical explanation Problems and solutions Spin-offs 3 10/ 17/ 2013 Online life
10/ 17/ 2013
Jum ping around in Blaise I S
Maurice Martens m.g.j.martens@uvt.nl CentERdata
10/ 17/ 2013
3
Jum ping around in Blaise I S Online life history calendar Technical explanation Problems and solutions Spin-offs
10/ 17/ 2013
4
Online life history calendar
10/ 17/ 2013
5
Online life history calendar
- Define an external stylesheet
- Try to generate calendar code in Blaise
- Problem with storing the full calendar datastructure
- Use service
- Upload json objects
- Return inline html code
10/ 17/ 2013
6
Online life history calendar
When click on event, jump back to the question where event information was gathered
10/ 17/ 2013
7
Technical explanation
JSON initialize to service
CALENDAR:= '<script language="JavaScript"> calendar.push ({ "Initialize":{ "Key1":'+STR(nohouse)+', "Key2":'+STR(nomem)+', "StartYear":' + STR(age+YEAR(SYSDATE)) + ', "EndYear":'+STR(YEAR(SYSDATE))+', "Sections":{ "1":{"Label":"Children","Link":"Sec_RC.RC001_strkid"}, "2":{"Label":"Partners","Link":"Sec_RP.RP001_prtstart"}, "3":{"Label":"Living","Link":"Sec_AC.AC001_acstrt"}, "4":{"Label":"Jobs","Link":"Sec_RE.RE001_whstart"}, "5":{"Label":"Health","Link":"Sec_HS.HS001_HSStart"}, "6":{"Label":"Detention","Link":"Sec_PR.PR001_PRStart"}, "7":{"Label":"Other","Link":"Sec_OT.OT001_OTStart"} } }}); </script>'
10/ 17/ 2013
8
Technical explanation
Divs returned
<div id="calendar_item_4_2_1" class="calendar_item calendar_item_style_cga_4 calendar_range_4_2" style="height: 24px; margin-top: 0px; z-index: 43; width: 24pxpx;"
- nmouseout="calendar_information_fixed_show();
calendar_highlight_hovered(false, '4', '2'); calendar_information_hover_clear();"
- nmouseover="calendar_information_fixed_hide();
calendar_highlight_hovered(true, '4', '2'); calendar_information_hover_set( '4', '2', '1', 1966, '4_2_1', 'CALENDAR_ITEM');" onClick="calendar_information_fixed_set();"> </div> When clicked on div a link will be generated: <a onclick="javascript: FieldFocused(64, 'Sec_RE.RE002_edfinage', '');" href="#"> Education </a> (1952)
10/ 17/ 2013
9
Problem s and solutions
Calling php
- Browser doesn’t like you calling
- ther servers
- Not possible to install php on same
server/port as Blaise IS Solution is to have an asp script on the Blaise IS server to forward the requests for you.
10/ 17/ 2013
10
Problem s and solutions
forw ard.asp
<% Dim objXMLHTTP Dim contents Dim x Dim URL contents = "" For x = 1 to Request.Form.Count contents = contents & "&" & Request.Form.Key(x) & "=" & Request.Form.Item(x) Next URL = "http://someserver/lhc_ajax.php" Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
- bjXMLHTTP.Open "POST", URL, false
- bjXMLHTTP.setRequestHeader "Content-Type","application/x-
www-form-urlencoded"
- bjXMLHTTP.Send contents
Response.Write objXMLHTTP.responseText Set objXMLHTTP = Nothing %>
10/ 17/ 2013
11
Problem s and solutions
Speeding up a questionnaire
At the end of each section we set a Timestamp field: TimeStampEnd / "END TIMESTAMP SECTION": TIMETYPE In each section this field is called using the rules: TimeStampEnd.keep IF (TimeStampEnd = EMPTY) THEN TimeStampEnd := SYSTIME ENDIF This TimeStampEnd is used to set a new section on route only when a previous section is finished. IF (Sec_W.TimeStampEnd <> empty) THEN Sec_X ENDIF IF (Sec_X.TimeStampEnd <> empty) THEN Sec_Y ENDIF
10/ 17/ 2013
12
Spin-offs
Tow ards a testing environm ent?
- 1. Define new control in Blaise Menu Editor
Caption: '<div onload="setPageLog('''+$KEYVALUE+''', '''+$DATE+''','''+$TIME+''','''+$DATAROOT+''', '''+$FIELDNAME+''', '''+$QUESTIONTEXT+''')">'
10/ 17/ 2013
13
Spin-offs
Tow ards a testing environm ent? App floats over your questionnaire. It allows you to directly jump back to any location you’ve visited. Attach messages to questions
10/ 17/ 2013
14
Spin-offs
Keylogger
jQuery(document).on('keydown', function(e) { var obj = { "keyvalue" : keyvalue, "type" : e.type, "timeStamp" : e.timeStamp, "keyCode" : e.keyCode, "shiftKey" : e.shiftKey, "ctrlKey" : e.ctrlKey, "altKey" : e.altKey, }; $.post("server.php",{json:JSON.stringify(obj)}); });
Will post every keypress with timestamp to server.php.
10/ 17/ 2013
15
Spin-offs
Sem antic
10/ 17/ 2013
16