[system] / branches / gage_dev / webwork2 / lib / WeBWorK / ContentGenerator / ProblemSet.pm Repository:
ViewVC logotype

Diff of /branches/gage_dev/webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 6997 Revision 6998
81 $globalSet->enable_reduced_scoring("0"); # defaults to disabled 81 $globalSet->enable_reduced_scoring("0"); # defaults to disabled
82 $db->putGlobalSet($globalSet); 82 $db->putGlobalSet($globalSet);
83 $set = $db->getMergedSet($effectiveUserName, $set->set_id); 83 $set = $db->getMergedSet($effectiveUserName, $set->set_id);
84 } 84 }
85 85
86 my $visiblityStateText = ($set->visible) ? "visible to students." : "hidden from students."; 86 my $visiblityStateText = ($set->visible) ? $r->maketext("visible to students")."." : $r->maketext("hidden from students").".";
87 my $visiblityStateClass = ($set->visible) ? "visible" : "hidden"; 87 my $visiblityStateClass = ($set->visible) ? "visible" : "hidden";
88 $self->addmessage(CGI::span("This set is " . CGI::font({class=>$visiblityStateClass}, $visiblityStateText))) if $authz->hasPermissions($userName, "view_hidden_sets"); 88 $self->addmessage(CGI::span($r->maketext("This set is [_1]", CGI::font({class=>$visiblityStateClass}, $visiblityStateText)))) if $authz->hasPermissions($userName, "view_hidden_sets");
89 89
90 90
91 $self->{userName} = $userName; 91 $self->{userName} = $userName;
92 $self->{user} = $user; 92 $self->{user} = $user;
93 $self->{effectiveUser} = $effectiveUser; 93 $self->{effectiveUser} = $effectiveUser;
148 ( defined($gs->visible()) ? $gs->visible() : 1 ) 148 ( defined($gs->visible()) ? $gs->visible() : 1 )
149 } @setIDs; 149 } @setIDs;
150 } 150 }
151 151
152 print CGI::start_div({class=>"info-box", id=>"fisheye"}); 152 print CGI::start_div({class=>"info-box", id=>"fisheye"});
153 print CGI::h2("Sets"); 153 print CGI::h2($r->maketext("Sets"));
154 print CGI::start_ul(); 154 print CGI::start_ul();
155 155
156 debug("Begin printing sets from listUserSets()"); 156 debug("Begin printing sets from listUserSets()");
157 foreach my $setID (@setIDs) { 157 foreach my $setID (@setIDs) {
158 my $setPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSet", $r, 158 my $setPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSet", $r,
268 } 268 }
269 269
270 print CGI::start_div({class=>"info-box", id=>"InfoPanel"}); 270 print CGI::start_div({class=>"info-box", id=>"InfoPanel"});
271 271
272 if ($editorURL) { 272 if ($editorURL) {
273 print CGI::h2({},"Set Info", CGI::a({href=>$editorURL, target=>"WW_Editor"}, "[edit]")); 273 print CGI::h2({},$r->maketext("Set Info"), CGI::a({href=>$editorURL, target=>"WW_Editor"}, $r->maketext("~[edit~]")));
274 } else { 274 } else {
275 print CGI::h2("Set Info"); 275 print CGI::h2($r->maketext("Set Info"));
276 } 276 }
277 277
278 if ($pg->{flags}->{error_flag}) { 278 if ($pg->{flags}->{error_flag}) {
279 print CGI::div({class=>"ResultsWithError"}, $self->errorOutput($pg->{errors}, $pg->{body_text})); 279 print CGI::div({class=>"ResultsWithError"}, $self->errorOutput($pg->{errors}, $pg->{body_text}));
280 } else { 280 } else {
303 # FIXME: this was already caught in initialize() 303 # FIXME: this was already caught in initialize()
304 # die "set $setName for user $effectiveUser not found" unless $set; 304 # die "set $setName for user $effectiveUser not found" unless $set;
305 305
306 if ( $self->{invalidSet} ) { 306 if ( $self->{invalidSet} ) {
307 return CGI::div({class=>"ResultsWithError"}, 307 return CGI::div({class=>"ResultsWithError"},
308 CGI::p("The selected problem set ($setName) " . 308 CGI::p($r->maketext("The selected problem set ([_1]) is not a valid set for [_2]",$setName,$effectiveUser).":"),
309 "is not a valid set for $effectiveUser:"),
310 CGI::p($self->{invalidSet})); 309 CGI::p($self->{invalidSet}));
311 } 310 }
312 311
313 #my $hardcopyURL = 312 #my $hardcopyURL =
314 # $ce->{webworkURLs}->{root} . "/" 313 # $ce->{webworkURLs}->{root} . "/"
317 316
318 my $hardcopyPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Hardcopy", $r, 317 my $hardcopyPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::Hardcopy", $r,
319 courseID => $courseID, setID => $setName); 318 courseID => $courseID, setID => $setName);
320 my $hardcopyURL = $self->systemLink($hardcopyPage); 319 my $hardcopyURL = $self->systemLink($hardcopyPage);
321 320
322 print CGI::p(CGI::a({href=>$hardcopyURL}, $r->maketext("Download a hardcopy of this homework set."))); 321 print CGI::p(CGI::a({href=>$hardcopyURL}, $r->maketext("Download PDF or TeX Hardcopy for Selected Set[_1]")));
323 322
324 323
325 my $enable_reduced_scoring = $set->enable_reduced_scoring; 324 my $enable_reduced_scoring = $set->enable_reduced_scoring;
326 my $reducedScoringPeriod = $ce->{pg}->{ansEvalDefaults}->{reducedScoringPeriod}; 325 my $reducedScoringPeriod = $ce->{pg}->{ansEvalDefaults}->{reducedScoringPeriod};
327 if ($reducedScoringPeriod > 0 and $enable_reduced_scoring) { 326 if ($reducedScoringPeriod > 0 and $enable_reduced_scoring) {
329 my $reducedScoringPeriodSec = $reducedScoringPeriod*60; # $reducedScoringPeriod is in minutes 328 my $reducedScoringPeriodSec = $reducedScoringPeriod*60; # $reducedScoringPeriod is in minutes
330 my $reducedScoringValue = $ce->{pg}->{ansEvalDefaults}->{reducedScoringValue}; 329 my $reducedScoringValue = $ce->{pg}->{ansEvalDefaults}->{reducedScoringValue};
331 my $reducedScoringPerCent = int(100*$reducedScoringValue+.5); 330 my $reducedScoringPerCent = int(100*$reducedScoringValue+.5);
332 my $beginReducedScoringPeriod = $self->formatDateTime($set->due_date() - $reducedScoringPeriodSec); 331 my $beginReducedScoringPeriod = $self->formatDateTime($set->due_date() - $reducedScoringPeriodSec);
333 if (time < $set->due_date()) { 332 if (time < $set->due_date()) {
334 print CGI::div({class=>"ResultsAlert"},"This assignment has a Reduced Credit Period that begins 333 print CGI::div({class=>"ResultsAlert"},$r->maketext("_REDUCED_CREDIT_MESSAGE_1",$beginReducedScoringPeriod,$dueDate,$reducedScoringPerCent));
335 $beginReducedScoringPeriod and ends on the due date, $dueDate. During this period all additional
336 work done counts $reducedScoringPerCent\% of the original.");
337 } else { 334 } else {
338 print CGI::div({class=>"ResultsAlert"},"This assignment had a Reduced Credit Period that began 335 print CGI::div({class=>"ResultsAlert"},$r->maketext("_REDUCED_CREDIT_MESSAGE_2",$beginReducedScoringPeriod,$dueDate,$reducedScoringPerCent));
339 $beginReducedScoringPeriod and ended on the due date, $dueDate. During that period all additional
340 work done counted $reducedScoringPerCent\% of the original.");
341 } 336 }
342 } 337 }
343 338
344 # DBFIXME use iterator 339 # DBFIXME use iterator
345 my @problemNumbers = WeBWorK::remove_duplicates($db->listUserProblems($effectiveUser, $setName)); 340 my @problemNumbers = WeBWorK::remove_duplicates($db->listUserProblems($effectiveUser, $setName));
346 341
347 if (@problemNumbers) { 342 if (@problemNumbers) {
348 # UPDATE - ghe3 343 # UPDATE - ghe3
349 # This table now contains a summary, a caption, and scope variables for the columns. 344 # This table now contains a summary, a caption, and scope variables for the columns.
350 print CGI::start_table({-summary=>"This table shows the problems that are in this problem set. The columns from left to right are: name of the problem, current number of attempts made, number of attempts remaining, the point worth, and the completion status. Click on the link on the name of the problem to take you to the problem page.", -class=>"problem_set_table"}); 345 print CGI::start_table({-summary=>"This table shows the problems that are in this problem set. The columns from left to right are: name of the problem, current number of attempts made, number of attempts remaining, the point worth, and the completion status. Click on the link on the name of the problem to take you to the problem page.", -class=>"problem_set_table"});
351 print CGI::caption("Problems"); 346 print CGI::caption($r->maketext("Problems"));
352 print CGI::Tr({}, 347 print CGI::Tr({},
353 348
354 CGI::th($r->maketext("Name")), 349 CGI::th($r->maketext("Name")),
355 CGI::th($r->maketext("Attempts")), 350 CGI::th($r->maketext("Attempts")),
356 CGI::th($r->maketext("Remaining")), 351 CGI::th($r->maketext("Remaining")),

Legend:
Removed from v.6997  
changed lines
  Added in v.6998

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9