<?php require_once('includes/requirecompere.inc.php'); require_once('includes/question.inc.php'); $CMD_TMPL_NAME='questioninfo'; $q_id=TGET('q_id'); $mb_id=current_mb_id(); $DBConn->connect(true); $question=db_load_question_by_id($DBConn,$q_id); if (!$question || $mb_id!=$question['mb_id_owner']) { redirect("./"); return; } $op=TGET('op'); $dataset['MODIFY']=array(0); $dataset['ENTERING']=array(0); if ($op=='revise' && $_SESSION['reserv.inputcache.domain']=='question.addnew') { $data=$_SESSION['reserv.inputcache.data']; $dataset+=$_SESSION['reserv.inputcache.errorareas']; $dataset+=prepare_questioninfo_dataset($data,$data['qc_ordinal'],$data['qc_text']); } else { $choices=db_load_question_choices($DBConn,$q_id); $dataset+=prepare_questioninfo_dataset($question,rowset2map($choices,'qc_id','qc_ordinal'),rowset2map($choices,'qc_id','qc_text')); } ?>