コード例 #1
0
											},
											onError: function() {
													$('preceptor_select').addClassName('notice');

													$('preceptor_select').update('<ul><li>No <strong>Preceptors</strong> available for evaluation found in the system.</li></ul>');
											},
                                            onComplete: function() {
                                                if ($('preceptor_proxy_id') && $('preceptor_proxy_id').selectedIndex == 0) {
                                                    jQuery('#target-details-holder').html('');
                                                }
                                            }
										});
									}
									</script>
									<?php 
                                    $sidebar_html = evaluation_generate_description(isset($evaluation_record["base_min_submittable"]) && $evaluation_record["base_min_submittable"] ? $evaluation_record["base_min_submittable"] : $evaluation_record["min_submittable"], $total_questions, isset($evaluation_record["base_max_submittable"]) && ($evaluation_record["base_max_submittable"] || (int) $evaluation_record["base_max_submittable"] === 0) ? $evaluation_record["base_max_submittable"] : $evaluation_record["max_submittable"], $evaluation_record["evaluation_finish"]);
                                    new_sidebar_item("Evaluation Statement", $sidebar_html, "page-anchors", "open", "1.9");
                                } else {
                                    $ERROR++;
                                    $ERRORSTR[] = "Unable to locate your progress information for this evaluation 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 eprogress_id [" . $eprogress_id . "] (either existing or created) when attempting to complete evaluation_id [" . $RECORD_ID . "] (eform_id [" . $evaluation_record["eform_id"] . "]).");
                                }
                                break;
                        }
                    } else {
                        $ERROR++;
                        $ERRORSTR[] = "You were only able to attempt this evaluation a total of <strong>" . (int) $evaluation_record["max_submittable"] . " time" . ($evaluation_record["max_submittable"] != 1 ? "s" : "") . "</strong>, and the 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 evaluation_id [" . $RECORD_ID . "] (eform_id [" . $evaluation_record["eform_id"] . "]) more than the total number of possible attempts [" . $evaluation_record["max_submittable"] . "] after their final attempt expired.");
                    }
コード例 #2
0
                         $content["evaluation_attempt"] .= "        preceptor_proxy_id = \$('preceptor_proxy_id').options[\$('preceptor_proxy_id').selectedIndex].value;\n";
                         $content["evaluation_attempt"] .= "    }\n";
                         $content["evaluation_attempt"] .= "    new Ajax.Updater('preceptor_select', '" . ENTRADA_URL . "/" . $MODULE . "?section=api-preceptor-select', {\n";
                         $content["evaluation_attempt"] .= "        method: 'post',\n";
                         $content["evaluation_attempt"] .= "        parameters: { 'id' : '" . $evaluation_id . "', 'event_id' : event_id, 'preceptor_proxy_id' : preceptor_proxy_id},\n";
                         $content["evaluation_attempt"] .= "        onSuccess: function(transport) {\n";
                         $content["evaluation_attempt"] .= "            \$('preceptor_select').removeClassName('notice');\n";
                         $content["evaluation_attempt"] .= "        },\n";
                         $content["evaluation_attempt"] .= "        onError: function() {\n";
                         $content["evaluation_attempt"] .= "                \$('preceptor_select').addClassName('notice');\n";
                         $content["evaluation_attempt"] .= "                \$('preceptor_select').update('<ul><li>No <strong>Preceptors</strong> available for evaluation found in the system.</li></ul>');\n";
                         $content["evaluation_attempt"] .= "        }\n";
                         $content["evaluation_attempt"] .= "    });\n";
                         $content["evaluation_attempt"] .= "}\n";
                         $content["evaluation_attempt"] .= "</script>\n";
                         $sidebar_html = evaluation_generate_description($evaluation_record["min_submittable"], $total_questions, $evaluation_record["max_submittable"], $evaluation_record["evaluation_finish"]);
                         new_sidebar_item("Evaluation Statement", $sidebar_html, "page-anchors", "open", "1.9");
                     } else {
                         $ERROR++;
                         $ERRORSTR[] = "Unable to locate your progress information for this evaluation at this time. The system administrator has been notified of this error; please try again later.";
                         $content["evaluation_attempt"] .= display_error();
                         application_log("error", "Failed to locate a eprogress_id [" . $eprogress_id . "] (either existing or created) when attempting to complete evaluation_id [" . $evaluation_id . "] (eform_id [" . $evaluation_record["eform_id"] . "]).");
                     }
                     break;
             }
         }
         $content["evaluation_attempt"] .= "</div>\n";
         echo json_encode($content, JSON_FORCE_OBJECT);
     }
 } else {
     echo "false";