From: moodler Date: Wed, 23 Apr 2008 09:33:54 +0000 (+0000) Subject: MDL-14493 First checkin of Feedback module into HEAD. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c70ad9f736d6e6ea8b0b3afbe17f333eb3c55fa5;p=moodle.git MDL-14493 First checkin of Feedback module into HEAD. I made a number of small tidy-ups to the contrib version before adding this here: - fixed some language string names - renamed a capability from deletecompleteds to deletesubmissions (can we use "submissions" everywhere?) - got rid of language packs (moved english to correct location) - deleted 'pics' type (it needs to be rewritten to use user files in moodledata) - moved changelog into README.txt - moved captcha font out of subdir - bumped version to today Thanks very much to Andreas Grabs for all your work on this module so far, and congratulations! :-) --- diff --git a/lang/en_utf8/feedback.php b/lang/en_utf8/feedback.php new file mode 100644 index 0000000000..7e56e7f813 --- /dev/null +++ b/lang/en_utf8/feedback.php @@ -0,0 +1,177 @@ +username has completed feedback activity : \'$a->feedback\' + +You can view it here: + +$a->url'; +$string['emailteachermailhtml'] = '$a->username has completed feedback activity : \'$a->feedback\'

+You can view it url\">here.'; +$string['entries_saved'] = 'Your answers have been saved. Thank you.'; +$string['export_questions'] = 'Export questions'; +$string['export_to_excel'] = 'Export to Excel'; +$string['feedback:complete'] = 'Complete a feedback'; +$string['feedback:createprivatetemplate'] = 'Create private template'; +$string['feedback:createpublictemplate'] = 'Create public template'; +$string['feedback:deletesubmissions'] = 'Delete completed submissions'; +$string['feedback:deletetemplate'] = 'Delete template'; +$string['feedback:edititems'] = 'Edit items'; +$string['feedback:mapcourse'] = 'Map courses to global feedbacks'; +$string['feedback:view'] = 'View a feedback'; +$string['feedback:viewreports'] = 'View reports'; +$string['feedback_is_not_open'] = 'The feedback is not open'; +$string['feedback_options'] = 'Feedback options'; +$string['feedbackclose'] = 'Close the feedback at'; +$string['feedbackcloses'] = 'Feedback closes'; +$string['feedbackopen'] = 'Open the feedback at'; +$string['feedbackopens'] = 'Feedback opens'; +$string['file'] = 'File'; +$string['filter_by_course'] = 'Filter by course'; +$string['handling_error']='Error occurred in feedback module action handling'; +$string['horizontal']='horizontal'; +$string['insufficient_responses_for_this_group'] = 'There are insufficient responses for this group';$string['import_questions'] = 'Import questions'; +$string['importfromthisfile'] = 'Import from this file'; +$string['import_successfully'] = 'Import successfully'; +$string['item_name'] = 'Question'; +$string['items_are_required'] = 'Answers are required to starred questions.'; +$string['label'] = 'Label'; +$string['line_labels'] = 'Label'; +$string['line_values'] = 'Rating'; +$string['mapcourse'] = 'Map course'; +$string['mapcourses'] = 'Map feedback to courses'; +$string['mapcourseinfo'] = 'This is a sitewide feedback that is available to all courses using the feedback block. You can however limit the courses to which it will appear by mapping them. Search the course and map it to this feedback.'; +$string['mapcoursenone'] = 'No courses mapped. Feedback available to all courses'; +$string['mappedcourses'] = 'Mapped courses'; +$string['max_args_exceeded'] = 'Max 6 arguments can be handled, too many arguments for'; +$string['maximal'] = 'maximal'; +$string['mode'] = 'Mode'; +$string['modulename'] = 'Feedback'; +$string['modulenameplural'] = 'Feedback'; +$string['move_item'] = 'Move this question'; +$string['movedown_item'] = 'Move this question down'; +$string['move_here'] = 'Move here'; +$string['moveup_item'] = 'Move this question up'; +$string['multiple_submit'] = 'Multiple submit'; +$string['name'] = 'Name'; +$string['name_required'] = 'Name required'; +$string['next_page'] = 'Next page'; +$string['no_handler']='No action handler exists for'; +$string['no_itemname'] = 'No itemname'; +$string['no_items_available_yet'] = 'No questions have been set up yet'; +$string['no_templates_available_yet'] = 'No templates available yet'; +$string['non_anonymous'] = 'User\'s name will be logged and shown with answers'; +$string['non_anonymous_entries'] = 'non anonymous entries'; +$string['not_completed_yet'] = 'Not completed yet'; +$string['not_selected'] = 'Not selected'; +$string['numeric'] = 'Numeric answer'; +$string['numeric_range_from'] = 'Range from'; +$string['numeric_range_to'] = 'Range to'; +$string['of'] = 'of'; +$string['overview'] = 'Overview'; +$string['page'] = 'Page'; +$string['page_after_submit'] = 'Page after submit'; +$string['pagebreak']='Page break'; +$string['parameters_missing']='Parameters missing from'; +$string['picture_file_list'] = 'List of pictures'; +$string['picture_values'] = 'Choose one or more
picture files from the list:'; +$string['picture'] = 'Picture'; +$string['position'] = 'Position'; +$string['preview'] = 'Preview'; +$string['previous_page'] = 'Previous page'; +$string['public'] = 'Public'; +$string['publish_stats_on_students'] = 'Show analysis to students'; +$string['question'] = 'Question'; +$string['questions'] = 'Questions'; +$string['radio'] = 'Multiple choice - single answer';; +$string['radio_values'] = 'Responses'; +$string['radiobutton'] = 'Multiple choice - single answer allowed (radio buttons)';; +$string['radiobutton_rated'] = 'Radiobutton (rated)'; +$string['radiorated'] = 'Radiobutton (rated)'; +$string['ready_feedbacks'] = 'Ready feedbacks'; +$string['required'] = 'Required'; +$string['resetting_data'] = 'Reset feedback responses'; +$string['resetting_feedbacks'] = 'Resetting feedbacks'; +$string['response_nr'] = 'Response Nr.'; +$string['responses'] = 'Responses'; +$string['save_as_new_template'] = 'Save as new template'; +$string['save_entries'] = 'Submit your answers'; +$string['save_item'] = 'Save question'; +$string['saving_failed'] = 'Saving failed'; +$string['saving_failed_because_missing_or_false_values'] = 'Saving failed because missing or false values'; +$string['search_course'] = 'Search course'; +$string['selected_dump']='Selected indexes of \$SESSION variable are dumped below:'; +$string['separator_decimal'] = '.'; +$string['separator_thousand'] = ','; +$string['show_all'] = 'Show all'; +$string['show_entries'] = 'Show responses'; +$string['show_entry'] = 'Show response'; +$string['sort_by_course'] = 'Sort by course'; +$string['start'] = 'Start'; +$string['stop'] = 'End'; +$string['switch_group'] = 'Switch group'; +$string['switch_item_to_not_required'] = 'switch to: answer not required'; +$string['switch_item_to_required'] = 'switch to: answer required'; +$string['template'] = 'Template'; +$string['template_saved'] = 'Template saved'; +$string['templates'] = 'Templates'; +$string['textarea'] = 'Longer text answer'; +$string['textarea_height'] = 'Number of lines'; +$string['textarea_width'] = 'Width'; +$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['update_item'] = 'Save changes to question'; +$string['use_one_line_for_each_value'] = '
Use one line for each answer!'; +$string['use_this_template'] = 'Use this template'; +$string['using_templates'] = 'Use a template'; +$string['vertical'] = 'vertical'; + +?> diff --git a/mod/feedback/README.txt b/mod/feedback/README.txt new file mode 100644 index 0000000000..b0df9b5397 --- /dev/null +++ b/mod/feedback/README.txt @@ -0,0 +1,211 @@ +Feedback-Module +=============== +Overview +-------- +The Feedback-Module is intended to create individual surveys in an easy way. + +This module consists of two parts +a) the "activity" feedback (required) +b) the "sideblock" feedback (optional) + +The activity is the main part an can run without the block. Here you can create, fill out or analyse the surveys. +The sideblock is an optional part. It works as a bridge between different courses and +an central placed feedback-activity. So you can create one feedback on the main site of moodle and then publish +it in many courses. + +Requirements +------------ +Moodle 1.9 or later + +Installation +------------ + The zip-archive includes the same directory hierarchy as moodle + So you only have to copy the files to the correspondent place. + copy the folder feedback.zip/mod/feedback --> moodle/mod/feedback + and the folder feedback.zip/blocks/feedback --> moodle/blocks/feedback + The langfiles normaly can be left into the folder mod/feedback/lang. + The only exception is the feedback-block. The langfile is block_feedback.php and + have to be copied into the correspondent lang folder of moodle/moodledata. + All languages should be encoded with utf8. + +After it you have to run the admin-page of moodle (http://your-moodle-site/admin) +in your browser. You have to loged in as admin before. +The installation process will be displayed on the screen. +That's all. + +using the block-feature +----------------------- + 1. create one or more new feedback-activitys on the moodle main-site + 2. go into some course and enable the feedback-block. This block now shows the feedbacks from the main-site. + 3. login as student and go into the course where the feedback-block is enabled + 4. fill out the feedback chosen from block + 5. login as admin and look at the feedback you created above + 6. now you can analyse the answers over the courses + +good luck + + + + + +CHANGELOG +========= + +04.04.2008 +- the heading has not supported multilang strings + +03.04.2008 +- anonymous feedback was send the userid on email-notification + (http://tracker.moodle.org/browse/CONTRIB-355) +- users can not see the own values if there are chars like single-(') or doublequotas (") + +08.03.2008 +- admin users now respect capability-setting + (http://tracker.moodle.org/browse/CONTRIB-321) + +17.12.2007 +- resolved issue http://tracker.moodle.org/browse/CONTRIB-231 + +03.12.2007 +- changing the table feedback_template, field public -> ispublic, public is reserved in oracle +- resolved issue http://tracker.moodle.org/browse/CONTRIB-95 + +16.09.2007 +- changing access.php, removed the lines with coursecreator, added some RISK_xxx +- removed the check of legacy roles on has_capability() +- coursesearch now use unicode characters + +13.09.2007 +- updated edit.php to make the output more xhtml 1.0 strict like + +11.09.2007 +- Update feedback settings has help showing wrongly +- Menu on "Add question to activity" should be sorted alphabetically +- missing "Add Pagebreak" is now at the item-list +- no hardcoded css +- use new print_header() (note it only is available on moodle 1.9!!!) +- missing sesskey checks in feedback +- uninitialised $filename when importing into feedback + +31.07.2007 +- fixed bug with missing numbers after xml Question-Import. + +29.07.2007 +- added "require_course_login()" in view.php +- added missing langstring "no_itemname" + +25.07.2007 +- now defined in applicable_formats() to hide the block in moodle My-Site + +07.07.2007 +- all functions in lib.php now are with comments in phpdoc-style +- removed all depricated function-calls +- some code-styling changes (http://docs.moodle.org/en/Coding) + +06.07.2007 +- Adding some missing lang-strings +- fixing some notice-messages with $SESSION-lstgroupid +- excelexport now uses the localwincharset from langconfig.php + Now it is possible to export excel with utf8. But to many data will crash the excel + file. If the excefile crashes so you switch to latin-export in lang-settings +- adding the default permission CAP_ALLOW to the legacy-role:user for the capabilities view and complete + +24.06.2007 +- fixed excel-problem with tempfiles +- added new field "idnumber" into excel detailed report + +21.06.2007 +- better support for xhtml + +09.05.2007 +- items now are classes +- most of forms use formslib +- gui now uses tabs +- new item "captcha" +Now it only runs on Moodle 1.8 or later + +09.05.2007 +- added two columns (random_response,anonymous_response) to feedback_complete and feedback_complete_tmp +- userids now will be logged even if the feedback is anonymous so you now can filter by group +- excelexport now use pear so cell-values can be greater then 255 chars +- logs now include the cm->id + +16.01.2007 +- the installation now uses the install.xml +- roles are full implemented +- now radiobuttons and checkboxes can be aligned horizontally or vertically +- now you can insert pagebreakes +- a feedback what is switch to the next page is saved temporary. the user can cancel the completion and later continue at the last filled page. +- now you can ex-/import feedbacks into/from a xml-file +- course-reseting is supported + +01.01.2007 +happy new year! + +14.09.2006 21:22 +improve the layout of analysis (thanks to Katja Krueger) + +02.06.2006 21:22 +several bugfixes +improve the block "feedback" + +20.05.2006 01:00 +adding the block "feedback" to publish feedback over all courses +Thanks to Jun Yamog! + +21.04.2006 16:00 +version 2006042102 +adding moving behavior like moodle activities +adding a dropdownlist on create/update item page to adjust the position + +21.04.2006 16:00 +version 2006042101 +prefixed all function-names like "feedback_" +fixed security issues (e.g. optional_variable() >> optional_param()) +improve group-feature + +03.01.2006 16:00 +Added "addslashes" and "stripslashes_safe" for preserving (') + +03.10.2005 13:00 +action handling error recovery improved (failed when debug=false) +function feedback_action_handler() argument list changed +added action handler debug modes: silent, normal, verbose + +30.09.2005 00:00 +version 2005300900 +action handling functions added +picture item (an example for action handling added) +XHTML compliance improved +number of PHP Notify-level errors reduced +source code transferred to CVS + +14.09.2005 00:20 +fixed problem with restoring +new feature user-tracking (prevent multiple_submit) +new feature deleting of some completeds + +22.08.2005 19:12 +fixed problem with secureforms-option + +16.08.2005 14:07 +fixed html-syntax in edit.php + +12.08.2005 21:38 +fixed problem with IE +If feedback is not anonym now guest is it not allowed to fill it out + +11.08.2005 22:00 +added email-notification +anonymous feedbacks can be filled out by anonymous users + +03.08.2005 01:20 +item specific functions were moved into the items-librarys +now developers can create individual feedback-items +javascript based filling-control was replaced by php-based control + +version = 2005072000 +20.07.2005 01:09 +adding group-ability +fixed missing bcmod()-Function-Problem +fixed referer-problem under https diff --git a/mod/feedback/TODO.txt b/mod/feedback/TODO.txt new file mode 100644 index 0000000000..5c1347c33c --- /dev/null +++ b/mod/feedback/TODO.txt @@ -0,0 +1,6 @@ +- items use formslib +- structured Numbering and switching visible or not +- printview +- css +- the email displays the completed feedback +- diff --git a/mod/feedback/analysis.php b/mod/feedback/analysis.php new file mode 100644 index 0000000000..a48a622c0b --- /dev/null +++ b/mod/feedback/analysis.php @@ -0,0 +1,161 @@ +feedback->current_tab = 'analysis'; + $current_tab = 'analysis'; + + $id = required_param('id', PARAM_INT); //the POST dominated the GET + $courseid = optional_param('courseid', false, PARAM_INT); + $lstgroupid = optional_param('lstgroupid', -2, PARAM_INT); //groupid (aus der Listbox gewaehlt) + + //check, whether a group is selected + if($lstgroupid == -1) { + $SESSION->feedback->lstgroupid = false; + }else { + if((!isset($SESSION->feedback->lstgroupid)) || $lstgroupid != -2) + $SESSION->feedback->lstgroupid = $lstgroupid; + } + + if ($id) { + if (! $cm = get_coursemodule_from_id('feedback', $id)) { + error("Course Module ID was incorrect"); + } + + if (! $course = get_record("course", "id", $cm->course)) { + error("Course is misconfigured"); + } + + if (! $feedback = get_record("feedback", "id", $cm->instance)) { + error("Course module is incorrect"); + } + } + + if(isset($SESSION->feedback->lstgroupid)) { + if($tmpgroup = groups_get_group($SESSION->feedback->lstgroupid)) { + if($tmpgroup->courseid != $course->id) { + $SESSION->feedback->lstgroupid = false; + } + }else { + $SESSION->feedback->lstgroupid = false; + } + } + $capabilities = feedback_load_capabilities($cm->id); + + require_login($course->id); + + if( !( (intval($feedback->publish_stats) == 1) || $capabilities->viewreports)) { + error(get_string('error')); + } + + /// Print the page header + $strfeedbacks = get_string("modulenameplural", "feedback"); + $strfeedback = get_string("modulename", "feedback"); + $buttontext = update_module_button($cm->id, $course->id, $strfeedback); + + $navlinks = array(); + $navlinks[] = array('name' => $strfeedbacks, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($feedback->name), 'link' => "", 'type' => 'activityinstance'); + + $navigation = build_navigation($navlinks); + + print_header_simple(format_string($feedback->name), "", + $navigation, "", "", true, $buttontext, navmenu($course, $cm)); + + /// print the tabs + include('tabs.php'); + + + //print analysed items + // print_simple_box_start("center", '80%'); + print_box_start('generalbox boxaligncenter boxwidthwide'); + + //get the groupid + //lstgroupid is the choosen id + $mygroupid = $SESSION->feedback->lstgroupid; + + if( $capabilities->viewreports ) { + + //available group modes (NOGROUPS, SEPARATEGROUPS or VISIBLEGROUPS) + $feedbackgroups = get_groups($course->id); + //get the effective groupmode of this course and module + $groupmode = groupmode($course, $cm); + if(is_array($feedbackgroups) && $groupmode > 0){ + require_once('choose_group_form.php'); + //the use_template-form + $choose_group_form = new feedback_choose_group_form(); + $choose_group_form->set_feedbackdata(array('groups'=>$feedbackgroups, 'mygroupid'=>$mygroupid)); + $choose_group_form->set_form_elements(); + $choose_group_form->set_data(array('id'=>$id, 'lstgroupid'=>$SESSION->feedback->lstgroupid)); + $choose_group_form->display(); + } + + //button "export to excel" + //echo '
'; + // echo '