mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
"MDL-14129, fixed hardcoded print_error in feedback module"
This commit is contained in:
parent
a6344df49a
commit
5d2edd1ce9
@ -197,6 +197,7 @@ $string['duplicateparaminsql'] = 'ERROR: duplicate parameter name in query';
|
||||
$string['duplicaterolename'] = 'There is already a role with this name!';
|
||||
$string['duplicateroleshortname'] = 'There is already a role with this short name!';
|
||||
$string['emailfail'] = 'Emailing failed';
|
||||
$string['error'] = 'Error occured';
|
||||
$string['errorcleaningdirectory'] = 'Error cleaning directory \"$a\"';
|
||||
$string['errorcopyingfiles'] = 'Error copying files';
|
||||
$string['errorcreatingdirectory'] = 'Error creating directory \"$a\"';
|
||||
@ -320,6 +321,7 @@ $string['needphpext'] = 'You need to add $a support to your PHP installation';
|
||||
$string['needcopy'] = 'You need to copy something first!';
|
||||
$string['needcoursecategroyid'] = 'Either course id or category must be specified';
|
||||
$string['noblocks'] = 'No blocks found!';
|
||||
$string['nodata'] = 'No data';
|
||||
$string['noformdesc'] = 'No formslib form description file found for this activity.';
|
||||
$string['nocategorydelete'] = 'Category \'$a\' cannot be deleted!';
|
||||
$string['nocontext'] = 'Sorry, but that course is not a valid context';
|
||||
|
@ -20,6 +20,8 @@ $string['confirmdeletetemplate'] = 'Are you sure you want to delete this templat
|
||||
$string['confirmusetemplate'] = 'Are you sure you want to use this template?';
|
||||
$string['average'] = 'Average';
|
||||
$string['bold'] = 'Bold';
|
||||
$string['cannotmapfeedback'] = 'Database problem, unable to map feedback to course';
|
||||
$string['cannotsavetempl'] = 'saving templates is not allowed';
|
||||
$string['cancel_moving'] = 'Cancel moving';
|
||||
$string['captcha'] = 'Captcha';
|
||||
$string['check_values'] = 'Possible responses';
|
||||
@ -70,6 +72,7 @@ $string['feedback:view'] = 'View a feedback';
|
||||
$string['feedback:viewanalysepage'] = 'View the analysepage after submit';
|
||||
$string['feedback:viewreports'] = 'View reports';
|
||||
$string['feedback_is_not_open'] = 'The feedback is not open';
|
||||
$string['feedback_is_not_for_anonymous'] = 'feedback is not for anonymous';
|
||||
$string['feedback_options'] = 'Feedback options';
|
||||
$string['feedbackclose'] = 'Close the feedback at';
|
||||
$string['feedbackcloses'] = 'Feedback closes';
|
||||
@ -179,6 +182,7 @@ $string['textfield'] = 'Short text answer';
|
||||
$string['textfield_maxlength'] = 'Maximum characters accepted';
|
||||
$string['textfield_size'] = 'Textfield width';
|
||||
$string['this_feedback_is_already_submitted'] = 'You\'ve already completed this activity.';
|
||||
$string['typemissing'] = 'missing value \"type\"';
|
||||
$string['update_item'] = 'Save changes to question';
|
||||
$string['use_one_line_for_each_value'] = '<br />Use one line for each answer!';
|
||||
$string['use_this_template'] = 'Use this template';
|
||||
|
@ -23,7 +23,7 @@
|
||||
$highlightrequired = false;
|
||||
|
||||
if(($formdata = data_submitted()) AND !confirm_sesskey()) {
|
||||
error('no sesskey defined');
|
||||
print_error('invalidsesskey');
|
||||
}
|
||||
|
||||
//if the use hit enter into a textfield so the form should not submit
|
||||
@ -46,7 +46,7 @@
|
||||
$gonextpage = false;
|
||||
$gopreviouspage = true;
|
||||
}else {
|
||||
error('parameter (gopage) required');
|
||||
print_error('parameters_missing', 'feedback');
|
||||
}
|
||||
}else {
|
||||
$gonextpage = $gopreviouspage = false;
|
||||
@ -55,15 +55,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,12 +73,12 @@
|
||||
if($feedback->anonymous == FEEDBACK_ANONYMOUS_YES) {
|
||||
$capabilities->complete = true;
|
||||
}else {
|
||||
error(get_string('feedback_is_not_for_anonymous'));
|
||||
print_error('feedback_is_not_for_anonymous', 'feedback');
|
||||
}
|
||||
|
||||
//check whether the user has a session
|
||||
if(!isset($USER->sesskey) OR !$USER->sesskey) {
|
||||
error('error');
|
||||
print_error('error');
|
||||
}
|
||||
|
||||
//check whether the feedback is located and! started from the mainsite
|
||||
@ -95,7 +95,7 @@
|
||||
}
|
||||
|
||||
if(!$capabilities->complete) {
|
||||
error(get_string('error'));
|
||||
print_error('error');
|
||||
}
|
||||
|
||||
|
||||
@ -144,7 +144,9 @@
|
||||
if($feedback_can_submit) {
|
||||
//preserving the items
|
||||
if($preservevalues == 1){
|
||||
if(!$SESSION->feedback->is_started == true)error('error', $CFG->wwwroot.'/course/view.php?id='.$course->id);
|
||||
if (!$SESSION->feedback->is_started == true) {
|
||||
print_error('error', 'error', $CFG->wwwroot.'/course/view.php?id='.$course->id);
|
||||
}
|
||||
//check, if all required items have a value
|
||||
if(feedback_check_values($_POST, $startitempos, $lastitempos)) {
|
||||
$userid = $USER->id; //arb
|
||||
@ -158,7 +160,7 @@
|
||||
if(isset($lastpage)) {
|
||||
$gopage = $lastpage;
|
||||
}else {
|
||||
error('parameter failed');
|
||||
print_error('parameters_missing', 'feedback');
|
||||
}
|
||||
}
|
||||
}else {
|
||||
@ -167,7 +169,7 @@
|
||||
if(isset($lastpage)) {
|
||||
$gopage = $lastpage;
|
||||
}else {
|
||||
error('parameter failed');
|
||||
print_error('parameters_missing', 'feedback');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,20 +16,20 @@
|
||||
$completedid = optional_param('completedid', 0, PARAM_INT);
|
||||
|
||||
if($completedid == 0){
|
||||
error(get_string('no_complete_to_delete', 'feedback'), 'show_entries.php?id='.$id.'&do_show=showentries');
|
||||
print_error('no_complete_to_delete', 'feedback', 'show_entries.php?id='.$id.'&do_show=showentries');
|
||||
}
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
$capabilities = feedback_load_capabilities($cm->id);
|
||||
@ -37,7 +37,7 @@
|
||||
require_login($course->id, true, $cm);
|
||||
|
||||
if(!$capabilities->deletesubmissions){
|
||||
error(get_string('error'));
|
||||
print_error('error');
|
||||
}
|
||||
|
||||
$mform = new mod_feedback_delete_completed_form();
|
||||
|
@ -17,15 +17,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
$capabilities = feedback_load_capabilities($cm->id);
|
||||
@ -33,7 +33,7 @@
|
||||
require_login($course->id, true, $cm);
|
||||
|
||||
if(!$capabilities->edititems){
|
||||
error(get_string('error'));
|
||||
print_error('error');
|
||||
}
|
||||
|
||||
$mform = new mod_feedback_delete_item_form();
|
||||
|
@ -22,7 +22,7 @@
|
||||
// $formdata = data_submitted();
|
||||
|
||||
if(($formdata = data_submitted()) AND !confirm_sesskey()) {
|
||||
error('no sesskey defined');
|
||||
print_error('invalidsesskey');
|
||||
}
|
||||
|
||||
if($canceldelete == 1){
|
||||
@ -31,15 +31,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
$capabilities = feedback_load_capabilities($cm->id);
|
||||
@ -47,7 +47,7 @@
|
||||
require_login($course->id, true, $cm);
|
||||
|
||||
if(!$capabilities->deletetemplate){
|
||||
error(get_string('error'));
|
||||
print_error('error');
|
||||
}
|
||||
|
||||
$mform = new mod_feedback_delete_template_form();
|
||||
|
@ -15,7 +15,7 @@
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
if(($formdata = data_submitted()) AND !confirm_sesskey()) {
|
||||
error('no sesskey defined');
|
||||
print_error('invalidsesskey');
|
||||
}
|
||||
|
||||
$do_show = optional_param('do_show', 'edit', PARAM_ALPHA);
|
||||
@ -30,15 +30,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
$capabilities = feedback_load_capabilities($cm->id);
|
||||
@ -46,7 +46,7 @@
|
||||
require_login($course->id, true, $cm);
|
||||
|
||||
if(!$capabilities->edititems){
|
||||
error(get_string('error'));
|
||||
print_error('error');
|
||||
}
|
||||
|
||||
//move up/down items
|
||||
@ -88,7 +88,7 @@
|
||||
if(isset($create_template_formdata->savetemplate) && $create_template_formdata->savetemplate == 1) {
|
||||
//check the capabilities to create templates
|
||||
if(!$capabilities->createprivatetemplate AND !$capabilities->createpublictemplate) {
|
||||
error('saving templates is not allowed');
|
||||
print_error('cannotsavetempl', 'feedback');
|
||||
}
|
||||
if(trim($create_template_formdata->templatename) == '')
|
||||
{
|
||||
|
@ -17,15 +17,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
$capabilities = feedback_load_capabilities($cm->id);
|
||||
@ -33,12 +33,12 @@
|
||||
require_login($course->id, true, $cm);
|
||||
|
||||
if(!$capabilities->edititems){
|
||||
error('this action is not allowed');
|
||||
print_error('invalidaction');
|
||||
}
|
||||
|
||||
if ($action == 'exportfile') {
|
||||
if(!$exportdata = feedback_get_xml_data($feedback->id)) {
|
||||
error('no data');
|
||||
print_error('nodata');
|
||||
}
|
||||
@feedback_send_xml_data($exportdata, 'feedback_'.$feedback->id.'.xml');
|
||||
exit;
|
||||
|
@ -18,7 +18,7 @@
|
||||
$courseid = optional_param('courseid', false, PARAM_INT);
|
||||
|
||||
if(($formdata = data_submitted()) AND !confirm_sesskey()) {
|
||||
error('no sesskey defined');
|
||||
print_error('invalidsesskey');
|
||||
}
|
||||
|
||||
// $SESSION->feedback->current_tab = 'mapcourse';
|
||||
@ -26,15 +26,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
$capabilities = feedback_load_capabilities($cm->id);
|
||||
@ -53,7 +53,7 @@
|
||||
FROM {feedback_sitecourse_map}
|
||||
WHERE feedbackid = ? AND courseid = ?";
|
||||
if (!$DB->get_records_sql($sql, array($map->feedbackid, $map->courseid)) && !$DB->insert_record('feedback_sitecourse_map', $map)) {
|
||||
error("Database problem, unable to map feedback = $feedback->id to course = $course->id");
|
||||
print_error('cannotmapfeedback', 'feedback');
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,4 +142,4 @@
|
||||
|
||||
print_footer($course);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -17,15 +17,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
$capabilities = feedback_load_capabilities($cm->id);
|
||||
@ -33,7 +33,7 @@
|
||||
require_login($course->id, true, $cm);
|
||||
|
||||
if(!$capabilities->edititems){
|
||||
error(get_string('error'));
|
||||
print_error('error');
|
||||
}
|
||||
|
||||
/// Print the page header
|
||||
|
@ -22,15 +22,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
$capabilities = feedback_load_capabilities($cm->id);
|
||||
@ -38,7 +38,7 @@
|
||||
require_login($course->id, true, $cm);
|
||||
|
||||
if(!$capabilities->edititems){
|
||||
error(get_string('error'));
|
||||
print_error('error');
|
||||
}
|
||||
|
||||
$mform = new mod_feedback_use_templ_form();
|
||||
|
@ -18,15 +18,15 @@
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_coursemodule_from_id('feedback', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) {
|
||||
error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
if($course->id == SITEID AND !$capabilities->edititems) {
|
||||
if($DB->get_records('feedback_sitecourse_map', array('feedbackid'=>$feedback->id))) {
|
||||
if(!$DB->get_record('feedback_sitecourse_map', array('feedbackid'=>$feedback->id, 'courseid'=>$courseid))){
|
||||
error("this feedback is not available");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -70,7 +70,7 @@
|
||||
require_course_login($course2); //this overwrites the object $course :-(
|
||||
$course = $DB->get_record("course", array("id"=>$cm->course)); // the workaround
|
||||
}else {
|
||||
error("courseid is not correct");
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user