Very Very Very Busy

I have been very busy lately for this,

$c = new Criteria();
$c->add(LevelPresetPeer::GRADE_ID, $this->getUser()->getAttribute(‘staff_grade’));
$grade_settings = LevelPresetPeer::doSelect($c);

foreach ($grade_settings as $grade_setting)
{
++$q;
$questions[$q][‘department’] = $grade_setting->getName();
$questions[$q][‘questions’] = $grade_setting->getQuestionNo();
$questions[$q][‘level’] = $grade_setting->getLevel();
}
$this->questions = $questions;

foreach ($questions as $question)
{
++$g;
$department_id = $this->getDepartmentId($question[‘department’]);

$c = new Criteria();
$c->add(QuestionPeer::DEPARTMENT_ID, $department_id);
$c->add(QuestionPeer::LEVEL, $question[‘level’]);
$c->setLimit($question[‘questions’]);

$loaded_questions[] = QuestionPeer::doSelect($c);
}

foreach($loaded_questions as $loaded_question)
{
foreach($loaded_question as $row)
{
++$kk;
$all_questions[$kk][‘q_id’] = $row->getId();
$all_questions[$kk][‘q_desc’] = $row->getDescription();
$all_questions[$kk][‘q_a’] = $row->getAnswerA();
$all_questions[$kk][‘q_b’] = $row->getAnswerB();
$all_questions[$kk][‘q_c’] = $row->getAnswerC();
$all_questions[$kk][‘q_d’] = $row->getAnswerD();
}
$this->all_questions = $all_questions;
}

Leave a comment

Your email address will not be published. Required fields are marked *