Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 7564f1d0950daf193ced81745bd7672637a993ad 1 parent 81fc303
pichetp authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 question/type/datasetdependent/abstractqtype.php
View
4 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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.