$ERROR++; $ERRORSTR[] = "Your account does not have the permissions required to use this feature of this module.<br /><br />If you believe you are receiving this message in error please contact <a href=\"mailto:" . html_encode($AGENT_CONTACTS["administrator"]["email"]) . "\">" . html_encode($AGENT_CONTACTS["administrator"]["name"]) . "</a> for assistance."; echo display_error(); application_log("error", "Group [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] . "] and role [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"] . "] does not have access to this module [" . $MODULE . "]"); } else { if ($COURSE_ID) { $PROCESSED = array(); $PROCESSED_NOTICE = array(); $BREADCRUMB[] = array("url" => "", "title" => "Add Assignment Drop Box"); if (isset($_GET["assessment_id"]) && ($tmp_input = clean_input($_GET["assessment_id"], array("nows", "int")))) { $ASSESSMENT_ID = $tmp_input; } else { $ASSESSMENT_ID = 0; } if ($ASSESSMENT_ID) { $assessment_object = Models_Gradebook_Assessment::fetchRowByID($ASSESSMENT_ID); $assessment = $assessment_object->toArray(); if ($assessment) { $query = "SELECT * FROM `assignments`\n WHERE `assessment_id` = " . $db->qstr($ASSESSMENT_ID) . "\n AND `assignment_active` = 1"; $assignment = $db->GetRow($query); if ($assignment) { add_error("In order to add an Assignment to a Gradebook Assessment you must provide a valid assessment identifier. The provided assessment identifier is already has an assignment."); } else { $PROCESSED["assessment_id"] = $assessment["assessment_id"]; } } else { add_error("In order to add an Assignment to a Gradebook Assessment you must provide a valid assessment identifier. The provided assessment identifier does not exist."); } } else { add_error("In order to add an Assignment to a Gradebook Assessment you must provide a valid assessment identifier."); }
if (isset($_POST["post_action"])) { if (@in_array($_POST["post_action"], array("new", "index", "parent", "grade"))) { $_SESSION[APPLICATION_IDENTIFIER]["tmp"]["post_action"] = $_POST["post_action"]; } else { $_SESSION[APPLICATION_IDENTIFIER]["tmp"]["post_action"] = "index"; } } else { $_SESSION[APPLICATION_IDENTIFIER]["tmp"]["post_action"] = "index"; } if (!$ERROR) { $PROCESSED["order"] = Models_Gradebook_Assessment::fetchNextOrder($COURSE_ID, $PROCESSED["cohort"]); $PROCESSED["updated_date"] = time(); $PROCESSED["updated_by"] = $ENTRADA_USER->getID(); $PROCESSED["course_id"] = $COURSE_ID; $PROCESSED["active"] = '1'; $assessment = new Models_Gradebook_Assessment($PROCESSED); if ($assessment->insert()) { $ASSESSMENT_ID = $assessment->getAssessmentID(); if ($ASSESSMENT_ID) { application_log("success", "Successfully added assessment ID [" . $ASSESSMENT_ID . "]"); } else { application_log("error", "Unable to fetch the newly inserted assessment identifier for this assessment."); } if (isset($PROCESSED["event_id"])) { $assessment_event_array = array("assessment_id" => $ASSESSMENT_ID, "event_id" => $PROCESSED["event_id"], "updated_by" => $PROCESSED["updated_by"], "updated_date" => $PROCESSED["updated_date"], "active" => 1); $assessment_event = new Models_Assessment_AssessmentEvent($assessment_event_array); if (!$assessment_event->insert()) { application_log("error", "Unable insert the attached learning event.Database said: " . $db->ErrorMsg()); } else { application_log("success", "Successfully attached learning event [" . $PROCESSED["event_id"] . "] to assessment ID [" . $ASSESSMENT_ID . "]"); }
if (!@count($ASSESSMENT_IDS)) { $ERROR++; $ERRORSTR[] = "There were no valid assessment identifiers provided to delete. Please ensure that you access this section through the assessment index."; } } if ($ERROR) { $STEP = 1; } break; } // Display Page switch ($STEP) { case 2: $total_removed_assessments = 0; foreach ($ASSESSMENT_IDS as $assessment_id) { $assessment = Models_Gradebook_Assessment::fetchRowByID($assessment_id); if ($assessment) { if ($assessment->fromArray(array("active" => 0))->update()) { $total_removed_assessments++; if (!$db->AutoExecute("assignments", array("assignment_active" => 0), "UPDATE", "`assessment_id` = " . $assessment_id)) { application_log("error", "Successfully removed assessment id: [" . $assessment_id . "] but was unable to remove the assignments pertaining to them."); } } } } if ($total_removed_assessments == count($ASSESSMENT_IDS)) { add_success("You have successfully removed " . $total_removed_assessments . " assessment" . ($total_removed_assessments != 1 ? "s" : "") . " from the system.<br /><br />You will be automatically redirected to the Assessment index in 5 seconds, or you can <strong><a href=\"" . $INDEX_URL . "\">click here</a></strong> to go there now."); echo display_success(); } else { add_error("We were unable to remove the requested assessments from the system. The MEdTech Unit has been informed of this issue and will address it shortly; please try again later."); echo display_error();
<tr> <td style="border-bottom:0;"></td> </tr> </tfoot> <tbody> <?php if ($cohorts) { if ($output_cohort) { echo "<tr>"; echo "<td style=\"width: 20px;\"></td>"; echo "<td style=\"width: 300px;\"><h3 style=\"border-bottom: 0;\">Assessment</h3></td>"; echo "<td><h3 style=\"border-bottom: 0;\">Grade Weighting</h3></td>"; echo "<td><h3 style=\"border-bottom: 0;\">Assignment</h3></td>"; echo "<td class=\"assessment_col_5\"><h3>Views</h3></td>"; echo "</tr>"; $assessments = Models_Gradebook_Assessment::fetchAllRecords($output_cohort["group_id"], $COURSE_ID); if ($assessments) { $total_grade_weight = 0; $count = 0; foreach ($assessments as $assessment) { $result = $assessment->toArray(); if ($ENTRADA_ACL->amIAllowed(new AssessmentResource($course_details["course_id"], $course_details["organisation_id"], $result["assessment_id"]), "update")) { //Display this row if the user is a Dropbox Contact for an assignment associated with this assessment or if they are the Course Owner. $query = "\tSELECT a.`course_id`, a.`assignment_id`, a.`assignment_title` \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `assignments` a\n\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN `assignment_contacts`\tb\n\t\t\t\t\t\t\t\t\t\t\t\t\tON a.`assignment_id` = b.`assignment_id`\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE a.`assessment_id` = " . $db->qstr($result["assessment_id"]) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND b.`proxy_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND a.`assignment_active` = 1"; $assignment_contact = $db->GetRow($query); if ($assignment_contact || $ENTRADA_ACL->amIAllowed(new CourseContentResource($course_details["course_id"], $course_details["organisation_id"]), "update")) { $count++; $total_grade_weight += $result["grade_weighting"]; $url = ENTRADA_URL . "/admin/gradebook/assessments?section=grade&id=" . $COURSE_ID . "&assessment_id=" . $result["assessment_id"]; echo "<tr id=\"assessment-" . $result["assessment_id"] . "\" class=\"assessment\">"; if ($ENTRADA_ACL->amIAllowed("gradebook", "delete", false)) {