diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 3bb26a1b5..92158237a 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -27,6 +27,13 @@ - Bugfix [ 942865 ] urlizedTitle problem. (Thanks to tr0nd). - Bugfix [ 940008 ] error deleting parts of a survey in 6.0.1 (Thanks to Andreas Sexauer.) + - Bugfix [ 927855 ] Grading problems using a subset of the questions with + Survey + - Bugfix [ 914798 ] Calendar displays events from wrong year (Thanks to Frank + Dillon). + - Bugfix [ 927266 ] WG 6.0.1 Data Form Issue + + 6.0.1 diff --git a/lib/WebGUI/Wobject.pm b/lib/WebGUI/Wobject.pm index 48f974934..f3a2bdcd2 100644 --- a/lib/WebGUI/Wobject.pm +++ b/lib/WebGUI/Wobject.pm @@ -433,7 +433,10 @@ The value of the column defined by "setName" to select a data set from. sub moveCollateralDown { my ($id, $seq, $setName, $setValue); $setName = $_[4] || "wobjectId"; - $setValue = $_[5] || $_[0]->get($setName); + $setValue = $_[5]; + unless (defined $setValue) { + $setValue = $_[0]->get($setName); + } ($seq) = WebGUI::SQL->quickArray("select sequenceNumber from $_[1] where $_[2]=$_[3] and $setName=".quote($setValue)); ($id) = WebGUI::SQL->quickArray("select $_[2] from $_[1] where $setName=".quote($setValue) ." and sequenceNumber=$seq+1"); @@ -483,7 +486,10 @@ The value of the column defined by "setName" to select a data set from. sub moveCollateralUp { my ($id, $seq, $setValue, $setName); $setName = $_[4] || "wobjectId"; - $setValue = $_[5] || $_[0]->get($setName); + $setValue = $_[5]; + unless (defined $setValue) { + $setValue = $_[0]->get($setName); + } ($seq) = WebGUI::SQL->quickArray("select sequenceNumber from $_[1] where $_[2]=$_[3] and $setName=".quote($setValue)); ($id) = WebGUI::SQL->quickArray("select $_[2] from $_[1] where $setName=".quote($setValue) ." and sequenceNumber=$seq-1"); diff --git a/lib/WebGUI/Wobject/Survey.pm b/lib/WebGUI/Wobject/Survey.pm index af3d43536..45b8647fc 100644 --- a/lib/WebGUI/Wobject/Survey.pm +++ b/lib/WebGUI/Wobject/Survey.pm @@ -900,7 +900,7 @@ sub www_view { } if ($var->{'response.Id'}) { $var->{'questions.soFar.count'} = $self->getQuestionResponseCount($var->{'response.Id'}); - ($var->{'questions.correct.Count'}) = WebGUI::SQL->quickArray("select count(*) from Survey_questionResponse a, Survey_answer b where a.Survey_responseId=" + ($var->{'questions.correct.count'}) = WebGUI::SQL->quickArray("select count(*) from Survey_questionResponse a, Survey_answer b where a.Survey_responseId=" .$var->{'response.Id'}." and a.Survey_answerId=b.Survey_answerId and b.isCorrect=1"); if ($var->{'questions.soFar.count'} > 0) { $var->{'questions.correct.percent'} = round(($var->{'questions.correct.count'}/$var->{'questions.soFar.count'})*100) @@ -946,7 +946,10 @@ sub www_viewGradebook { $p->setDataByQuery("select userId,username,ipAddress,Survey_responseId,startDate,endDate from Survey_response where isComplete=1 and Survey_id=".$self->get("Survey_id")." order by username,ipAddress,startDate"); my $users = $p->getPageData; - ($var->{'question.Count'}) = WebGUI::SQL->quickArray("select count(*) from Survey_question where Survey_id=".$self->get("Survey_id")); + ($var->{'question.count'}) = WebGUI::SQL->quickArray("select count(*) from Survey_question where Survey_id=".$self->get("Survey_id")); + if ($var->{'question.count'} > $self->get("questionsPerResponse")) { + $var->{'question.count'} = $self->get("questionsPerResponse"); + } $var->{'response.user.label'} = WebGUI::International::get(67,$self->get("namespace")); $var->{'response.count.label'} = WebGUI::International::get(52,$self->get("namespace")); $var->{'response.percent.label'} = WebGUI::International::get(54,$self->get("namespace")); @@ -960,7 +963,7 @@ sub www_viewGradebook { .'&responseId='.$user->{Survey_responseId}), 'response.user.name'=>($user->{userId} == 1) ? $user->{ipAddress} : $user->{username}, 'response.count.correct' => $correctCount, - 'response.percent' => round(($correctCount/$var->{'question.Count'})*100) + 'response.percent' => round(($correctCount/$var->{'question.count'})*100) }); } $var->{response_loop} = \@responseloop;