You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(53) |
Feb
(56) |
Mar
|
Apr
|
May
(30) |
Jun
(78) |
Jul
(121) |
Aug
(155) |
Sep
(77) |
Oct
(61) |
Nov
(45) |
Dec
(94) |
2006 |
Jan
(116) |
Feb
(33) |
Mar
(11) |
Apr
(23) |
May
(60) |
Jun
(89) |
Jul
(130) |
Aug
(109) |
Sep
(124) |
Oct
(63) |
Nov
(82) |
Dec
(45) |
2007 |
Jan
(31) |
Feb
(35) |
Mar
(123) |
Apr
(36) |
May
(18) |
Jun
(134) |
Jul
(133) |
Aug
(241) |
Sep
(126) |
Oct
(31) |
Nov
(15) |
Dec
(5) |
2008 |
Jan
(11) |
Feb
(6) |
Mar
(16) |
Apr
(29) |
May
(43) |
Jun
(149) |
Jul
(27) |
Aug
(29) |
Sep
(37) |
Oct
(20) |
Nov
(4) |
Dec
(6) |
2009 |
Jan
(34) |
Feb
(30) |
Mar
(16) |
Apr
(6) |
May
(1) |
Jun
(32) |
Jul
(22) |
Aug
(7) |
Sep
(18) |
Oct
(50) |
Nov
(22) |
Dec
(8) |
2010 |
Jan
(17) |
Feb
(15) |
Mar
(10) |
Apr
(9) |
May
(67) |
Jun
(30) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
From: Sam H. v. a. <we...@ma...> - 2005-10-11 22:07:10
|
Log Message: ----------- added sorting of set definition files, fixing bug #809. also added no_chdir=>1 flag to File::Find::find and modified $get_set_defs_wanted accordingly. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: SetMaker.pm Revision Data ------------- Index: SetMaker.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -u -r1.57 -r1.58 --- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm @@ -156,13 +156,14 @@ my @found_set_defs; # get_set_defs_wanted is a closure over @found_set_defs my $get_set_defs_wanted = sub { - my $fn = $_; - my $fdir = $File::Find::dir; - return() if($fn !~ /^set.*\.def$/); - #return() if(not -T $fn); - push @found_set_defs, "$fdir/$fn"; + #my $fn = $_; + #my $fdir = $File::Find::dir; + #return() if($fn !~ /^set.*\.def$/); + ##return() if(not -T $fn); + #push @found_set_defs, "$fdir/$fn"; + push @found_set_defs, $_ if m|/set[^/]*\.def$|; }; - find({ wanted => $get_set_defs_wanted, follow_fast=>1}, $topdir); + find({ wanted => $get_set_defs_wanted, follow_fast=>1, no_chdir=>1}, $topdir); map { $_ =~ s|^$topdir/?|| } @found_set_defs; return @found_set_defs; } @@ -673,7 +674,11 @@ my $ce = $r->ce; my $library_selected = shift; my $default_value = "Select a Set Definition File"; - my @list_of_set_defs = get_set_defs($ce->{courseDirs}{templates}); + # in the following line, the parens after sort are important. if they are + # omitted, sort will interpret get_set_defs as the name of the comparison + # function, and ($ce->{courseDirs}{templates}) as a single element list to + # be sorted. *barf* + my @list_of_set_defs = sort(get_set_defs($ce->{courseDirs}{templates})); if(scalar(@list_of_set_defs) == 0) { @list_of_set_defs = (NO_LOCAL_SET_STRING); } elsif (not $library_selected or $library_selected eq $default_value) { |
From: Sam H. v. a. <we...@ma...> - 2005-10-11 21:14:04
|
Log Message: ----------- added check to ensure that permission level is numeric, fixing bug #822. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: UserList.pm Revision Data ------------- Index: UserList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v retrieving revision 1.73 retrieving revision 1.74 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -u -r1.73 -r1.74 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -1297,6 +1297,8 @@ %replaceOK = %allUserIDs; } + my $default_permission_level = $ce->{default_permission_level}; + my (@replaced, @added, @skipped); # get list of hashrefs representing lines in classlist file @@ -1321,6 +1323,12 @@ next; } + # make sure permission level is numeric + unless ($record{permission} =~ m/^[+\-]?\d*$/) { + $self->addbadmessage("permission level '$record{permission}' for user '$user_id' is not an integer. using default permission level '$default_permission_level'.\n"); + $record{permission} = $default_permission_level; + } + my $User = $db->newUser(%record); my $PermissionLevel = $db->newPermissionLevel(user_id => $user_id, permission => 0); my $Password = $db->newPassword(user_id => $user_id, password => cryptPassword($record{student_id})); |
From: Sam H. v. a. <we...@ma...> - 2005-10-11 21:04:46
|
Log Message: ----------- added $default_permission_level Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.150 retrieving revision 1.151 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.150 -r1.151 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -555,6 +555,10 @@ download_hardcopy_format_tex => "ta", ); +# This is the default permission level given to new students and students with +# invalid or missing permission levels. +$default_permission_level = $userRoles{student}; + ################################################################################ # Status system ################################################################################ |
From: Sam H. v. a. <we...@ma...> - 2005-10-11 20:46:39
|
Log Message: ----------- don't show "act as" link unless the user is actually allowed to. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: Stats.pm StudentProgress.pm Revision Data ------------- Index: Stats.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Stats.pm,v retrieving revision 1.59 retrieving revision 1.60 diff -Llib/WeBWorK/ContentGenerator/Instructor/Stats.pm -Llib/WeBWorK/ContentGenerator/Instructor/Stats.pm -u -r1.59 -r1.60 --- lib/WeBWorK/ContentGenerator/Instructor/Stats.pm +++ lib/WeBWorK/ContentGenerator/Instructor/Stats.pm @@ -137,43 +137,35 @@ unless $authz->hasPermissions($user, "access_instructor_tools"); if ($type eq 'student') { - my $studentName = $self->{studentName}; + my $studentName = $self->{studentName}; + my $studentRecord = $db->getUser($studentName) # checked + or die "record for user $studentName not found"; + my $fullName = $studentRecord->full_name; + my $courseHomePage = $urlpath->new(type => 'set_list', + args => {courseID=>$courseName}); + my $email = $studentRecord->email_address; - my $studentRecord = $db->getUser($studentName); # checked - die "record for user $studentName not found" unless $studentRecord; - - my $fullName = join("", $studentRecord->first_name," ", $studentRecord->last_name); - - my $courseHomePage = $urlpath->new(type => 'set_list', - args => {courseID => $courseName} - ); - my $act_as_student_url = $self->systemLink($courseHomePage, - params => { effectiveUser => $studentName } - ); - - my $email = $studentRecord->email_address; - print - CGI::a({-href=>"mailto:$email"},$email),CGI::br(), + print CGI::a({-href=>"mailto:$email"}, $email), CGI::br(), "Section: ", $studentRecord->section, CGI::br(), - "Recitation: ", $studentRecord->recitation,CGI::br(), - 'Act as: ', - CGI::a({-href=>$act_as_student_url},$studentRecord->user_id); - WeBWorK::ContentGenerator::Grades::displayStudentStats($self,$studentName); + "Recitation: ", $studentRecord->recitation, CGI::br(); - # The table format has been borrowed from the Grades.pm module + if ($authz->hasPermissions($user, "become_student")) { + my $act_as_student_url = $self->systemLink($courseHomePage, + params => {effectiveUser=>$studentName}); + + print 'Act as: ', CGI::a({-href=>$act_as_student_url},$studentRecord->user_id); + } + + print WeBWorK::ContentGenerator::Grades::displayStudentStats($self,$studentName); } elsif( $type eq 'set') { - my $setName = $self->{setName}; $self->displaySets($self->{setName}); } elsif ($type eq '') { $self->index; } else { warn "Don't recognize statistics display type: |$type|"; - } - return ''; - } sub index { my $self = shift; Index: StudentProgress.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -Llib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm -Llib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm -u -r1.21 -r1.22 --- lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm +++ lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm @@ -136,32 +136,27 @@ unless $authz->hasPermissions($user, "access_instructor_tools"); if ($type eq 'student') { - my $studentName = $self->{studentName}; + my $studentName = $self->{studentName}; + my $studentRecord = $db->getUser($studentName) # checked + or die "record for user $studentName not found"; + my $fullName = $studentRecord->full_name; + my $courseHomePage = $urlpath->new(type => 'set_list', + args => {courseID=>$courseName}); + my $email = $studentRecord->email_address; - my $studentRecord = $db->getUser($studentName); # checked - die "record for user $studentName not found" unless $studentRecord; - - my $fullName = join("", $studentRecord->first_name," ", $studentRecord->last_name); - - my $courseHomePage = $urlpath->new(type => 'set_list', - args => {courseID => $courseName} - ); - my $act_as_student_url = $self->systemLink($courseHomePage, - params => { effectiveUser => $studentName } - ); - - my $email = $studentRecord->email_address; - print - CGI::a({-href=>"mailto:$email"},$email),CGI::br(), + print CGI::a({-href=>"mailto:$email"}, $email), CGI::br(), "Section: ", $studentRecord->section, CGI::br(), - "Recitation: ", $studentRecord->recitation,CGI::br(), - 'Act as: ', - CGI::a({-href=>$act_as_student_url},$studentRecord->user_id); - WeBWorK::ContentGenerator::Grades::displayStudentStats($self,$studentName); + "Recitation: ", $studentRecord->recitation, CGI::br(); + + if ($authz->hasPermissions($user, "become_student")) { + my $act_as_student_url = $self->systemLink($courseHomePage, + params => {effectiveUser=>$studentName}); + + print 'Act as: ', CGI::a({-href=>$act_as_student_url},$studentRecord->user_id); + } - # The table format has been borrowed from the Grades.pm module + print WeBWorK::ContentGenerator::Grades::displayStudentStats($self,$studentName); } elsif( $type eq 'set') { - my $setName = $self->{setName}; $self->displaySets($self->{setName}); } elsif ($type eq '') { |
From: Sam H. v. a. <we...@ma...> - 2005-10-11 20:45:36
|
Log Message: ----------- stop redirecting to Login when user is not allowed to "act as". Instead, throw an exception. Modified Files: -------------- webwork2/lib: WeBWorK.pm Revision Data ------------- Index: WeBWorK.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK.pm,v retrieving revision 1.76 retrieving revision 1.77 diff -Llib/WeBWorK.pm -Llib/WeBWorK.pm -u -r1.76 -r1.77 --- lib/WeBWorK.pm +++ lib/WeBWorK.pm @@ -241,9 +241,10 @@ debug("Ok, looks like you're allowed to become $eUserID. Whoopie!\n"); } else { debug("Uh oh, you're not allowed to become $eUserID. Nice try!\n"); - $eUserID = $userID; - $r->notes("authen_error" => "You do not have permission to become another user."); - $displayModule = AUTHEN_MODULE; + #$eUserID = $userID; + #$r->notes("authen_error" => "You do not have permission to become another user."); + #$displayModule = AUTHEN_MODULE; + die "You are not allowed to act as another user.\n"; } } |
From: jj v. a. <we...@ma...> - 2005-10-11 18:01:10
|
Log Message: ----------- Added syntactic sugar for pop_up_lists. A common situation is that a problem includes a short multiple-choice question along with other answers. Often, these questions are written as fill-in-the-blank where the student is told a list of legal words to put in the blanks. The idea is to make it as simple as possible for problem writers to replace the fill-in-the-blank with a drop-down list of alternatives. So, now the text of a problem can contain is the function increasing on [0,1]? \{ pop_up_list(['?', 'yes', 'no']) \} instead of is the function increasing on [0,1]? \{ pop_up_list('?' => '?', 'yes' => 'yes', 'no' => 'no') \} The result is checked with something like ANS(str_cmp('yes')); Existing problems are unaffected since the added syntax uses a reference to a list (the extra square brackets). Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.42 retrieving revision 1.43 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.42 -r1.43 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -185,7 +185,12 @@ ans_rule( width ) tex_ans_rule( width ) ans_radio_buttons(value1=>label1, value2,label2 => value3,label3=>...) - pop_up_list(@list) # list consists of (value => label, PR => "Product rule",...) + pop_up_list(@list) # list consists of (value => label, PR => "Product rule",...) + pop_up_list([@list]) # list consists of values + +In the last case, one can use C<pop_up_list(['?', 'yes', 'no'])> to produce a +pop-up list containing the three strings listed, and then use str_cmp to check +the answer. To indicate the checked position of radio buttons put a '%' in front of the value: C<ans_radio_buttons(1, 'Yes','%2','No')> will have 'No' checked. C<tex_ans_rule> works inside math equations in C<HTML_tth> mode. It does not work in C<Latex2HTML> mode @@ -212,6 +217,7 @@ NAMED_ANS_RADIO_BUTTONS(name,value1,label1,value2,label2,...) check_box('-name' =>answer5,'-value' =>'statement3','-label' =>'I loved this course!' ) NAMED_POP_UP_LIST($name, @list) # list consists of (value => tag, PR => "Product rule",...) + NAMED_POP_UP_LIST($name, [@list]) # list consists of a list of values (and each tag will be set to the corresponding value) (Name is the name of the variable, value is the value given to the variable when this option is selected, and label is the text printed next to the button or check box. Check box variables can have multiple values.) @@ -733,6 +739,10 @@ sub NAMED_POP_UP_LIST { my $name = shift; my @list = @_; + if(ref($list[0]) eq 'ARRAY') { + my @list1 = @{$list[0]}; + @list = map { $_ => $_ } @list1; + } $name = RECORD_ANS_NAME($name); # record answer name my $answer_value = ''; $answer_value = ${$inputs_ref}{$name} if defined(${$inputs_ref}{$name}); |
From: dpvc v. a. <we...@ma...> - 2005-10-10 23:47:49
|
Log Message: ----------- Add a new context flag that controls how the student answer should be displayed. The formatStudentAnswer flag can be set to 'evaluated' (the default), which shows the final numeric answer; 'parsed', which shows the fully parsed version (including extra parentheses for clarity); or 'reduced', which performs constant operations, but doesn't perform function evaluations or named-constant substitutions. For example, if the student answers 1+2+sqrt(3), then 'evaluated' will produce 4.73205, 'reduced' will show 3+sqrt(3), and 'parsed' will show 1+2+sqrt(3). Modified Files: -------------- pg/lib/Parser/Context: Default.pm pg/lib/Value: AnswerChecker.pm Revision Data ------------- Index: Default.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Context/Default.pm,v retrieving revision 1.32 retrieving revision 1.33 diff -Llib/Parser/Context/Default.pm -Llib/Parser/Context/Default.pm -u -r1.32 -r1.33 --- lib/Parser/Context/Default.pm +++ lib/Parser/Context/Default.pm @@ -196,6 +196,7 @@ reduceConstants => 1, # 1 = automatically combine constants reduceConstantFunctions => 1, # 1 = compute function values of constants showExtraParens => 0, # 1 = make things painfully unambiguous + formatStudentAnswer => 'evaluated', # or 'parsed' or 'reduced' }; ############################################################################ Index: AnswerChecker.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/AnswerChecker.pm,v retrieving revision 1.68 retrieving revision 1.69 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.68 -r1.69 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -31,6 +31,28 @@ )} # +# Special Context flags to be set for the student answer +# +sub cmp_contextFlags { + my $self = shift; my $ans = shift; + return ( + StringifyAsTeX => 0, # reset this, just in case. + no_parameters => 1, # don't let students enter parameters + showExtraParens => 1, # make student answer painfully unambiguous + reduceConstants => 0, # don't combine student constants + reduceConstantFunctions => 0, # don't reduce constant functions + ($ans->{studentsMustReduceUnions} ? + (reduceUnions => 0, reduceSets => 0, + reduceUnionsForComparison => $ans->{showUnionReduceWarnings}, + reduceSetsForComparison => $ans->{showUnionReduceWarnings}) : + (reduceUnions => 1, reduceSets => 1, + reduceUnionsForComparison => 1, reduceSetsForComparison => 1)), + ($ans->{requireParenMatch}? (): ignoreEndpointTypes => 1), # for Intervals + ); +} + + +# # Create an answer checker for the given type of object # sub cmp { @@ -67,21 +89,7 @@ my $current = $$Value::context; # save it for later my $context = $ans->{correct_value}{context} || $current; Parser::Context->current(undef,$context); # change to correct answser's context - my $flags = contextSet($context, # save old context flags for the below - StringifyAsTeX => 0, # reset this, just in case. - no_parameters => 1, # don't let students enter parameters - showExtraParens => 1, # make student answer painfully unambiguous - reduceConstants => 0, # don't combine student constants - reduceConstantFunctions => 0, # don't reduce constant functions - ($ans->{studentsMustReduceUnions} ? - (reduceUnions => 0, reduceSets => 0, - reduceUnionsForComparison => $ans->{showUnionReduceWarnings}, - reduceSetsForComparison => $ans->{showUnionReduceWarnings}) : - (reduceUnions => 1, reduceSets => 1, - reduceUnionsForComparison => 1, reduceSetsForComparison => 1)), - ($ans->{requireParenMatch}? (): ignoreEndpointTypes => 1), # for Intervals - $self->cmp_contextFlags($ans), # any additional ones from the object itself - ); + my $flags = contextSet($context,$self->cmp_contextFlags($ans)); # save old context flags my $inputs = $self->getPG('$inputs_ref',{action=>""}); $ans->{isPreview} = $inputs->{previewAnswers} || ($inputs->{action} =~ m/^Preview/); $ans->{cmp_class} = $self->cmp_class($ans) unless $ans->{cmp_class}; @@ -105,7 +113,19 @@ unless Value::isValue($ans->{student_value}); $ans->{preview_latex_string} = $ans->{student_formula}->TeX; $ans->{preview_text_string} = protectHTML($ans->{student_formula}->string); - $ans->{student_ans} = protectHTML($ans->{student_value}->string); + # + # Get the string for the student answer + # + for ($ans->{formatStudentAnswer} || $context->flag('formatStudentAnswer')) { + /evaluated/i and do {$ans->{student_ans} = protectHTML($ans->{student_value}->string); last}; + /parsed/i and do {$ans->{student_ans} = $ans->{preview_text_string}; last}; + /reduced/i and do { + my $oldFlags = contextSet($context,reduceConstants=>1,reduceConstantFunctions=>0); + $ans->{student_ans} = protectHTML($ans->{student_formula}->substitute()->string); + contextSet($context,%{$oldFags}); last; + }; + warn "Unkown student answer format |$ans->{formatStudentAnswer}|"; + } if ($self->cmp_collect($ans)) { $self->cmp_equal($ans); $self->cmp_postprocess($ans) if !$ans->{error_message}; @@ -248,7 +268,6 @@ # filled in by sub-classes # sub cmp_postprocess {} -sub cmp_contextFlags {return ()} # # Check for unreduced reduced Unions and Sets |
From: dpvc v. a. <we...@ma...> - 2005-10-10 23:41:26
|
Log Message: ----------- If constant functions are not being reduced, don't mark the function call as constant (since otherwise it might be evaluated later accidentally). Modified Files: -------------- pg/lib/Parser: Function.pm Revision Data ------------- Index: Function.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Function.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -Llib/Parser/Function.pm -Llib/Parser/Function.pm -u -r1.17 -r1.18 --- lib/Parser/Function.pm +++ lib/Parser/Function.pm @@ -21,8 +21,9 @@ }, $def->{class}; $fn->{isConstant} = $constant; $fn->_check; - $fn = $context->{parser}{Value}->new($equation,[$fn->eval]) + return $context->{parser}{Value}->new($equation,[$fn->eval]) if $constant && $context->flag('reduceConstantFunctions'); + $fn->{isConstant} = 0; return $fn; } @@ -79,6 +80,7 @@ {$x = $x->substitute; $constant = 0 unless $x->{isConstant}} return $context->{parser}{Value}->new($equation,[$self->eval]) if $constant && $context->flag('reduceConstantFunctions'); + $self->{isConstant} = 0; return $self; } |
From: Sam H. v. a. <we...@ma...> - 2005-10-10 22:37:47
|
Log Message: ----------- putting site_info back in htdocs. see bug #832. Modified Files: -------------- webwork2/conf: global.conf.dist Added Files: ----------- webwork2/htdocs: site_info.txt Removed Files: ------------- webwork2/conf/snippets: site_info.txt Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.149 retrieving revision 1.150 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.149 -r1.150 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -316,7 +316,7 @@ $webworkFiles{screenSnippets}{blankProblem} = "$webworkDirs{conf}/snippets/blankProblem.pg"; # screenSetHeader.pg" # A site info "message of the day" file -$webworkFiles{site_info} = "$webworkDirs{conf}/snippets/site_info.txt"; +$webworkFiles{site_info} = "$webworkDirs{htdocs}/site_info.txt"; ################################################################################ # Course-specific files |
From: Sam H. v. a. <we...@ma...> - 2005-10-10 22:34:41
|
Log Message: ----------- make sure there are answer blanks before printing \begin{itemize}. fixes bug #859. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Hardcopy.pm Revision Data ------------- Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.66 retrieving revision 1.67 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.66 -r1.67 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -813,11 +813,12 @@ print $FH $pg->{body_text}; # write the list of correct answers is appropriate - if ($showCorrectAnswers && $MergedProblem->problem_id != 0) { + my @ans_entry_order = @{$pg->{flags}->{ANSWER_ENTRY_ORDER}}; + if ($showCorrectAnswers && $MergedProblem->problem_id != 0 && @ans_entry_order) { my $correctTeX = "\\par{\\small{\\it Correct Answers:}\n" . "\\vspace{-\\parskip}\\begin{itemize}\n"; - foreach my $ansName (@{$pg->{flags}->{ANSWER_ENTRY_ORDER}}) { + foreach my $ansName (@ans_entry_order) { my $correctAnswer = $pg->{answers}->{$ansName}->{correct_ans}; $correctTeX .= "\\item\\begin{verbatim}$correctAnswer\\end{verbatim}\n"; # FIXME: What about vectors (where TeX will complain about < and > outside of math mode)? |
From: Sam H. v. a. <we...@ma...> - 2005-10-10 22:18:23
|
Log Message: ----------- added full_name and rfc822_mailbox methods for convenience. Modified Files: -------------- webwork2/lib/WeBWorK/DB/Record: User.pm Revision Data ------------- Index: User.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Record/User.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -Llib/WeBWorK/DB/Record/User.pm -Llib/WeBWorK/DB/Record/User.pm -u -r1.6 -r1.7 --- lib/WeBWorK/DB/Record/User.pm +++ lib/WeBWorK/DB/Record/User.pm @@ -65,4 +65,38 @@ TEXT )} +sub full_name { + my ($self) = @_; + + my $first = $self->first_name; + my $last = $self->last_name; + + if (defined $first and $first ne "" and defined $last and $last ne "") { + return "$first $last"; + } elsif (defined $first and $first ne "") { + return $first; + } elsif (defined $last and $last ne "") { + return $last; + } else { + return ""; + } +} + +sub rfc822_mailbox { + my ($self) = @_; + + my $full_name = $self->full_name; + my $address = $self->email_address; + + if (defined $address and $address ne "") { + if (defined $full_name and $full_name ne "") { + return "$full_name <$address>"; + } else { + return $address; + } + } else { + return ""; + } +} + 1; |
From: dpvc v. a. <we...@ma...> - 2005-10-10 12:37:55
|
Log Message: ----------- Fixed a bug where correct_ans could not be overridden in the cmp() method for Lists. Modified Files: -------------- pg/lib/Value: AnswerChecker.pm Revision Data ------------- Index: AnswerChecker.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/AnswerChecker.pm,v retrieving revision 1.67 retrieving revision 1.68 diff -Llib/Value/AnswerChecker.pm -Llib/Value/AnswerChecker.pm -u -r1.67 -r1.68 --- lib/Value/AnswerChecker.pm +++ lib/Value/AnswerChecker.pm @@ -1002,11 +1002,12 @@ # sub cmp { my $self = shift; + my %params = @_; my $cmp = $self->SUPER::cmp(@_); if ($cmp->{rh_ans}{removeParens}) { $self->{open} = $self->{close} = ''; $cmp->ans_hash(correct_ans => $self->stringify) - unless defined($self->{correct_ans}); + unless defined($self->{correct_ans}) || defined($params{correct_ans}); } return $cmp; } |
From: Sam H. v. a. <we...@ma...> - 2005-10-08 22:21:19
|
Log Message: ----------- fix for bug 815 "Emphasize set name on the Assign users to Set page (set detail page)" Modified Files: -------------- webwork2/lib/WeBWorK: URLPath.pm webwork2/lib/WeBWorK/ContentGenerator/Instructor: UsersAssignedToSet.pm Revision Data ------------- Index: URLPath.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/URLPath.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -Llib/WeBWorK/URLPath.pm -Llib/WeBWorK/URLPath.pm -u -r1.26 -r1.27 --- lib/WeBWorK/URLPath.pm +++ lib/WeBWorK/URLPath.pm @@ -300,7 +300,7 @@ display => 'WeBWorK::ContentGenerator::Instructor::ProblemSetDetail', }, instructor_users_assigned_to_set => { - name => 'Users Assigned to Set', + name => 'Users Assigned to Set $setID', parent => 'instructor_set_detail', kids => [ qw// ], match => qr|^users/|, Index: UsersAssignedToSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -Llib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm -Llib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm -u -r1.19 -r1.20 --- lib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm @@ -98,7 +98,6 @@ return $pathSetName; } - sub body { my ($self) = @_; my $r = $self->r; @@ -127,7 +126,7 @@ "There is NO undo for unassigning students. "), CGI::p("When you unassign by unchecking a student's name, you destroy all - of the data for homework set $setID for this student. You will then need to + of the data for homework set ".CGI::b($setID)." for this student. You will then need to reassign the set to these students and they will receive new versions of the problems. Make sure this is what you want to do before unchecking students." ); |
From: Sam H. v. a. <we...@ma...> - 2005-10-08 22:13:56
|
Log Message: ----------- added check for $total==0 to eliminate potential DIV error (bug #855) Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Grades.pm Revision Data ------------- Index: Grades.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Grades.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -Llib/WeBWorK/ContentGenerator/Grades.pm -Llib/WeBWorK/ContentGenerator/Grades.pm -u -r1.18 -r1.19 --- lib/WeBWorK/ContentGenerator/Grades.pm +++ lib/WeBWorK/ContentGenerator/Grades.pm @@ -337,7 +337,7 @@ my $avg_num_attempts = ($num_of_problems) ? $num_of_attempts/$num_of_problems : 0; - my $successIndicator = ($avg_num_attempts) ? ($totalRight/$total)**2/$avg_num_attempts : 0 ; + my $successIndicator = ($avg_num_attempts && $total) ? ($totalRight/$total)**2/$avg_num_attempts : 0 ; push @rows, CGI::Tr( CGI::td(CGI::a({-href=>$act_as_student_set_url}, WeBWorK::ContentGenerator::underscore2nbsp($setName))), |
From: Sam H. v. a. <we...@ma...> - 2005-10-08 22:08:35
|
Log Message: ----------- disallow login of "dropped" practice users (bug #387). also don't show Guest Login button if there are no "dropped" practice users. Modified Files: -------------- webwork2/lib/WeBWorK: Authen.pm webwork2/lib/WeBWorK/ContentGenerator: Login.pm Revision Data ------------- Index: Authen.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Authen.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -Llib/WeBWorK/Authen.pm -Llib/WeBWorK/Authen.pm -u -r1.45 -r1.46 --- lib/WeBWorK/Authen.pm +++ lib/WeBWorK/Authen.pm @@ -287,7 +287,14 @@ if ($login_practice_user) { # ignore everything else, find an unused practice user my $found = 0; - foreach my $userID (sort grep m/^$practiceUserPrefix/, $db->listUsers) { + + # figure out if there are any valid practice users + my @guestUserIDs = grep m/^$practiceUserPrefix/, $db->listUsers; + my @GuestUsers = $db->getUsers(@guestUserIDs); + my @allowedGuestUsers = grep { $ce->status_abbrev_has_behavior($_->status, "allow_course_access") } @GuestUsers; + my @allowedGestUserIDs = map { $_->user_id } @allowedGuestUsers; + + foreach my $userID (@allowedGestUserIDs) { if (not $self->unexpiredKeyExists($userID)) { my $Key = $self->generateKey($userID); $db->addKey($Key); Index: Login.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Login.pm,v retrieving revision 1.29 retrieving revision 1.30 diff -Llib/WeBWorK/ContentGenerator/Login.pm -Llib/WeBWorK/ContentGenerator/Login.pm -u -r1.29 -r1.30 --- lib/WeBWorK/ContentGenerator/Login.pm +++ lib/WeBWorK/ContentGenerator/Login.pm @@ -172,8 +172,13 @@ print CGI::input({-type=>"submit", -value=>"Continue"}); print CGI::endform(); + # figure out if there are any valid practice users + my @guestUserIDs = grep m/^$practiceUserPrefix/, $db->listUsers; + my @GuestUsers = $db->getUsers(@guestUserIDs); + my @allowedGuestUsers = grep { $ce->status_abbrev_has_behavior($_->status, "allow_course_access") } @GuestUsers; + # form for guest login - if (grep m/^$practiceUserPrefix/, $db->listUsers) { + if (@allowedGuestUsers) { print CGI::startform({-method=>"POST", -action=>$r->uri}); # preserve the form data posted to the requested URI |
From: Sam H. v. a. <we...@ma...> - 2005-10-08 22:03:04
|
Log Message: ----------- fixed typo. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: AddUsers.pm Revision Data ------------- Index: AddUsers.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -Llib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm -Llib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm -u -r1.19 -r1.20 --- lib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm +++ lib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm @@ -66,7 +66,7 @@ $newUser->section(trim_spaces($r->param("section_$i"))); $newUser->recitation(trim_spaces($r->param("recitation_$i"))); $newUser->comment(trim_spaces($r->param("comment_$i"))); - $newUser->status($ce->status_name_to_abbrev($ce->{default_status})); + $newUser->status($ce->status_name_to_abbrevs($ce->{default_status})); $newPermissionLevel->permission(0); #FIXME handle errors if user exists already eval { $db->addUser($newUser) }; |
From: Sam H. v. a. <we...@ma...> - 2005-10-08 21:57:12
|
Log Message: ----------- added "include_in_email" behavior to Enrolled and Audit statuses. Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.146 retrieving revision 1.147 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.146 -r1.147 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -489,7 +489,7 @@ submit_feedback => "student", change_password => "student", change_email_address => "student", - + proctor_quiz => "proctor", view_multiple_sets => "ta", @@ -553,6 +553,10 @@ # Status system ################################################################################ +# This is the default status given to new students and students with invalid +# or missing statuses. +$default_status = "Enrolled"; + # The first abbreviation in the abbreviations list is the canonical # abbreviation, and will be used when setting the status value in a user record # or an exported classlist file. @@ -563,16 +567,19 @@ # allow_course_access => is this user allowed to log in? # include_in_assignment => is this user included when assigning as set to "all" users? # include_in_stats => is this user included in statistical reports? +# include_in_email => is this user included in emails sent to the class? # include_in_scoring => is this user included in score reports? %statuses = ( Enrolled => { abbrevs => [qw/ C c current enrolled /], - behaviors => [qw/ allow_course_access include_in_assignment include_in_stats include_in_scoring /], + behaviors => [qw/ allow_course_access include_in_assignment include_in_stats + include_in_email include_in_scoring /], }, Audit => { abbrevs => [qw/ A a audit /], - behaviors => [qw/ allow_course_access include_in_assignment include_in_stats /], + behaviors => [qw/ allow_course_access include_in_assignment include_in_stats + include_in_email /], }, Drop => { abbrevs => [qw/ D d drop withdraw /], @@ -580,10 +587,6 @@ }, ); -# This is the default status given to new students and students with invalid -# or missing statuses. -$default_status = "Enrolled"; - ################################################################################ # Session options ################################################################################ |
From: Sam H. v. a. <we...@ma...> - 2005-10-08 21:56:40
|
Log Message: ----------- modify usage of user status to take advantage of new status system. the=20 most extensive change is in UserList, where the names of statuses are=20 now shown in the status column along with the abbreviation that's=20 actually set in the database, and the edit popup shows the actual names=20 that are defined in global.conf. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Grades.pm webwork2/lib/WeBWorK/ContentGenerator/Instructor: AddUsers.pm SendMail.pm Stats.pm StudentProgress.pm UserList.pm Revision Data ------------- Index: Grades.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Grade= s.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -Llib/WeBWorK/ContentGenerator/Grades.pm -Llib/WeBWorK/ContentGenera= tor/Grades.pm -u -r1.17 -r1.18 --- lib/WeBWorK/ContentGenerator/Grades.pm +++ lib/WeBWorK/ContentGenerator/Grades.pm @@ -148,12 +148,15 @@ $text =3D join( '', <FILE>); close(FILE); =09 + my $status_name =3D $ce->status_abbrev_to_name($ur->status); + $status_name =3D $ur->status unless defined $status_name; +=09 my $SID =3D $ur->student_id; my $FN =3D $ur->first_name; my $LN =3D $ur->last_name; my $SECTION =3D $ur->section; my $RECITATION =3D $ur->recitation; - my $STATUS =3D $ur->status; + my $STATUS =3D $status_name; my $EMAIL =3D $ur->email_address; my $LOGIN =3D $ur->user_id; my @COL =3D defined($rh_merge_data->{$SID}) ? @{$rh_merge_dat= a->{$SID} } : (); @@ -161,6 +164,7 @@ =20 my $endCol =3D @COL; # for safety, only evaluate special variables + # FIXME /e is not required for simple variable interpolation my $msg =3D $text;=20 $msg =3D~ s/(\$PAR)/<p>/ge; $msg =3D~ s/(\$BR)/<br>/ge; Index: Stats.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instr= uctor/Stats.pm,v retrieving revision 1.58 retrieving revision 1.59 diff -Llib/WeBWorK/ContentGenerator/Instructor/Stats.pm -Llib/WeBWorK/Con= tentGenerator/Instructor/Stats.pm -u -r1.58 -r1.59 --- lib/WeBWorK/ContentGenerator/Instructor/Stats.pm +++ lib/WeBWorK/ContentGenerator/Instructor/Stats.pm @@ -324,7 +324,7 @@ next unless ref($studentRecord); my $student =3D $studentRecord->user_id; next if $studentRecord->last_name =3D~/^practice/i; # don't show prac= tice users - next if $studentRecord->status !~/C/; # don't show droppe= d students FIXME + next unless $ce->status_abbrev_has_behavior($studentRecord->status, "i= nclude_in_stats"); $number_of_active_students++; my $string =3D ''; my $twoString =3D ''; Index: SendMail.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instr= uctor/SendMail.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -Llib/WeBWorK/ContentGenerator/Instructor/SendMail.pm -Llib/WeBWorK/= ContentGenerator/Instructor/SendMail.pm -u -r1.42 -r1.43 --- lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm @@ -165,7 +165,9 @@ # =20 foreach my $ur (@user_records) { - push(@send_to,$ur->user_id) if $ur->status eq 'C' and not($ur->user_i= d =3D~ /practice/); + push(@send_to,$ur->user_id) + if $ce->status_abbrev_has_behavior($ur->status, "include_in_email") + and not $ur->user_id =3D~ /practice/; } } elsif (defined($recipients) and $recipients eq 'studentID' ) { @send_to =3D $r->param('classList'); @@ -938,13 +940,17 @@ my $text =3D defined($self->{r_text}) ? ${ $self->{r_text} }: 'FIXME no text was produced by initialization!!= ';=09 my $merge_file =3D ( defined($self->{merge_file}) ) ? $self->{merg= e_file} : 'None'; =20 +=09 + my $status_name =3D $self->r->ce->status_abbrev_to_name($ur->status); + $status_name =3D $ur->status unless defined $status_name; +=09 #user macros that can be used in the email message my $SID =3D $ur->student_id; my $FN =3D $ur->first_name; my $LN =3D $ur->last_name; my $SECTION =3D $ur->section; my $RECITATION =3D $ur->recitation; - my $STATUS =3D $ur->status; + my $STATUS =3D $status_name; my $EMAIL =3D $ur->email_address; my $LOGIN =3D $ur->user_id; =09 @@ -984,9 +990,9 @@ } =20 =20 -# =CA sub data_format { +# =DD sub data_format { #=20 -# =CA =CA =CA =CA =CAmap {$_ =3D~s/\s/\./g;$_} =CA =CA map {sprintf('%-8= .8s',$_);} =CA@_; +# =DD =DD =DD =DD =DDmap {$_ =3D~s/\s/\./g;$_} =DD =DD map {sprintf('%-8= .8s',$_);} =DD@_; sub data_format { map {"COL[$_]".' 'x(3-length($_));} @_; # problems if $_ ha= s length bigger than 4 } Index: UserList.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instr= uctor/UserList.pm,v retrieving revision 1.72 retrieving revision 1.73 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/= ContentGenerator/Instructor/UserList.pm -u -r1.72 -r1.73 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -136,20 +136,21 @@ access =3D> "readwrite", }, status =3D> { - type =3D> "enumerable", + #type =3D> "enumerable", + type =3D> "status", size =3D> 4, access =3D> "readwrite", - items =3D> { - "C" =3D> "Enrolled", - "D" =3D> "Drop", - "A" =3D> "Audit", - }, - synonyms =3D> { - qr/^[ce]/i =3D> "C", - qr/^[dw]/i =3D> "D", - qr/^a/i =3D> "A", - "*" =3D> "C", - } + #items =3D> { + # "C" =3D> "Enrolled", + # "D" =3D> "Drop", + # "A" =3D> "Audit", + #}, + #synonyms =3D> { + # qr/^[ce]/i =3D> "C", + # qr/^[dw]/i =3D> "D", + # qr/^a/i =3D> "A", + # "*" =3D> "C", + #} }, section =3D> { type =3D> "text", @@ -1385,6 +1386,7 @@ =20 sub fieldEditHTML { my ($self, $fieldName, $value, $properties) =3D @_; + my $ce =3D $self->r->ce; my $size =3D $properties->{size}; my $type =3D $properties->{type}; my $access =3D $properties->{access}; @@ -1400,6 +1402,13 @@ } =09 if ($access eq "readonly") { + # hack for status + if ($type eq "status") { + my $status_name =3D $ce->status_abbrev_to_name($value); + if (defined $status_name) { + $value =3D "$status_name ($value)"; + } + } return $value; } =09 @@ -1429,6 +1438,31 @@ labels =3D> $items, }); } +=09 + if ($type eq "status") { + # we used to surreptitously map synonyms to a canonical value... + # so should we continue to do that? + my $status_name =3D $ce->status_abbrev_to_name($value); + if (defined $status_name) { + $value =3D ($ce->status_name_to_abbrevs($status_name))[0]; + } + =09 + my (@values, %labels); + while (my ($k, $v) =3D each %{$ce->{statuses}}) { + my @abbrevs =3D @{$v->{abbrevs}}; + push @values, $abbrevs[0]; + foreach my $abbrev (@abbrevs) { + $labels{$abbrev} =3D $k; + } + } + =09 + return CGI::popup_menu({ + name =3D> $fieldName,=20 + values =3D> \@values, + default =3D> $value, + labels =3D> \%labels, + }); + } } =20 sub recordEditHTML { Index: StudentProgress.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instr= uctor/StudentProgress.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -Llib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm -Llib/W= eBWorK/ContentGenerator/Instructor/StudentProgress.pm -u -r1.20 -r1.21 --- lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm +++ lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm @@ -384,7 +384,7 @@ next unless ref($studentRecord); my $student =3D $studentRecord->user_id; next if $studentRecord->last_name =3D~/^practice/i; # don't show prac= tice users - next if $studentRecord->status !~/C/; # don't show droppe= d students FIXME + next unless $ce->status_abbrev_has_behavior($studentRecord->status, "i= nclude_in_stats"); $number_of_active_students++; =20 # build list of versioned sets for this student user Index: AddUsers.pm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instr= uctor/AddUsers.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -Llib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm -Llib/WeBWorK/= ContentGenerator/Instructor/AddUsers.pm -u -r1.18 -r1.19 --- lib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm +++ lib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm @@ -66,7 +66,7 @@ $newUser->section(trim_spaces($r->param("section_$i"))); $newUser->recitation(trim_spaces($r->param("recitation_$i"))); $newUser->comment(trim_spaces($r->param("comment_$i"))); - $newUser->status('C'); + $newUser->status($ce->status_name_to_abbrev($ce->{default_status})); $newPermissionLevel->permission(0); #FIXME handle errors if user exists already eval { $db->addUser($newUser) }; |
From: dpvc v. a. <we...@ma...> - 2005-10-07 02:39:37
|
Log Message: ----------- Corrected a problem with contexts not being reset properly after num_cmp or fun_cmp. Modified Files: -------------- pg/macros: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGanswermacros.pl,v retrieving revision 1.38 retrieving revision 1.39 diff -Lmacros/PGanswermacros.pl -Lmacros/PGanswermacros.pl -u -r1.38 -r1.39 --- macros/PGanswermacros.pl +++ macros/PGanswermacros.pl @@ -1107,7 +1107,7 @@ # Get the proper Parser object for the professor's answer # using the initialized context # - my $oldContext = &$Context($context); my $r; + my $oldContext = &$Context(); &$Context($context); my $r; if ($num_params{units}) { $r = new Parser::Legacy::NumberWithUnits($correctAnswer); $options{rh_correct_units} = $num_params{units}; @@ -1970,7 +1970,7 @@ # # Create the Formula object and get its answer checker # - my $oldContext = &$Context($context); + my $oldContext = &$Context(); &$Context($context); my $f = new Value::Formula($correctEqn); $f->{limits} = $func_params{'limits'}; $f->{test_points} = $func_params{'test_points'}; |
From: Sam H. v. a. <we...@ma...> - 2005-10-05 18:17:52
|
Log Message: ----------- Implemented status system as per bug #743. The status system consists of a new hash in the course environment, %statuses, that maps status names (like "Enrolled", "Drop", "Audit") to (a) a list of allowed abbreviations for the status and (b) a list of behaviors the system should have when dealing with users who have the status. I didn't want to have to mangle that hash-of-hashes-of-arrays myself in many modules, but I also didn't want to devote an entire module (Status.pm) to it. So, I'm trying a little experiment: I've added them as methods to WeBWorK::CourseEnvironment. My thinkint is that since all the data for these operations comes from the course environment, so why not have them be course environment methods? Here they are: status_abbrev_to_name($status_abbrev) Given the abbreviation for a status, return the name. Returns undef if the abbreviation is not found. status_name_to_abbrevs($status_name) Returns the list of abbreviations for a given status. Returns an empty list if the status is not found. status_has_behavior($status_name, $behavior) Return true if $status_name lists $behavior. status_abbrev_has_behavior($status_abbrev, $behavior) Return true if the status abbreviated by $status_abbrev lists $behavior. Since I removed the previous $siteDefaults{status} hash from global.conf, I have already switched modules that formerly used that hash over to using the new methods: Authen.pm: use status_abbrev_has_behavior($status, "allow_course_access") to determine if a user should be allowed to log in. Feedback.pm: look up status abbreviation using status_abbrev_to_name() and print the result for the status field in the email. Instructor.pm: use status_abbrev_has_behavior($status, "include_in_assignment") to determine if a user should be included in an assignment. UserList.pm and UsersAssignedToSet.pm: use status_abbrev_to_name() to get name of CSS class. Modified Files: -------------- webwork2/conf: global.conf.dist webwork2/lib/WeBWorK: Authen.pm CourseEnvironment.pm webwork2/lib/WeBWorK/ContentGenerator: Feedback.pm Instructor.pm webwork2/lib/WeBWorK/ContentGenerator/Instructor: UserList.pm UsersAssignedToSet.pm Revision Data ------------- Index: CourseEnvironment.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/CourseEnvironment.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -Llib/WeBWorK/CourseEnvironment.pm -Llib/WeBWorK/CourseEnvironment.pm -u -r1.28 -r1.29 --- lib/WeBWorK/CourseEnvironment.pm +++ lib/WeBWorK/CourseEnvironment.pm @@ -21,15 +21,65 @@ WeBWorK::CourseEnvironment - Read configuration information from global.conf and course.conf files. +=head1 SYNOPSIS + + use WeBWorK::CourseEnvironment; + $ce = WeBWorK::CourseEnvironment->new({ + webwork_url => "/webwork2", + webwork_dir => "/opt/webwork2", + pg_dir => "/opt/pg", + webwork_htdocs_url => "/webwork2_files", + webwork_htdocs_dir => "/opt/webwork2/htdocs", + webwork_courses_url => "/webwork2_course_files", + webwork_courses_dir => "/opt/webwork2/courses", + courseName => "name_of_course", + }); + + my $timeout = $courseEnv->{sessionKeyTimeout}; + my $mode = $courseEnv->{pg}->{options}->{displayMode}; + # etc... + +=head1 DESCRIPTION + +The WeBWorK::CourseEnvironment module reads the system-wide F<global.conf> and +course-specific F<course.conf> files used by WeBWorK to calculate and store +settings needed throughout the system. The F<.conf> files are perl source files +that can contain any code allowed under the default safe compartment opset. +After evaluation of both files, any package variables are copied out of the +safe compartment into a hash. This hash becomes the course environment. + =cut use strict; use warnings; +use Carp qw/croak/; use Safe; use WeBWorK::Utils qw(readFile); use WeBWorK::Debug; use Opcode qw(empty_opset); +=head1 CONSTRUCTION + +=over + +=item new(HASHREF) + +HASHREF is a reference to a hash containing scalar variables with which to seed +the course environment. It must contain at least a value for the key +C<webworkRoot>. + +The C<new> method finds the file F<conf/global.conf> relative to the given +C<webwork_dir> directory. After reading this file, it uses the +C<$courseFiles{environment}> variable, if present, to locate the course +environment file. If found, the file is read and added to the environment. + +=item new(ROOT URLROOT PGROOT COURSENAME) + +A deprecated form of the constructor in which four seed variables are given +explicitly: C<webwork_dir>, C<webwork_url>, C<pg_dir>, and C<courseName>. + +=cut + # NEW SYNTAX # # new($invocant, $seedVarsRef) @@ -154,72 +204,107 @@ } bless $self, $class; + + # here is where we can do evil things to the course environment *sigh* + # anything changed has to be done here. after this, CE is considered read-only + # anything added must be prefixed with an underscore. + + # create reverse-lookup hash mapping status abbreviations to real names + $self->{_status_abbrev_to_name} = { + map { my $name = $_; map { $_ => $name } @{$self->{statuses}{$name}{abbrevs}} } + keys %{$self->{statuses}} + }; + + # now that we're done, we can go ahead and return... return $self; } -1; +=back -__END__ +=head1 ACCESS -=head1 SYNOPSIS +There are no formal accessor methods. However, since the course environemnt is +a hash of hashes and arrays, is exists as the self hash of an instance +variable: - use WeBWorK::CourseEnvironment; - $ce = WeBWorK::CourseEnvironment->new({ - webwork_url => "/webwork2", - webwork_dir => "/opt/webwork2", - pg_dir => "/opt/pg", - webwork_htdocs_url => "/webwork2_files", - webwork_htdocs_dir => "/opt/webwork2/htdocs", - webwork_courses_url => "/webwork2_course_files", - webwork_courses_dir => "/opt/webwork2/courses", - courseName => "name_of_course", - }); - - my $timeout = $courseEnv->{sessionKeyTimeout}; - my $mode = $courseEnv->{pg}->{options}->{displayMode}; - # etc... + $ce->{someKey}{someOtherKey}; -=head1 DESCRIPTION +=head1 EXPERIMENTAL ACCESS METHODS -The WeBWorK::CourseEnvironment module reads the system-wide F<global.conf> and -course-specific F<course.conf> files used by WeBWorK to calculate and store -settings needed throughout the system. The F<.conf> files are perl source files -that can contain any code allowed under the default safe compartment opset. -After evaluation of both files, any package variables are copied out of the -safe compartment into a hash. This hash becomes the course environment. +This is an experiment in extending CourseEnvironment to know a little more about +its contents, and perform useful operations for me. -=head1 CONSTRUCTION +There is a set of operations that require certain data from the course +environment. Most of these are un Utils.pm. I've been forced to pass $ce into +them, so that they can get their data out. But some things are so intrinsically +linked to the course environment that they might as well be methods in this +class. + +=head2 STATUS METHODS =over -=item new(HASHREF) +=item status_abbrev_to_name($status_abbrev) -HASHREF is a reference to a hash containing scalar variables with which to seed -the course environment. It must contain at least a value for the key -C<webworkRoot>. +Given the abbreviation for a status, return the name. Returns undef if the +abbreviation is not found. -The C<new> method finds the file F<conf/global.conf> relative to the given -C<webwork_dir> directory. After reading this file, it uses the -C<$courseFiles{environment}> variable, if present, to locate the course -environment file. If found, the file is read and added to the environment. +=cut -=item new(ROOT URLROOT PGROOT COURSENAME) +sub status_abbrev_to_name { + my ($ce, $status_abbrev) = @_; + return $ce->{_status_abbrev_to_name}{$status_abbrev}; +} -A deprecated form of the constructor in which four seed variables are given -explicitly: C<webwork_dir>, C<webwork_url>, C<pg_dir>, and C<courseName>. +=item status_name_to_abbrevs($status_name) -=back +Returns the list of abbreviations for a given status. Returns an empty list if +the status is not found. -=head1 ACCESS +=cut -There are no formal accessor methods. However, since the course environemnt is -a hash of hashes and arrays, is exists as the self hash of an instance -variable: +sub status_name_to_abbrevs { + my ($ce, $status_name) = @_; + return unless exists $ce->{statuses}{$status_name}; + return @{$ce->{statuses}{$status_name}{abbrevs}}; +} + +=item status_has_behavior($status_name, $behavior) + +Return true if $status_name lists $behavior. + +=cut - $ce->{someKey}->{someOtherKey}; +sub status_has_behavior { + my ($ce, $status_name, $behavior) = @_; + if (exists $ce->{statuses}{$status_name}) { + if (exists $ce->{statuses}{$status_name}{behaviors}) { + my $num_matches = grep { $_ eq $behavior } @{$ce->{statuses}{$status_name}{behaviors}}; + return $num_matches > 0; + } else { + return 0; # no behaviors + } + } else { + warn "status '$status_name' not found in \%statuses -- assuming no behaviors.\n"; + return 0; + } +} -=head1 AUTHOR +=item status_abbrev_has_behavior($status_abbrev, $behavior) -Written by Sam Hathaway, sh002i (at) math.rochester.edu. +Return true if the status abbreviated by $status_abbrev lists $behavior. =cut + +sub status_abbrev_has_behavior { + my ($ce, $status_abbrev, $behavior) = @_; + return $ce->status_has_behavior($ce->status_abbrev_to_name($status_abbrev), $behavior); +} + +=back + +=cut + +1; + +# perl doesn't look like line noise. line noise has way more alphanumerics. Index: Authen.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Authen.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -Llib/WeBWorK/Authen.pm -Llib/WeBWorK/Authen.pm -u -r1.44 -r1.45 --- lib/WeBWorK/Authen.pm +++ lib/WeBWorK/Authen.pm @@ -334,25 +334,26 @@ } # Make sure user is in the database - my $userRecord = $db->getUser($user); # checked - unless (defined $userRecord) { + my $User = $db->getUser($user); # checked + unless (defined $User) { # FIXME too much information! $error = "There is no account for $user in this course."; last VERIFY; } # fix invalid status values (FIXME this should be in DB!) - unless (defined $userRecord->status and - defined($ce->{siteDefaults}->{status}->{$userRecord->status}) - ) { - $userRecord-> status('C'); - # need to save this value to the database. - $db->putUser($userRecord); - warn "Setting status for user $user to C. It was previously undefined or miss defined."; + if (not defined $User->status or not defined $ce->status_abbrev_to_name($User->status)) { + my $default_status = $ce->{default_status}; + die "default_status not defined in course environment" unless defined $default_status; + my ($default_abbrev) = $ce->status_name_to_abbrevs($default_status); + die "default status has no abbrevs in course environment" unless defined $default_abbrev; + $User->status($default_abbrev); + $db->putUser($User); + warn "Setting status for user $user to '$default_abbrev'. It was previously unset or set to an invalid value."; } - # make sure the user hasn't been dropped from the course - if ($ce->{siteDefaults}->{status}->{$userRecord->status} eq "Drop") { + # make sure users with this user's status are allowed to access the course (jeez...) + unless ($ce->status_abbrev_has_behavior($User->status, "allow_course_access")) { # FIXME too much information! $error = "The user $user has been dropped from this course."; last VERIFY; @@ -523,111 +524,109 @@ # essentially the same as verify(), but pulls out the proctor data from the # form input and uses that with the appropriate database entry names to determine # whether the proctor is valid. -sub verifyProctor ($) { - my $self = shift(); - my $r = $self->{r}; - my $ce = $r->ce; - my $db = $r->db; - - my $user = $r->param('effectiveUser'); - my $proctorUser = $r->param('proctor_user'); - my $proctorPasswd = $r->param('proctor_passwd'); - my $proctorKey = $r->param('proctor_key'); -# we use the following to require a second proctor authorization to grade the -# test - my $submitAnswers = ( defined($r->param('submitAnswers')) ? - $r->param('submitAnswers') : '' ); - - my $failWithoutError = 0; - my $error = ''; - -# we define a key for "effectiveuser,proctoruser" to authorize a test, and -# "effectiveuser,proctoruser,g" to authorize grading. - my $prKeyIndex = ''; - - VERIFY: { - unless( ( defined($proctorUser) && $proctorUser ) or - ( defined($proctorPasswd) && $proctorPasswd ) or - ( defined($proctorKey) && $proctorKey ) ) { - $failWithoutError = 1; - last VERIFY; - } - - unless( defined($proctorUser) ) { - $error = 'Proctor username must be specified.'; - last VERIFY; - } - - my $proctorUserRecord = $db->getUser( $proctorUser ); - unless( defined( $proctorUserRecord ) ) { - $error = "There is no proctor account for $proctorUser in this course"; - last VERIFY; - } - - unless( ! defined( $proctorUserRecord->status() ) || - $proctorUserRecord->status() eq 'C' ) { - $error = "Proctor user $proctorUser does not have a valid status " . - "in this course."; - last VERIFY; - } - - if ( $proctorKey ) { - $r->param( 'proctor_password', '' ); - - $prKeyIndex = "$user,$proctorUser" . (($submitAnswers) ? ',g' : ''); - if ( $self->checkKey($prKeyIndex, $proctorKey) ) { - last VERIFY; - } else { - if ( $submitAnswers ) { - $error = 'Assignment requires valid proctor authorization ' . - 'for grading'; - } else { - $error = "Invalid or expired proctor session key."; - } - last VERIFY; - } - } - - if ( $proctorPasswd ) { - - if ( $self->checkPassword( $proctorUser, $proctorPasswd ) ) { - $prKeyIndex = "$user,$proctorUser" . - (($submitAnswers) ? ',g' : ''); - my $newKeyObject = $self->generateKey( $prKeyIndex ); - $r->param('proctor_passwd', ''); - - eval{ $db->deleteKey( $prKeyIndex ); }; - $db->addKey($newKeyObject); - - $r->param('proctor_key', $newKeyObject->key()); - - last VERIFY; - } else { - $error = 'Incorrect proctor username or password.'; - last VERIFY; - } - } - } - - if ( defined($error) && $error ) { - $r->notes("authen_error", $error); - return 0; - - } elsif ( $failWithoutError ) { - return 0; - - } else { - return 1; - } +sub verifyProctor { + my $self = shift(); + my $r = $self->{r}; + my $ce = $r->ce; + my $db = $r->db; + + my $user = $r->param('effectiveUser'); + my $proctorUser = $r->param('proctor_user'); + my $proctorPasswd = $r->param('proctor_passwd'); + my $proctorKey = $r->param('proctor_key'); + + # we use the following to require a second proctor authorization to grade the test + my $submitAnswers = defined($r->param('submitAnswers')) + ? $r->param('submitAnswers') + : ''; + + my $failWithoutError = 0; + my $error = ''; + + # we define a key for "effectiveuser,proctoruser" to authorize a test, and + # "effectiveuser,proctoruser,g" to authorize grading. + my $prKeyIndex = ''; + + VERIFY: { + unless( + defined $proctorUser && $proctorUser + or + defined $proctorPasswd && $proctorPasswd + or + defined $proctorKey && $proctorKey + ) { + $failWithoutError = 1; + last VERIFY; + } + + unless(defined $proctorUser) { + $error = 'Proctor username must be specified.'; + last VERIFY; + } + + my $Proctor = $db->getUser($proctorUser); + unless(defined $Proctor) { + # FIXME too much information + $error = "There is no proctor account for $proctorUser in this course"; + last VERIFY; + } + + unless( !defined($Proctor->status) or $Proctor->status() eq 'C' ) { + # FIXME too much information + $error = "Proctor user $proctorUser does not have a valid status in this course."; + last VERIFY; + } + + # make sure proctor has valid status + unless($ce->status_abbrev_has_behavior($Proctor->status, "allow_course_access")) { + # FIXME too much information + $error = "Proctor user $proctorUser does not have a valid status in this course."; + last VERIFY; + } + + if ($proctorKey) { + $r->param('proctor_password', ''); + + $prKeyIndex = "$user,$proctorUser" . (($submitAnswers) ? ',g' : ''); + if ($self->checkKey($prKeyIndex, $proctorKey)) { + last VERIFY; + } else { + if ($submitAnswers) { + $error = 'Assignment requires valid proctor authorization for grading'; + } else { + $error = "Invalid or expired proctor session key."; + } + last VERIFY; + } + } + + if ($proctorPasswd) { + if ($self->checkPassword($proctorUser, $proctorPasswd)) { + $prKeyIndex = "$user,$proctorUser" . (($submitAnswers) ? ',g' : ''); + my $newKeyObject = $self->generateKey( $prKeyIndex ); + $r->param('proctor_passwd', ''); + + eval{ $db->deleteKey($prKeyIndex); }; + $db->addKey($newKeyObject); + + $r->param('proctor_key', $newKeyObject->key); + + last VERIFY; + } else { + $error = 'Incorrect proctor username or password.'; + last VERIFY; + } + } + } + + if (defined $error and $error) { + $r->notes("authen_error", $error); + return 0; + } elsif ($failWithoutError) { + return 0; + } else { + return 1; + } } 1; - -__END__ - -=head1 AUTHOR - -Written by Dennis Lambe Jr., malsyned (at) math.rochester.edu, and Sam -Hathaway, sh002i (at) math.rochester.edu. - -=cut Index: Feedback.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -Llib/WeBWorK/ContentGenerator/Feedback.pm -Llib/WeBWorK/ContentGenerator/Feedback.pm -u -r1.33 -r1.34 --- lib/WeBWorK/ContentGenerator/Feedback.pm +++ lib/WeBWorK/ContentGenerator/Feedback.pm @@ -373,8 +373,11 @@ $result .= "Email: " . $User->email_address . "\n"; $result .= "Student ID: " . $User->student_id . "\n"; - my %status = %{$ce->{siteDefaults}{status}}; - $result .= "Status: " . (exists $status{$User->status} ? $status{$User->status} : $User->status) . "\n"; + my $status_name = $ce->status_abbrev_to_name($User->status); + my $status_string = defined $status_name + ? "$status_name ('" . $User->status . "')" + : $User->status . " (unknown status abbreviation)"; + $result .= "Status: $status_string\n"; $result .= "Section: " . $User->section . "\n"; $result .= "Recitation: " . $User->recitation . "\n"; Index: Instructor.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor.pm,v retrieving revision 1.50 retrieving revision 1.51 diff -Llib/WeBWorK/ContentGenerator/Instructor.pm -Llib/WeBWorK/ContentGenerator/Instructor.pm -u -r1.50 -r1.51 --- lib/WeBWorK/ContentGenerator/Instructor.pm +++ lib/WeBWorK/ContentGenerator/Instructor.pm @@ -298,7 +298,7 @@ my @results; foreach my $User (@userRecords) { - next if grep /$User->{status}/, @{$self->{r}->{ce}->{siteDefaults}->{statusDrop}}; + next unless $self->r->ce->status_abbrev_has_behavior($User->status, "include_in_assignment"); my $UserSet = $db->newUserSet; my $userID = $User->user_id; $UserSet->user_id($userID); Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.145 retrieving revision 1.146 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.145 -r1.146 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -429,22 +429,6 @@ # Site defaults (FIXME: what other things could be "site defaults"?) ################################################################################ -# Status strings -- lists valid status values and their names. If your site uses -# additional values, add them here. -$siteDefaults{status} = { - A => "Audit", - a => "Audit", - audit => "Audit", - D => "Drop", - d => "Drop", - drop => "Drop", - withdraw => "Drop", - C => "Enrolled", - c => "Enrolled", - current => "Enrolled", - enrolled => "Enrolled", -}; - # Set the default timezone of courses on this server. To get a list of valid # timezones, run: # @@ -566,6 +550,41 @@ ); ################################################################################ +# Status system +################################################################################ + +# The first abbreviation in the abbreviations list is the canonical +# abbreviation, and will be used when setting the status value in a user record +# or an exported classlist file. +# +# Results are undefined if more than one status has the same abbreviation. +# +# The four behaviors that are controlled by status are: +# allow_course_access => is this user allowed to log in? +# include_in_assignment => is this user included when assigning as set to "all" users? +# include_in_stats => is this user included in statistical reports? +# include_in_scoring => is this user included in score reports? + +%statuses = ( + Enrolled => { + abbrevs => [qw/ C c current enrolled /], + behaviors => [qw/ allow_course_access include_in_assignment include_in_stats include_in_scoring /], + }, + Audit => { + abbrevs => [qw/ A a audit /], + behaviors => [qw/ allow_course_access include_in_assignment include_in_stats /], + }, + Drop => { + abbrevs => [qw/ D d drop withdraw /], + behaviors => [qw/ /], + }, +); + +# This is the default status given to new students and students with invalid +# or missing statuses. +$default_status = "Enrolled"; + +################################################################################ # Session options ################################################################################ Index: UsersAssignedToSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -Llib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm -Llib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm -u -r1.18 -r1.19 --- lib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UsersAssignedToSet.pm @@ -153,7 +153,7 @@ foreach my $userRecord (@userRecords) { - my $statusClass = $ce->{siteDefaults}->{status}->{$userRecord->{status}} || ""; + my $statusClass = $ce->status_abbrev_to_name($userRecord->status) || ""; my $user = $userRecord->user_id; my $userSetRecord = $db->getUserSet($user, $setID); #checked Index: UserList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v retrieving revision 1.71 retrieving revision 1.72 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -u -r1.71 -r1.72 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -1446,7 +1446,7 @@ my $passwordMode = $options{passwordMode}; my $userSelected = $options{userSelected}; - my $statusClass = $ce->{siteDefaults}->{status}->{$User->{status}}; + my $statusClass = $ce->status_abbrev_to_name($User->status); my $sets = $db->countUserSets($User->user_id); my $totalSets = $self->{totalSets}; |
From: jj v. a. <we...@ma...> - 2005-10-03 04:45:52
|
Log Message: ----------- Added e-mail feedback verbosity to config area. Modified Files: -------------- webwork-modperl/lib/WeBWorK: Constants.pm Revision Data ------------- Index: Constants.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/Constants.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -Llib/WeBWorK/Constants.pm -Llib/WeBWorK/Constants.pm -u -r1.33 -r1.34 --- lib/WeBWorK/Constants.pm +++ lib/WeBWorK/Constants.pm @@ -221,6 +221,17 @@ </ul>', width => 45, type => 'text'}, + { var => 'mail{feedbackVerbosity}', + doc => 'E-mail verbosity level', + doc2 => 'The e-mail verbosity level controls how much information is + automatically added to feedback e-mails. Levels are +<ol> +<li value="0"> send only the feedback comment and context link +<li value="1"> as in 0, plus user, set, problem, and PG data +<li value="2"> as in 1, plus the problem environment (debugging data) +</ol>', + type => 'number' + }, { var => 'mail{allowedRecipients}', doc => 'E-mail addresses which can recieve e-mail from a pg problem', doc2 => 'List of e-mail addresses to which e-mail can be sent by a problem. Professors need to be added to this list if questionaires are used, or other WeBWorK problems which send e-mail as part of their answer mechanism.', |
From: jj v. a. <we...@ma...> - 2005-10-03 04:32:26
|
Log Message: ----------- Added email subject line to config variable. Modified Files: -------------- webwork-modperl/lib/WeBWorK: Constants.pm Revision Data ------------- Index: Constants.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/Constants.pm,v retrieving revision 1.32 retrieving revision 1.33 diff -Llib/WeBWorK/Constants.pm -Llib/WeBWorK/Constants.pm -u -r1.32 -r1.33 --- lib/WeBWorK/Constants.pm +++ lib/WeBWorK/Constants.pm @@ -160,23 +160,23 @@ { var => 'pg{displayModes}', doc => 'List of display modes made available to students', doc2 => 'When viewing a problem, users may choose different methods of rendering -formulas via an options box in the left panel. Here, you can adjust what display modes are -listed.<p> -Some display modes require other software to be installed on the server. Be sure to check -that all display modes selected here work from your server.<p> -The display modes are <ul> + formulas via an options box in the left panel. Here, you can adjust what display modes are + listed.<p> + Some display modes require other software to be installed on the server. Be sure to check + that all display modes selected here work from your server.<p> + The display modes are <ul> <li> plainText: shows the raw LaTeX strings for formulas. <li> formattedText: formulas are passed through the external program <code>tth</code>, -which produces an HTML version of them. Some browsers do not display all of the fonts -properly. + which produces an HTML version of them. Some browsers do not display all of the fonts + properly. <li> images: produces images using the external programs LaTeX and dvipng. <li> jsMath: uses javascript to place symbols, which may come from fonts or images -(the choice is configurable by the end user). + (the choice is configurable by the end user). <li> asciimath: renders formulas client side using ASCIIMathML </ul> <p> You must use at least one display mode. If you select only one, then the options box will -not give a choice of modes (since there will only be one active).', + not give a choice of modes (since there will only be one active).', min => 1, values => ["plainText", "formattedText", "images", "jsMath", "asciimath"], type => 'checkboxlist'}, @@ -195,14 +195,32 @@ { var => 'pg{ansEvalDefaults}{numRelPercentTolDefault}', doc => 'Allowed error, as a percentage, for numerical comparisons', doc2 => "When numerical answers are checked, most test if the student's answer -is close enough to the programmed answer be computing the error as a percentage of -the correct answer. This value controls the default for how close the student answer -has to be in order to be marked correct. + is close enough to the programmed answer be computing the error as a percentage of + the correct answer. This value controls the default for how close the student answer + has to be in order to be marked correct. <p> A value such as 0.1 means 0.1 percent error is allowed.", type => 'number'}, ], ['E-Mail', + { var => 'mail{feedbackSubjectFormat}', + doc => 'Format for the subject line in feedback e-mails', + doc2 => 'When students click the <em>Email Instructor</em> button + to send feedback, WeBWorK fills in the subject line. Here you can set the + subject line. In it, you can have various bits of information filled in + with the following escape sequences. +<p> +<ul> +<li> %c = course ID +<li> %u = user ID +<li> %s = set ID +<li> %p = problem ID +<li> %x = section +<li> %r = recitation +<li> %% = literal percent sign +</ul>', + width => 45, + type => 'text'}, { var => 'mail{allowedRecipients}', doc => 'E-mail addresses which can recieve e-mail from a pg problem', doc2 => 'List of e-mail addresses to which e-mail can be sent by a problem. Professors need to be added to this list if questionaires are used, or other WeBWorK problems which send e-mail as part of their answer mechanism.', |
From: jj v. a. <we...@ma...> - 2005-10-03 04:30:12
|
Log Message: ----------- Allow basic types to specify the width of their input fields, and changed the handling of the long doc strings. The long string is no longer sent as a parameter where it might be truncated. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: Config.pm Revision Data ------------- Index: Config.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/Config.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -Llib/WeBWorK/ContentGenerator/Instructor/Config.pm -Llib/WeBWorK/ContentGenerator/Instructor/Config.pm -u -r1.3 -r1.4 --- lib/WeBWorK/ContentGenerator/Instructor/Config.pm +++ lib/WeBWorK/ContentGenerator/Instructor/Config.pm @@ -83,10 +83,11 @@ # A widget to interact with the user sub entry_widget { my ($self, $name, $default) = @_; + my $width = $self->{width} || 15; return CGI::textfield( -name => $name, -value => $default, - -size => '15', + -size => $width, ); } @@ -99,7 +100,7 @@ CGI::a({href=>$self->{Module}->systemLink( $r->urlpath->new(type=>'instructor_config', args=>{courseID => $r->urlpath->arg("courseID")}), - params=>{show_long_doc=>$self->{doc2} || $self->{doc}, + params=>{show_long_doc=>1, var_name=>"$self->{var}"}), target=>"_blank"}, CGI::img({src=>$r->{ce}->{webworkURLs}->{htdocs}. @@ -501,9 +502,18 @@ } if ($r->param('show_long_doc')) { + my $docstring; + for my $consec (@$ConfigValues) { + my @configSectionArray = @$consec; + shift @configSectionArray; + for my $con (@configSectionArray) { + $docstring = $con->{doc2} || $con->{doc} + if($con->{var} eq $r->param('var_name')); + } + } print CGI::h2("Variable Documentation: ". CGI::code('$'.$r->param('var_name'))), CGI::p(), - CGI::blockquote( $r->param('show_long_doc')); + CGI::blockquote( $docstring ); return ""; } |
From: jj v. a. <we...@ma...> - 2005-10-03 00:52:18
|
Log Message: ----------- Made a little more html use CGI::* methods. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: Config.pm Revision Data ------------- Index: Config.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/Config.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WeBWorK/ContentGenerator/Instructor/Config.pm -Llib/WeBWorK/ContentGenerator/Instructor/Config.pm -u -r1.2 -r1.3 --- lib/WeBWorK/ContentGenerator/Instructor/Config.pm +++ lib/WeBWorK/ContentGenerator/Instructor/Config.pm @@ -228,7 +228,7 @@ sub display_value { my ($self, $val) = @_; return ' ' if not defined($val); - my $str = join(',<br>', @{$val}); + my $str = join(','.CGI::br(), @{$val}); $str = ' ' if $str !~ /\S/; return $str; } @@ -284,7 +284,7 @@ my ($self, $val) = @_; $val = [] if not defined($val); my @vals = @$val; - return join(',<br>', @vals); + return join(CGI::br(), @vals); } # here r->param() returns an array, so we need a custom @@ -539,17 +539,18 @@ my $configTitle = shift @configSectionArray; print CGI::p(CGI::div({-align=>'center'}, CGI::b($configTitle))); - print '<table border="1">'; + print CGI::start_table({-border=>"1"}); print '<tr>'.CGI::th('What'). CGI::th('Default') .CGI::th('Current'); for my $con (@configSectionArray) { my $conobject = $self->objectify($con); print "\n<tr>"; print $conobject->what_string; - print CGI::td($conobject->display_value(eval('$default_ce->'.inline_var($con->{var})))); + print CGI::td({-align=>"center"}, $conobject->display_value(eval('$default_ce->'.inline_var($con->{var})))); print CGI::td($conobject->entry_widget("widget$widget_count", eval('$ce4->'.inline_var($con->{var})))); + print '</tr>'; $widget_count++; } - print "</table>"; + print CGI::end_table(); print CGI::p(CGI::submit(-name=>'make_changes', -value=>'Save Changes')); print CGI::end_form(); |
From: dpvc v. a. <we...@ma...> - 2005-10-02 23:42:04
|
Log Message: ----------- Allow context to override object class used to create formula objects (so that things like ImplicitPlane can create instances of themselves automatically when needed). This mechanism needs to be enlarged to encompass the other Value object classes as well (like the Context()->{parser}{...} hash). The real problem is that the List object probably shouldn't create a formula returning a list when it is passed formulas, since there really isn't much need for a formula returning a list to be autogenerated (you can create one by hand using Formula if needed). Right now, ALL the Value objects make themselves into Formulas when one of their entries is a formula. For example, Point(1,"x") produces the same thing as Formula("(1,x)"), and List(1,"x") is the same as Formula("1,x"). This is good for points, but not so good for lists. And it might sometimes be nice to have a Vector of Formulas, or a Matrix with Formula entries (rather than Formulas returning Vectors or Matrices). But this would require some serious changes internally in the Value objects, which make assumptions about their values being constant. Changing that will be for another day... Modified Files: -------------- pg/lib/Value: Context.pm Formula.pm Revision Data ------------- Index: Formula.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Formula.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -Llib/Value/Formula.pm -Llib/Value/Formula.pm -u -r1.37 -r1.38 --- lib/Value/Formula.pm +++ lib/Value/Formula.pm @@ -35,15 +35,22 @@ # # Call Parser to make the new item, copying important -# fields from the tree. +# fields from the tree. The Context can override the +# Context()->{value}{Formula} setting to substitue a +# different class to call for creating the formula. # sub new { - shift; my $self = $pkg->SUPER::new(@_); + shift; my $self = $$Value::context->{value}{Formula}->create(@_); foreach my $id ('open','close') {$self->{$id} = $self->{tree}{$id}} return $self; } # +# Call Parser to creat the formula +# +sub create {shift; $pkg->SUPER::new(@_)} + +# # Create the new parser with no string # (we'll fill in its tree by hand) # Index: Context.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Context.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -Llib/Value/Context.pm -Llib/Value/Context.pm -u -r1.8 -r1.9 --- lib/Value/Context.pm +++ lib/Value/Context.pm @@ -33,6 +33,9 @@ arrays => ['data'], values => ['flags','pattern','format'], }, + value => { + Formula => "Value::Formula" + }, }, $class; my %data = (lists=>{},flags=>{},@_); $context->{_lists} = new Value::Context::Lists($context,%{$data{lists}}); |