Commit
…xt question if it's filtered by another question Dev: review relevance of sub question by number of relevance of answers. Dev: when rewriting Question object/EM : need a function for mandatory :)
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5972,7 +5972,6 @@ function _ValidateQuestion($questionSeq,$force=false) | |||||
$qrel=true; // assume relevant unless discover otherwise | ||||||
$prettyPrintRelEqn=''; // assume no relevance eqn by default | ||||||
$qid=$qInfo['qid']; | ||||||
|
||||||
$gid=$qInfo['gid']; | ||||||
$qhidden = $qInfo['hidden']; | ||||||
$debug_qmessage=''; | ||||||
|
@@ -6042,7 +6041,8 @@ function _ValidateQuestion($questionSeq,$force=false) | |||||
if ($qInfo['type'] == 'X') { | ||||||
$sgqas = array(); // Boilerplate questions can be ignored | ||||||
} | ||||||
else { | ||||||
else | ||||||
{ | ||||||
$sgqas = explode('|',$LEM->qid2code[$qid]); | ||||||
} | ||||||
foreach ($sgqas as $sgqa) | ||||||
|
@@ -6054,6 +6054,23 @@ function _ValidateQuestion($questionSeq,$force=false) | |||||
continue; | ||||||
} | ||||||
$foundSQrelevance=false; | ||||||
if($qInfo['type']=='R') | ||||||
{ | ||||||
// Relevance of subquestion for ranking question depend of the count of relevance of answers. | ||||||
$iCountRank=(isset($iCountRank) ? $iCountRank+1 : 1); | ||||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Shnoulle
Author
Collaborator
|
$iCountRelevant=isset($iCountRelevant) ? $iCountRelevant : count($sgqas)-count(array_filter($LEM->subQrelInfo[$qid],function($sqRankAnwsers){ return !$sqRankAnwsers['result']; })); |
And (maybe) add a else { at
not needed : default don't do anything
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
Shnoulle
Oct 2, 2019
Author
Collaborator
/me still hate this big spaghetti code in EM, but don't find a good wau to fixing it differently now.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
olleharstedt
Oct 2, 2019
Contributor
Thanks a lot for the feedback! Holiday in Germany tomorrow, but I'll get back on it on Friday. I'll also try to add a unit test for each bug (the old and the new).
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
olleharstedt
Oct 4, 2019
Contributor
I have no idea how or why, but seems like your suggestion fixes it.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
Shnoulle
Oct 4, 2019
Author
Collaborator
with max_columns
: $sgqa goes to 1 to 7 (here) : it's done for this (limit the number of columns).
$LEM->subQrelInfo[$qid] it's not columns … here, here the information about answers …
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
Shnoulle
Oct 4, 2019
Author
Collaborator
Without this settings
/* Ranking specific : max DB answer */ |
count($sgqa) == count($LEM->subQrelInfo[$qid]) == count(answers)
But with this settings count($sgqa) != count($LEM->subQrelInfo[$qid]) …
With ranking (and single choice ?) subQrelInfo
give information about answers ?
Hi ho! Can you explain what's going on here? Why are you counting each row and compare with "count relevant"?