Permalink
Browse files

MDL-22386 merge from HEAD setting correctly the number of dataitem wh…

…en duplicating a calculated, calculatedsimple, calculatedmulti question
  • Loading branch information...
1 parent 13e949c commit 0fc550a5cc21c84dcee04db7aed80cac14ef777c @ppichet ppichet committed May 7, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 question/type/datasetdependent/abstractqtype.php
@@ -468,8 +468,13 @@ function save_as_new_dataset_definitions($form, $initialid) {
}
$itemcount++;
}
- //update item count
- $datasetdef->itemcount =$itemcount;
+ //update item count to olditemcount if
+ // at least this number of items has been recover from the database
+ if( $olditemcount <= $itemcount ) {
+ $datasetdef->itemcount = $olditemcount;
+ } else {
+ $datasetdef->itemcount = $itemcount ;
+ }
update_record('question_dataset_definitions', $datasetdef);
} // end of copy the dataitems
}// end of copy the datasetdef

0 comments on commit 0fc550a

Please sign in to comment.