} </style> <div class="quiz-questions" id="quiz-content-questions-holder"> <ol class="questions" id="quiz-questions-list"> <?php foreach ($questions as $q) { if ($q->getQuestionTypeID() != 3) { $question = $q->toArray(); $question_correct = false; $question_feedback = ""; echo "<li id=\"question_" . $question["qquestion_id"] . "\" class=\"" . ($question["questiontype_id"] == 4 ? "group" : "") . "\">"; echo "\t<div class=\"question noneditable\">\n"; echo "\t\t<span id=\"question_text_" . $question["qquestion_id"] . "\" class=\"question\">" . clean_input($question["question_text"], "trim") . "</span>"; echo "\t</div>\n"; if ($q->getQuestionTypeID() == "4") { $grouped_qquestions = Models_Quiz_Question::fetchGroupedQuestions($q->getQquestionID()); if ($grouped_qquestions) { echo "<ul>"; foreach ($grouped_qquestions as $q) { $question = $q->toArray(); echo "<li id=\"question_" . $question["qquestion_id"] . "\">"; echo "\t<div class=\"question noneditable\">\n"; echo "\t\t<span id=\"question_text_" . $question["qquestion_id"] . "\" class=\"question\">" . clean_input($question["question_text"], "trim") . "</span>"; echo "\t</div>\n"; $responses = Models_Quiz_Question_Response::fetchAllRecords($q->getQquestionID()); if ($responses) { echo "\t<ul class=\"responses\">\n"; foreach ($responses as $r) { $response = $r->toArray(); $response_selected = false; $response_correct = false;
} ol.questions { padding-left:20px; } </style> <?php $problem_pages = array(); $page_counter = 1; $counter = 1; $quiz_markup = ""; $used_qquestion_group_ids = array(); foreach ($questions as $question) { if ($question->getQquestionGroupID()) { if (!in_array($question->getQquestionGroupID(), $used_qquestion_group_ids)) { $used_qquestion_group_ids[] = $question->getQquestionGroupID(); $grouped_qquestions = Models_Quiz_Question::fetchGroupedQuestions($question->getQuizID(), $question->getQquestionGroupID()); if ($grouped_qquestions) { $quiz_markup .= "</ol><ol class=\"questions group\" start=\"" . $counter . "\">"; foreach ($grouped_qquestions as $question) { $quiz_markup .= "<li>" . clean_input($question->getQuestionText(), "trim"); $responses = Models_Quiz_Question_Response::fetchAllRecords($question->getQquestionID()); if ($responses) { $quiz_markup .= "<ul class=\"responses\">"; foreach ($responses as $r) { $response = $r->toArray(); $quiz_markup .= "<li class=\"row-fluid\">"; $quiz_markup .= "\t<span class=\"span1\"><input type=\"radio\" id=\"response_" . $question->getQquestionID() . "_" . $response["qqresponse_id"] . "\" name=\"responses[" . $question->getQquestionID() . "]\" value=\"" . $response["qqresponse_id"] . "\"" . ($ajax_load_progress[$question->getQquestionID()] == $response["qqresponse_id"] ? " checked=\"checked\"" : "") . " onclick=\"((this.checked == true) ? storeResponse('" . $question->getQquestionID() . "', '" . $response["qqresponse_id"] . "') : false)\" /></span>"; $quiz_markup .= "\t<label class=\"span11\" for=\"response_" . $question->getQquestionID() . "_" . $response["qqresponse_id"] . "\">" . clean_input($response["response_text"], $response["response_is_html"] == 1 ? "trim" : "encode") . "</label>"; $quiz_markup .= "</li>\n"; } $quiz_markup .= "</ul>";