mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-17228 Synchronizing dataitems between calculated questions in a quiz
This commit is contained in:
parent
9a5a069450
commit
f96e83d4b6
1 changed files with 14 additions and 1 deletions
|
@ -321,7 +321,20 @@ class question_calculated_qtype extends default_questiontype {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Choose a random dataset
|
// Choose a random dataset
|
||||||
|
if (!isset($cmoptions->intro) || strstr($cmoptions->intro, 'synchronize_calculated') === false ) {
|
||||||
$state->options->datasetitem = rand(1, $maxnumber);
|
$state->options->datasetitem = rand(1, $maxnumber);
|
||||||
|
}else{
|
||||||
|
if( !isset($cmoptions->synchronize_calculated)) {
|
||||||
|
$state->options->datasetitem = rand(1, $maxnumber);
|
||||||
|
$cmoptions->synchronize_calculated = $state->options->datasetitem ;
|
||||||
|
}else {
|
||||||
|
if ($cmoptions->synchronize_calculated <= $maxnumber){
|
||||||
|
$state->options->datasetitem = $cmoptions->synchronize_calculated ;
|
||||||
|
}else {
|
||||||
|
$state->options->datasetitem = rand(1, $maxnumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
$state->options->dataset =
|
$state->options->dataset =
|
||||||
$this->pick_question_dataset($question,$state->options->datasetitem);
|
$this->pick_question_dataset($question,$state->options->datasetitem);
|
||||||
$state->responses = array('' => '');
|
$state->responses = array('' => '');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue