-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check algorithm for calculating splits #46
Comments
For other issues see https://docs.google.com/document/d/1HQ-C7TfVBDiM8AL1TzA7wg-uEiYSsBTeYrEfLLeOl7k/edit |
We identified that this issue is on the sample page and it looks like once sampled the calculations are correct. |
The issue with the sample screen is as follows:
$view = views_get_current_view();
$debug = print_r($view->exposed_input, TRUE);
drupal_set_message($debug); return: Array ( [range] => Array ( [value] => 54 [value2] => 82 ) ) will review the code to find how this can be accomplished |
To do
|
Code to use inside the view fieldsGlobal: PHP (Points) field codeValue code: if (module_exists('kendra_wf') && function_exists('kendra_wf_calc_points_value') ) {
if (isset($view->exposed_input['range'])) {
// If we have a filter provide the start and end points
$start_p = $view->exposed_input['range']['value'];
$end_p = $view->exposed_input['range']['value2'];
return kendra_wf_calc_points_value($data->nid, $static, $start_p, $end_p);
}
else {
// If no filter applied use 0-100.
return kendra_wf_calc_points_value($data->nid, $static, 0, 100);
}
}
else {
return '';
} Output code: <?php
print $value;
?> Global: PHP (Points) field codeValue code: if (module_exists('kendra_wf') && function_exists('kendra_wf_calc_points_value') ) {
if (isset($view->exposed_input['range'])) {
// If we have a filter provide the start and end points
$start_p = $view->exposed_input['range']['value'];
$end_p = $view->exposed_input['range']['value2'];
return kendra_wf_calc_points_value($data->nid, $static, $start_p, $end_p);
}
else {
// If no filter applied use 0-100.
return kendra_wf_calc_points_value($data->nid, $static, 0, 100);
}
} Output code: <?php
if (module_exists('kendra_wf') && function_exists('kendra_wf_calc_points_split') ) {
print kendra_wf_calc_points_split($data->nid, $value, $static) . '%';
}
else {
print '';
}
?> |
…osed filter (also needs code update in php fields)
Live testing resultsI have pushed all changes live.
Left right testStairway to Heaven LocalStairway to Heaven Live |
Looks like the issue is that if a legal entities has more then one contribution, then contributions can override each other so out of the two vocal tracks by Robert Plant only one is picked up. |
… contributions by the same legal entity
I have fixed the issue on the Asset page, but still need to fix it on the sample page |
Daniel can you please review and close if you are happy |
The above image to check calculations go with 90-100 that works out a clean 20%,20%,20%,40% |
The split calculation seems to go wrong when sampling tracks that include more than one part in the track timeline. Somehow parts not included in the sample range are included in the sample because they are part of the track. Where the track is a collection of parts. Also there's nothing to stop parts overlapping within one track. Perhaps the easiest thing to do right now is not allow multiple parts per track. Perhaps we'll solve that issue later?
To do
The text was updated successfully, but these errors were encountered: