Permalink
Browse files

merge from HEAD MDL-15358 negative data from datasets between ()

  • Loading branch information...
pichetp
pichetp committed Sep 20, 2008
1 parent 81fc303 commit 7564f1d0950daf193ced81745bd7672637a993ad
Showing with 4 additions and 0 deletions.
  1. +4 −0 question/type/datasetdependent/abstractqtype.php
@@ -83,8 +83,12 @@ function save_session_and_responses(&$question, &$state) {
function substitute_variables($str, $dataset) {
foreach ($dataset as $name => $value) {
+ if($value < 0 ){
+ $str = str_replace('{'.$name.'}', '('.$value.')', $str);
+ } else {
$str = str_replace('{'.$name.'}', $value, $str);
}
+ }
return $str;
}

0 comments on commit 7564f1d

Please sign in to comment.