-
-
+
+
+
-
-
-
-
- $lt{'cuse'}: |
- |
-
+ |
+ $lt{'cuse'}:
END
if ($newpostsflag) {
$discussion .=
@@ -589,13 +582,7 @@ END
}
}
$discussion .= < |
- |
-
- $lt{'chgt'}?
- |
-
-
+ $lt{'chgt'}
|
END
if ($sortposts) {
@@ -604,7 +591,7 @@ END
my %status_types = ();
&sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype);
- $discussion .= ''.&mt('Sorted by').': '.$sort_types{$sortposts}.' ';
+ $discussion .= ' | '.&mt('Sorted by').': '.$sort_types{$sortposts}.' ';
if (defined($env{'form.totposters'})) {
$discussion .= &mt('Posts by').':';
if ($totposters > 0) {
@@ -639,8 +626,9 @@ END
if ($filterchoice) {
$discussion .= ''.&mt('Filters').': '.$filterchoice;
}
- $discussion .= ' | ';
}
+ $discussion .= '';
+
}
if ($dischash{$toggkey}) {
my $storebutton = &mt('Save read/unread changes');
@@ -659,9 +647,7 @@ END
$discussion .= &action_links_bar($colspan,$ressymb,$visible,
$newpostsflag,$group,
$prevread,$markondisp);
- $discussion .= "
-
-
\n";
+ $discussion .= " | \n";
}
if ($outputtarget eq 'export') {
if ($manifestok) {
@@ -804,8 +790,8 @@ sub send_message_link {
sub action_links_bar {
my ($colspan,$ressymb,$visible,$newpostsflag,$group,$prevread,$markondisp) = @_;
- my $discussion = ' | '.
- ''.
+ my $discussion = ' '.
+ ''.
'';
my $escsymb=&escape($ressymb);
if ($visible) {
@@ -820,26 +806,28 @@ sub action_links_bar {
$discussion .= '&previous='.$prevread;
}
$discussion .= &group_args($group);
- $discussion .='">'.&mt('Chronological View').'
- '.&mt('Chronological View').' ';
+
+ my $otherviewurl='/adm/feedback?cmd=sortfilter&symb='.$escsymb.'&inhibitmenu=yes&modal=yes';
if ($newpostsflag) {
- $discussion .= '&previous='.$prevread;
+ $otherviewurl .= '&previous='.$prevread;
}
- $discussion .= &group_args($group);
- $discussion .='">'.&mt('Sorting/Filtering options').''.(' ' x2);
+ $otherviewurl .= &group_args($group);
+ $discussion .= &Apache::loncommon::modal_link($otherviewurl,&mt('Other Views ...'),800,340);
+ $discussion .= ' ';
}
$discussion .=''.&mt('Export').'? | ';
+ $discussion .= '">'.&mt('Export').'';
if ($newpostsflag) {
if (!$markondisp) {
$discussion .=''.
- &mt('Preferences on what is marked as NEW').
+ &mt('My general preferences on what is marked as NEW').
' '.&mt('Mark NEW posts no longer new').' | ';
@@ -1274,24 +1262,17 @@ sub build_posting_display {
unless ($$notshown{$idx} == 1) {
if ($prevread > 0 && $prevread <= $posttime) {
$$newitem{$idx} = 1;
- $$discussionitems[$idx] .= '
-
- '.&mt('NEW').' | ';
+ $$discussionitems[$idx] .= ''.&mt('NEW').' ';
} else {
$$newitem{$idx} = 0;
- $$discussionitems[$idx] .= '
-
- | ';
}
- $$discussionitems[$idx] .= ' '.
- ''.$subject.' '.
+ $$discussionitems[$idx] .= ''.$subject.' '.
$sender.' '.$vgrlink.' ('.
- &Apache::lonlocal::locallocaltime($posttime).') | ';
+ &Apache::lonlocal::locallocaltime($posttime).')';
if ($$dischash{$toggkey}) {
- $$discussionitems[$idx].=' '.
- $ctlink.' | ';
+ $$discussionitems[$idx].=' '.$ctlink;
}
- $$discussionitems[$idx].= ' '.
+ $$discussionitems[$idx].= '
'.
$message.' ';
if ($contrib{$idx.':history'}) {
my @postversions = ();
@@ -1654,7 +1635,7 @@ END
$comment = &unescape($env{'form.comment'});
&process_attachments(\@currnewattach,\@currdelold,\@keepold);
}
- my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(undef,undef,1);
+ my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(undef,undef,1,($env{'form.modal'}?'popup':0));
my $send=&mt('Send');
my $alert = &mt('Please select a feedback type.');
my $js= <
$lt{'diso'} $lt{'prca'}
-
+
$lt{'soor'} |
@@ -2248,7 +2229,8 @@ $start_page
-
+
+
@@ -2373,6 +2355,7 @@ END
$r->print(<
+
@@ -2804,21 +2787,85 @@ sub send_msg {
}
}
-
- my %record=&Apache::lonnet::restore('_feedback');
- my ($temp)=keys(%record);
- unless ($temp=~/^error\:/) {
- my %newrecord=();
- $newrecord{'resource'}=$feedurl;
- $newrecord{'subnumber'}=$record{'subnumber'}+1;
- unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') {
- $status.=' '.&mt('Not registered').' ';
- }
+# Records of number of feedback messages are kept under the "symb" called "_feedback"
+# There are two entries within the framework of a course:
+# - the URLs for which feedback was provided
+# - the total number of contributions
+ if ($sendsomething) {
+ my %record=&getfeedbackrecords();
+ my ($temp)=keys(%record);
+ unless ($temp=~/^error\:/) {
+ my %newrecord=();
+ $newrecord{'resource'}=$feedurl;
+ $newrecord{'subnumber'}=$record{'subnumber'}+1;
+ unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') {
+ $status.=' '.&mt('Not registered').' ';
+ }
+ }
}
-
return ($status,$sendsomething);
}
+# Routine to get the complete feedback records
+
+sub getfeedbackrecords {
+ my ($uname,$udom,$course)=@_;
+ unless ($uname) { $uname=$env{'user.name'}; }
+ unless ($udom) { $udom=$env{'user.domain'}; }
+ unless ($course) { $course=$env{'request.course.id'}; }
+ my %record=&Apache::lonnet::restore('_feedback',$course,$udom,$uname);
+ return %record;
+}
+
+# Routine to get feedback statistics
+
+sub getfeedbackstats {
+ my %record=&getfeedbackrecords(@_);
+ my $subnumber=$record{'subnumber'};
+ my $points=0;
+ my $likes=0;
+ foreach my $key (keys(%record)) {
+ if ($key=~/^\d+\:points$/) {
+ $points+=$record{$key};
+ }
+ if ($key=~/^\d+\:likes$/) {
+ $likes+=$record{$key};
+ }
+ }
+ return ($subnumber,$points,$likes);
+}
+
+# Store feedback credit
+
+sub storefeedbackpoints {
+ my ($points,$uname,$udom,$course)=@_;
+ unless ($points) { $points=0; }
+ unless ($uname) { $uname=$env{'user.name'}; }
+ unless ($udom) { $udom=$env{'user.domain'}; }
+ unless ($course) { $course=$env{'request.course.id'}; }
+ my %record=('grader_user' => $env{'user.name'},
+ 'grader_domain' => $env{'user.domain'},
+ 'points' => $points);
+ return &Apache::lonnet::cstore(\%record,'_feedback');
+}
+
+# Store feedback "likes"
+
+sub storefeedbacklikes {
+ my ($likes,$uname,$udom,$course)=@_;
+ unless ($likes) { $likes=0; }
+ if ($likes>0) { $likes=1; }
+ if ($likes<0) { $likes=-1; }
+ unless ($uname) { $uname=$env{'user.name'}; }
+ unless ($udom) { $udom=$env{'user.domain'}; }
+ unless ($course) { $course=$env{'request.course.id'}; }
+ my %record=('likes_user' => $env{'user.name'},
+ 'likes_domain' => $env{'user.domain'},
+ 'likes' => $likes);
+ return &Apache::lonnet::cstore(\%record,'_feedback');
+}
+
+
sub adddiscuss {
my ($symb,$email,$anon,$attachmenturl,$subject,$group)=@_;
my $status='';
|
|