Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 13 additions & 32 deletions app/config.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<widget id="com.rand.egowebmoble" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.rand.egowebmoble" version="0.0.8" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>EgoWeb Mobile</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
Expand All @@ -13,31 +8,17 @@
Apache Cordova Team
</author>
<content src="index.html" />
<preference name="permissions" value="none"/>

<preference name="BackupWebStorage" value="local"/>

<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />
<preference name="StatusBarStyle" value="lightcontent" />


<preference name="iosPersistentFileLocation" value="Library" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />
<preference name="StatusBarStyle" value="lightcontent" />
<preference name="Orientation" value="landscape" />
<preference name="android-targetSdkVersion" value="23" />
<preference name="android-minSdkVersion" value="18" />
<access origin="*" />

<preference name="android-targetSdkVersion" value="18" />
<preference name="android-minSdkVersion" value="18" />

<platform name="ios">
<config-file target="*-Info.plist" parent="NSAppTransportSecurity">
<array>
<dict>
<key>NSAllowsArbitraryLoads</key>
<boolean>YES</boolean>
</dict>
</array>
</config-file>
</platform>

<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<engine name="android" spec="^6.2.3" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.2" />
</widget>

3 changes: 3 additions & 0 deletions app/plugins/android.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"installed_plugins": {
"cordova-plugin-statusbar": {
"PACKAGE_NAME": "com.rand.egowebmoble"
},
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "com.rand.egowebmoble"
}
},
"dependent_plugins": {}
Expand Down
8 changes: 8 additions & 0 deletions app/plugins/fetch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-whitelist": {
"source": {
"type": "registry",
"id": "cordova-plugin-whitelist@1.3.2"
},
"is_top_level": true,
"variables": {}
}
}
4 changes: 4 additions & 0 deletions app/www/css/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}

#main_buttons
{
display: none;
}
.admin{
border-radius: 5px;
background-color: #e58320;
Expand Down
133 changes: 131 additions & 2 deletions app/www/js/interview.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ app.controller('interviewController', ['$scope', '$log', '$routeParams','$sce',
// check to make sure the form is completely valid
deleteAlter.getAlters().then(function(data){
alters = JSON.parse(data);
for(k in alters){
if (alters[k].ID == alterId ){
delete alters[k];
}
}
$route.reload();
});
};
Expand Down Expand Up @@ -1034,11 +1039,16 @@ function buildQuestions(pageNumber, interviewId){
page[i] = new Object;
}

// first pass at ego questions
if(interviewId != null){
ego_question_list = new Object;
network_question_list = new Object;
prompt = "";

for(j in ego_questions){
if (ego_questions[j].TITLE.indexOf("VS3.") >= 0){
break;
}
ego_questions[j].array_id = ego_questions[j].ID;
if(Object.keys(ego_question_list).length > 0 && (parseInt(ego_questions[j].ASKINGSTYLELIST) != 1 || prompt != ego_questions[j].PROMPT.replace(/<\/*[^>]*>/gm, '').replace(/(\r\n|\n|\r)/gm,""))){
if(pageNumber == i){
Expand Down Expand Up @@ -1445,6 +1455,74 @@ function buildQuestions(pageNumber, interviewId){
page[i] = new Object;
}

// second ego round - DSM 032217
var second_ego_q = 0;
for(j in ego_questions){

if (ego_questions[j].TITLE.indexOf("VS3.") >= 0){
second_ego_q++;
}

if (second_ego_q < 1){
continue;
}

ego_questions[j].array_id = ego_questions[j].ID;
if(Object.keys(ego_question_list).length > 0 && (parseInt(ego_questions[j].ASKINGSTYLELIST) != 1 || prompt != ego_questions[j].PROMPT.replace(/<\/*[^>]*>/gm, '').replace(/(\r\n|\n|\r)/gm,""))){
if(pageNumber == i){
page[i] = ego_question_list;
return page[i];
}
ego_question_list = new Object;
prompt = "";
i++;
page[i] = new Object;
}

if(evalExpression(ego_questions[j].ANSWERREASONEXPRESSIONID) != true){
saveSkip(interviewId, ego_questions[j].ID, "", "", ego_questions[j].ID);
continue;
}

if(ego_questions[j].PREFACE != ""){
if(pageNumber == i){
preface = new Object;
preface.ID = ego_questions[j].ID;
preface.ANSWERTYPE = "PREFACE";
preface.SUBJECTTYPE = "PREFACE";
preface.PROMPT = ego_questions[j].PREFACE;
page[i][0] = preface;
return page[i];
}
i++;
page[i] = new Object;
}
if(parseInt(ego_questions[j].ASKINGSTYLELIST) == 1){
//console.log(prompt + ":" +ego_questions[j].PROMPT);
if(prompt == "" || prompt == ego_questions[j].PROMPT.replace(/<\/*[^>]*>/gm, '').replace(/(\r\n|\n|\r)/gm,"")){
//console.log('list type question');
prompt = ego_questions[j].PROMPT.replace(/<\/*[^>]*>/gm, '').replace(/(\r\n|\n|\r)/gm,"");
ego_question_list[parseInt(ego_questions[j].ORDERING) + 1] = ego_questions[j];
}
}else{
if(pageNumber == i){
page[i][ego_questions[j].ID] = ego_questions[j];
return page[i];
}
i++;
page[i] = new Object;
}
}

if(Object.keys(ego_question_list).length > 0){
if(pageNumber == i){
page[i] = ego_question_list;
return page[i];
}
i++;
page[i] = new Object;
}

conclusion = new Object;
conclusion.ANSWERTYPE = "CONCLUSION";
conclusion.PROMPT = study.CONCLUSION;
Expand Down Expand Up @@ -2436,7 +2514,17 @@ function buildNav(pageNumber, scope){
}
var prompt = "";
var ego_question_list = '';
for(j in ego_questions){
var skip_ego_questions = 0;
for(j in ego_questions){
if (ego_questions[j].TITLE.indexOf("VS3.") >= 0)
skip_ego_questions = j;
}

// first pass at ego questions
for(j in ego_questions){
if (ego_questions[j].TITLE.indexOf("VS3.") >= 0){
break;
}
if(evalExpression(ego_questions[j].ANSWERREASONEXPRESSIONID, interviewId) != true)
continue;

Expand Down Expand Up @@ -2652,6 +2740,47 @@ function buildNav(pageNumber, scope){
i++;
}

// second ego round - DSM 032217
var second_ego_nav = 0;
for(j in ego_questions){

if (ego_questions[j].TITLE.indexOf("VS3.") >= 0){
second_ego_nav++;
}

if (second_ego_nav < 1){
continue;
}

if(evalExpression(ego_questions[j].ANSWERREASONEXPRESSIONID, interviewId) != true)
continue;

if((parseInt(ego_questions[j].ASKINGSTYLELIST) != 1 || prompt != ego_questions[j].PROMPT.replace(/<\/*[^>]*>/gm, '').replace(/(\r\n|\n|\r)/gm,"")) && ego_question_list){
pages[i] = this.checkPage(i, pageNumber, ego_question_list.TITLE);
prompt = "";
ego_question_list = '';
i++;
}
if(ego_questions[j].PREFACE != ""){
pages[i] = this.checkPage(i, pageNumber, "PREFACE");
i++;
}
if(parseInt(ego_questions[j].ASKINGSTYLELIST) == 1){
prompt = ego_questions[j].PROMPT.replace(/<\/*[^>]*>/gm, '').replace(/(\r\n|\n|\r)/gm,"");
if(ego_question_list == '')
ego_question_list = ego_questions[j];
}else{
pages[i] = this.checkPage(i, pageNumber, ego_questions[j].TITLE);
i++;
}

}
if(ego_question_list){
pages[i] = this.checkPage(i, pageNumber, ego_question_list.TITLE);
ego_question_list = '';
i++;
}

pages[i] = this.checkPage(i, pageNumber, "CONCLUSION");
return pages;
}
Expand Down Expand Up @@ -2713,4 +2842,4 @@ function unfixHeader(){
$(window).unbind('scroll');
$(window).unbind('touchmove');
$(window).unbind('resize');
}
}
Loading