Skip to content

Commit

Permalink
rating MDL-23933 Removed a bunch of no longer used strings and moved …
Browse files Browse the repository at this point in the history
…rating strings into the rating lang file.

AMOS BEGIN
 MOV [couldnotdeleteratings,mod_forum],[couldnotdeleteratings,core_rating]
 MOV [aggregatenone,mod_forum],[aggregatenone,core_rating]
 MOV [aggregateavg,mod_forum],[aggregateavg,core_rating]
 MOV [aggregatecount,mod_forum],[aggregatecount,core_rating]
 MOV [aggregatemax,mod_forum],[aggregatemax,core_rating]
 MOV [aggregatemin,mod_forum],[aggregatemin,core_rating]
 MOV [aggregatesum,mod_forum],[aggregatesum,core_rating]
AMOS END
  • Loading branch information
Andrew Davis committed Sep 17, 2010
1 parent d7eeb39 commit 07f05a0
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 113 deletions.
11 changes: 9 additions & 2 deletions lang/en/rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
*/

$string['aggregatetype'] = 'Aggregate type';
$string['aggregateavg'] = 'Average of ratings';
$string['aggregatecount'] = 'Count of ratings';
$string['aggregatemax'] = 'Maximum rating';
$string['aggregatemin'] = 'Minimum rating';
$string['aggregatenone'] = 'No ratings';
$string['aggregatesum'] = 'Sum of ratings';
$string['aggregatetype_help'] = 'The aggregate type defines how ratings are combined to form the final grade in the gradebook.
* Average of ratings - The mean of all ratings
Expand All @@ -35,9 +41,10 @@
If "No ratings" is selected, then the activity will not appear in the gradebook.';
$string['allowratings'] = 'Allow items to be rated?';
$string['capabilitychecknotavailable'] = 'Capability check not available until activity is saved';
$string['couldnotdeleteratings'] = 'Sorry, that cannot be deleted as people have already rated it';
$string['norate'] = 'Rating of items not allowed!';
$string['noviewanyrate'] = 'You can only look at results for posts that you made';
$string['noviewrate'] = 'You do not have the capability to view post ratings';
$string['noviewanyrate'] = 'You can only look at results for items that you made';
$string['noviewrate'] = 'You do not have the capability to view item ratings';
$string['rate'] = 'Rate';
$string['ratepermissiondenied'] = 'You do not have permission to rate this item';
$string['rating'] = 'Rating';
Expand Down
10 changes: 5 additions & 5 deletions lib/outputrenderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1402,19 +1402,19 @@ function render_rating(rating $rating) {
$aggregatelabel = '';
switch ($rating->settings->aggregationmethod) {
case RATING_AGGREGATE_AVERAGE :
$aggregatelabel .= get_string("aggregateavg", "forum");
$aggregatelabel .= get_string("aggregateavg", "rating");
break;
case RATING_AGGREGATE_COUNT :
$aggregatelabel .= get_string("aggregatecount", "forum");
$aggregatelabel .= get_string("aggregatecount", "rating");
break;
case RATING_AGGREGATE_MAXIMUM :
$aggregatelabel .= get_string("aggregatemax", "forum");
$aggregatelabel .= get_string("aggregatemax", "rating");
break;
case RATING_AGGREGATE_MINIMUM :
$aggregatelabel .= get_string("aggregatemin", "forum");
$aggregatelabel .= get_string("aggregatemin", "rating");
break;
case RATING_AGGREGATE_SUM :
$aggregatelabel .= get_string("aggregatesum", "forum");
$aggregatelabel .= get_string("aggregatesum", "rating");
break;
}

Expand Down
16 changes: 0 additions & 16 deletions mod/data/lang/en/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
$string['addentries'] = 'Add entries';
$string['addtemplate'] = 'Add template';
$string['advancedsearch'] = 'Advanced search';
$string['allowratings'] = 'Allow posts to be rated?';
$string['alttext'] = 'Alternative text';
$string['approve'] = 'Approve';
$string['approved'] = 'Approved';
Expand All @@ -55,7 +54,6 @@
$string['cannotaccesspresentsother'] = 'You are not allowed to access presets from other users';
$string['cannotadd'] = 'Can not add entries!';
$string['cannotdeletepreset'] = 'Error deleting a preset!';
$string['cannotrate'] = 'Rating of items not allowed!';
$string['cannotunziptopreset'] = 'Cannot unzip to the preset directory';
$string['columns'] = 'columns';
$string['comment'] = 'Comment';
Expand Down Expand Up @@ -159,7 +157,6 @@
$string['fromfile'] = 'Import from zip file';
$string['fromfile_help'] = 'The import from zip file feature allows you to browse for and upload a preset zip of templates and fields.';
$string['generateerror'] = 'Not all files generated!';
$string['guestrate'] = 'Guests are not allowed to rate entries.';
$string['header'] = 'Header';
$string['headeraddtemplate'] = 'Defines the interface when editing entries';
$string['headerasearchtemplate'] = 'Defines the interface for Advanced Searches';
Expand All @@ -182,8 +179,6 @@
$string['invalidfieldtype'] = 'Field Type is incorrect';
$string['invalidid'] = 'Incorrect data ID';
$string['invalidpreset'] = '{$a} is not a preset.';
$string['invalidrate'] = 'Invalid database rate ({$a})';
$string['invalidratedata'] = 'Incorrect submitted ratings data';
$string['invalidrecord'] = 'Incorrect record';
$string['invalidurl'] = 'The URL you just entered is not valid';
$string['jstemplate'] = 'Javascript template';
Expand Down Expand Up @@ -239,7 +234,6 @@
$string['nolisttemplate'] = 'List template is not yet defined';
$string['nomatch'] = 'No matching entries found!';
$string['nomaximum'] = 'No maximum';
$string['norating'] = 'This activity does not use ratings';
$string['norecords'] = 'No entries in database';
$string['nosingletemplate'] = 'Single template is not yet defined';
$string['notapproved'] = 'Entry is not approved yet.';
Expand All @@ -266,15 +260,6 @@
$string['presetinfo'] = 'Saving as a preset will publish this template. Other users may be able to use it in their databases.';
$string['presets'] = 'Presets';
$string['radiobutton'] = 'Radio buttons';
$string['rate'] = 'Rate';
$string['rating'] = 'Rating';
$string['ratingeveryone'] = 'Everyone can rate posts';
$string['ratingno'] = 'No ratings';
$string['ratingonlyteachers'] = 'Only {$a} can rate posts';
$string['ratingpublic'] = '{$a} can see everyone\'s ratings';
$string['ratingpublicnot'] = '{$a} can only see their own ratings';
$string['ratings'] = 'Ratings';
$string['ratingssaved'] = 'Ratings saved';
$string['recordapproved'] = 'Entry approved';
$string['recorddeleted'] = 'Entry deleted';
$string['recordsnotsaved'] = 'No entry was saved. Please check the format of the uploaded file.';
Expand Down Expand Up @@ -305,7 +290,6 @@
$string['savetemplate'] = 'Save template';
$string['search'] = 'Search';
$string['selectedrequired'] = 'All selected required';
$string['sendinratings'] = 'Send in my latest ratings';
$string['showall'] = 'Show all entries';
$string['single'] = 'View single';
$string['singletemplate'] = 'Single template';
Expand Down
37 changes: 0 additions & 37 deletions mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1576,43 +1576,6 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
* @return void Output echo'd
*/
function data_print_ratings($data, $record) {
/*global $USER, $DB, $OUTPUT;
$cm = get_coursemodule_from_instance('data', $data->id);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
if ($data->assessed and isloggedin() and (has_capability('mod/data:rate', $context) or has_capability('mod/data:viewrating', $context) or data_isowner($record->id))) {
if ($ratingsscale = make_grades_menu($data->scale)) {
$ratingsmenuused = false;
echo '<div class="ratings" style="text-align:center">';
echo '<form id="form" method="post" action="rate.php">';
echo '<input type="hidden" name="dataid" value="'.$data->id.'" />';
if (has_capability('mod/data:rate', $context) and !data_isowner($record->id)) {
data_print_ratings_mean($record->id, $ratingsscale, has_capability('mod/data:viewrating', $context));
echo '&nbsp;';
data_print_rating_menu($record->id, $USER->id, $ratingsscale);
$ratingsmenuused = true;
} else {
data_print_ratings_mean($record->id, $ratingsscale, true);
}
if ($data->scale < 0) {
if ($scale = $DB->get_record('scale', array('id'=>abs($data->scale)))) {
echo $OUTPUT->help_icon_scale($data->course, $scale);
}
}
if ($ratingsmenuused) {
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="submit" value="'.get_string('sendinratings', 'data').'" />';
}
echo '</form>';
echo '</div>';
}
}*/
global $OUTPUT;
if( !empty($record->rating) ){
echo $OUTPUT->render($record->rating);
Expand Down
29 changes: 0 additions & 29 deletions mod/forum/lang/en/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,8 @@
$string['addanewquestion'] = 'Add a new question';
$string['addanewtopic'] = 'Add a new topic';
$string['advancedsearch'] = 'Advanced search';
$string['aggregateavg'] = 'Average of ratings';
$string['aggregatecount'] = 'Count of ratings';
$string['aggregatecountformat'] = '{$a->count} (grade: {$a->grade})';
$string['aggregatemax'] = 'Maximum rating';
$string['aggregatemin'] = 'Minimum rating';
$string['aggregatenone'] = 'No ratings';
$string['aggregatesum'] = 'Sum of ratings';
$string['ajaxrating'] = 'Enable AJAX rating';
$string['allforums'] = 'All forums';
$string['allowdiscussions'] = 'Can a {$a} post to this forum?';
$string['allowratings'] = 'Allow posts to be rated?';
$string['allowsallsubscribe'] = 'This forum allows everyone to choose whether to subscribe or not';
$string['allowsdiscussions'] = 'This forum allows each person to start one discussion topic.';
$string['allsubscribe'] = 'Subscribe to all forums';
Expand Down Expand Up @@ -92,7 +83,6 @@
$string['completionreplies'] = 'Student must post replies:';
$string['completionrepliesgroup'] = 'Require replies';
$string['completionreplieshelp'] = 'requiring replies to complete';
$string['configajaxrating'] = 'AJAX rating is a forum rating usability improvement. If enabled, users can rate forum posts almost instantly without needing to scroll to the bottom of the page and click the \'Send in my latest ratings\' button. This setting also requires AJAX to be enabled for the site and in user profiles.';
$string['configcleanreadtime'] = 'The hour of the day to clean old posts from the \'read\' table.';
$string['configdisplaymode'] = 'The default display mode for discussions if one isn\'t set.';
$string['configenablerssfeeds'] = 'This switch will enable the possibility of RSS feeds for all forums. You will still need to turn feeds on manually in the settings for each forum.';
Expand All @@ -108,7 +98,6 @@
$string['configtrackreadposts'] = 'Set to \'yes\' if you want to track read/unread for each user.';
$string['configusermarksread'] = 'If \'yes\', the user must manually mark a post as read. If \'no\', when the post is viewed it is marked as read.';
$string['couldnotadd'] = 'Could not add your post due to an unknown error';
$string['couldnotdeleteratings'] = 'Sorry, that cannot be deleted as people have already rated it';
$string['couldnotdeletereplies'] = 'Sorry, that cannot be deleted as people have already responded to it';
$string['couldnotupdate'] = 'Could not update your post due to an unknown error';
$string['delete'] = 'Delete';
Expand Down Expand Up @@ -208,7 +197,6 @@
$string['invalidforumid'] = 'Forum ID was incorrect';
$string['invalidparentpostid'] = 'Parent post ID was incorrect';
$string['invalidpostid'] = 'Invalid Post ID - {$a}';
$string['invalidrate'] = 'Invalid rate ({$a})';
$string['lastpost'] = 'Last post';
$string['learningforums'] = 'Learning forums';
$string['logblocked'] = 'Log blocked emails';
Expand Down Expand Up @@ -251,7 +239,6 @@
$string['nodiscussions'] = 'There are no discussion topics yet in this forum';
$string['nodiscussionsstartedby'] = 'No discussions started by this user';
$string['noguestpost'] = 'Sorry, guests are not allowed to post.';
$string['noguestrate'] = 'Guests are not allowed to rate entries.';
$string['noguestsubscribe'] = 'Sorry, guests are not allowed to subscribe to receive forum postings by email.';
$string['noguesttracking'] = 'Sorry, guests are not allowed to set tracking options.';
$string['nomorepostscontaining'] = 'No more posts containing \'{$a}\' were found';
Expand All @@ -263,19 +250,14 @@
$string['noposts'] = 'No posts';
$string['nopostscontaining'] = 'No posts containing \'{$a}\' were found';
$string['noquestions'] = 'There are no questions yet in this forum';
$string['norate'] = 'Rating of items not allowed!';
$string['noratinggiven'] = 'No rating given';
$string['noresult'] = 'No ratings for this post: {$a}';
$string['nosubscribers'] = 'There are no subscribers yet for this forum';
$string['notexists'] = 'Discussion no longer exists';
$string['nothingnew'] = 'Nothing new for {$a}';
$string['notingroup'] = 'Sorry, but you need to be part of a group to see this forum.';
$string['notinstalled'] = 'The forum module is not installed';
$string['notpartofdiscussion'] = 'This post is not part of a discussion!';
$string['notrackforum'] = 'Don\'t track unread posts';
$string['noviewanyrate'] = 'You can only look at results for posts that you made';
$string['noviewdiscussionspermission'] = 'You do not have the permission to view discussions in this forum';
$string['noviewrate'] = 'You do not have the capability to view post ratings';
$string['nowallsubscribed'] = 'All forums in {$a} are subscribed.';
$string['nowallunsubscribed'] = 'All forums in {$a} are not subscribed.';
$string['nownotsubscribed'] = '{$a->name} will NOT receive copies of \'{$a->forum}\' by email.';
Expand Down Expand Up @@ -317,15 +299,6 @@
$string['pruneheading'] = 'Split the discussion and move this post to a new discussion';
$string['qandaforum'] = 'Q and A forum';
$string['qandanotify'] = 'This is a Question and Answer forum. In order to see other responses to these Questions, you must first post your Answer';
$string['rate'] = 'Rate';
$string['rating'] = 'Rating';
$string['ratingeveryone'] = 'Everyone can rate posts';
$string['ratingno'] = 'No ratings';
$string['ratingonlyteachers'] = 'Only {$a} can rate posts';
$string['ratingpublic'] = '{$a} can see everyone\'s ratings';
$string['ratingpublicnot'] = '{$a} can only see their own ratings';
$string['ratings'] = 'Ratings';
$string['ratingssaved'] = 'Ratings saved';
$string['re'] = 'Re:';
$string['readtherest'] = 'Read the rest of this topic';
$string['replies'] = 'Replies';
Expand Down Expand Up @@ -360,7 +333,6 @@
$string['searchwhichforums'] = 'Choose which forums to search';
$string['searchwords'] = 'These words can appear anywhere in the post';
$string['seeallposts'] = 'See all posts made by this user';
$string['sendinratings'] = 'Send in my latest ratings';
$string['shortpost'] = 'Short post';
$string['showsubscribers'] = 'Show/edit current subscribers';
$string['singleforum'] = 'A single simple discussion';
Expand Down Expand Up @@ -421,7 +393,6 @@
$string['viewalldiscussions'] = 'View all discussions';
$string['warnafter'] = 'Post threshold for warning';
$string['warnafter_help'] = 'Students can be warned as they approach the maximum number of posts allowed in a given period. This setting specifies after how many posts they are warned. Users with the capability mod/forum:postwithoutthrottling are exempt from post limits.';
$string['youratedthis'] = 'You rated this';
$string['yournewquestion'] = 'Your new question';
$string['yournewtopic'] = 'Your new discussion topic';
$string['yourreply'] = 'Your reply';
2 changes: 1 addition & 1 deletion mod/forum/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
if (!empty($confirm) && confirm_sesskey()) { // User has confirmed the delete

if ($post->totalscore) {
notice(get_string("couldnotdeleteratings", "forum"),
notice(get_string('couldnotdeleteratings', 'rating'),
forum_go_back_to("discuss.php?d=$post->discussion"));

} else if ($replycount && !has_capability('mod/forum:deleteanypost', $modcontext)) {
Expand Down
4 changes: 0 additions & 4 deletions mod/forum/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,5 @@

$settings->add(new admin_setting_configcheckbox('forum_logblocked', get_string('logblocked', 'forum'),
get_string('configlogblocked', 'forum'), 1));

//no using the central ajax setting for ratings. MDL-21657
//$settings->add(new admin_setting_configcheckbox('forum_ajaxrating', get_string('ajaxrating', 'forum'),
// get_string('configajaxrating', 'forum'), 0));
}

12 changes: 0 additions & 12 deletions mod/glossary/lang/en/glossary.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
$string['allowduplicatedentries_help'] = 'If enabled, multiple entries can have the same concept name.';
$string['allowprintview'] = 'Allow print view';
$string['allowprintview_help'] = 'If enabled, students are provided with a link to a printer-friendly version of the glossary. The link is always available to teachers.';
$string['allowratings'] = 'Allow entries to be rated?';
$string['answer'] = 'Answer';
$string['approve'] = 'Approve';
$string['areyousuredelete'] = 'Are you sure you want to delete this entry?';
Expand Down Expand Up @@ -190,7 +189,6 @@
$string['importentries'] = 'Import entries';
$string['importentriesfromxml'] = 'Import entries from XML file';
$string['includegroupbreaks'] = 'Include group breaks';
$string['invalidrate'] = 'Invalid glossary rate ({$a})';
$string['isglobal'] = 'Is this glossary global?';
$string['isglobal_help'] = 'A global glossary has entries which are linked to from throughout the site, rather than only in the course that the glossary is in. Only administrators can set a glossary as global.';
$string['letter'] = 'letter';
Expand Down Expand Up @@ -223,15 +221,6 @@
$string['printerfriendly'] = 'Printer-friendly version';
$string['printviewnotallowed'] = 'Print view isn\'t allowed';
$string['question'] = 'Question';
$string['rate'] = 'Rate';
$string['rating'] = 'Rating';
$string['ratingeveryone'] = 'Everyone can rate entries';
$string['ratingno'] = 'No ratings';
$string['ratingonlyteachers'] = 'Only {$a} can rate entries';
$string['ratingonlywithpermissions'] = 'Only people with permission to rate entries';
$string['ratings'] = 'Ratings';
$string['ratingssaved'] = 'Ratings saved';
$string['ratingtime'] = 'Restrict ratings to entries with dates in this range:';
$string['rejectedentries'] = 'Rejected entries';
$string['rejectionrpt'] = 'Rejection Report';
$string['resetglossaries'] = 'Delete entries from';
Expand All @@ -243,7 +232,6 @@
$string['rsstype_help'] = 'To enable the RSS feed for this activity, select either concepts with author or concepts without author to be included in the feed.';
$string['searchindefinition'] = 'Search full text';
$string['secondaryglossary'] = 'Secondary glossary';
$string['sendinratings'] = 'Send in my latest ratings';
$string['showall'] = 'Show \'ALL\' link';
$string['showall_help'] = 'If enabled, participants can browse all entries at once.';
$string['showalphabet'] = 'Show alphabet';
Expand Down
7 changes: 7 additions & 0 deletions rating/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
echo "<th class=\"header\" scope=\"col\"><a href=\"index.php?$sortargs&amp;sort=time\">$strtime</a></th>";
echo "</tr>";

$maxrating = count($scalemenu);
foreach ($ratings as $rating) {
//Undo the aliasing of the user id column from user_picture::fields()
//we could clone the rating object or preserve the rating id if we needed it again
Expand All @@ -107,6 +108,12 @@
echo $OUTPUT->user_picture($rating);
}
echo '</td><td>'.fullname($rating).'</td>';

//if they've switched to rating out of 5 but there were ratings submitted out of 10 for example
//Not doing this within $rm->get_all_ratings_for_item to allow access to the raw data
if ($rating->rating > $maxrating) {
$rating->rating = $maxrating;
}
echo '<td style="white-space:nowrap" align="center" class="rating">'.$scalemenu[$rating->rating]."</td>";
echo '<td style="white-space:nowrap" align="center" class="time">'.userdate($rating->timemodified)."</td>";
echo "</tr>\n";
Expand Down
12 changes: 6 additions & 6 deletions rating/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,12 @@ public function get_user_grades($options) {
* @return array
*/
public function get_aggregate_types() {
return array (RATING_AGGREGATE_NONE => get_string('aggregatenone', 'forum'),
RATING_AGGREGATE_AVERAGE => get_string('aggregateavg', 'forum'),
RATING_AGGREGATE_COUNT => get_string('aggregatecount', 'forum'),
RATING_AGGREGATE_MAXIMUM => get_string('aggregatemax', 'forum'),
RATING_AGGREGATE_MINIMUM => get_string('aggregatemin', 'forum'),
RATING_AGGREGATE_SUM => get_string('aggregatesum', 'forum'));
return array (RATING_AGGREGATE_NONE => get_string('aggregatenone', 'rating'),
RATING_AGGREGATE_AVERAGE => get_string('aggregateavg', 'rating'),
RATING_AGGREGATE_COUNT => get_string('aggregatecount', 'rating'),
RATING_AGGREGATE_MAXIMUM => get_string('aggregatemax', 'rating'),
RATING_AGGREGATE_MINIMUM => get_string('aggregatemin', 'rating'),
RATING_AGGREGATE_SUM => get_string('aggregatesum', 'rating'));
}

/**
Expand Down
Loading

0 comments on commit 07f05a0

Please sign in to comment.