Skip to content

Commit

Permalink
Dev Fix for EM test
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Jan 23, 2018
1 parent 28ad432 commit a58d94b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -857,12 +857,13 @@ public static function getLEMqcode2sgqa($iSurveyId){
*/
public static function ConvertConditionsToRelevance($surveyId, $qid=NULL)
{
$aDictionary = LimeExpressionManager::getLEMqcode2sgqa($surveyId);
if (is_null($aDictionary)) {
$aDictionary=array();
} else {
$aDictionary = array_flip($aDictionary);
}
$aDictionary=array();
if (!is_null($surveyId)) {
$aDictionary = LimeExpressionManager::getLEMqcode2sgqa($surveyId);
if (!is_null($aDictionary)) {
$aDictionary = array_flip($aDictionary);
}
}
$query = LimeExpressionManager::getConditionsForEM($surveyId,$qid);
$aConditions=$query->readAll();
$_qid = -1;
Expand Down Expand Up @@ -945,7 +946,6 @@ public static function ConvertConditionsToRelevance($surveyId, $qid=NULL)
$row['cfieldname'] = $aDictionary[$row['cfieldname']];
}
// else create name by concatenating two parts together
debugbreak();
$fieldname = $row['cfieldname'] . $row['value'] . '.NAOK';
$subqid = $row['cfieldname'];
$value = 'Y';
Expand Down
Expand Up @@ -6,7 +6,11 @@
?>

<?php
$data = LimeExpressionManager::UnitTestConvertConditionsToRelevance();
$aSurveys = Survey::model()->findAll();
$data= array();
foreach ($aSurveys as $aSurvey){
$data += LimeExpressionManager::UnitTestConvertConditionsToRelevance($aSurvey->sid);
}
echo count($data) . " question(s) in your database contain conditions. Below is the mapping of question ID number to generated relevance equation<br/>";
echo "<pre>";
print_r($data);
Expand Down

0 comments on commit a58d94b

Please sign in to comment.