Commit 1923a2f3 authored by Daniel Haag's avatar Daniel Haag
Browse files

Merge branch 'uibk' into 'uibk'

corrected error concerning number of questions



See merge request !64
parents 14edbc5a 78221f9c
......@@ -366,18 +366,19 @@ switch($menu_mode) {
}
if (!empty($subject_id)) {
// 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;
$sqlq2 .= ' AND question_difficulty='.$n;
if ($tsubset_quantity < 999) {
if (K_DATABASE_TYPE == 'ORACLE') {
$sqlq2 = 'SELECT * FROM ('.$sqlq2.') WHERE rownum <= '.$tsubset_quantity.'';
$sqlq2 = 'SELECT * FROM ('.$sqlq2.') WHERE rownum <= '.$tquan.'';
} else {
$sqlq2 .= ' LIMIT '.$tsubset_quantity.'';
$sqlq2 .= ' LIMIT '.$tquan.'';
}
}
if ($rq = F_db_query($sqlq2, $db)) {
......@@ -387,7 +388,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 +400,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