From: Mike G. v. a. <we...@ma...> - 2005-02-06 21:05:32
|
Log Message: ----------- Added links to the sidebar for student and current set Added links to problems on the stats page Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/lib/WeBWorK: ContentGenerator.pm webwork2/lib/WeBWorK/ContentGenerator/Instructor: Stats.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.123.2.3 retrieving revision 1.123.2.4 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.123.2.3 -r1.123.2.4 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -519,17 +519,19 @@ $setID = "" if (defined $setID && !(grep /$setID/, $db->listUserSets($userID))); my $problemID = $urlpath->arg("problemID"); $problemID = "" if (defined $problemID && !(grep /$problemID/, $db->listUserProblems($userID, $setID))); - + # instructor tools link my $instr = $urlpath->newFromModule("${ipfx}Index", %args); - my $addUsers = $urlpath->newFromModule("${ipfx}AddUsers", %args); + # Class list editor my $userList = $urlpath->newFromModule("${ipfx}UserList", %args); - # set list links + # Homework sets editor and set editing list links my $setList = $urlpath->newFromModule("${ipfx}ProblemSetList", %args); my $setDetail = $urlpath->newFromModule("${ipfx}ProblemSetDetail", %args, setID => $setID); my $problemEditor = $urlpath->newFromModule("${ipfx}PGProblemEditor", %args, setID => $setID, problemID => $problemID); + # Library browser my $maker = $urlpath->newFromModule("${ipfx}SetMaker", %args); + my $assigner = $urlpath->newFromModule("${ipfx}Assigner", %args); my $mail = $urlpath->newFromModule("${ipfx}SendMail", %args); my $scoring = $urlpath->newFromModule("${ipfx}Scoring", %args); @@ -546,51 +548,62 @@ my $fileMgr = $urlpath->newFromModule("${ipfx}FileManager", %args); - #my $fileXfer = $urlpath->newFromModule("${ipfx}FileXfer", %args); print CGI::hr(); print CGI::start_li(); + ## Instructor tools print CGI::span({style=>"font-size:larger"}, - CGI::a({href=>$self->systemLink($instr,params=>{ %displayOptions,})}, space2nbsp($instr->name)) + CGI::a({href=>$self->systemLink($instr,params=>{ %displayOptions,})}, sp2nbsp($instr->name)) ); + ## Class list editor print CGI::start_ul(); print CGI::li(CGI::a({href=>$self->systemLink($userList,params=>{ %displayOptions,})}, sp2nbsp($userList->name))); print CGI::start_li(); + ## Homework sets editor and sub links print CGI::a({href=>$self->systemLink($setList,params=>{ %displayOptions,})}, sp2nbsp($setList->name)); if (defined $setID and $setID ne "") { - print CGI::start_ul(); - print CGI::start_li(); - print CGI::a({href=>$self->systemLink($setDetail,params=>{ %displayOptions,})}, $setID); + print CGI::li( CGI::a({href=>$self->systemLink($setDetail,params=>{ %displayOptions,})}, $setID) ); if (defined $problemID and $problemID ne "") { print CGI::ul( CGI::li(CGI::a({href=>$self->systemLink($problemEditor,params=>{ %displayOptions,})}, $problemID)) ); } - print CGI::end_li(); - print CGI::end_ul(); } print CGI::end_li(); + ## Library browser print CGI::li(CGI::a({href=>$self->systemLink($maker,params=>{ %displayOptions,})}, sp2nbsp($maker->name))) if $authz->hasPermissions($user, "modify_problem_sets"); print CGI::li(CGI::a({href=>$self->systemLink($assigner,params=>{ %displayOptions,})}, sp2nbsp($assigner->name))) if $authz->hasPermissions($user, "assign_problem_sets"); - + ## Stats print CGI::li(CGI::a({href=>$self->systemLink($stats,params=>{ %displayOptions,})}, sp2nbsp($stats->name))); - - ## Added Link for Student Progress + print CGI::start_li(); + if (defined $userID and $userID ne "") { + print ' ', + CGI::a({href=>$self->systemLink($userStats,params=>{ %displayOptions,})}, $userID), + CGI::br(); + } + if (defined $setID and $setID ne "") { + print ' ', + CGI::a({href=>$self->systemLink($setStats,params=>{ %displayOptions,})}, sp2nbsp($setID)), + CGI::br(); + } + print CGI::end_li(); + ## Student Progress print CGI::li(CGI::a({href=>$self->systemLink($progress,params=>{ %displayOptions,})}, sp2nbsp($progress->name))); print CGI::start_li(); if (defined $userID and $userID ne "") { - print CGI::ul( - CGI::li(CGI::a({href=>$self->systemLink($userProgress,params=>{ %displayOptions,})}, $userID)) - ); + print ' ', + CGI::a({href=>$self->systemLink($userProgress,params=>{ %displayOptions,})}, $userID), + CGI::br(); } if (defined $setID and $setID ne "") { - print CGI::ul( - CGI::li(CGI::a({href=>$self->systemLink($setProgress,params=>{ %displayOptions,})}, space2nbsp($setID))) - ); + print ' ', + CGI::a({href=>$self->systemLink($setProgress,params=>{ %displayOptions,})}, sp2nbsp($setID)), + CGI::br(); } print CGI::end_li(); - + ## Scoring tools print CGI::li(CGI::a({href=>$self->systemLink($scoring,params=>{ %displayOptions,})}, sp2nbsp($scoring->name))) if $authz->hasPermissions($user, "score_sets"); + ## Email print CGI::li(CGI::a({href=>$self->systemLink($mail,params=>{ %displayOptions,})}, sp2nbsp($mail->name))) if $authz->hasPermissions($user, "send_mail"); print CGI::li(CGI::a({href=>$self->systemLink($fileMgr,params=>{ %displayOptions,})}, sp2nbsp($fileMgr->name))); #print CGI::li(CGI::a({href=>$self->systemLink($fileXfer)}, sp2nbsp($fileXfer->name))); @@ -1571,21 +1584,24 @@ sub sp2nbsp { my ($str) = @_; return unless defined $str; - $str =~ s/ / /g; + #$str =~ s/ / /g; + $str =~ s/\s/ /g; return $str; } -=item space2nbsp($string) - -Replace spaces in the string with html non-breaking spaces. - -=cut - -sub space2nbsp { - my $str = shift; - $str =~ s/\s/ /g; - return($str); -} +# FIXME -- I don't think we need both this and the one above. +# Remove this comment block after some time.(2/6/05) +# =item space2nbsp($string) +# +# Replace spaces in the string with html non-breaking spaces. +# +# =cut +# +# sub space2nbsp { +# my $str = shift; +# $str =~ s/\s/ /g; +# return($str); +# } =item errorOutput($error, $details) Index: Stats.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Stats.pm,v retrieving revision 1.47.2.1 retrieving revision 1.47.2.2 diff -Llib/WeBWorK/ContentGenerator/Instructor/Stats.pm -Llib/WeBWorK/ContentGenerator/Instructor/Stats.pm -u -r1.47.2.1 -r1.47.2.2 --- lib/WeBWorK/ContentGenerator/Instructor/Stats.pm +++ lib/WeBWorK/ContentGenerator/Instructor/Stats.pm @@ -431,10 +431,13 @@ my %index_percentiles = determine_percentiles(\@brackets1, @index_list); my %score_percentiles = determine_percentiles(\@brackets1, @score_list); my %attempts_percentiles_for_problem = (); + my %problemPage = (); # link to the problem page foreach my $probID (@problemIDs) { $attempts_percentiles_for_problem{$probID} = { determine_percentiles([@brackets2], @{$attempts_list_for_problem{$probID}}) }; + $problemPage{$probID} = $urlpath->newFromModule("WeBWorK::ContentGenerator::Problem", + courseID => $courseName, setID => $setName, problemID => $probID); } ##################################################################################### @@ -446,7 +449,9 @@ CGI::p('The percentage of active students with correct answers for each problem'), CGI::start_table({-border=>1}), CGI::Tr(CGI::td( - ['Problem #', @problemIDs] + ['Problem #', + map {CGI::a({ href=>$self->systemLink($problemPage{$_}) },$_)} @problemIDs + ] )), CGI::Tr(CGI::td( [ '% correct',map {($number_of_students_attempting_problem{$_}) @@ -519,11 +524,9 @@ foreach my $probID (@problemIDs) { - my $problemPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Problem", - courseID => $courseName, setID => $setName, problemID => $probID); print CGI::Tr( CGI::td( [ - CGI::a({href=>$self->systemLink($problemPage)},"Prob $probID"), + CGI::a({ href=>$self->systemLink($problemPage{$probID}) },"Prob $probID"), ( prevent_repeats reverse map { sprintf("%0.0f",$attempts_percentiles_for_problem{$probID}->{$_}) } @brackets2), ] |