// Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Delete the response from the teacher + all comments * * @package assignfeedback_pdf * @copyright 2014 Davo Smith * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once dirname(__FILE__) . '/../../../../config.php'; global $DB, $PAGE, $CFG; require_once $CFG->dirroot . '/mod/assign/locallib.php'; require_once $CFG->dirroot . '/mod/assign/submission/pdf/lib.php'; $id = required_param('id', PARAM_INT); $submissionid = required_param('submissionid', PARAM_INT); $returnparams = required_param('returnparams', PARAM_TEXT); $cm = get_coursemodule_from_id('assign', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $url = new moodle_url('/mod/assign/feedback/pdf/delete.php', array('id' => $id, 'submissionid' => $submissionid, 'returnparams' => $returnparams)); $PAGE->set_url($url); require_login($course, false, $cm); $context = context_module::instance($cm->id); $assignment = new assign($context, $cm, $course); $feedbackpdf = new assign_feedback_pdf($assignment, 'feedback_pdf'); $submission = $DB->get_record('assign_submission', array('id' => $submissionid, 'assignment' => $assignment->get_instance()->id), '*', MUST_EXIST); $feedbackpdf->delete_feedback($submission);
$returnparams = optional_param('returnparams', null, PARAM_TEXT); $url = new moodle_url('/mod/assign/feedback/pdf/editcomment.php', array('submissionid' => $submissionid, 'pageno' => $pageno, 'id' => $id)); if (!is_null($rownum)) { $url->param('rownum', $rownum); } if (!is_null($returnparams)) { $url->param('returnparams', $returnparams); } $cm = get_coursemodule_from_id('assign', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $PAGE->set_url($url); require_login($course, false, $cm); $context = context_module::instance($cm->id); require_capability('mod/assign:grade', $context); $assignment = new assign($context, $cm, $course); $feedbackpdf = new assign_feedback_pdf($assignment, 'feedback_pdf'); if ($action == 'showprevious') { $feedbackpdf->show_previous_comments($submissionid); } else { if ($action == 'showpreviouspage') { $feedbackpdf->edit_comment_page($submissionid, $pageno, false); } else { if ($action == 'clearcache') { $feedbackpdf->clear_image_cache($submissionid, optional_param('nextaction', null, PARAM_ALPHA)); } else { if ($action == 'browseimages') { $feedbackpdf->browse_images($submissionid, $pageno); } else { $feedbackpdf->edit_comment_page($submissionid, $pageno); } }
// Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Handle AJAX requests for updating / viewing annotations * * @subpackage assignfeedback_pdf * @copyright 2012 Davo Smith * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ define('AJAX_SCRIPT', true); require_once dirname(__FILE__) . '/../../../../config.php'; global $CFG, $PAGE, $DB; require_once $CFG->dirroot . '/mod/assign/locallib.php'; require_once $CFG->dirroot . '/mod/assign/submission/pdf/lib.php'; $id = required_param('id', PARAM_INT); $submissionid = required_param('submissionid', PARAM_INT); $pageno = required_param('pageno', PARAM_INT); $url = new moodle_url('/mod/assign/feedback/pdf/updatecomment.php', array('id' => $id, 'submissionid' => $submissionid, 'pageno' => $pageno)); $cm = get_coursemodule_from_id('assign', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $PAGE->set_url($url); require_login($course, false, $cm); $context = context_module::instance($cm->id); $assignment = new assign($context, $cm, $course); $submissionpdf = new assign_feedback_pdf($assignment, 'feedback_pdf'); $submissionpdf->update_comment_page($submissionid, $pageno);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once dirname(__FILE__) . '/../../../../config.php'; global $CFG, $DB, $PAGE, $USER; require_once $CFG->dirroot . '/mod/assign/locallib.php'; require_once $CFG->dirroot . '/mod/assign/submission/pdf/lib.php'; $id = required_param('id', PARAM_INT); $submissionid = optional_param('submissionid', 0, PARAM_INT); $pageno = optional_param('pageno', 1, PARAM_INT); $url = new moodle_url('/mod/assign/feedback/pdf/viewcomment.php', array('submissionid' => $submissionid, 'pageno' => $pageno, 'id' => $id)); $cm = get_coursemodule_from_id('assign', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $PAGE->set_url($url); require_login($course, false, $cm); $context = context_module::instance($cm->id); $assignment = new assign($context, $cm, $course); $feedbackpdf = new assign_feedback_pdf($assignment, 'feedback_pdf'); // Check the user has the relevant capability to access this assignment submission. if ($submissionid) { $submission = $DB->get_record('assign_submission', array('id' => $submissionid), '*', MUST_EXIST); } else { if ($assignment->get_instance()->teamsubmission) { $submission = $assignment->get_group_submission($USER->id, 0, false); } else { $submission = $assignment->get_user_submission($USER->id, false); } } if (!$submission) { print_error('nosubmission', 'assignfeedback_pdf'); } $feedbackpdf->edit_comment_page($submission->id, $pageno, false);