コード例 #1
0
 }
 echo "\t<tr id=\"quiz-" . $quiz_record["aquiz_id"] . "\">\n";
 echo "\t\t<td class=\"modified\" style=\"vertical-align: top\">" . ((int) $quiz_record["last_visited"] ? (int) $quiz_record["last_visited"] >= (int) $quiz_record["updated_date"] ? "<img src=\"" . ENTRADA_RELATIVE . "/images/checkmark.gif\" width=\"20\" height=\"20\" alt=\"You have previously completed this quiz.\" title=\"You have previously completed this quiz.\" style=\"vertical-align: middle\" />" : "<img src=\"" . ENTRADA_RELATIVE . "/images/exclamation.gif\" width=\"20\" height=\"20\" alt=\"This attached quiz has been updated since you last completed it.\" title=\"This attached quiz has been updated since you last completed it.\" style=\"vertical-align: middle\" />" : "") . "</td>\n";
 echo "\t\t<td class=\"title\" style=\"vertical-align: top; white-space: normal; overflow: visible\">\n";
 if ($allow_attempt) {
     echo "\t\t<a href=\"javascript: beginQuiz(" . $quiz_record["aquiz_id"] . ")\" title=\"Take " . html_encode($quiz_record["quiz_title"]) . "\" style=\"font-weight: bold\">" . html_encode($quiz_record["quiz_title"]) . "</a>";
 } else {
     echo "\t\t<span style=\"color: #666666; font-weight: bold\">" . html_encode($quiz_record["quiz_title"]) . "</span>";
 }
 echo "\t\t\t<div class=\"content-small\" style=\"margin-top: 3px; margin-bottom: 5px\">\n";
 if ((int) $quiz_record["release_date"] && $quiz_record["release_date"] > time()) {
     echo "You will be able to attempt this quiz starting <strong>" . date(DEFAULT_DATE_FORMAT, $quiz_record["release_date"]) . "</strong>.<br /><br />";
 } elseif ((int) $quiz_record["release_until"] && $quiz_record["release_until"] < time()) {
     echo "This quiz was only available until <strong>" . date(DEFAULT_DATE_FORMAT, $quiz_record["release_until"]) . "</strong>. Please contact a teacher for assistance if required.<br /><br />";
 }
 echo quiz_generate_description($quiz_record["required"], $quiz_record["quiztype_code"], $quiz_record["quiz_timeout"], $total_questions, $quiz_record["quiz_attempts"], $quiz_record["timeframe"], $quiz_record["require_attendance"], $event_info["course_id"]);
 echo "\t\t\t</div>\n";
 if ($progress_record) {
     echo "<strong>Your Attempts</strong>";
     echo "<ul class=\"menu\">";
     foreach ($progress_record as $entry) {
         $quiz_start_time = $entry["updated_date"];
         $quiz_end_time = (int) $quiz_record["quiz_timeout"] ? $quiz_start_time + $quiz_record["quiz_timeout"] * 60 : 0;
         /**
          * Checking for quizzes that are expired, but still in progress.
          */
         if ($entry["progress_value"] == "inprogress" && ((int) $quiz_record["release_until"] && $quiz_record["release_until"] < time() || $quiz_end_time && time() > $quiz_end_time + 30)) {
             $quiz_progress_array = array("progress_value" => "expired", "quiz_score" => "0", "quiz_value" => "0", "updated_date" => time(), "updated_by" => $ENTRADA_USER->getID());
             if (!$db->AutoExecute("quiz_progress", $quiz_progress_array, "UPDATE", "qprogress_id = " . $db->qstr($entry["qprogress_id"]))) {
                 application_log("error", "Unable to update the qprogress_id [" . $qprogress_id . "] to expired. Database said: " . $db->ErrorMsg());
             }
コード例 #2
0
															$('display-unsaved-warning').appear({ duration: 0.5 });
														}
													}
												},
												onError: function() {
														$('question_' + qid).addClassName('notice');

														if ($('display-unsaved-warning').style.display == 'none') {
															$('display-unsaved-warning').appear({ duration: 0.5 });
														}
												}
											});
										}
										</script>
										<?php 
                                        $sidebar_html = quiz_generate_description($quiz_record["required"], $quiz_record["quiztype_code"], $quiz_record["quiz_timeout"], $total_questions, $quiz_record["quiz_attempts"], $quiz_record["timeframe"], $quiz_record["require_attendance"], isset($quiz_record["course_id"]) && $quiz_record["course_id"] ? $quiz_record["course_id"] : 0);
                                        new_sidebar_item("Quiz Statement", $sidebar_html, "page-anchors", "open", "1.9");
                                    } else {
                                        add_error("Unable to locate your progress information for this quiz at this time. The system administrator has been notified of this error; please try again later.");
                                        echo display_error();
                                        application_log("error", "Failed to locate a qprogress_id [" . $qprogress_id . "] (either existing or created) when attempting to complete aquiz_id [" . $RECORD_ID . "] (quiz_id [" . $quiz_record["quiz_id"] . "] / event_id [" . $quiz_record["content_id"] . "]).");
                                    }
                                    break;
                            }
                        } else {
                            add_error("You were only able to attempt this quiz a total of <strong>" . (int) $quiz_record["quiz_attempts"] . " time" . ($quiz_record["quiz_attempts"] != 1 ? "s" : "") . "</strong>, and time limit for your final attempt expired before completion.<br /><br />Please contact a teacher if you require further assistance.");
                            echo display_error();
                            application_log("notice", "Someone attempted to complete aquiz_id [" . $RECORD_ID . "] (quiz_id [" . $quiz_record["quiz_id"] . "] / event_id [" . $quiz_record["content_id"] . "]) more than the total number of possible attempts [" . $quiz_record["quiz_attempts"] . "] after their final attempt expired.");
                        }
                    } else {
                        add_notice("You were only able to attempt this quiz a total of <strong>" . (int) $quiz_record["quiz_attempts"] . " time" . ($quiz_record["quiz_attempts"] != 1 ? "s" : "") . "</strong>.<br /><br />Please contact a teacher if you require further assistance.");
コード例 #3
0
															$('display-unsaved-warning').appear({ duration: 0.5 });
														}
													}
												},
												onError: function() {
														$('question_' + qid).addClassName('notice');

														if ($('display-unsaved-warning').style.display == 'none') {
															$('display-unsaved-warning').appear({ duration: 0.5 });
														}
												}
											});
										}
										</script>
										<?php 
                                        $sidebar_html = quiz_generate_description($quiz_record["required"], $quiz_record["quiztype_code"], $quiz_record["quiz_timeout"], $total_questions, $quiz_record["quiz_attempts"], $quiz_record["timeframe"]);
                                        new_sidebar_item("Quiz Statement", $sidebar_html, "page-anchors", "open", "1.9");
                                    } else {
                                        $ERROR++;
                                        $ERRORSTR[] = "Unable to locate your progress information for this quiz at this time. The system administrator has been notified of this error; please try again later.";
                                        echo display_error();
                                        application_log("error", "Failed to locate a qprogress_id [" . $qprogress_id . "] (either existing or created) when attempting to complete aquiz_id [" . $RECORD_ID . "] (quiz_id [" . $quiz_record["quiz_id"] . "] / event_id [" . $quiz_record["content_id"] . "]).");
                                    }
                                    break;
                            }
                        } else {
                            $ERROR++;
                            $ERRORSTR[] = "You were only able to attempt this quiz a total of <strong>" . (int) $quiz_record["quiz_attempts"] . " time" . ($quiz_record["quiz_attempts"] != 1 ? "s" : "") . "</strong>, and time limit for your final attempt expired before completion.<br /><br />Please contact a teacher if you require further assistance.";
                            echo display_error();
                            application_log("notice", "Someone attempted to complete aquiz_id [" . $RECORD_ID . "] (quiz_id [" . $quiz_record["quiz_id"] . "] / event_id [" . $quiz_record["content_id"] . "]) more than the total number of possible attempts [" . $quiz_record["quiz_attempts"] . "] after their final attempt expired.");
                        }