18 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
43 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
60 $bodycopy = $asset->getQuestionTextBodycopy();
61 $write_access = $asset->writeAccess(
'links') && $asset->writeAccess(
'attributes');
62 $use_bodycopy = !is_null($bodycopy);
64 $o->openField(translate(
'online_quiz_question_use_question_text_bodycopy'));
67 '1' => translate(
'yes'),
68 '0' => translate(
'no'),
71 combo_box($prefix.
'_question_text_use_bodycopy', $options, FALSE, Array($use_bodycopy));
73 echo
' '.get_asset_tag_line($bodycopy->id,
'contents');
77 echo translate(
'yes').
' - '.get_asset_tag_line($bodycopy->id,
'contents');
82 $o->note(translate(
'online_quiz_question_use_question_text_bodycopy_note'));
86 $o->openField(
'Question Text');
88 text_area($prefix.
'_question_text', $asset->attr(
'question_text'), 60, 3);
90 echo $asset->attr(
'question_text');
112 if ($asset->writeAccess(
'links') && $asset->writeAccess(
'attributes')) {
113 $use_bodycopy = array_get_index($_POST, $prefix.
'_question_text_use_bodycopy', NULL);
114 $question_text = array_get_index($_POST, $prefix.
'_question_text', NULL);
115 if (!is_null($use_bodycopy)) {
116 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
117 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
120 if (!is_null($question_text)) {
121 $asset->setAttrValue(
'question_text', $question_text);
125 if (!$asset->setQuestionTextBodycopy($use_bodycopy)) {
126 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
127 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
131 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
132 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();