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: Mike G. v. a. <we...@ma...> - 2008-09-12 14:19:25
|
Log Message: ----------- Update behavior of hint so that it will always print for instructors. Tags: ---- rel-2-4-patches Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.47.2.2.2.4 retrieving revision 1.47.2.2.2.5 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.47.2.2.2.4 -r1.47.2.2.2.5 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -994,27 +994,55 @@ } - sub hint { my @in = @_; my $out = ''; - - PG_restricted_eval(q!$main::hintExists =1; - $main::numOfAttempts = 0 unless defined($main::numOfAttempts); - !); + my $permissionLevel = PG_restricted_eval(q!$main::envir{permissionLevel}!); + my $PRINT_FILE_NAMES_PERMISSION_LEVEL = PG_restricted_eval(q!$envir->{'PRINT_FILE_NAMES_PERMISSION_LEVEL'}!); + my $printHintForInstructor = $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL; + my $showHint = PG_restricted_eval(q!$main::showHint!); + my $displayHint = PG_restricted_eval(q!$envir->{'displayHintsQ'}!); + PG_restricted_eval(q!$main::hintExists =1!); + my $attempts = PG_restricted_eval(q!$main::numOfAttempts = 0 unless defined($main::numOfAttempts);!); if ($displayMode eq 'TeX') { - $out = ''; # do nothing since hints are not available for download - } elsif (($envir->{'displayHintsQ'}) and - PG_restricted_eval(q!($main::numOfAttempts >= $main::showHint)!)) + if ($printHintForInstructor) { + $out = join(' ',@in, "$BR(Show hint after $showHint attempts. ) $BR"); + } else { + $out = ''; # do nothing since hints are not available for download for students + } + } elsif ($printHintForInstructor) { # always print hints for instructor types + $out = join(' ',@in, "$BR(Show hint after $showHint attempts. )$BR "); + } elsif ( $displayHint and ( $attempts > $showHint )) { ## the second test above prevents a hint being shown if a doctored form is submitted - {$out = join(' ',@in);} # show hint + $out = join(' ',@in); + } # show hint $out ; } +# sub hint { +# my @in = @_; +# my $out = ''; +# +# PG_restricted_eval(q!$main::hintExists =1; +# $main::numOfAttempts = 0 unless defined($main::numOfAttempts); +# !); +# +# if ($displayMode eq 'TeX') { +# $out = ''; # do nothing since hints are not available for download +# } elsif (($envir->{'displayHintsQ'}) and +# PG_restricted_eval(q!($main::numOfAttempts >= $main::showHint)!)) +# +# ## the second test above prevents a hint being shown if a doctored form is submitted +# +# {$out = join(' ',@in);} # show hint +# +# $out ; +# } + sub HINT { TEXT("$BR" . hint(@_) . "$BR") if hint(@_); |
From: dpvc v. a. <we...@ma...> - 2008-09-11 20:59:54
|
Log Message: ----------- Removed extraneous "e" that got inserted into the beginning of the file on my last edit. Argh! Tags: ---- rel-2-4-patches Modified Files: -------------- pg/lib/WeBWorK/PG: IO.pm Revision Data ------------- Index: IO.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/WeBWorK/PG/IO.pm,v retrieving revision 1.3.8.1 retrieving revision 1.3.8.2 diff -Llib/WeBWorK/PG/IO.pm -Llib/WeBWorK/PG/IO.pm -u -r1.3.8.1 -r1.3.8.2 --- lib/WeBWorK/PG/IO.pm +++ lib/WeBWorK/PG/IO.pm @@ -1,4 +1,4 @@ -e################################################################################ +################################################################################ # WeBWorK mod_perl (c) 2000-2002 WeBWorK Project # $Id$ ################################################################################ |
From: dpvc v. a. <we...@ma...> - 2008-09-11 17:31:32
|
Log Message: ----------- BACKPORT: Fixed a problem where if two FormulaUpToConstant objects were used in the same problem, the second would always be marked as incorrect. (Subtle interplay of variable names in the safe compartment.) Modified Files: -------------- pg/macros: parserFormulaUpToConstant.pl Revision Data ------------- |
From: dpvc v. a. <we...@ma...> - 2008-09-11 17:30:55
|
Log Message: ----------- Fixed a problem where if two FormulaUpToConstant objects were used in the same problem, the second would always be marked as incorrect. (Subtle interplay of variable names in the safe compartment.) Modified Files: -------------- pg/macros: parserFormulaUpToConstant.pl Revision Data ------------- Index: parserFormulaUpToConstant.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserFormulaUpToConstant.pl,v retrieving revision 1.11 retrieving revision 1.12 diff -Lmacros/parserFormulaUpToConstant.pl -Lmacros/parserFormulaUpToConstant.pl -u -r1.11 -r1.12 --- macros/parserFormulaUpToConstant.pl +++ macros/parserFormulaUpToConstant.pl @@ -175,9 +175,9 @@ # # Compare with adaptive parameters to see if $l + n0 C = $r for some n0. # - $main::_cmp_ = sub {return $l->{adapt} == $r}; # a closure to access local variables - my $equal = main::PG_restricted_eval('&$_cmp_'); # prevents errors with large adaptive parameters - delete $main::{_cmp_}; # remove temprary function + $main::{_cmp_} = sub {return $l->{adapt} == $r}; # a closure to access local variables + my $equal = main::PG_restricted_eval('&{$main::{_cmp_}}'); # prevents errors with large adaptive parameters + delete $main::{_cmp_}; # remove temprary function return -1 unless $equal; # # Check that n0 is non-zero (i.e., there is a multiple of C in the student answer) |
From: dpvc v. a. <we...@ma...> - 2008-09-08 16:29:03
|
Log Message: ----------- BACKPORT: read_whole_file was reporting the wrong routine name in its error messages. Tags: ---- rel-2-4-patches Modified Files: -------------- pg/lib/WeBWorK/PG: IO.pm Revision Data ------------- Index: IO.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/WeBWorK/PG/IO.pm,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -Llib/WeBWorK/PG/IO.pm -Llib/WeBWorK/PG/IO.pm -u -r1.3 -r1.3.8.1 --- lib/WeBWorK/PG/IO.pm +++ lib/WeBWorK/PG/IO.pm @@ -1,4 +1,4 @@ -################################################################################ +e################################################################################ # WeBWorK mod_perl (c) 2000-2002 WeBWorK Project # $Id$ ################################################################################ @@ -111,7 +111,7 @@ sub read_whole_file { my $filePath = shift; local (*INPUT); - open(INPUT, "<$filePath") || die "$0: readWholeProblemFile subroutine: <BR>Can't read file $filePath"; + open(INPUT, "<$filePath") || die "$0: read_whole_file subroutine: <BR>Can't read file $filePath"; local($/)=undef; my $string = <INPUT>; # can't append spaces because this causes trouble with <<'EOF' \nEOF construction close(INPUT); |
From: dpvc v. a. <we...@ma...> - 2008-09-08 16:26:45
|
Log Message: ----------- read_whole_file was reporting the wrong routine name in its error messages. Modified Files: -------------- pg/lib/WeBWorK/PG: IO.pm Revision Data ------------- Index: IO.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/WeBWorK/PG/IO.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -Llib/WeBWorK/PG/IO.pm -Llib/WeBWorK/PG/IO.pm -u -r1.3 -r1.4 --- lib/WeBWorK/PG/IO.pm +++ lib/WeBWorK/PG/IO.pm @@ -111,7 +111,7 @@ sub read_whole_file { my $filePath = shift; local (*INPUT); - open(INPUT, "<$filePath") || die "$0: readWholeProblemFile subroutine: <BR>Can't read file $filePath"; + open(INPUT, "<$filePath") || die "$0: read_whole_file subroutine: <BR>Can't read file $filePath"; local($/)=undef; my $string = <INPUT>; # can't append spaces because this causes trouble with <<'EOF' \nEOF construction close(INPUT); |
From: dpvc v. a. <we...@ma...> - 2008-09-04 22:07:59
|
Log Message: ----------- BACKPORT: Demote Real() results of Formula() evaluations to standard Perl reals. (Makes graphing more efficient.) Tags: ---- rel-2-4-patches Modified Files: -------------- pg/macros: PGgraphmacros.pl Revision Data ------------- Index: PGgraphmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGgraphmacros.pl,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.1.2.1 diff -Lmacros/PGgraphmacros.pl -Lmacros/PGgraphmacros.pl -u -r1.6.6.1 -r1.6.6.1.2.1 --- macros/PGgraphmacros.pl +++ macros/PGgraphmacros.pl @@ -323,10 +323,9 @@ my $localContext= Parser::Context->current(\%main::context)->copy; $localContext->variables->add($var=>'Real') unless $localContext->variables->get($var); my $formula = Value->Package("Formula()")->new($localContext,$rule); - my $subRef = sub {my $x=shift; Parser::Evaluate($formula, $var=>$x)}; + my $subRef = sub {my $x=shift; Parser::Evaluate($formula, $var=>$x)->value}; #traps errors when # graph domain is larger than the function's domain. - #my $subRef = string_to_sub($rule,$var); my $funRef = new Fun($subRef,$graph); $funRef->color($color); |
From: dpvc v. a. <we...@ma...> - 2008-09-04 22:03:27
|
Log Message: ----------- Demote Real() results of Formula() evaluation back to Perl reals. Modified Files: -------------- pg/macros: PGgraphmacros.pl Revision Data ------------- Index: PGgraphmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGgraphmacros.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -Lmacros/PGgraphmacros.pl -Lmacros/PGgraphmacros.pl -u -r1.9 -r1.10 --- macros/PGgraphmacros.pl +++ macros/PGgraphmacros.pl @@ -323,10 +323,9 @@ my $localContext= Parser::Context->current(\%main::context)->copy; $localContext->variables->add($var=>'Real') unless $localContext->variables->get($var); my $formula = Value->Package("Formula()")->new($localContext,$rule); - my $subRef = sub {my $x=shift; Parser::Evaluate($formula, $var=>$x)}; + my $subRef = sub {my $x=shift; Parser::Evaluate($formula, $var=>$x)->value}; #traps errors when # graph domain is larger than the function's domain. - #my $subRef = string_to_sub($rule,$var); my $funRef = new Fun($subRef,$graph); $funRef->color($color); |
From: Mike G. v. a. <we...@ma...> - 2008-09-03 02:36:33
|
Log Message: ----------- Only due dates are posted as events Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: locallib.php Revision Data ------------- Index: locallib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/locallib.php,v retrieving revision 1.5 retrieving revision 1.6 diff -Lwwassignment4/moodle/mod/wwassignment/locallib.php -Lwwassignment4/moodle/mod/wwassignment/locallib.php -u -r1.5 -r1.6 --- wwassignment4/moodle/mod/wwassignment/locallib.php +++ wwassignment4/moodle/mod/wwassignment/locallib.php @@ -1,6 +1,7 @@ <?php global $CFG; require_once("$CFG->libdir/soap/nusoap.php"); + define('WWASSIGNMENT_DEBUG',0); @@ -85,24 +86,26 @@ $event->instance = $wwassignmentid; $event->visible = 1; - $openevent = $event; + // FIXME -- this doesn't create a new object we'll just handle the due date for now + // what you want is $openevent = clone $event this makes a shallow copy of the object + //$openevent = $event; + // FIXME -- it's likely that only the due date needs to be posted. once that is sure, clean this up. $dueevent = $event; - $openevent->name .= ' is Open.'; - $openevent->eventtype = 'open'; - $openevent->timestart = $opendate; - $openevent->timeduration = $duedate - $opendate; + //$openevent->name .= ' is Open.'; + //$openevent->eventtype = 'open'; + //$openevent->timestart = $opendate; + //$openevent->timeduration = $duedate - $opendate; $dueevent->name .= ' is Due.'; $dueevent->eventtype = 'due'; $dueevent->timestart = $duedate; $dueevent->timeduration = 1; - - + // error_log("adding a due event"); $result = 0; - if(!add_event($openevent)) { - $result = -1; - } + //if(!add_event($openevent)) { + // $result = -1; + //} if(!add_event($dueevent)) { $result = -1; } @@ -118,6 +121,7 @@ function _wwassignment_delete_events($wwassignmentid) { if ($events = get_records_select('event', "modulename = 'wwassignment' and instance = '$wwassignmentid'")) { foreach($events as $event) { + // error_log("deleting event ".$event->id); delete_event($event->id); } } @@ -579,7 +583,42 @@ 'password' => $userdata->password))); return 1; } - + /** NOT yet ready!!!!!!!!! + * @desc Updates data for a user in the WeBWorK course. + * @param string $webworkcourse The webwork course name. + * @param array $userdata The user data to use in creation. + * @param string $permission The permissions of the new user, defaults to 0. + * @return Returns 1 on success. + */ + function update_user($webworkcourse,&$userdata,$permission='0') { + error_log("update_user called -- not yet ready"); + $studentid = $userid; + # FIXME: find permission for this user and set permissions appropriately in webwork + # FIXME: find the group(s) that this person is a member of + # FIXME: I have used the following scheme: gage_SEC use groups ending like this to determine sections in webwork + # FIXME: use ordinary groups taName to correspond to recitation sections in WeBWorK + # + # FIXME: make it so an update_user function is called whenever the user data in moodle is changed + # FIXME: so if a student switches groups this is reflected in WeBWorK + # do get_user first to get current status then update this?? + $this->handler('put_user',array('courseName' => $webworkcourse, 'record' => array( + //'user_id' => $userdata->username, // can't update this + 'first_name' => $userdata->firstname, + 'last_name' => $userdata->lastname, + 'email_address' => $userdata->email, + 'student_id' => $studentid, + //'status' => 'C', //can you update this from moodle? + 'section' => '', + 'recitation' => '', + 'comment' => 'moodle updated user'))); + $this->handler('add_permission',array('courseName' => $webworkcourse,'record' => array( + 'user_id' => $userdata->username, + 'permission' => $permission))); + $this->handler('add_password',array('courseName' => $webworkcourse,'record' => array( + 'user_id' => $userdata->username, + 'password' => $userdata->password))); + return 1; + } /** * @desc Creates a user set in WeBWorK * @param string $webworkcourse The webwork course name. |
From: Mike G. v. a. <we...@ma...> - 2008-09-02 12:20:55
|
Log Message: ----------- I fixed bad url. This squashes bug #1485 Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/htdocs/helpFiles: InstructorUserList.html Revision Data ------------- Index: InstructorUserList.html =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/helpFiles/InstructorUserList.html,v retrieving revision 1.3.4.2.2.1 retrieving revision 1.3.4.2.2.2 diff -Lhtdocs/helpFiles/InstructorUserList.html -Lhtdocs/helpFiles/InstructorUserList.html -u -r1.3.4.2.2.1 -r1.3.4.2.2.2 --- htdocs/helpFiles/InstructorUserList.html +++ htdocs/helpFiles/InstructorUserList.html @@ -52,7 +52,7 @@ <dd> Click the "Add x student(s)" radio button and then click "Take action". This will take you to a new page where the data can be entered for one or more students. It is also possible to assign the student to one or more problem sets as they are being entered: simply select the homework sets from the list below the data entry table. Use 'command' or 'control' click to select more than one homework set.</dd> <dt>Add many students to a course from a class list.</dt> - <dd>This is most easily done by importing a class list. The class list can be uploaded from your workstation to the server using the File Manager page. The class list must be a file ending in .lst and must have a specific <a href="http://webhost.math.rochester.edu/webworkdocs/discuss/msgReader$59#2397">format</a>. Once the file has been uploaded to the server the file will appear in the import action pop-up list (5th action). demoCourse.lst is available for most courses and adds the "practice users" which activate guest logins to the class list .</dd> + <dd>This is most easily done by importing a class list. The class list can be uploaded from your workstation to the server using the File Manager page. The class list must be a file ending in .lst and must have a specific <a href="http://webwork.maa.org/wiki/Classlist_Files#Format_of_classlist_files">format</a>. Once the file has been uploaded to the server the file will appear in the import action pop-up list (5th action). demoCourse.lst is available for most courses and adds the "practice users" which activate guest logins to the class list .</dd> <dt>Add a TA or an instructor (change permission level of user)</dt> <dd>This is done by first entering the user as a student and then changing the permission level of the user. First edit the user by clicking on the pencil next to their name (or using the technique above for several users), then change their permssion level -- an entry blank at the far right of the screen, you may have to scroll to see it. The permission levels are |
From: dpvc v. a. <we...@ma...> - 2008-09-01 11:53:42
|
Log Message: ----------- BACKPORT: changes from 1.35 Tags: ---- rel-2-4-patches Modified Files: -------------- pg/lib/Value: Matrix.pm Revision Data ------------- Index: Matrix.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Matrix.pm,v retrieving revision 1.22.4.2.2.1 retrieving revision 1.22.4.2.2.2 diff -Llib/Value/Matrix.pm -Llib/Value/Matrix.pm -u -r1.22.4.2.2.1 -r1.22.4.2.2.2 --- lib/Value/Matrix.pm +++ lib/Value/Matrix.pm @@ -169,6 +169,14 @@ Value::Error("Can't convert %s to %s",Value::showClass($x),Value::showClass($self)); } +# +# Don't inherit ColumnVector flag +# +sub noinherit { + my $self = shift; + return ("ColumnVector",$self->SUPER::noinherit); +} + ############################################ # # Operations on matrices |
From: dpvc v. a. <we...@ma...> - 2008-09-01 11:50:09
|
Log Message: ----------- Don't inherit the ColumnVector flag from Vector operands. (This fixes a problem with using the result of matrix-vector multiplication together with the ->ans_array method.) Modified Files: -------------- pg/lib/Value: Matrix.pm Revision Data ------------- Index: Matrix.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Matrix.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -Llib/Value/Matrix.pm -Llib/Value/Matrix.pm -u -r1.35 -r1.36 --- lib/Value/Matrix.pm +++ lib/Value/Matrix.pm @@ -169,6 +169,14 @@ Value::Error("Can't convert %s to %s",Value::showClass($x),Value::showClass($self)); } +# +# Don't inherit ColumnVector flag +# +sub noinherit { + my $self = shift; + return ("ColumnVector",$self->SUPER::noinherit); +} + ############################################ # # Operations on matrices |
From: Gavin L. v. a. <we...@ma...> - 2008-08-29 18:21:41
|
Log Message: ----------- ProblemSetDetail: show ip restriction fields if set isn't assigned to any users. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetDetail.pm Revision Data ------------- Index: ProblemSetDetail.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm,v retrieving revision 1.74 retrieving revision 1.75 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -u -r1.74 -r1.75 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm @@ -617,7 +617,8 @@ $numLocations = @locations; # we don't show ip selector fields if we're editing a set version - if ( defined( $userRecord ) && ! $userRecord->can("version_id") ) { + if ( ! defined( $userRecord ) || + ( defined( $userRecord ) && ! $userRecord->can("version_id") ) ) { if ( ( ! $forUsers && $globalRecord->restrict_ip && $globalRecord->restrict_ip ne 'No' ) || ( $forUsers && $userRecord->restrict_ip ne 'No' ) ) { |
From: Mike G. v. a. <we...@ma...> - 2008-08-29 16:01:06
|
Log Message: ----------- We need the Scalar::Util::weaken to remove a memory leak present in MathObjects Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/bin: check_modules.pl Revision Data ------------- Index: check_modules.pl =================================================================== RCS file: /webwork/cvs/system/webwork2/bin/check_modules.pl,v retrieving revision 1.12.2.4.2.1 retrieving revision 1.12.2.4.2.2 diff -Lbin/check_modules.pl -Lbin/check_modules.pl -u -r1.12.2.4.2.1 -r1.12.2.4.2.2 --- bin/check_modules.pl +++ bin/check_modules.pl @@ -73,6 +73,7 @@ PHP::Serialization Pod::Usage Safe + Scalar::Util SOAP::Lite Socket SQL::Abstract |
From: Mike G. v. a. <we...@ma...> - 2008-08-28 01:00:36
|
Log Message: ----------- Updated simplifications of database calls in locallib.php Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: locallib.php Revision Data ------------- Index: locallib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/locallib.php,v retrieving revision 1.4 retrieving revision 1.5 diff -Lwwassignment4/moodle/mod/wwassignment/locallib.php -Lwwassignment4/moodle/mod/wwassignment/locallib.php -u -r1.4 -r1.5 --- wwassignment4/moodle/mod/wwassignment/locallib.php +++ wwassignment4/moodle/mod/wwassignment/locallib.php @@ -177,6 +177,24 @@ //////////////////////////////////////////////////////////////// //functions that check mapping existance in the local db //////////////////////////////////////////////////////////////// +/** +@desc Find the id of the wwlink block class +*@param none +*@return id +*/ +function _wwasssignment_wwlink_blockid() { + $wwlink = get_record('block','name','wwlink'); + return $wwlink->id; +} +/** +@desc Find the id of the wwassignment module class +*@param none +*@return id +*/ +function _wwassignment_cmid() { + $wwassignment = get_record('mod','name','wwassignment'); + return $wwassignment->id; +} /** * @desc Finds the webwork course name from a moodle course id. @@ -185,9 +203,9 @@ * @return string the name of the webwork course on success and -1 on failure. */ function _wwassignment_mapped_course($courseid,$silent = true) { - $wwlink = get_record('block','name','wwlink'); - //error_log("wwlink".print_r($wwlink,true)); - $blockinstance = get_record('block_instance','blockid', $wwlink->id,'pageid',$courseid,'pagetype','course-view'); + $blockinstance = get_record('block_instance','blockid', + _wwasssignment_wwlink_blockid(), + 'pageid',$courseid, 'pagetype','course-view'); //error_log("block instance".print_r($blockinstance,true)); $block_config = unserialize(base64_decode($blockinstance->configdata)); //error_log("config_data ".print_r($block_config,true)); |
From: dpvc v. a. <we...@ma...> - 2008-08-27 12:05:59
|
Log Message: ----------- BACKPORT: changes from version 1.8 (in particular,include the \verb command). Tags: ---- rel-2-4-patches Modified Files: -------------- webwork-modperl/htdocs/jsMath: jsMath-ww.js Revision Data ------------- Index: jsMath-ww.js =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/htdocs/jsMath/jsMath-ww.js,v retrieving revision 1.6.2.1.2.1 retrieving revision 1.6.2.1.2.2 diff -Lhtdocs/jsMath/jsMath-ww.js -Lhtdocs/jsMath/jsMath-ww.js -u -r1.6.2.1.2.1 -r1.6.2.1.2.2 --- htdocs/jsMath/jsMath-ww.js +++ htdocs/jsMath/jsMath-ww.js @@ -9,18 +9,22 @@ */ var jsMath = { + styles: { '.math': 'font-family: serif; font-style: normal; color: grey; font-size: 75%' }, Controls: {cookie: {scale: 133}}, Parser: {prototype: {macros: { - lt: ['Macro','<'], - gt: ['Macro','>'], setlength: ['Macro','',2], - boldsymbol: ['Macro','{\\bf #1}',1] + boldsymbol: ['Macro','{\\bf #1}',1], + verb: ['Extension','verb'] }}}, Font: {}, + // + // Look for jsMath-ww.js file and replace by jsMath.js + // Cause the jsMath.js file to be loaded + // wwSource: function () { var script = document.getElementsByTagName('SCRIPT'); var src = script[script.length-1].getAttribute('SRC'); @@ -34,15 +38,32 @@ wwProcess: function () { if (this.wwCount > 1) return; - var onload = (this.wwCount? this.wwProcessMultiple: this.wwProcessSingle); - if (window.addEventListener) {window.addEventListener("load",onload,false)} - else if (window.attachEvent) {window.attachEvent("onload",onload)} - else {window.onload = onload} + if (this.wwCount == 0) { + // + // This is the first call to jsMath, so install handler + // + if (window.addEventListener) {window.addEventListener("load",jsMath.wwOnLoad,false)} + else if (window.attachEvent) {window.attachEvent("onload",jsMath.wwOnLoad)} + else {window.onload = jsMath.wwOnLoad} + // + // Process the page synchronously + // + this.wwProcessWW = jsMath.ProcessBeforeShowing; + } else { + // + // There are multiple calls, so we're in the Library Browser + // Process the page asynchronously + // + this.wwProcessWW = jsMath.Process; + } this.wwCount++; }, - wwProcessSingle: function () {jsMath.ProcessBeforeShowing()}, - wwProcessMultiple: function () {jsMath.Process()} + // + // The actual onload handler calls whichever of the two + // processing commands has been saved + // + wwOnLoad: function () {jsMath.wwProcessWW()} }; @@ -50,12 +71,14 @@ if (window.missingFontMessage) {jsMath.Font.message = missingFontMessage} if (!window.processDoubleClicks) {jsMath.Click = {CheckDblClick: function () {}}} - // Load actual jsMath code + // + // Load jsMath.js + // jsMath.wwSource(); // - // Make sure answer boxes are above jsMath output (avoids deep - // baselines in jsMath fonts) + // Make sure answer boxes are above jsMath output + // (avoids deep baselines in jsMath fonts) // document.write('<STYLE> .problem INPUT, .problem TEXTAREA {position: relative; z-index: 2} </STYLE>'); |
From: Mike G. v. a. <we...@ma...> - 2008-08-24 03:07:33
|
Log Message: ----------- Modified file to use the internal configuration of the wwlink block rather than the data from wwassignment_bridge The instance behavior needs more detailed warning message when no webwork course is connected or when it does not have the desired course. Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: backuplib.php lib.php locallib.php restorelib.php wwmoodle/wwassignment4/moodle/mod/wwassignment/db: install.xml upgrade.php Revision Data ------------- Index: restorelib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/restorelib.php,v retrieving revision 1.2 retrieving revision 1.3 diff -Lwwassignment4/moodle/mod/wwassignment/restorelib.php -Lwwassignment4/moodle/mod/wwassignment/restorelib.php -u -r1.2 -r1.3 --- wwassignment4/moodle/mod/wwassignment/restorelib.php +++ wwassignment4/moodle/mod/wwassignment/restorelib.php @@ -27,12 +27,12 @@ global $CFG; $status = true; - error_log("mod id ".$mod->id); - if ($mod->id == "66666") { - $wwlinkdata = backup_getid($restore->backup_unique_code,"wwassignment_bridge","wwassignment_bridge"); - error_log("wwlink data ".print_r($wwlinkdata, true )); - return $status; - } + //error_log("mod id ".$mod->id); +// if ($mod->id == "66666") { +// $wwlinkdata = backup_getid($restore->backup_unique_code,"wwassignment_bridge","wwassignment_bridge"); +// error_log("wwlink data ".print_r($wwlinkdata, true )); +// return $status; +// } //Get record from backup_ids @@ -78,7 +78,7 @@ } else { $status = false; } - error_log("mod id is ".print_r($mod,true)); + //error_log("mod id is ".print_r($mod,true)); return $status; } Index: lib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/lib.php,v retrieving revision 1.4 retrieving revision 1.5 diff -Lwwassignment4/moodle/mod/wwassignment/lib.php -Lwwassignment4/moodle/mod/wwassignment/lib.php -u -r1.4 -r1.5 --- wwassignment4/moodle/mod/wwassignment/lib.php +++ wwassignment4/moodle/mod/wwassignment/lib.php @@ -472,16 +472,21 @@ function wwassignment_delete_course() { + error_log("Begin wwassignment_delete_course --not used yet"); } function wwassignment_process_options() { + error_log("Begin wwassignment_process_options --not used yet"); + } function wwassignment_reset_course_form() { + error_log("Begin wwassignment_reset_course_form --not used yet"); } function wwassignment_delete_userdata() { - + error_log("Begin wwassignment_delete_userdata --not used yet"); + } /** @@ -489,6 +494,8 @@ */ function wwassignment_print_recent_activity($course, $isteacher, $timestart) { global $CFG; + error_log("Begin wwassignment_print_recent_activity --not used yet"); + return false; // True if anything was printed, otherwise false } @@ -513,7 +520,6 @@ */ function wwassignment_get_participants($wwassignmentid) { - error_log("wwassignment_get_participants"); $wwassignment = get_record('wwassignment', 'id', $wwassignmentid); if(!isset($wwassignment)) { return array(); Index: locallib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/locallib.php,v retrieving revision 1.3 retrieving revision 1.4 diff -Lwwassignment4/moodle/mod/wwassignment/locallib.php -Lwwassignment4/moodle/mod/wwassignment/locallib.php -u -r1.3 -r1.4 --- wwassignment4/moodle/mod/wwassignment/locallib.php +++ wwassignment4/moodle/mod/wwassignment/locallib.php @@ -185,13 +185,22 @@ * @return string the name of the webwork course on success and -1 on failure. */ function _wwassignment_mapped_course($courseid,$silent = true) { - $wwassignmentbridge = get_record('wwassignment_bridge','course', $courseid); - if((isset($wwassignmentbridge)) && (isset($wwassignmentbridge->webwork_course))) { - return $wwassignmentbridge->webwork_course; - } - if(!$silent) { - print_error('webwork_course_map_failure','wwassignment'); + $wwlink = get_record('block','name','wwlink'); + //error_log("wwlink".print_r($wwlink,true)); + $blockinstance = get_record('block_instance','blockid', $wwlink->id,'pageid',$courseid,'pagetype','course-view'); + //error_log("block instance".print_r($blockinstance,true)); + $block_config = unserialize(base64_decode($blockinstance->configdata)); + //error_log("config_data ".print_r($block_config,true)); + if ( isset($block_config) && isset($block_config->webwork_link_id) ) { + return $block_config->webwork_link_id; } +// $wwassignmentbridge = get_record('wwassignment_bridge','course', $courseid); +// if((isset($wwassignmentbridge)) && (isset($wwassignmentbridge->webwork_course))) { +// return $wwassignmentbridge->webwork_course; +// } +// if(!$silent) { +// print_error('webwork_course_map_failure','wwassignment'); +// } return -1; } Index: backuplib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/backuplib.php,v retrieving revision 1.2 retrieving revision 1.3 diff -Lwwassignment4/moodle/mod/wwassignment/backuplib.php -Lwwassignment4/moodle/mod/wwassignment/backuplib.php -u -r1.2 -r1.3 --- wwassignment4/moodle/mod/wwassignment/backuplib.php +++ wwassignment4/moodle/mod/wwassignment/backuplib.php @@ -25,8 +25,8 @@ function wwassignment_backup_mods($bf,$preferences) { - error_log("wwassignment_backup_mods"); - //error_log("preferences ".print_r($preferences,true)); + //error_log("wwassignment_backup_mods"); + ////error_log("preferences ".print_r($preferences,true)); global $CFG; $status = true; @@ -35,7 +35,7 @@ $wwassignments = get_records ("wwassignment","course",$preferences->backup_course); if ($wwassignments) { foreach ($wwassignments as $wwassignment) { - //error_log("backing up wwassignment ".$wwassignment->id); + ////error_log("backing up wwassignment ".$wwassignment->id); if (backup_mod_selected($preferences,'wwassignment',$wwassignment->id)) { $status = wwassignment_backup_one_mod($bf,$preferences,$wwassignment); // backup files happens in backup_one_mod now too. @@ -45,15 +45,14 @@ - error_log("end wwassignment_backup_mods"); + //error_log("end wwassignment_backup_mods"); return $status; } function wwassignment_backup_one_mod($bf,$preferences,$wwassignment) { - error_log("wwassignment_backup_one_mod"); - //error_log("preferences ".print_r($preferences,true)); + //error_log("wwassignment_backup_one_mod"); + ////error_log("preferences ".print_r($preferences,true)); global $CFG; - global $BaCkUpWWassignment_bridge ; // hack to back up wwassignment_bridge table just once if (is_numeric($wwassignment)) { $wwassignment = get_record('wwassignment','id',$wwassignment); @@ -77,21 +76,9 @@ $status =fwrite ($bf,end_tag("MOD",3,true)); - error_log("end wwassignment_one_backup_mod"); - error_log("preferences ".print_r($preferences,true)); - if ($status and !$BaCkUpWWassignment_bridge) { - $BaCkUpWWassignment_bridge = 1 ; // don't back it up again - $wwassignment_bridge =get_record("wwassignment_bridge","course",$preferences->backup_course); - error_log("writing wwassignment_bridge"); - fwrite ($bf,start_tag("MOD",3,true)); - //Print wwassignment_bridge data - fwrite ($bf,full_tag("ID",4,false,"66666")); - fwrite ($bf,full_tag("MODTYPE",4,false,"wwassignment")); - fwrite ($bf,full_tag("WEBWORK_COURSE",4,false,$wwassignment_bridge->webwork_course)); - fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$wwassignment_bridge->timemodified)); - $status =fwrite ($bf,end_tag("MOD",3,true)); - error_log("wwassignment_bridge backed up"); - } + //error_log("end wwassignment_one_backup_mod"); + //error_log("preferences ".print_r($preferences,true)); + return $status; @@ -100,10 +87,10 @@ //Return an array of info (name,value) function wwassignment_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) { - //error_log("wwassignment_check_backup_mods "); - //error_log("user_data ".print_r($user_data,true) ); - //error_log("backup code ".print_r($backup_unique_code,true)); - //error_log("instance ".print_r($instance,true)); + ////error_log("wwassignment_check_backup_mods "); + ////error_log("user_data ".print_r($user_data,true) ); + ////error_log("backup code ".print_r($backup_unique_code,true)); + ////error_log("instance ".print_r($instance,true)); $info=array(); if (!empty($instances) && is_array($instances) && count($instances)) { foreach ($instances as $id => $instance) { @@ -119,16 +106,16 @@ $info[0][1] = 0; } - //error_log("end wwassignment_check_backup_mods"); + ////error_log("end wwassignment_check_backup_mods"); return $info; } //Return an array of info (name,value) function wwassignment_check_backup_mods_instances($instance,$backup_unique_code) { - //error_log("wwassignment_check_backup_mods_instances "); - //error_log("content ".print_r($content,true)); - //error_log("preferences ".print_r($preferences,true)); + ////error_log("wwassignment_check_backup_mods_instances "); + ////error_log("content ".print_r($content,true)); + ////error_log("preferences ".print_r($preferences,true)); $info[$instance->id.'0'][0] = '<b>'.$instance->name.'</b>'; $info[$instance->id.'0'][1] = ''; @@ -140,7 +127,7 @@ // $info[$instance->id.'1'][1] = 0; // } // } - //error_log("end wwassignment_check_backup_mods_instances"); + ////error_log("end wwassignment_check_backup_mods_instances"); return $info; } @@ -168,13 +155,13 @@ //Returns an array of assignments id function wwassignment_ids ($course) { - //error_log("wwassignment_ids "); - //error_log("course ".print_r($course,true)); + ////error_log("wwassignment_ids "); + ////error_log("course ".print_r($course,true)); global $CFG; - //error_log("end wwassignment_ids"); + ////error_log("end wwassignment_ids"); return get_records_sql ("SELECT a.id, a.course FROM {$CFG->prefix}wwassignment a Index: upgrade.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/db/upgrade.php,v retrieving revision 1.4 retrieving revision 1.5 diff -Lwwassignment4/moodle/mod/wwassignment/db/upgrade.php -Lwwassignment4/moodle/mod/wwassignment/db/upgrade.php -u -r1.4 -r1.5 --- wwassignment4/moodle/mod/wwassignment/db/upgrade.php +++ wwassignment4/moodle/mod/wwassignment/db/upgrade.php @@ -60,12 +60,12 @@ /// Define field timemodified to be added to wwassignment - $table = new XMLDBTable('wwassignment_bridge'); - $field = new XMLDBField('timemodified'); - $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'webwork_course'); - - /// Launch add field timemodified to wwassignment_bridge - $result = $result && add_field($table, $field); +// $table = new XMLDBTable('wwassignment_bridge'); +// $field = new XMLDBField('timemodified'); +// $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'webwork_course'); +// +// /// Launch add field timemodified to wwassignment_bridge +// $result = $result && add_field($table, $field); //notify('Processing assignment grades, this may take a while if there are many assignments...', 'notifysuccess'); Index: install.xml =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/db/install.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -Lwwassignment4/moodle/mod/wwassignment/db/install.xml -Lwwassignment4/moodle/mod/wwassignment/db/install.xml -u -r1.2 -r1.3 --- wwassignment4/moodle/mod/wwassignment/db/install.xml +++ wwassignment4/moodle/mod/wwassignment/db/install.xml @@ -14,17 +14,6 @@ <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for data"/> </KEYS> </TABLE> - <TABLE NAME="wwassignment_bridge" COMMENT="" PREVIOUS="wwassignment"> - <FIELDS> - <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/> - <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="webwork_course"/> - <FIELD NAME="webwork_course" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course"/> - <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="webwork_set"/> - </FIELDS> - <KEYS> - <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for data"/> - </KEYS> - </TABLE> </TABLES> <STATEMENTS> </STATEMENTS> |
From: Mike G. v. a. <we...@ma...> - 2008-08-24 03:04:27
|
Log Message: ----------- wwlink now saves its configuration internally instead of using the wwassignment_bridge table Modified Files: -------------- wwmoodle/wwassignment4/moodle/blocks/wwlink: block_wwlink.php Revision Data ------------- Index: block_wwlink.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/blocks/wwlink/block_wwlink.php,v retrieving revision 1.3 retrieving revision 1.4 diff -Lwwassignment4/moodle/blocks/wwlink/block_wwlink.php -Lwwassignment4/moodle/blocks/wwlink/block_wwlink.php -u -r1.3 -r1.4 --- wwassignment4/moodle/blocks/wwlink/block_wwlink.php +++ wwassignment4/moodle/blocks/wwlink/block_wwlink.php @@ -22,28 +22,28 @@ /** * @desc Saves the form data from configuration into the wwassignment_bridge table. */ - function instance_config_save($data) { +// function instance_config_save($data) { - $webworkcourse = $data->webwork_link_id; - $moodlecourse = $data->courseid; +// $webworkcourse = $data->webwork_link_id; +// $moodlecourse = $data->courseid; +// +// $wwassignmentbridge = new stdClass; +// $wwassignmentbridge->course = $moodlecourse; +// $wwassignmentbridge->webwork_course = $webworkcourse; +// +// //has this mapping been defined +// $record = get_record('wwassignment_bridge','course',$moodlecourse); +// if(!$record) { +// //new one +// insert_record('wwassignment_bridge',$wwassignmentbridge); +// } else { +// //update +// $wwassignmentbridge->id = $record->id; +// update_record('wwassignment_bridge',$wwassignmentbridge); +// } - $wwassignmentbridge = new stdClass; - $wwassignmentbridge->course = $moodlecourse; - $wwassignmentbridge->webwork_course = $webworkcourse; - - //has this mapping been defined - $record = get_record('wwassignment_bridge','course',$moodlecourse); - if(!$record) { - //new one - insert_record('wwassignment_bridge',$wwassignmentbridge); - } else { - //update - $wwassignmentbridge->id = $record->id; - update_record('wwassignment_bridge',$wwassignmentbridge); - } - - return parent::instance_config_save($data); - } +// return parent::instance_config_save($data); +// } /** * @desc Makes sure that the only place this block can be added is on course-view page. This insures one block per course. @@ -55,26 +55,39 @@ /** * @desc Prints the content of the block. Whether or not the course is connected to a moodle course. */ +// function get_content() { +// global $COURSE; +// print_r($this->config ); +// $courseid = $COURSE->id; +// $record = get_record('wwassignment_bridge','course',$courseid); +// print_r($record); +// if(!$record) { +// $wwlinkdata = $this->config; +// if (!$wwlinkdata) { +// $this->content->text = get_string('not_connected','block_wwlink'); +// } else { +// $this->content->text = "connecting to ". $this->config->webwork_link_id; +// $wwassignmentbridge->course = $courseid; +// $wwassignmentbridge->webwork_course = $wwlinkdata->webwork_link_id; +// insert_record('wwassignment_bridge',$wwassignmentbridge); +// } +// +// } else { +// $this->content->text = get_string('connected','block_wwlink') . ' ' . $record->webwork_course; +// } +// $this->content->footer = ''; +// return $this->content; +// } function get_content() { global $COURSE; - print_r($this->config ); - $courseid = $COURSE->id; - $record = get_record('wwassignment_bridge','course',$courseid); - print_r($record); - if(!$record) { - $wwlinkdata = $this->config; - if (!$wwlinkdata) { - $this->content->text = get_string('not_connected','block_wwlink'); - } else { - $this->content->text = "connecting to ". $this->config->webwork_link_id; - $wwassignmentbridge->course = $courseid; - $wwassignmentbridge->webwork_course = $wwlinkdata->webwork_link_id; - insert_record('wwassignment_bridge',$wwassignmentbridge); - } - - } else { - $this->content->text = get_string('connected','block_wwlink') . ' ' . $record->webwork_course; - } + //print_r($this->config ); + $wwlinkdata = $this->config; + if (!isset($wwlinkdata) || !$wwlinkdata->webwork_link_id ) { // need webwork_link_id to exist and be non-zero + $this->content->text = get_string('not_connected','block_wwlink'); + } else { + $this->content->text = get_string('connected','block_wwlink') . ' ' . $wwlinkdata->webwork_link_id; + } + $this->content->footer = ''; return $this->content; } |
From: Mike G. v. a. <we...@ma...> - 2008-08-24 01:36:07
|
Log Message: ----------- Include code that allows blocks to be restored. There is still some unneeded error reporting. Modified Files: -------------- wwmoodle/wwassignment4/moodle/blocks/wwlink: block_wwlink.php Revision Data ------------- Index: block_wwlink.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/blocks/wwlink/block_wwlink.php,v retrieving revision 1.2 retrieving revision 1.3 diff -Lwwassignment4/moodle/blocks/wwlink/block_wwlink.php -Lwwassignment4/moodle/blocks/wwlink/block_wwlink.php -u -r1.2 -r1.3 --- wwassignment4/moodle/blocks/wwlink/block_wwlink.php +++ wwassignment4/moodle/blocks/wwlink/block_wwlink.php @@ -57,11 +57,21 @@ */ function get_content() { global $COURSE; - + print_r($this->config ); $courseid = $COURSE->id; $record = get_record('wwassignment_bridge','course',$courseid); + print_r($record); if(!$record) { - $this->content->text = get_string('not_connected','block_wwlink'); + $wwlinkdata = $this->config; + if (!$wwlinkdata) { + $this->content->text = get_string('not_connected','block_wwlink'); + } else { + $this->content->text = "connecting to ". $this->config->webwork_link_id; + $wwassignmentbridge->course = $courseid; + $wwassignmentbridge->webwork_course = $wwlinkdata->webwork_link_id; + insert_record('wwassignment_bridge',$wwassignmentbridge); + } + } else { $this->content->text = get_string('connected','block_wwlink') . ' ' . $record->webwork_course; } |
From: Mike G. v. a. <we...@ma...> - 2008-08-24 01:32:02
|
Log Message: ----------- Added changes that allow backup and restore Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: backuplib.php lib.php restorelib.php wwmoodle/wwassignment4/moodle/mod/wwassignment/db: install.xml upgrade.php Revision Data ------------- Index: restorelib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/restorelib.php,v retrieving revision 1.1 retrieving revision 1.2 diff -Lwwassignment4/moodle/mod/wwassignment/restorelib.php -Lwwassignment4/moodle/mod/wwassignment/restorelib.php -u -r1.1 -r1.2 --- wwassignment4/moodle/mod/wwassignment/restorelib.php +++ wwassignment4/moodle/mod/wwassignment/restorelib.php @@ -0,0 +1,178 @@ +<?php //$Id$ + //This php script contains all the stuff to backup/restore + //assignment mods + + //This is the "graphical" structure of the assignment mod: + // + // assignment + // (CL,pk->id) + // | + // | + // | + // assignment_submisions + // (UL,pk->id, fk->assignment,files) + // + // Meaning: pk->primary key field of the table + // fk->foreign key to link with parent + // nt->nested field (recursive data) + // CL->course level info + // UL->user level info + // files->table may have files) + // + //----------------------------------------------------------- + + //This function executes all the restore procedure about this mod + function wwassignment_restore_mods($mod,$restore) { + + global $CFG; + + $status = true; + error_log("mod id ".$mod->id); + if ($mod->id == "66666") { + $wwlinkdata = backup_getid($restore->backup_unique_code,"wwassignment_bridge","wwassignment_bridge"); + error_log("wwlink data ".print_r($wwlinkdata, true )); + return $status; + } + + //Get record from backup_ids + + $data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id); + + if ($data) { + //Now get completed xmlized object + $info = $data->info; + //if necessary, write to restorelog and adjust date/time fields + if ($restore->course_startdateoffset) { + //restore_log_date_changes('Wwassignment', $restore, $info['MOD']['#'], array('TIMEDUE', 'TIMEAVAILABLE')); + } + //traverse_xmlize($info); //Debug + //print_object ($GLOBALS['traverse_array']); //Debug + //$GLOBALS['traverse_array']=""; //Debug + + //Now, build the ASSIGNMENT record structure + $wwassignment->course = $restore->course_id; + $wwassignment->name = backup_todb($info['MOD']['#']['NAME']['0']['#']); + $wwassignment->description = backup_todb($info['MOD']['#']['DESCRIPTION']['0']['#']); + $wwassignment->webwork_set = backup_todb($info['MOD']['#']['WEBWORK_SET']['0']['#']); + $wwassignment->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']); + + + + //The structure is equal to the db, so insert the assignment + $newid = insert_record ("wwassignment",$wwassignment); + + //Do some output + if (!defined('RESTORE_SILENTLY')) { + echo "<li>".get_string("modulename","wwassignment")." \"".format_string(stripslashes($wwassignment->name),true)."\"</li>"; + } + backup_flush(300); + + if ($newid) { + //We have the newid, update backup_ids + backup_putid($restore->backup_unique_code,$mod->modtype, + $mod->id, $newid); + + } else { + $status = false; + } + } else { + $status = false; + } + error_log("mod id is ".print_r($mod,true)); + return $status; + } + + + + //This function returns a log record with all the necessay transformations + //done. It's used by restore_log_module() to restore modules log. + function wwassignment_restore_logs($restore,$log) { + + $status = false; + + //Depending of the action, we recode different things + switch ($log->action) { + case "add": + if ($log->cmid) { + //Get the new_id of the module (to recode the info field) + $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info); + if ($mod) { + $log->url = "view.php?id=".$log->cmid; + $log->info = $mod->new_id; + $status = true; + } + } + break; + case "update": + if ($log->cmid) { + //Get the new_id of the module (to recode the info field) + $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info); + if ($mod) { + $log->url = "view.php?id=".$log->cmid; + $log->info = $mod->new_id; + $status = true; + } + } + break; + case "view": + if ($log->cmid) { + //Get the new_id of the module (to recode the info field) + $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info); + if ($mod) { + $log->url = "view.php?id=".$log->cmid; + $log->info = $mod->new_id; + $status = true; + } + } + break; + case "view all": + $log->url = "index.php?id=".$log->course; + $status = true; + break; + case "upload": + if ($log->cmid) { + //Get the new_id of the module (to recode the info field) + $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info); + if ($mod) { + $log->url = "view.php?a=".$mod->new_id; + $log->info = $mod->new_id; + $status = true; + } + } + break; + case "view submission": + if ($log->cmid) { + //Get the new_id of the module (to recode the info field) + $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info); + if ($mod) { + $log->url = "submissions.php?id=".$mod->new_id; + $log->info = $mod->new_id; + $status = true; + } + } + break; + case "update grades": + if ($log->cmid) { + //Extract the assignment id from the url field + $assid = substr(strrchr($log->url,"="),1); + //Get the new_id of the module (to recode the info field) + $mod = backup_getid($restore->backup_unique_code,$log->module,$assid); + if ($mod) { + $log->url = "submissions.php?id=".$mod->new_id; + $status = true; + } + } + break; + default: + if (!defined('RESTORE_SILENTLY')) { + echo "action (".$log->module."-".$log->action.") unknown. Not restored<br />"; //Debug + } + break; + } + + if ($status) { + $status = $log; + } + return $status; + } +?> Index: lib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/lib.php,v retrieving revision 1.3 retrieving revision 1.4 diff -Lwwassignment4/moodle/mod/wwassignment/lib.php -Lwwassignment4/moodle/mod/wwassignment/lib.php -u -r1.3 -r1.4 --- wwassignment4/moodle/mod/wwassignment/lib.php +++ wwassignment4/moodle/mod/wwassignment/lib.php @@ -175,6 +175,35 @@ * @param int $userid optional user id, 0 means all users * @return array array of grades, false if none */ +// function assignment_get_user_grades($assignment, $userid=0) { +// global $CFG; +// +// $user = $userid ? "AND u.id = $userid" : ""; +// +// $sql = "SELECT u.id, u.id AS userid, s.grade AS rawgrade, s.submissioncomment AS feedback, s.format AS feedbackformat, +// s.teacher AS usermodified, s.timemarked AS dategraded, s.timemodified AS datesubmitted +// FROM {$CFG->prefix}user u, {$CFG->prefix}assignment_submissions s +// WHERE u.id = s.userid AND s.assignment = $assignment->id +// $user"; +// +// return get_records_sql($sql); +// } +// object returned looks like an array of standard objects +// ( +// [22] => stdClass Object +// ( +// [userid] => 22 +// [rawgrade] => -1 +// [feedback] => 23 +// [feedbackformat] => 0 +// [usermodified] => 2 +// [dategraded] => 1211200838 +// [datesubmitted] => 1211199392 +// [id] => 22 +// ) +// +// ) + function wwassignment_get_user_grades($wwassignment,$userid=0) { debugLog("Begin wwassignment_get_user_grades"); //debugLog("inputs -- wwassignment" . print_r($wwassignment,true)); @@ -437,12 +466,7 @@ * @return array Representing time, info pairing. */ function wwassignment_user_complete($course, $user, $mod, $wwassignment) { -$aLogs = get_logs("l.userid=$user AND l.course=$course AND l.cmid={$wwassignment->id}"); - if( count($aLogs) > 0 ) { - $return->time = $aLogs[0]->time; - $return->info = $aLogs[0]->info; - } - return $return; + return true; } @@ -489,7 +513,7 @@ */ function wwassignment_get_participants($wwassignmentid) { - error_log("wwassignment_get_participants -- legacy??"); + error_log("wwassignment_get_participants"); $wwassignment = get_record('wwassignment', 'id', $wwassignmentid); if(!isset($wwassignment)) { return array(); Index: backuplib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/backuplib.php,v retrieving revision 1.1 retrieving revision 1.2 diff -Lwwassignment4/moodle/mod/wwassignment/backuplib.php -Lwwassignment4/moodle/mod/wwassignment/backuplib.php -u -r1.1 -r1.2 --- wwassignment4/moodle/mod/wwassignment/backuplib.php +++ wwassignment4/moodle/mod/wwassignment/backuplib.php @@ -0,0 +1,185 @@ +<?php //$Id$ + //This php script contains all the stuff to backup + //wwassignment mods + + //This is the "graphical" structure of the assignment mod: + // + // assignment + // (CL,pk->id) + // | + // | + // | + // assignment_submisions + // (UL,pk->id, fk->assignment,files) + // + // Meaning: pk->primary key field of the table + // fk->foreign key to link with parent + // nt->nested field (recursive data) + // CL->course level info + // UL->user level info + // files->table may have files) + // + //----------------------------------------------------------- + + //This function executes all the backup procedure about this mod + + + function wwassignment_backup_mods($bf,$preferences) { + error_log("wwassignment_backup_mods"); + //error_log("preferences ".print_r($preferences,true)); + global $CFG; + + $status = true; + + //Iterate over assignment table + $wwassignments = get_records ("wwassignment","course",$preferences->backup_course); + if ($wwassignments) { + foreach ($wwassignments as $wwassignment) { + //error_log("backing up wwassignment ".$wwassignment->id); + if (backup_mod_selected($preferences,'wwassignment',$wwassignment->id)) { + $status = wwassignment_backup_one_mod($bf,$preferences,$wwassignment); + // backup files happens in backup_one_mod now too. + } + } + } + + + + error_log("end wwassignment_backup_mods"); + return $status; + } + + function wwassignment_backup_one_mod($bf,$preferences,$wwassignment) { + error_log("wwassignment_backup_one_mod"); + //error_log("preferences ".print_r($preferences,true)); + global $CFG; + global $BaCkUpWWassignment_bridge ; // hack to back up wwassignment_bridge table just once + + if (is_numeric($wwassignment)) { + $wwassignment = get_record('wwassignment','id',$wwassignment); + } + + $status = true; +// function full_tag($tag,$level=0,$endline=true,$content,$attributes=null) { +// //Start mod + fwrite ($bf,start_tag("MOD",3,true)); + //Print wwassignment data + fwrite ($bf,full_tag("ID",4,false,$wwassignment->id)); + fwrite ($bf,full_tag("MODTYPE",4,false,"wwassignment")); + fwrite ($bf,full_tag("NAME",4,false,$wwassignment->name)); + fwrite ($bf,full_tag("DESCRIPTION",4,false,$wwassignment->description)); + fwrite ($bf,full_tag("WEBWORK_SET",4,false,$wwassignment->webwork_set)); + fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$wwassignment->timemodified)); + //if we've selected to backup users info, then execute backup_assignment_submisions and + //backup_assignment_files_instance + + //End mod + $status =fwrite ($bf,end_tag("MOD",3,true)); + + + error_log("end wwassignment_one_backup_mod"); + error_log("preferences ".print_r($preferences,true)); + if ($status and !$BaCkUpWWassignment_bridge) { + $BaCkUpWWassignment_bridge = 1 ; // don't back it up again + $wwassignment_bridge =get_record("wwassignment_bridge","course",$preferences->backup_course); + error_log("writing wwassignment_bridge"); + fwrite ($bf,start_tag("MOD",3,true)); + //Print wwassignment_bridge data + fwrite ($bf,full_tag("ID",4,false,"66666")); + fwrite ($bf,full_tag("MODTYPE",4,false,"wwassignment")); + fwrite ($bf,full_tag("WEBWORK_COURSE",4,false,$wwassignment_bridge->webwork_course)); + fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$wwassignment_bridge->timemodified)); + $status =fwrite ($bf,end_tag("MOD",3,true)); + error_log("wwassignment_bridge backed up"); + } + + + return $status; + } + + + //Return an array of info (name,value) + function wwassignment_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) { + //error_log("wwassignment_check_backup_mods "); + //error_log("user_data ".print_r($user_data,true) ); + //error_log("backup code ".print_r($backup_unique_code,true)); + //error_log("instance ".print_r($instance,true)); + $info=array(); + if (!empty($instances) && is_array($instances) && count($instances)) { + foreach ($instances as $id => $instance) { + $info += wwassignment_check_backup_mods_instances($instance,$backup_unique_code); + } + return $info; + } + //First the course data + $info[0][0] = get_string("modulenameplural","wwassignment"); + if ($ids = wwassignment_ids ($course)) { + $info[0][1] = count($ids); + } else { + $info[0][1] = 0; + } + + //error_log("end wwassignment_check_backup_mods"); + + return $info; + } + + //Return an array of info (name,value) + function wwassignment_check_backup_mods_instances($instance,$backup_unique_code) { + //error_log("wwassignment_check_backup_mods_instances "); + //error_log("content ".print_r($content,true)); + //error_log("preferences ".print_r($preferences,true)); + + $info[$instance->id.'0'][0] = '<b>'.$instance->name.'</b>'; + $info[$instance->id.'0'][1] = ''; +// if (!empty($instance->userdata)) { +// $info[$instance->id.'1'][0] = get_string("submissions","assignment"); +// if ($ids = assignment_submission_ids_by_instance ($instance->id)) { +// $info[$instance->id.'1'][1] = count($ids); +// } else { +// $info[$instance->id.'1'][1] = 0; +// } +// } + //error_log("end wwassignment_check_backup_mods_instances"); + + return $info; + } +// +// //Return a content encoded to support interactivities linking. Every module +// //should have its own. They are called automatically from the backup procedure. +// function assignment_encode_content_links ($content,$preferences) { +// +// global $CFG; +// +// $base = preg_quote($CFG->wwwroot,"/"); +// +// //Link to the list of assignments +// $buscar="/(".$base."\/mod\/assignment\/index.php\?id\=)([0-9]+)/"; +// $result= preg_replace($buscar,'$@ASSIGNMENTINDEX*$2@$',$content); +// +// //Link to assignment view by moduleid +// $buscar="/(".$base."\/mod\/assignment\/view.php\?id\=)([0-9]+)/"; +// $result= preg_replace($buscar,'$@ASSIGNMENTVIEWBYID*$2@$',$result); +// +// return $result; +// } + + // INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE + + //Returns an array of assignments id + function wwassignment_ids ($course) { + //error_log("wwassignment_ids "); + //error_log("course ".print_r($course,true)); + + global $CFG; + + + //error_log("end wwassignment_ids"); + + return get_records_sql ("SELECT a.id, a.course + FROM {$CFG->prefix}wwassignment a + WHERE a.course = '$course'"); + } + + +?> Index: upgrade.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/db/upgrade.php,v retrieving revision 1.3 retrieving revision 1.4 diff -Lwwassignment4/moodle/mod/wwassignment/db/upgrade.php -Lwwassignment4/moodle/mod/wwassignment/db/upgrade.php -u -r1.3 -r1.4 --- wwassignment4/moodle/mod/wwassignment/db/upgrade.php +++ wwassignment4/moodle/mod/wwassignment/db/upgrade.php @@ -36,11 +36,17 @@ notify("running 1.9 upgrade"); if ($result && $oldversion < 2008042072) { + + /// Define field grade to be added to wwassignment //$table = new XMLDBTable('wwassignment'); //$field = new XMLDBField('grade'); //$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'webwork_set'); + // can't do this until you are connected to webwork -- which you won't be on initial upgrades + // add this either to wwlink block or to configuration + + /// Launch add field grade //$result = $result && add_field($table, $field); @@ -49,11 +55,18 @@ $field = new XMLDBField('timemodified'); $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'webwork_set'); - /// Launch add field timemodified + /// Launch add field timemodified to wwassignment_bridge $result = $result && add_field($table, $field); - // can't do this until you are connected to webwork -- which you won't be on initial upgrades - // add this either to wwlink block or to configuration + + /// Define field timemodified to be added to wwassignment + $table = new XMLDBTable('wwassignment_bridge'); + $field = new XMLDBField('timemodified'); + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'webwork_course'); + + /// Launch add field timemodified to wwassignment_bridge + $result = $result && add_field($table, $field); + //notify('Processing assignment grades, this may take a while if there are many assignments...', 'notifysuccess'); // change grade typo to text if no grades MDL-13920 Index: install.xml =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/db/install.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -Lwwassignment4/moodle/mod/wwassignment/db/install.xml -Lwwassignment4/moodle/mod/wwassignment/db/install.xml -u -r1.1 -r1.2 --- wwassignment4/moodle/mod/wwassignment/db/install.xml +++ wwassignment4/moodle/mod/wwassignment/db/install.xml @@ -18,8 +18,8 @@ <FIELDS> <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/> <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="webwork_course"/> - <FIELD NAME="webwork_course" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course"/> + <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="webwork_set"/> </FIELDS> <KEYS> <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for data"/> |
From: Mike G. v. a. <we...@ma...> - 2008-08-22 17:29:53
|
Log Message: ----------- added changes to global.conf.dist to facilitate the use of the new national library Tags: ---- rel-2-4-patches 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.189.2.7.2.9 retrieving revision 1.189.2.7.2.10 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.189.2.7.2.9 -r1.189.2.7.2.10 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -49,7 +49,7 @@ # Paths to external programs ################################################################################ -# system utilties +# system utilities $externalPrograms{mv} = "/bin/mv"; $externalPrograms{cp} = "/bin/cp"; $externalPrograms{rm} = "/bin/rm"; @@ -375,32 +375,6 @@ # the templates directory. $courseFiles{login_info} = "login_info.txt"; -# Additional library buttons can be added to the Library Browser (SetMaker.pm) -# by adding the libraries you want to the following line. For each key=>value -# in the list, if a directory (or link to a directory) with name 'key' appears -# in the templates directory, then a button with name 'value' will be placed at -# the top of the problem browser. (No button will appear if there is no -# directory or link with the given name in the templates directory.) For -# example, -# -# $courseFiles{problibs} = {rochester => "Rochester", asu => "ASU"}; -# -# would add two buttons, one for the Rochester library and one for the ASU -# library, provided templates/rochester and templates/asu exists either as -# subdirectories or links to other directories. The "NPL Directory" button -# activated below gives access to all the directories in the National -# Problem Library. -# -$courseFiles{problibs} = { - Library => "NPL Directory", -# rochesterLibrary => "Rochester", -# asuLibrary => "Arizona State", -# dcdsLibrary => "Detroit CDS", -# dartmouthLibrary => "Dartmouth", -# indianaLibrary => "Indiana", -# osuLibrary => "Ohio State", -# capaLibrary => "CAPA", -}; ################################################################################ # Status system @@ -448,6 +422,11 @@ # these variables are used by database.conf. we define them here so that editing # database.conf isn't necessary. + +# required permissions +# GRANT SELECT ON webwork.* TO webworkRead@localhost IDENTIFIED BY 'passwordRO'; +# GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, LOCK TABLES ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'passwordRW'; + $database_dsn = "dbi:mysql:webwork"; $database_username = "webworkWrite"; $database_password = ""; @@ -477,9 +456,8 @@ ################################################################################ # For configuration instructions, see: -# http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/DatabaseProblemLibrary - -# The directory containing the problem library files. Set to "" if no problem +# http://webwork.maa.org/wiki/National_Problem_Library +# The directory containing the natinal problem library files. Set to "" if no problem # library is installed. $problemLibrary{root} = ""; @@ -494,6 +472,35 @@ passwd => $database_password, }; + +# Additional library buttons can be added to the Library Browser (SetMaker.pm) +# by adding the libraries you want to the following line. For each key=>value +# in the list, if a directory (or link to a directory) with name 'key' appears +# in the templates directory, then a button with name 'value' will be placed at +# the top of the problem browser. (No button will appear if there is no +# directory or link with the given name in the templates directory.) For +# example, +# +# $courseFiles{problibs} = {rochester => "Rochester", asu => "ASU"}; +# +# would add two buttons, one for the Rochester library and one for the ASU +# library, provided templates/rochester and templates/asu exists either as +# subdirectories or links to other directories. The "NPL Directory" button +# activated below gives access to all the directories in the National +# Problem Library. +# +$courseFiles{problibs} = { + Library => "NPL Directory", +# rochesterLibrary => "Rochester", +# asuLibrary => "Arizona State", +# dcdsLibrary => "Detroit CDS", +# dartmouthLibrary => "Dartmouth", +# indianaLibrary => "Indiana", +# osuLibrary => "Ohio State", + capaLibrary => "CAPA", + ucsbLibrary => "UCSB" +}; + ################################################################################ # Logs ################################################################################ @@ -544,7 +551,7 @@ # your school. If just a few courses are in a different timezone, set this in # course.conf for the affected courses instead. # -$siteDefaults{timezone} = ""; +$siteDefaults{timezone} ="US/Eastern"; # The default_templates_course is used by default to create a new course. # The contents of the templates directory are copied from this course @@ -836,6 +843,10 @@ ".", # search the problem file's directory $courseDirs{macros}, $pg{directories}{macros}, + "$courseDirs{templates}/Library/macros/Dartmouth", + "$courseDirs{templates}/Library/macros/Union", + "$courseDirs{templates}/Library/macros/NAU", + "$courseDirs{templates}/Library/macros/Michigan", ]; # The applet search path. If a full URL is given, it is used unmodified. If an @@ -845,6 +856,7 @@ # and the local server is "https://math.yourschool.edu", # then the URL "https://math.yourschool.edu/math/applets" will be used. # + $pg{directories}{appletPath} = [ # paths to search for applets (requires full url) "$webworkURLs{htdocs}/applets", "$courseURLs{html}/applets", |
From: Mike G. v. a. <we...@ma...> - 2008-08-21 20:02:55
|
Log Message: ----------- removed commented out code. put in filler code for user_complete Modified Files: -------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: lib.php Revision Data ------------- Index: lib.php =================================================================== RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/lib.php,v retrieving revision 1.2 retrieving revision 1.3 diff -Lwwassignment4/moodle/mod/wwassignment/lib.php -Lwwassignment4/moodle/mod/wwassignment/lib.php -u -r1.2 -r1.3 --- wwassignment4/moodle/mod/wwassignment/lib.php +++ wwassignment4/moodle/mod/wwassignment/lib.php @@ -175,35 +175,6 @@ * @param int $userid optional user id, 0 means all users * @return array array of grades, false if none */ -// function assignment_get_user_grades($assignment, $userid=0) { -// global $CFG; -// -// $user = $userid ? "AND u.id = $userid" : ""; -// -// $sql = "SELECT u.id, u.id AS userid, s.grade AS rawgrade, s.submissioncomment AS feedback, s.format AS feedbackformat, -// s.teacher AS usermodified, s.timemarked AS dategraded, s.timemodified AS datesubmitted -// FROM {$CFG->prefix}user u, {$CFG->prefix}assignment_submissions s -// WHERE u.id = s.userid AND s.assignment = $assignment->id -// $user"; -// -// return get_records_sql($sql); -// } -// object returned looks like an array of standard objects -// ( -// [22] => stdClass Object -// ( -// [userid] => 22 -// [rawgrade] => -1 -// [feedback] => 23 -// [feedbackformat] => 0 -// [usermodified] => 2 -// [dategraded] => 1211200838 -// [datesubmitted] => 1211199392 -// [id] => 22 -// ) -// -// ) - function wwassignment_get_user_grades($wwassignment,$userid=0) { debugLog("Begin wwassignment_get_user_grades"); //debugLog("inputs -- wwassignment" . print_r($wwassignment,true)); @@ -466,7 +437,12 @@ * @return array Representing time, info pairing. */ function wwassignment_user_complete($course, $user, $mod, $wwassignment) { - return true; +$aLogs = get_logs("l.userid=$user AND l.course=$course AND l.cmid={$wwassignment->id}"); + if( count($aLogs) > 0 ) { + $return->time = $aLogs[0]->time; + $return->info = $aLogs[0]->info; + } + return $return; } |
From: Mike G. v. a. <we...@ma...> - 2008-08-21 20:01:58
|
Log Message: ----------- removing javascript.php which was not being used. Removed Files: ------------- wwmoodle/wwassignment4/moodle/mod/wwassignment: javascript.php Revision Data ------------- |
From: Mike G. v. a. <we...@ma...> - 2008-08-21 18:06:51
|
Log Message: ----------- This file has been moved inside the en_ut8 folder Removed Files: ------------- wwmoodle/wwassignment4/moodle/mod/wwassignment/lang: wwassignment.php Revision Data ------------- --- wwassignment4/moodle/mod/wwassignment/lang/wwassignment.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -// $Id: wwassignment.php,v 1.1 2008/05/22 14:36:25 gage Exp $ -// language strings for wwmoodle_set - -$string['modulename'] = "WeBWorK Problem Set"; -$string['modulenameplural'] = "WeBWorK Problem Sets"; - -$string['set_name'] = $string['modulename']; - -//index list -$string['open_date'] = "Opened"; -$string['due_date'] = "Due"; - -//viewing page -$string['go_to_webwork'] = "Administer the WeBWorK portion of this course."; -$string['iframeNoShow-1'] = "If you are unable to view this problem set, please "; -$string['iframeNoShow-2'] = "click here"; - -//Defining New Module without Block -$string['mainpage_link_desc'] = 'You need to create the webwork course mapping by creating a WeBWorK link block.'; -$string['mainpage_link_name'] = 'Course Page'; - -//Course Link form -$string['course_initialization'] = 'Linking to WeBWorK'; -$string['webwork_course'] = 'WeBWorK Course'; - -//Set Link form -$string['set_initialization'] = 'Linking to WeBWorK Problem Set'; -$string['wwassignmentname'] = 'Name'; -$string['webwork_set'] = 'WeBWorK Set'; -$string['instructor_page_link_desc'] = 'Link to the Instructor Section of WeBWorK'; -$string['instructor_page_link_name'] = 'Go To WeBWorK Instructor Tools'; - -$string['edit_set_link_desc'] = 'Link to Set Modification Section of WeBWorK'; -$string['edit_set_link_name'] = 'Modify Set'; - -//CONFIG -$string['webwork_url'] = "The URL location of webwork on the server. ex: http://www.example.org/webwork2"; -$string['iframe_width'] = "The width in percentage of the page of the iframe displaying WeBWorK problem sets."; -$string['iframe_height'] = "The height in pixels of the iframe displaying WeBWorK problem sets."; -$string['rpc_wsdl'] = "Path to the WSDL file on the host running WeBWorK."; -$string['rpc_key'] = "Key identifying Moodle to WeBWorK."; -$string['testchanges'] = "Test WeBWorK Connection."; - - -//ERRORS -$string['construction_error'] = 'An error occured in establishing the connection to WeBWorK.<br>The most likely cause of this problem is that your WSDL path is incorrect.'; - -$string['event_creation_error'] = 'wwassignment event could not be created.'; -$string['webwork_course_list_map_failure'] = 'Could not retrieve a list of courses on the current WeBWorK server.'; - -$string['webwork_course_map_failure'] = 'No WeBWorK course is linked to this course.<br>Use the WWLink block to create a connection between this Moodle course and a WeBWorK course.'; - -$string['webwork_set_map_failure'] = 'No WeBWorK problem set is mapped to the current Moodle problem set.'; -$string['webwork_user_map_failure'] = 'No WeBWorK user is mapped to the current Moodle user.'; -$string['webwork_user_set_map_failure'] = 'The WeBWorK user does not have the current Moodle set assigned.'; -$string['rpc_error'] = 'Communication error between the Moodle client and WeBWorK server.'; - - - -?> \ No newline at end of file |
From: Mike G. v. a. <we...@ma...> - 2008-08-21 18:05:50
|
Log Message: ----------- added language file in location where moodle will look for it. This file and its parent directories can be kept in the module folder -- it doesn't need to be moved to the moodle/lang folder Added Files: ----------- wwmoodle/wwassignment4/moodle/mod/wwassignment/lang/en_utf8: wwassignment.php Revision Data ------------- --- /dev/null +++ wwassignment4/moodle/mod/wwassignment/lang/en_utf8/wwassignment.php @@ -0,0 +1,78 @@ +<?php +// $Id: wwassignment.php,v 1.1 2008/08/21 18:01:54 gage Exp $ +// language strings for wwmoodle_set + +$string['modulename'] = "WeBWorK Problem Set"; +$string['modulenameplural'] = "WeBWorK Problem Sets"; + +$string['set_name'] = $string['modulename']; + +//index list +$string['open_date'] = "Opened"; +$string['due_date'] = "Due"; + +//viewing page +$string['go_to_webwork'] = "Administer the WeBWorK portion of this course."; +$string['iframeNoShow-1'] = "If you are unable to view this problem set, please "; +$string['iframeNoShow-2'] = "click here"; + +//Defining New Module without Block +$string['mainpage_link_desc'] = 'You need to create the webwork course mapping by creating a WeBWorK link block.'; +$string['mainpage_link_name'] = 'Course Page'; + +//Course Link form +$string['course_initialization'] = 'Linking to WeBWorK'; +$string['webwork_course'] = 'WeBWorK Course'; + +//Set Link form +$string['set_initialization'] = 'Linking to WeBWorK Problem Set'; +$string['wwassignmentname'] = 'Name'; +$string['webwork_set'] = 'WeBWorK Set'; +$string['instructor_page_link_desc'] = 'Link to the Instructor Section of WeBWorK'; +$string['instructor_page_link_name'] = 'Go To WeBWorK Instructor Tools'; + +$string['edit_set_link_desc'] = 'Link to Set Modification Section of WeBWorK'; +$string['edit_set_link_name'] = 'Modify Set'; + +//CONFIG +$string['webwork_url'] = "WeBWorK server URL:"; +$string['webwork_url_desc'] = "Enter the url of the webwork installation containing the webwork course: e.g. http://www.server.edu/webwork2"; +$string['rpc_wsdl'] = "URL for WeBWorK server WSDL file"; +$string['rpc_wsdl_desc'] = "Enter the url of the WSDL at the installation containing the webwork course: e.g. http://www.server.edu/webwork2_wsdl"; +$string['rpc_key'] = "Key identifying Moodle to WeBWorK."; +$string['rpc_key_desc'] = "Enter the key for obtaining access to the server. e.g. ABC321 "; + +$string['iframe_width'] = " iframe width as per cent:"; +$string['iframe_width_desc'] = "Enter the width of the frame containing the webwork pages.e.g. 95% ";//% is per cent sign--can't use it in string?? +$string['iframe_height'] = "iframe height in pixels"; +$string['iframe_height_desc'] = "Enter the height of the frame containing the webwork pages. e.g. 500px "; + +// +// +// $string['testchanges'] = "Test WeBWorK Connection."; +// + + + +// $string['webwork_url'] = "The URL location of webwork on the server. ex: http://www.example.org/webwork2"; +// $string['iframe_width'] = "The width in percentage of the page of the iframe displaying WeBWorK problem sets."; +// $string['iframe_height'] = "The height in pixels of the iframe displaying WeBWorK problem sets."; +// $string['rpc_wsdl'] = "Path to the WSDL file on the host running WeBWorK."; +// $string['rpc_key'] = "Key identifying Moodle to WeBWorK."; +// $string['testchanges'] = "Test WeBWorK Connection."; +//ERRORS +$string['construction_error'] = 'An error occured in establishing the connection to WeBWorK.<br>The most likely cause of this problem is that your WSDL path is incorrect.'; + +$string['event_creation_error'] = 'wwassignment event could not be created.'; +$string['webwork_course_list_map_failure'] = 'Could not retrieve a list of courses on the current WeBWorK server.'; + +$string['webwork_course_map_failure'] = 'No WeBWorK course is linked to this course.<br>Use the WWLink block to create a connection between this Moodle course and a WeBWorK course.'; + +$string['webwork_set_map_failure'] = 'No WeBWorK problem set is mapped to the current Moodle problem set.'; +$string['webwork_user_map_failure'] = 'No WeBWorK user is mapped to the current Moodle user.'; +$string['webwork_user_set_map_failure'] = 'The WeBWorK user does not have the current Moodle set assigned.'; +$string['rpc_error'] = 'Communication error between the Moodle client and WeBWorK server.'; + + + +?> \ No newline at end of file |