Skip to content

Commit

Permalink
Fixed issue #10044: Subquestions are shown as imported even when skip…
Browse files Browse the repository at this point in the history
…ped due to malformed SQL
  • Loading branch information
c-schmitz committed Dec 4, 2015
1 parent 313548f commit 618588f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions application/helpers/admin/import_helper.php
Expand Up @@ -469,12 +469,15 @@ function XMLImportQuestion($sFullFilePath, $iNewSID, $newgid)
foreach ($insertdata as $k => $v)
$ques->$k = $v;
$result = $ques->save();
$newsqid=getLastInsertID($ques->tableName());
if (!isset($insertdata['qid']))
if ($result)
{
$aQIDReplacements[$oldsqid]=$newsqid; // add old and new qid to the mapping array
$newsqid=getLastInsertID($ques->tableName());
if (!isset($insertdata['qid']))
{
$aQIDReplacements[$oldsqid]=$newsqid; // add old and new qid to the mapping array
}
$results['subquestions']++;
}
$results['subquestions']++;
}
}

Expand Down

0 comments on commit 618588f

Please sign in to comment.