From 6e1b702e71fcad10488789340434d25cdb5b399e Mon Sep 17 00:00:00 2001 From: Geoff Goehle Date: Tue, 21 Aug 2012 16:53:55 -0400 Subject: [PATCH 1/4] Fixed some initialization stuff with problemGrader. It should no longer explode when editing sets where not all users are assigned to all problems. --- .../ContentGenerator/Instructor/ProblemGrader.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm b/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm index 3e6574bbe2..45fe17b979 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm @@ -91,7 +91,7 @@ sub initialize { foreach my $userID (@users) { my $userProblem = $db->getUserProblem($userID,$setID,$problemID); - + next unless $userProblem; #update grades and set flags $userProblem->{flags} =~ s/needs_grading/graded/; if ($r->param("$userID.mark_correct")) { @@ -156,6 +156,8 @@ sub body { my $problem = $db->getMergedProblem($userID, $setID, $problemID); # checked my $user = $db->getUser($userID); + return CGI::div({class=>"ResultsWithError"}, CGI::p("This set needs to be assigned to you before you can grade it.")) unless $set && $problem; + #set up a silly problem to render the problem text my $pg = WeBWorK::PG->new( $ce, @@ -213,8 +215,11 @@ sub body { my $userID = $userRecord->user_id; my $userPastAnswerID = $db->latestProblemPastAnswer($courseName, $userID, $setID, $problemID); my $userAnswerString; + my $userProblem = $db->getUserProblem($userID,$setID,$problemID); - if ($userPastAnswerID) { + next unless $userProblem; + + if ($userPastAnswerID && $userProblem) { my $userPastAnswer = $db->getPastAnswer($userPastAnswerID); my @scores = split(//,$userPastAnswer->scores); my @answers = split(/\t/,$userPastAnswer->answer_string); @@ -281,7 +286,6 @@ sub body { $userAnswerString = "There are no answers for this student."; } - my $userProblem = $db->getUserProblem($userID,$setID,$problemID); my $score = int(100*$userProblem->status); my $prettyName = $userRecord->last_name @@ -331,6 +335,7 @@ sub body { # ); print CGI::Tr(CGI::td([CGI::hr(),CGI::hr(),"",CGI::hr(),"",CGI::hr(),"",CGI::hr()])); + } print CGI::end_table(); From 974c68b0e3661d9c65bb4ee5d0a40f1b6f2c9740 Mon Sep 17 00:00:00 2001 From: Geoff Goehle Date: Wed, 22 Aug 2012 12:40:18 -0400 Subject: [PATCH 2/4] Fixed facebook integration --- lib/WeBWorK/AchievementEvaluator.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WeBWorK/AchievementEvaluator.pm b/lib/WeBWorK/AchievementEvaluator.pm index 687cd625fc..a036b5b33e 100644 --- a/lib/WeBWorK/AchievementEvaluator.pm +++ b/lib/WeBWorK/AchievementEvaluator.pm @@ -171,10 +171,10 @@ sub checkForAchievements { #build the cheevo message. New level messages are slightly different my $imgSrc; if ($achievement->{icon}) { - $imgSrc = $ce->{courseURLs}->{achievements}."/".$achievement->{icon}; + $imgSrc = $ce->{server_root_url}.$ce->{courseURLs}->{achievements}."/".$achievement->{icon}; } else { - $imgSrc = $ce->{webworkURLs}->{htdocs}."/images/defaulticon.png"; + $imgSrc = $ce->{server_root_url}.$ce->{webworkURLs}->{htdocs}."/images/defaulticon.png"; } $cheevoMessage .= CGI::start_div({class=>'cheevopopupouter'}); From 21a4e8953584cd83960e826622ed6b6e4cfe5534 Mon Sep 17 00:00:00 2001 From: Geoff Goehle Date: Thu, 23 Aug 2012 00:02:31 -0300 Subject: [PATCH 3/4] Update conf/localOverrides.conf.dist --- conf/localOverrides.conf.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist index 996b73a665..e2d8ec6cb0 100644 --- a/conf/localOverrides.conf.dist +++ b/conf/localOverrides.conf.dist @@ -245,7 +245,7 @@ $problemDefaults{max_attempts} = -1; # pgproblemeditor1 => 1, # pgproblemeditor2 => 1, # pgproblemeditor3 => 1, -# ); + ); ################################################################################ # Directory for temporary files From dfab1aca3ead126338071ade495b83f153c5b729 Mon Sep 17 00:00:00 2001 From: Michael Gage Date: Wed, 29 Aug 2012 20:29:46 -0400 Subject: [PATCH 4/4] Add changes to OPL-update obtained from iron particle --- README | 10 +++++----- bin/OPL-update | 13 +++++++------ bin/check_modules.pl | 2 ++ conf/localOverrides.conf.dist | 3 ++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README b/README index 92b4a0802d..a96378e228 100644 --- a/README +++ b/README @@ -1,11 +1,11 @@ + WeBWorK Online Homework Delivery System - Version 2.5.1 - Branch: openwebwork/webwork2 ww2.5.1 + Version 2.5.* + Branch: github.com/openwebwork - http://webwork.maa.org/wiki/Release_notes_for_WeBWorK_2.5.1 - Copyright 2000-2011, The WeBWorK Project + http://webwork.maa.org/wiki/Release_notes_for_WeBWorK_2.5.0 + Copyright 2000-2012, The WeBWorK Project http://webwork.maa.org All rights reserved. - diff --git a/bin/OPL-update b/bin/OPL-update index aa5d79f9a6..11e05bd494 100755 --- a/bin/OPL-update +++ b/bin/OPL-update @@ -56,12 +56,12 @@ my %NPLtables = ( path => 'NPL-path', pgfile => 'NPL-pgfile', keyword => 'NPL-keyword', - pgfile-keyword => 'NPL-pgfile-keyword', + pgfile_keyword => 'NPL-pgfile-keyword', textbook => 'NPL-textbook', chapter => 'NPL-chapter', section => 'NPL-section', problem => 'NPL-problem', - pgfile-problem => 'NPL-pgfile-problem', + pgfile_problem => 'NPL-pgfile-problem', ); @@ -97,19 +97,20 @@ sub dbug { ##Figure out which set of tables to use +my %tables; if( -e "$libraryRoot/VERSION") { include("$libraryRoot/VERSION"); if($OPL_VERSION eq '2.5.0') { - my %tables = %OPLtables; + %tables = %OPLtables; my $lib = 'OPL'; print "Got OPLtables!\n"; } else { - my %tables = %NPLtables; + %tables = %NPLtables; my $lib = 'NPL'; print "Got NPLtables! (1)\n"; } -else { - my %tables = %NPLtables; +} else { + %tables = %NPLtables; my $lib = 'NPL'; print "Got NPLtables! (2)\n"; } diff --git a/bin/check_modules.pl b/bin/check_modules.pl index 6dc265a2e6..fcca289b6b 100755 --- a/bin/check_modules.pl +++ b/bin/check_modules.pl @@ -61,9 +61,11 @@ Getopt::Std HTML::Entities HTML::Tagset + HTML::Template IO::File Iterator Iterator::Util + JSON Locale::Maketext::Lexicon Locale::Maketext::Simple Mail::Sender diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist index 116de693c8..253139c0d7 100644 --- a/conf/localOverrides.conf.dist +++ b/conf/localOverrides.conf.dist @@ -253,7 +253,8 @@ $problemDefaults{max_attempts} = -1; pgproblemeditor1 => 1, # pgproblemeditor2 => 1, # pgproblemeditor3 => 1, - ); +); + ################################################################################ # Directory for temporary files