Skip to content

Commit

Permalink
Fixed issue #9814: When copying a question with subquestion/answer op…
Browse files Browse the repository at this point in the history
…tions onlyt the first one is copied
  • Loading branch information
c-schmitz committed Aug 12, 2015
1 parent 51129cb commit 7cd31dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions application/controllers/admin/database.php
Expand Up @@ -482,8 +482,8 @@ function index($sa = null)
{
$aSQIDMappings = array();
$r1 = Question::model()->getSubQuestions(returnGlobal('oldqid'));

while ($qr1 = $r1->read())
$aSubQuestions = $r1->readAll();
foreach ($aSubQuestions as $qr1)
{
$qr1['parent_qid'] = $iQuestionID;
if (isset($aSQIDMappings[$qr1['qid']]))
Expand All @@ -504,7 +504,8 @@ function index($sa = null)
if (returnGlobal('copyanswers') == "Y")
{
$r1 = Answer::model()->getAnswers(returnGlobal('oldqid'));
while ($qr1 = $r1->read())
$aAnswerOptions = $r1->readAll();
foreach ($aAnswerOptions as $qr1)
{
Answer::model()->insertRecords(array(
'qid' => $iQuestionID,
Expand Down

0 comments on commit 7cd31dc

Please sign in to comment.