Commit 82c4148d authored by Ewald's avatar Ewald
Browse files

corrected error concerning number of questions

parent 14edbc5a
......@@ -368,7 +368,9 @@ switch($menu_mode) {
// insert new subject
//$tsubset_quantity = ($tsubset_quantity < 999 ? $tsubset_quantity : $numofrows);
$nmax = ($alldifficulties == true ? 9 : 1);
$tquanorig = $tsubset_quantity;
for ($n=1; $n <= $nmax; $n++) {
$tquan = $tquanorig;
$sqlq2 = $sqlq1;
if ($alldifficulties == true){
$tsubset_difficulty = $n;
......@@ -377,7 +379,7 @@ switch($menu_mode) {
if (K_DATABASE_TYPE == 'ORACLE') {
$sqlq2 = 'SELECT * FROM ('.$sqlq2.') WHERE rownum <= '.$tsubset_quantity.'';
} else {
$sqlq2 .= ' LIMIT '.$tsubset_quantity.'';
$sqlq2 .= ' LIMIT '.$tquan.'';
}
}
if ($rq = F_db_query($sqlq2, $db)) {
......@@ -387,7 +389,7 @@ switch($menu_mode) {
} else {
F_display_db_error();
}
$tsubset_quantity = $numofrows;
$tquan = $numofrows;
}
if ($numofrows > 0 ) {
$sql = 'INSERT INTO '.K_TABLE_TEST_SUBJSET.' (tsubset_test_id,
......@@ -399,7 +401,7 @@ switch($menu_mode) {
\''.$test_id.'\',
\''.$tsubset_type.'\',
\''.$tsubset_difficulty.'\',
\''.$tsubset_quantity.'\',
\''.$tquan.'\',
\''.$tsubset_answers.'\'
)';
if (!$r = F_db_query($sql, $db)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment