$weight) { $qid = intval($qid); $weight = intval($weight); $orders = $_POST['ordering']; asort($orders); $orders = array_keys($orders); foreach ($orders as $k => $id) $orders[$k] = intval($id); $orders = array_flip($orders); $testsQuestionsAssocDAO->Update($tid, $qid, $weight, $orders[$qid]+1); $count++; } $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY'); header('Location: '.$_SERVER['PHP_SELF'] .'?tid='.$tid.'&_course_id='.$_course_id); exit; } $cats = array(); $cats[0] = _AT('cats_uncategorized'); $cat_rows = $testsQuestionsCategoriesDAO->getByCourseID($_course_id); if (is_array($cat_rows)) { foreach ($cat_rows as $cat_row) { $cats[$cat_row['category_id']] = $cat_row['title']; } } require_once(TR_INCLUDE_PATH.'header.inc.php'); $row = $testsDAO->get($tid); echo '
'; echo '

'._AT('questions_for').' '.AT_print($row['title'], 'tests.title').'

'; $rows = $testsQuestionsAssocDAO->getZeroWeightRowsByTestID($tid); if (is_array($rows)) { $msg->printWarnings('QUESTION_WEIGHT'); } $msg->printAll(); $rows = $testsQuestionsAssocDAO->getByTestID($tid); $savant->assign('cats', $cats); $savant->assign('rows', $rows); $savant->assign('tid', $tid); $savant->assign('course_id', $_course_id); $savant->display('tests/questions.tmpl.php'); echo '
'; require_once(TR_INCLUDE_PATH.'footer.inc.php');?>