logicampus-cvs Mailing List for Logicampus (Page 5)
Brought to you by:
trilexcom
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(30) |
Sep
(77) |
Oct
(33) |
Nov
(29) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(36) |
Feb
(33) |
Mar
(5) |
Apr
(2) |
May
(7) |
Jun
(3) |
Jul
|
Aug
(2) |
Sep
(8) |
Oct
(1) |
Nov
(136) |
Dec
(30) |
2007 |
Jan
(64) |
Feb
(103) |
Mar
(29) |
Apr
(106) |
May
(185) |
Jun
(75) |
Jul
(3) |
Aug
(16) |
Sep
(154) |
Oct
(164) |
Nov
(26) |
Dec
|
2008 |
Jan
(15) |
Feb
(17) |
Mar
(32) |
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
(4) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
(21) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Mark K <har...@us...> - 2008-01-26 21:21:48
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17316 Modified Files: LC_user.php Log Message: Fix one more session bug. Index: LC_user.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/LC_user.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** LC_user.php 26 Jan 2008 02:24:19 -0000 1.35 --- LC_user.php 26 Jan 2008 21:21:45 -0000 1.36 *************** *** 411,415 **** if ($this->_sessionKey == "") { return false; } ! if ($this->username == "") { return false; /*print "no username"; exit();*/} //save userID to the session $this->commitSessionVars(); --- 411,415 ---- if ($this->_sessionKey == "") { return false; } ! if ($this->username == "") { $this->username == 'anonymous';} //save userID to the session $this->commitSessionVars(); *************** *** 440,443 **** --- 440,444 ---- $updateWorked = $db->getAffectedRows(); if ($updateWorked < 0) { + die('update did not work ' .$updateWorked); $e = ErrorStack::pullError('php'); |
From: Mark K <har...@us...> - 2008-01-26 04:17:22
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/classmgr In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3735 Modified Files: exportContent.lcp Log Message: Add some more info to the lessons export. Index: exportContent.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classmgr/exportContent.lcp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** exportContent.lcp 8 Oct 2007 14:21:07 -0000 1.20 --- exportContent.lcp 26 Jan 2008 04:17:19 -0000 1.21 *************** *** 608,611 **** --- 608,622 ---- //start building nodes $xml_child_nodes = array(); + + //name, description + $less_title_node = new xml_node('lesson:title',null,null,$lessonRec['title']); + $less_title_node->cdata = true; + $xml_child_nodes[] = $less_title_node; + + $less_desc_node = new xml_node('lesson:description',null,null,$lessonRec['description']); + $less_desc_node->cdata = true; + $xml_child_nodes[] = $less_desc_node; + + //learning path $less_seq_node = new xml_node('lesson:learningpath'); *************** *** 614,623 **** $lob_seq_node = new xml_node('lesson:lobsequence',array('order'=>$lob['rank'], 'visible'=>'yes')); $lob_ref_node = new xml_node('lesson:lob',array('refid'=>$lob['lob_guid'])); ! $lob_sta_node = new xml_node('lesson:start',array('type'=>'offset', format=>'unix'), null, $lob['start_offset']); ! $lob_end_node = new xml_node('lesson:end',array('type'=>'offset', format=>'unix'), null, $lob['start_offset']); $lob_seq_node->children[] = $lob_ref_node; $lob_seq_node->children[] = $lob_sta_node; $lob_seq_node->children[] = $lob_end_node; $less_seq_node->children[] = $lob_seq_node; --- 625,636 ---- $lob_seq_node = new xml_node('lesson:lobsequence',array('order'=>$lob['rank'], 'visible'=>'yes')); $lob_ref_node = new xml_node('lesson:lob',array('refid'=>$lob['lob_guid'])); ! $lob_sta_node = new xml_node('lesson:start',array('type'=>'offset', format=>'unix'), null, $lob['start_offset']+ $lob['start_time']); ! $lob_end_node = new xml_node('lesson:end',array('type'=>'offset', format=>'unix'), null, $lob['end_offset']+ $lob['end_time']); ! $lob_due_node = new xml_node('lesson:due',array('type'=>'offset', format=>'unix'), null, $lob['due_offset']+ $lob['due_time']); $lob_seq_node->children[] = $lob_ref_node; $lob_seq_node->children[] = $lob_sta_node; $lob_seq_node->children[] = $lob_end_node; + $lob_seq_node->children[] = $lob_due_node; $less_seq_node->children[] = $lob_seq_node; *************** *** 625,628 **** --- 638,642 ---- $xml_child_nodes[] = $less_seq_node; + $guid = lcUuid(); $lob_nodes[] = new xml_node('lesson:lesson', |
From: Mark K <har...@us...> - 2008-01-26 02:24:23
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23680 Modified Files: LC_user.php Log Message: Fixing some problems after removing the entire user from the session object. Index: LC_user.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/LC_user.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** LC_user.php 26 Jan 2008 02:09:13 -0000 1.34 --- LC_user.php 26 Jan 2008 02:24:19 -0000 1.35 *************** *** 114,117 **** --- 114,118 ---- $temp = lcUser::getUserByPkey($sessArr["_userId"]); $temp->sessionvars = $sessArr; + $temp->unwrapSessionVars(); $temp->_sessionKey = $sessID; $temp->_origChecksum = $origSession; *************** *** 122,125 **** --- 123,127 ---- $temp = lcUser::getUserByUsername($sessArr["_username"]); $temp->sessionvars = $sessArr; + $temp->unwrapSessionVars(); $temp->_sessionKey = $sessID; $temp->_origChecksum = $origSession; *************** *** 130,133 **** --- 132,136 ---- $temp = new lcUser(); $temp->sessionvars = $sessArr; + $temp->unwrapSessionVars(); $temp->_sessionKey = $sessID; $temp->_origChecksum = $origSession; *************** *** 381,387 **** --- 384,403 ---- function commitSessionVars() { $this->sessionvars['_userId'] = $this->userId; + $this->sessionvars['_activeClassTaught'] = $this->activeClassTaught; + $this->sessionvars['_activeClassTaken'] = $this->activeClassTaken; + $this->sessionvars['_classesTaken'] = $this->classesTaken; + $this->sessionvars['_classesTaught'] = $this->classesTaught; + } + + function unwrapSessionVars() { + $this->userId = $this->sessionvars['_userId']; + $this->activeClassTaught = $this->sessionvars['_activeClassTaught']; + $this->activeClassTaken = $this->sessionvars['_activeClassTaken']; + $this->classesTaken = $this->sessionvars['_classesTaken']; + $this->classesTaught = $this->sessionvars['_classesTaught']; } + /** * Saves current session (user->sessionvars) into lcSession table *************** *** 412,424 **** $val = serialize($sessBlob); } - /* - */ - $val = serialize($sessBlob); if ( crc32($val) == $this->_origChecksum) { return true; } $db = DB::getHandle(); $sessid = $this->_sessionKey; ! // $val=base64_encode($val); ! $val = addslashes($val); $s="UPDATE lcSessions SET username =\"".$this->username."\", sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; if ($this->username == "anonymous" ) { --- 428,436 ---- $val = serialize($sessBlob); } if ( crc32($val) == $this->_origChecksum) { return true; } $db = DB::getHandle(); $sessid = $this->_sessionKey; ! $val=base64_encode($val); $s="UPDATE lcSessions SET username =\"".$this->username."\", sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; if ($this->username == "anonymous" ) { *************** *** 464,468 **** } */ ! $this->sessionvars['_username'] = $this->username; if (function_exists("gzcompress")) { $val = base64_encode(gzcompress(serialize($this->sessionvars))); --- 476,480 ---- } */ ! $this->commitSessionVars(); if (function_exists("gzcompress")) { $val = base64_encode(gzcompress(serialize($this->sessionvars))); |
From: Mark K <har...@us...> - 2008-01-26 02:09:17
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16993 Modified Files: LC_mysql.php LC_user.php User.php pellet.php Log Message: cleaning up login and session functionality. removing cruft, reworking the idea of saving the user object each request. Index: pellet.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/pellet.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** pellet.php 3 Oct 2007 02:07:53 -0000 1.31 --- pellet.php 26 Jan 2008 02:09:13 -0000 1.32 *************** *** 486,491 **** $lcUser->activeClassTaught->id_classes != $lcObj->getvars['id_classes'] ) { - //__FIXME__ add constraint against classesTaught array; - foreach ( $lcUser->classesTaught as $k => $v) { if ($v->id_classes == $lcObj->getvars['id_classes']) { --- 486,489 ---- Index: LC_mysql.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/LC_mysql.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** LC_mysql.php 8 Oct 2007 14:49:08 -0000 1.21 --- LC_mysql.php 26 Jan 2008 02:09:13 -0000 1.22 *************** *** 290,296 **** /** ! * Return the number of rows affected by the last query * ! * @return int number of affected rows */ function getNumRows() { --- 290,296 ---- /** ! * Return the number of rows retruned by the last query * ! * @return int number of rows returned */ function getNumRows() { *************** *** 299,302 **** --- 299,310 ---- } + /** + * Return the number of rows affected by the last query + * + * @return int number of affected rows + */ + function getAffectedRows() { + return @mysql_affected_rows(); + } /** Index: LC_user.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/LC_user.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** LC_user.php 8 Oct 2007 14:35:28 -0000 1.33 --- LC_user.php 26 Jan 2008 02:09:13 -0000 1.34 *************** *** 74,77 **** --- 74,78 ---- } + /* if (rand(1,20) >= 20 ) { //gc cleanup, mysql specific with DATE_SUB *************** *** 80,87 **** --- 81,90 ---- $db->freeResult(); } + */ $db->query("select * from lcSessions where sesskey = '$sessID'",false); $j = $db->nextRecord(); $db->freeResult(); + if (!$j) { //trigger_error('second try to get session for: '.$sessID); *************** *** 92,127 **** if (function_exists("gzuncompress")) { ! $temp2 = unserialize(gzuncompress(base64_decode($db->record['sessdata']))); } else { ! $temp2 = unserialize(base64_decode($db->record['sessdata'])); } ! if (!$temp2) { ! $temp2 = unserialize(base64_decode($db->record['sessdata'])); } ! ! if ($temp2['_userobj']->username!='anonymous') { ! $tt = 'got valid user obj back with user name = '.$temp2['_userobj']->username; } if ($j) { - $sessArr = $temp2; - /* - $sessArr = unserialize(gzuncompress(base64_decode($db->record["sessdata"]))); - if (!$sessArr) { - $sessArr = unserialize((base64_decode($db->record["sessdata"]))); - } - */ $origSession = crc32($db->record['sessdata']); ! if ( is_object($sessArr['_userobj']) && $sessArr['_userobj']->userType > 0) { ! $temp = $sessArr['_userobj']; ! $temp = lcUser::getUserByUsername($sessArr['_userobj']->username); ! unset($sessArr['_userobj']); $temp->sessionvars = $sessArr; $temp->_sessionKey = $sessID; $temp->_origChecksum = $origSession; $temp->loggedIn = true; ! } else ! if ($sessArr["_username"] != "") { $temp = lcUser::getUserByUsername($sessArr["_username"]); $temp->sessionvars = $sessArr; --- 95,123 ---- if (function_exists("gzuncompress")) { ! $sessArr = unserialize(gzuncompress(base64_decode($db->record['sessdata']))); } else { ! $sessArr = unserialize(base64_decode($db->record['sessdata'])); } ! //maybe it wasn't gzipped ! if (!$sessArr) { ! $sessArr = unserialize(base64_decode($db->record['sessdata'])); } ! if (!$sessArr) { ! $sessArr = unserialize($db->record['sessdata']); } if ($j) { $origSession = crc32($db->record['sessdata']); ! //DEPRECATED ! if ($sessArr["_userId"] != "") { ! $temp = lcUser::getUserByPkey($sessArr["_userId"]); $temp->sessionvars = $sessArr; $temp->_sessionKey = $sessID; $temp->_origChecksum = $origSession; $temp->loggedIn = true; ! $temp->loadProfile(); ! } ! else if ($sessArr["_username"] != "") { $temp = lcUser::getUserByUsername($sessArr["_username"]); $temp->sessionvars = $sessArr; *************** *** 168,172 **** if ( !$db->nextRecord() ) { return new lcUser(); } $db->freeResult(); ! $temp = new lcUser(); $temp->username = $db->record['username']; $temp->password = $db->record['password']; --- 164,180 ---- if ( !$db->nextRecord() ) { return new lcUser(); } $db->freeResult(); ! switch($db->record['userType']) { ! case USERTYPE_FACULTY: ! $temp = new FacultyUser($db->record['username']); ! break; ! case USERTYPE_STUDENT: ! $temp = new StudentUser($db->record['username']); ! break; ! case USERTYPE_STANDARD: ! $temp = new StandardUser($db->record['username']); ! break; ! default: ! $temp = new lcUser(); ! } $temp->username = $db->record['username']; $temp->password = $db->record['password']; *************** *** 174,177 **** --- 182,186 ---- $temp->groups = array_merge($temp->groups,explode("|",$db->record['groups'])); $temp->userId = $db->record['pkey']; + $temp->loadProfile(); return $temp; } *************** *** 299,303 **** * Remove from proflie_course_family */ - function deleteUser() { --- 308,311 ---- *************** *** 371,374 **** --- 379,385 ---- } + function commitSessionVars() { + $this->sessionvars['_userId'] = $this->userId; + } *************** *** 385,391 **** if ($this->_sessionKey == "") { return false; } if ($this->username == "") { return false; /*print "no username"; exit();*/} ! //unhook session from user, reverse rolse $sessBlob = $this->sessionvars; ! unset($this->sessionvars); // combatting access denied issue // 8/5/03 mgk --- 396,404 ---- if ($this->_sessionKey == "") { return false; } if ($this->username == "") { return false; /*print "no username"; exit();*/} ! //save userID to the session ! $this->commitSessionVars(); ! $sessBlob = $this->sessionvars; ! // unset($this->sessionvars); // combatting access denied issue // 8/5/03 mgk *************** *** 394,398 **** //$this->newval = crc32($val); - $sessBlob['_userobj'] = $this; if (function_exists("gzcompress")) { $val = gzcompress(serialize($sessBlob)); --- 407,410 ---- *************** *** 400,415 **** $val = serialize($sessBlob); } ! if ( crc32($val) == $this->_origChecksum) { return; } $db = DB::getHandle(); $sessid = $this->_sessionKey; ! $val=base64_encode($val); $s="UPDATE lcSessions SET username =\"".$this->username."\", sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; if ($this->username == "anonymous" ) { ! $s="UPDATE lcSessions SET username =\"".$this->username."\", sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; } ! if (!$db->query($s)) { ! die('no update'); ! //no update record, try insert $s="INSERT into lcSessions (username,sessdata,sesskey) values ('".$this->username."','$val','$sessid')"; if ($this->username == "anonymous" ) { --- 412,436 ---- $val = serialize($sessBlob); } + /* + */ + $val = serialize($sessBlob); ! if ( crc32($val) == $this->_origChecksum) { return true; } $db = DB::getHandle(); $sessid = $this->_sessionKey; ! // $val=base64_encode($val); ! $val = addslashes($val); $s="UPDATE lcSessions SET username =\"".$this->username."\", sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; if ($this->username == "anonymous" ) { ! $s="UPDATE lcSessions SET sessdata = \"".$val."\" WHERE sesskey = '".$sessid."'"; } ! $queryWorked = $db->query($s); ! $updateWorked = $db->getAffectedRows(); ! if ($updateWorked < 0) { ! $e = ErrorStack::pullError('php'); ! ! $s="DELETE FROM lcSessions WHERE username = '".$this->username."'"; ! $queryWorked = $db->query($s); ! $e = ErrorStack::pullError('php'); $s="INSERT into lcSessions (username,sessdata,sesskey) values ('".$this->username."','$val','$sessid')"; if ($this->username == "anonymous" ) { *************** *** 418,424 **** $db->query($s); } //sess_close(DB::getHandle(),$this->uid,serialize($this->session)); ! $sessBlob['_userobj'] = ''; ! $this->sessionvars = $sessBlob; } --- 439,446 ---- $db->query($s); } + return true; //sess_close(DB::getHandle(),$this->uid,serialize($this->session)); ! // $sessBlob['_userobj'] = ''; ! // $this->sessionvars = $sessBlob; } *************** *** 435,438 **** --- 457,461 ---- if ($this->username == "" ){ $this->username = 'anonymous'; return false; } global $tail; + /* if (!$this->isAnonymous()) { $PHPSESSID=md5 (uniqid (rand())); *************** *** 440,443 **** --- 463,467 ---- $this->_sessionKey = $PHPSESSID; } + */ $this->sessionvars['_username'] = $this->username; if (function_exists("gzcompress")) { *************** *** 447,456 **** } $this->_origChecksum = crc32($val); - $sessid = $this->_sessionKey; ! $s="replace into lcSessions (username,sessdata,sesskey) values ('".$this->username."','$val','$sessid')"; ! $db = DB::getHandle(); ! $db->query($s,false); return true; } --- 471,480 ---- } + /* + */ + $val = serialize($this->sessionvars); $this->_origChecksum = crc32($val); ! $this->saveSession(); return true; } *************** *** 478,481 **** --- 502,506 ---- function endSession($db) { $this->sessionvars["_username"] = ""; + $this->sessionvars["_userId"] = ""; setCookie("PHPSESSID","",0); } *************** *** 520,531 **** $this->password = $db->record['password']; $this->username = $db->record['username']; ! //__FIXME__ what is this fields for?? ! //$this->fields = $db->record; ! $this->sessionvars['_username'] = $username; $this->groups = array_merge($this->groups,explode("|",substr($db->record['groups'],1,-1))); $this->userId = $db->record['pkey']; ! // $this->userType = $db->record['userType']; return true; } else { $this->groups[] = 'public'; return false; --- 545,556 ---- $this->password = $db->record['password']; $this->username = $db->record['username']; ! $this->sessionvars['_userId'] = $db->record['pkey']; $this->groups = array_merge($this->groups,explode("|",substr($db->record['groups'],1,-1))); $this->userId = $db->record['pkey']; ! $this->loadProfile(); return true; } else { + $this->password = ''; + $this->username = 'anonymous'; $this->groups[] = 'public'; return false; Index: User.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/User.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** User.php 8 Oct 2007 14:35:29 -0000 1.8 --- User.php 26 Jan 2008 02:09:13 -0000 1.9 *************** *** 84,93 **** var $classesTaken = array(); var $classesTaught = array(); ! var $activeClassTaught = 0; var $profileTable = 'profile_faculty'; ! # Constructor ! # Grabs all classes the faculty member teaches? Maybe? ! #only gets called on login function FacultyUser ($userid) { --- 84,95 ---- var $classesTaken = array(); var $classesTaught = array(); ! var $activeClassTaught = null; var $profileTable = 'profile_faculty'; ! /** ! * FacultyUser Constructor ! * Grabs all classes the faculty member teaches ! * only gets called on login ! */ function FacultyUser ($userid) { *************** *** 144,147 **** --- 146,150 ---- if ($v->id_classes == $classID) return true; } + reset($lcUser->classesTaught); return false; } |
From: Mark K <har...@us...> - 2008-01-26 02:07:43
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/unitTest In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16162 Added Files: loginTest.php Log Message: Test logins and sessions. --- NEW FILE: loginTest.php --- <? class LoginTest extends UnitTestCase { var $tests = array ( 'Login Faculty'=> array ('name'=>'facultyLogin','expected'=>1) ); var $description = "Test logins and session"; /** */ function testLoginFaculty() { $u = lcUser::getUserBySesskey('aabb'); $this->assertTrue( is_object($u) ); $db = DB::getHandle(); $u->username = 'admin'; $u->password = 'teacher2'; $loggedIn = $u->validateLogin($db); $this->assertFalse( $loggedIn ); $u->username = 'admin'; $u->password = 'admin'; $loggedIn = $u->validateLogin($db); $this->assertTrue( $loggedIn ); $sess = $u->bindSession(); $save = $u->saveSession(); $this->assertTrue($sess); $this->assertTrue($save); $this->assertEqual( 'aabb', $u->_sessionKey ); /** var_dump($sess); var_dump($u->sessionvars); var_dump($u); */ } /** */ function testAnonSession() { $u = new lcUser(); $this->assertTrue( is_object($u) ); $db = DB::getHandle(); $u->username = 'admin'; $u->password = 'teacher2'; $loggedIn = $u->validateLogin($db); $this->assertFalse( $loggedIn ); $sess = $u->bindSession(); $save = $u->saveSession(); $this->assertFalse($sess); $this->assertFalse($save); $this->assertEqual( '', $u->_sessionKey ); $u->_sessionKey = '12345'; $sess = $u->bindSession(); $save = $u->saveSession(); $this->assertFalse($sess); $this->assertTrue($save); $this->assertEqual( '12345', $u->_sessionKey ); } } ?> |
From: Mark K <har...@us...> - 2008-01-25 22:44:08
|
Update of /cvsroot/logicampus/logicampus/src/logicreate In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv641 Added Files: .htaccess Log Message: Adding an htaccess file to stop browsing. --- NEW FILE: .htaccess --- Order deny,allow Deny from all |
From: Mark K <har...@us...> - 2008-01-05 19:56:02
|
Update of /cvsroot/logicampus/logicampus/docs In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22354/docs Modified Files: INSTALL Log Message: Fix messages about md5 command line and php5 Index: INSTALL =================================================================== RCS file: /cvsroot/logicampus/logicampus/docs/INSTALL,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** INSTALL 10 Apr 2007 19:39:49 -0000 1.3 --- INSTALL 5 Jan 2008 19:55:57 -0000 1.4 *************** *** 15,19 **** Internet, Inc. in conjunction with Tarant County College Center for Distance Learning. LogiCampus provides various tools for educators to manage online ! courses or classroom courses. Please visit http://www.logicampus.com for more information about the specific features of LogiCampus. LogiCampus is built on top of the php-based application server called LogiCreate --- 15,19 ---- Internet, Inc. in conjunction with Tarant County College Center for Distance Learning. LogiCampus provides various tools for educators to manage online ! courses or classroom courses. Please visit http://logicampus.sf.net/ for more information about the specific features of LogiCampus. LogiCampus is built on top of the php-based application server called LogiCreate *************** *** 27,35 **** * Apache web server 1.3 or higher (see http://www.logicreate.com if you are using Apache 2.0) ! * PHP 4.3.1 or higher (PHP 5 not tested) * MySQL Database 3.23 or higher, 4.0 preferred * Server - Linux is recommended to use setup scripts * PHP must be compiled with the following extensions - gd 2.0 ! * Tidy (tidy.sourceforge.net) - needed for importing of content ******************************************** --- 27,35 ---- * Apache web server 1.3 or higher (see http://www.logicreate.com if you are using Apache 2.0) ! * PHP 4.3.1 or higher (PHP 5 tested but not required) * MySQL Database 3.23 or higher, 4.0 preferred * Server - Linux is recommended to use setup scripts * PHP must be compiled with the following extensions - gd 2.0 ! * Tidy (tidy.sourceforge.net) - optional, but helps with importing of content ******************************************** *************** *** 159,163 **** at a Unix command line: ! echo 'HHH' | md5sum The output should paste nicely into the auth.php file. An md5 sum cannot be --- 159,163 ---- at a Unix command line: ! echo -n 'HHH' | md5sum The output should paste nicely into the auth.php file. An md5 sum cannot be *************** *** 171,177 **** define(PASSWD_IS_MD5,1); - Note: On some systems, the command line tool md5sum and php's md5() function - are incompatible, in such instances writing a small php script to echo the md5 - instead of using the command line should work. - - --- 171,172 ---- |
From: Mark K <har...@us...> - 2008-01-05 19:55:07
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/content In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21958/src/logicreate/content Modified Files: __messageoftheday__ Log Message: Don't use a default MOTD. Index: __messageoftheday__ =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/content/__messageoftheday__,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** __messageoftheday__ 15 Nov 2006 23:52:59 -0000 1.3 --- __messageoftheday__ 5 Jan 2008 19:55:03 -0000 1.4 *************** *** 1,2 **** - Look for important messages from your system administrators throughout - the semester in the message of the day box. --- 0 ---- |
From: Mark K <har...@us...> - 2008-01-05 19:53:32
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/classroom In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21519/src/logicreate/services/classroom Modified Files: content.lcp lessons.lcp Log Message: Added comments. Index: content.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classroom/content.lcp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** content.lcp 8 Oct 2007 14:11:46 -0000 1.14 --- content.lcp 5 Jan 2008 19:53:28 -0000 1.15 *************** *** 42,45 **** --- 42,46 ---- $classId=-1; $lesson_id=-1; + $lesson_id = $u->sessionvars['activeLesson']['id_class_lessons']; foreach ($u->classesTaken as $classObj) { Index: lessons.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classroom/lessons.lcp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** lessons.lcp 8 Oct 2007 14:22:27 -0000 1.23 --- lessons.lcp 5 Jan 2008 19:53:28 -0000 1.24 *************** *** 225,234 **** $t['checkListArray'] = explode("\n",trim($t['lesson']['checkList'])); - - //DEPRECATED, we don't need to store it in the session anymore - // because this info is only on one page, not all pages - // of the lesson - // Create the sidebar and stash it in the session $u->sessionvars['activeLesson'] = $t['lesson']; --- 225,230 ---- $t['checkListArray'] = explode("\n",trim($t['lesson']['checkList'])); // Create the sidebar and stash it in the session + // we need the lesson stored in the sesison for more security checks later $u->sessionvars['activeLesson'] = $t['lesson']; |
From: Mark K <har...@us...> - 2008-01-05 17:54:36
|
Update of /cvsroot/logicampus/logicampus/src/public_html/install In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3958 Modified Files: install_proc.php Log Message: Don't forget the build date and version information when installing. Index: install_proc.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/public_html/install/install_proc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** install_proc.php 4 Oct 2007 02:12:11 -0000 1.4 --- install_proc.php 5 Jan 2008 17:54:27 -0000 1.5 *************** *** 23,26 **** --- 23,30 ---- $defines = str_replace( '@db.password@', $_POST['db_pass'], $defines); $defines = str_replace( '@db.database@', $_POST['db_name'], $defines); + $defines = str_replace( '@version.number@', LOGICAMPUS_VERSION, $defines); + $defines = str_replace( '@version.extra@', LOGICAMPUS_VERSION_STATUS, $defines); + $defines = str_replace( '@build.date@', LOGICAMPUS_BUILD_DATE, $defines); + $f = fopen('../defines.php','w'); if (!$f) { |
From: Mark K <har...@us...> - 2007-11-10 21:10:41
|
Update of /cvsroot/logicampus/logicampus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25932 Modified Files: Tag: BR_CAMPUS_20X build.xml build.properties Log Message: Version bump. Index: build.xml =================================================================== RCS file: /cvsroot/logicampus/logicampus/build.xml,v retrieving revision 1.38.4.1 retrieving revision 1.38.4.2 diff -C2 -d -r1.38.4.1 -r1.38.4.2 *** build.xml 3 Oct 2007 19:23:30 -0000 1.38.4.1 --- build.xml 10 Nov 2007 21:10:21 -0000 1.38.4.2 *************** *** 160,163 **** --- 160,164 ---- <!-- + --> <zip destfile="${dist}/logicampus-${lc.version}.zip"> <tarfileset refid="srcdir"/> *************** *** 172,176 **** </zip> <echo message="Zip saved as 'dist/${lc.version}.zip'!" /> - --> <delete dir="filtertmp"/> <!-- --- 173,176 ---- Index: build.properties =================================================================== RCS file: /cvsroot/logicampus/logicampus/build.properties,v retrieving revision 1.16.2.2.2.1 retrieving revision 1.16.2.2.2.2 diff -C2 -d -r1.16.2.2.2.1 -r1.16.2.2.2.2 *** build.properties 3 Oct 2007 19:23:30 -0000 1.16.2.2.2.1 --- build.properties 10 Nov 2007 21:10:21 -0000 1.16.2.2.2.2 *************** *** 1,3 **** ! version.number=2.0.3 version.extra= db.host=localhost --- 1,3 ---- ! version.number=2.0.4 version.extra= db.host=localhost |
From: Mark K <har...@us...> - 2007-11-10 21:09:11
|
Update of /cvsroot/logicampus/logicampus/docs In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25097/docs Modified Files: Tag: BR_CAMPUS_20X INSTALL Log Message: Update some install instructions to reflect PHP5 and new installer. Index: INSTALL =================================================================== RCS file: /cvsroot/logicampus/logicampus/docs/INSTALL,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** INSTALL 10 Apr 2007 19:39:49 -0000 1.3 --- INSTALL 10 Nov 2007 21:09:06 -0000 1.3.4.1 *************** *** 15,19 **** Internet, Inc. in conjunction with Tarant County College Center for Distance Learning. LogiCampus provides various tools for educators to manage online ! courses or classroom courses. Please visit http://www.logicampus.com for more information about the specific features of LogiCampus. LogiCampus is built on top of the php-based application server called LogiCreate --- 15,19 ---- Internet, Inc. in conjunction with Tarant County College Center for Distance Learning. LogiCampus provides various tools for educators to manage online ! courses or classroom courses. Please visit http://logicampus.sf.net/ for more information about the specific features of LogiCampus. LogiCampus is built on top of the php-based application server called LogiCreate *************** *** 27,35 **** * Apache web server 1.3 or higher (see http://www.logicreate.com if you are using Apache 2.0) ! * PHP 4.3.1 or higher (PHP 5 not tested) * MySQL Database 3.23 or higher, 4.0 preferred * Server - Linux is recommended to use setup scripts * PHP must be compiled with the following extensions - gd 2.0 ! * Tidy (tidy.sourceforge.net) - needed for importing of content ******************************************** --- 27,35 ---- * Apache web server 1.3 or higher (see http://www.logicreate.com if you are using Apache 2.0) ! * PHP 4.3.1 or higher (PHP 5 tested but not required) * MySQL Database 3.23 or higher, 4.0 preferred * Server - Linux is recommended to use setup scripts * PHP must be compiled with the following extensions - gd 2.0 ! * Tidy (tidy.sourceforge.net) - optional, but helps with importing of content ******************************************** *************** *** 159,163 **** at a Unix command line: ! echo 'HHH' | md5sum The output should paste nicely into the auth.php file. An md5 sum cannot be --- 159,163 ---- at a Unix command line: ! echo -n 'HHH' | md5sum The output should paste nicely into the auth.php file. An md5 sum cannot be *************** *** 171,177 **** define(PASSWD_IS_MD5,1); - Note: On some systems, the command line tool md5sum and php's md5() function - are incompatible, in such instances writing a small php script to echo the md5 - instead of using the command line should work. - - --- 171,172 ---- |
From: Mark K <har...@us...> - 2007-11-08 17:09:46
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6333/services/test Modified Files: Tag: BR_CAMPUS_20X question.lcp take.lcp Log Message: Backport fix to assessment libraries to correctly decompress member variables. Index: question.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/test/question.lcp,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** question.lcp 20 Sep 2004 05:29:11 -0000 1.4 --- question.lcp 8 Nov 2007 17:09:41 -0000 1.4.4.1 *************** *** 68,72 **** // assume we want to display something, because no event was passed in ! $this->displayRun($db,&$u,&$lc,&$t); } --- 68,72 ---- // assume we want to display something, because no event was passed in ! $this->displayRun($db,$u,$lc,$t); } *************** *** 291,295 **** if ($qstId) { $lc->postvars['questionID'] = $qstId; ! $this->displayRun($db,&$u,&$lc,&$t); return; # $qst = AssessmentQuestion::load($qstId, $u->activeClassTaken->id_classes); --- 291,295 ---- if ($qstId) { $lc->postvars['questionID'] = $qstId; ! $this->displayRun($db,$u,$lc,$t); return; # $qst = AssessmentQuestion::load($qstId, $u->activeClassTaken->id_classes); Index: take.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/test/take.lcp,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -C2 -d -r1.8 -r1.8.4.1 *** take.lcp 14 Sep 2005 18:19:25 -0000 1.8 --- take.lcp 8 Nov 2007 17:09:41 -0000 1.8.4.1 *************** *** 290,294 **** function stopRun($db, &$u, &$lc, &$t) { $log = $u->sessionvars['testObj']->log; - debug($log); if (!$log) { # there was a serious problem --- 290,293 ---- |
From: Mark K <har...@us...> - 2007-11-08 17:09:46
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6333/lib Modified Files: Tag: BR_CAMPUS_20X Assessment.php AssessmentQuestion.php Log Message: Backport fix to assessment libraries to correctly decompress member variables. Index: AssessmentQuestion.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/AssessmentQuestion.php,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** AssessmentQuestion.php 8 Feb 2007 19:23:24 -0000 1.4 --- AssessmentQuestion.php 8 Nov 2007 17:09:41 -0000 1.4.4.1 *************** *** 401,408 **** $subObj->fileHash = $superObj->fileHash; ! // Adam added this here.. it seemed necessary ! //$subObj->questionChoices = unserialize(base64_decode($subObj->questionChoices)); ! // Commented out by Keith since this needs to be in row2Obj above ! return $subObj; } --- 401,406 ---- $subObj->fileHash = $superObj->fileHash; ! $subObj->questionChoices = unserialize(base64_decode($subObj->questionChoices)); ! $subObj->questionInput = unserialize(base64_decode($subObj->questionInput)); return $subObj; } Index: Assessment.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/Assessment.php,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -C2 -d -r1.7 -r1.7.4.1 *** Assessment.php 8 Feb 2007 19:23:24 -0000 1.7 --- Assessment.php 8 Nov 2007 17:09:41 -0000 1.7.4.1 *************** *** 409,412 **** --- 409,415 ---- $subObj->fileHash = $superObj->fileHash; + $subObj->questionChoices = unserialize(base64_decode($subObj->questionChoices)); + $subObj->questionInput = unserialize(base64_decode($subObj->questionInput)); + $subObjArray[] =$subObj; } |
From: Mark K <har...@us...> - 2007-11-08 17:09:45
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/assessments In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6333/services/assessments Modified Files: Tag: BR_CAMPUS_20X main.lcp Log Message: Backport fix to assessment libraries to correctly decompress member variables. Index: main.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/assessments/main.lcp,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -C2 -d -r1.7 -r1.7.4.1 *** main.lcp 18 Nov 2006 00:09:34 -0000 1.7 --- main.lcp 8 Nov 2007 17:09:41 -0000 1.7.4.1 *************** *** 134,138 **** $f = new SiteForm(); ! $t['error'] = $f->validateForm('addassessment', &$lc->postvars); if ($t['error']) { --- 134,138 ---- $f = new SiteForm(); ! $t['error'] = $f->validateForm('addassessment', $lc->postvars); if ($t['error']) { |
From: Mark K <har...@us...> - 2007-11-08 17:08:13
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5865/lib Modified Files: Assessment.php AssessmentQuestion.php Log Message: Fix assessment decompress questions and answers. Remove debugging notice when completing a test. Index: AssessmentQuestion.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/AssessmentQuestion.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AssessmentQuestion.php 8 Oct 2007 14:35:27 -0000 1.5 --- AssessmentQuestion.php 8 Nov 2007 17:08:04 -0000 1.6 *************** *** 401,408 **** $subObj->fileHash = $superObj->fileHash; ! // Adam added this here.. it seemed necessary ! //$subObj->questionChoices = unserialize(base64_decode($subObj->questionChoices)); ! // Commented out by Keith since this needs to be in row2Obj above ! return $subObj; } --- 401,406 ---- $subObj->fileHash = $superObj->fileHash; ! $subObj->questionChoices = unserialize(base64_decode($subObj->questionChoices)); ! $subObj->questionInput = unserialize(base64_decode($subObj->questionInput)); return $subObj; } Index: Assessment.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/Assessment.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Assessment.php 8 Oct 2007 14:35:27 -0000 1.8 --- Assessment.php 8 Nov 2007 17:08:04 -0000 1.9 *************** *** 409,412 **** --- 409,415 ---- $subObj->fileHash = $superObj->fileHash; + $subObj->questionChoices = unserialize(base64_decode($subObj->questionChoices)); + $subObj->questionInput = unserialize(base64_decode($subObj->questionInput)); + $subObjArray[] =$subObj; } |
From: Mark K <har...@us...> - 2007-11-08 17:08:13
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5865/services/test Modified Files: question.lcp take.lcp Log Message: Fix assessment decompress questions and answers. Remove debugging notice when completing a test. Index: question.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/test/question.lcp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** question.lcp 20 Sep 2004 05:29:11 -0000 1.4 --- question.lcp 8 Nov 2007 17:08:04 -0000 1.5 *************** *** 54,58 **** ! /* * Main function which handles test taking for students. Students are brought to here from * test/take/event=start/id=$assessmentId --- 54,58 ---- ! /** * Main function which handles test taking for students. Students are brought to here from * test/take/event=start/id=$assessmentId *************** *** 65,72 **** */ ! function Run(&$db,&$u,&$lc,&$t) { // assume we want to display something, because no event was passed in ! $this->displayRun($db,&$u,&$lc,&$t); } --- 65,72 ---- */ ! function run(&$db,&$u,&$lc,&$t) { // assume we want to display something, because no event was passed in ! $this->displayRun($db,$u,$lc,$t); } *************** *** 104,108 **** if (is_object($test)) { $log = $test->getLastLogEntry($u->username); - #$debug($log); exit(); $log->endDate = time(); $log->save(); --- 104,107 ---- *************** *** 291,295 **** if ($qstId) { $lc->postvars['questionID'] = $qstId; ! $this->displayRun($db,&$u,&$lc,&$t); return; # $qst = AssessmentQuestion::load($qstId, $u->activeClassTaken->id_classes); --- 290,294 ---- if ($qstId) { $lc->postvars['questionID'] = $qstId; ! $this->displayRun($db,$u,$lc,$t); return; # $qst = AssessmentQuestion::load($qstId, $u->activeClassTaken->id_classes); Index: take.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/test/take.lcp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** take.lcp 14 Sep 2005 18:19:25 -0000 1.8 --- take.lcp 8 Nov 2007 17:08:04 -0000 1.9 *************** *** 67,71 **** * */ ! function Run(&$db,&$u,&$lc,&$t) { include_once(LIB_PATH.'ClassGradebookEntries.php'); include_once(LIB_PATH.'ClassGradebookVal.php'); --- 67,71 ---- * */ ! function run(&$db,&$u,&$lc,&$t) { include_once(LIB_PATH.'ClassGradebookEntries.php'); include_once(LIB_PATH.'ClassGradebookVal.php'); *************** *** 290,294 **** function stopRun($db, &$u, &$lc, &$t) { $log = $u->sessionvars['testObj']->log; - debug($log); if (!$log) { # there was a serious problem --- 290,293 ---- |
From: Mark K <har...@us...> - 2007-11-02 22:36:19
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/classmgr/templates In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27695/templates Modified Files: teacherclass_newClass.html Log Message: Fix IE broken CSS. Index: teacherclass_newClass.html =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classmgr/templates/teacherclass_newClass.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** teacherclass_newClass.html 8 Apr 2007 02:04:52 -0000 1.2 --- teacherclass_newClass.html 2 Nov 2007 22:36:16 -0000 1.3 *************** *** 6,10 **** ?> ! <table width="95%" border="0" cellspacing="3" cellpadding="4"> <form method="POST" enctype="application/x-www-form-urlencoded" action="<?=appurl('classmgr/teacherclass/event=saveClass');?>"> <tr><th colspan="2" valign="top" class="">Complete the following fields to add a course to the site.</th></tr> --- 6,10 ---- ?> ! <table width="95%" border="0" cellspacing="3" cellpadding="4" class="ie_drop_fix"> <form method="POST" enctype="application/x-www-form-urlencoded" action="<?=appurl('classmgr/teacherclass/event=saveClass');?>"> <tr><th colspan="2" valign="top" class="">Complete the following fields to add a course to the site.</th></tr> |
From: Mark K <har...@us...> - 2007-11-02 22:25:30
|
Update of /cvsroot/logicampus/logicampus/src/pbdo In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23591/src/pbdo Modified Files: logicampus_pbdo.xml Log Message: Small schema changes to support tests and activities at the bare minimum. Index: logicampus_pbdo.xml =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/pbdo/logicampus_pbdo.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** logicampus_pbdo.xml 2 Oct 2007 17:06:36 -0000 1.25 --- logicampus_pbdo.xml 2 Nov 2007 22:25:26 -0000 1.26 *************** *** 280,291 **** --- 280,306 ---- size="11" type="int"/> + <attribute name="start_time" + required="false" + size="5" + extra="unsigned" + type="mediumint"/> <attribute name="end_offset" required="false" size="11" type="int"/> + <attribute name="end_time" + required="false" + size="5" + extra="unsigned" + type="mediumint"/> <attribute name="due_offset" required="false" size="11" type="int"/> + <attribute name="due_time" + required="false" + size="5" + extra="unsigned" + type="mediumint"/> <attribute name="grace_period_days" required="false" |
From: Mark K <har...@us...> - 2007-11-02 22:25:30
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23591/src/logicreate/lib Added Files: lc_lob_class_test.php Log Message: Small schema changes to support tests and activities at the bare minimum. --- NEW FILE: lc_lob_class_test.php --- <?php include_once(LIB_PATH.'PBDO/LobTest.php'); include_once(LIB_PATH.'PBDO/LobTestQst.php'); /** * Hold lob repo entries and lob test entries */ class Lc_Lob_ClassTest extends Lc_Lob_Class { var $type = 'test'; var $questionObjs = array(); var $mime = 'X-LMS/test'; function Lc_Lob_ClassTest($id = 0) { if ($id < 1) { $this->repoObj = new LobClassRepo(); $this->lobSub = new LobClassTest(); $this->lobMetaObj = new LobClassMetadata(); $this->lobMetaObj->createdOn = time(); } else { $this->repoObj = LobClassRepo::load($id); $tests = $this->repoObj->getLobClassTestsByLobClassRepoId(); $this->lobSub = $tests[0]; } } function addQuestion($qtext, $type = 'QUESTION_ESSAY', $choices = '', $answers = '') { $q = new LobTestQst(); $q->qstText = $qtext; if ( is_array($choices) ) { } $this->questionObjs[] = $q; } function getQuestionCount() { return count($this->questionObjs); } /** * Copy all the values of a specific sub Object to this lobSub */ function copySub(&$repoSub) { /* $this->lobSub->lobText = $repoSub->lobText; $this->lobSub->lobBinary = $repoSub->lobBinary; $this->lobSub->lobFilename = $repoSub->lobFilename; $this->lobSub->lobCaption = $repoSub->lobCaption; */ } /** * Skip the meta object for now */ function save() { if ($this->repoObj->lobGuid == '') { $guid = lcUuid(); $this->repoObj->set('lobGuid',$guid); } $this->repoObj->version++; $this->repoObj->save(); $ret = ($this->repoObj->getPrimaryKey() > 0); $this->lobSub->lobClassRepoId = $this->repoObj->getPrimaryKey(); $this->lobSub->save(); $this->lobMetaObj->updatedOn = time(); if ($this->lobMetaObj->isNew()) { //might be a brand new object $this->lobMetaObj->lobId = $this->repoObj->getPrimaryKey(); } return $this->lobMetaObj->save() && $ret; } //////////////// DEPRECATED //////////////// # Gradebook entry id # used for redirects back to the gradebook when modifying a user's score var $idClassGradebookEntries= ''; function load($id,$class_id) { if ( $class_id == '' ) { trigger_error('load with empty class id'); return false; } $array = AssessmentPeer::doSelect("class_id = $class_id and assessment_id = $id"); if (!is_array($array) ) { trigger_error('No permission to load assessment '.$id); return false; } return $array[0]; } function loadAll($class_id) { if ( $class_id == '' ) { trigger_error('Peer doSelect with empty key'); return false; } $array = AssessmentPeer::doSelect("class_id = $class_id"); return $array; } # boolean returns true if student can take the # test, false if they cannot # pass in the time stamp of when the user started taking the test # ($u->sessionvars['asmt_start_date'] for example function canTake($start) { $end = $this->dateUnavailable; $timeLimitSeconds = $this->minuteLimit * 60; $newEndingTime = $start + $timeLimitSeconds; $time = time(); /* echo '<br>'.$time. '= current time<br>'; echo $newEndingTime. '= ending time<br>'; */ if ( ($time > $newEndingTime) || ($time > $end) ) { return FALSE; } return TRUE; } function getAssessmentQuestions() { $array = AssessmentQuestionPeer::doSelect('assessment_id = \''.$this->getPrimaryKey().'\' order by question_sort'); $cc = count ($array); for($x=0; $x<$cc; ++$x) { $superObj = $array[$x]; switch($superObj->questionType) { case QUESTION_TRUEFALSE: $subObj = new AssessmentQuestionTrueFalse(); break; case QUESTION_MCHOICE: $subObj = new AssessmentQuestionMChoice(); break; case QUESTION_MANSWER: $subObj = new AssessmentQuestionMAnswer(); break; case QUESTION_MATCHING: $subObj = new AssessmentQuestionMatching(); break; case QUESTION_FILLINBLANK: $subObj = new AssessmentQuestionFill(); break; case QUESTION_ESSAY: $subObj = new AssessmentQuestionEssay(); break; default: trigger_error("Cannot find appropriate class for question. Question type was ".$superObj->questionType); } if( $superObj->assessmentQuestionId ) $subObj->_new = false; else $subObj->_new = true; $subObj->_modified = false; $subObj->assessmentQuestionId = $superObj->assessmentQuestionId; $subObj->assessmentId = $superObj->assessmentId; $subObj->questionType = $superObj->questionType; $subObj->questionSort = $superObj->questionSort; $subObj->questionDisplay = $superObj->questionDisplay; $subObj->questionText = $superObj->questionText; $subObj->questionPoints = $superObj->questionPoints; $subObj->questionChoices = $superObj->questionChoices; $subObj->fileHash = $superObj->fileHash; $subObjArray[] =$subObj; } return $subObjArray; } # $questions = array of question objects with answer object added on # $answers = array 0f answer objects # $u = user object # $grade = on / off to re-grade the assessment # If you want it to re-grade the assessment for you before sending out # the email, this does update the students grades for points_earned in the database function emailTeacher($questions, $stuUserObj, $logObj, $grade=0) { $u = $stuUserObj; $qstans .= "Student ID: ".$stuUserObj->username."\n"; $qstans .= "Name: ".$stuUserObj->profile->values['firstname']." ".$stuUserObj->profile->values['lastname']."\n"; $qstans .= "Assessment: Name ".$this->displayName."\n"; $qstans .= "Date Started: ".date('m-d-y h:i A', $u->sessionvars['asmt_date_start'])."\n"; $qstans .= "Date Stopped: ".date('m-d-y h:i A', $logObj->end_date)."\n\n"; $questionCount = count($questions); for ($i=0; $i<$questionCount; $i++) { $num = $i +1; $questionId = $questions[$i]->assessmentQuestionId; $qstans .= $num.".\n"; $qstans .= "Type of Question: ".$questions[$i]->questionDisplay."\nQuestion: ".$questions[$i]->questionText."\n"; $qstans .= "Points Assigned: ".$questions[$i]->answer->pointsEarned."\n"; if ($questions[$i]->questionType == QUESTION_MATCHING || $questions[$i]->questionType == QUESTION_MANSWER) { $answer = unserialize($questions[$i]->answer->assessmentAnswerValues); $qstans .= "Answers: \n"; for ($y=0;$y<$answerCount; $y++) { $ansnum = $y + 1; + //$qstans .= "\t $ansnum. ".$answer[$y]."\n"; + //trying out a fix for a bug where the teacher just + //gets the index of the correct answer + //MAK 11-03-04 + $qstans .= "\t $ansnum. ".$questions[$i]->questionChoices[$y]->label ." " .$answer[$y]."\n"; } } else { $qstans .= "Answer: ".$questions[$i]->answer->assessmentAnswerValues."\n\n"; } $total_points_earned += $questions[$i]->answer->pointsEarned; $total_possible_points += $questions[$i]->questionPoints; } $qstans .= "\n\nTotal Points Earned: ". $total_points_earned ." out of ". $total_possible_points; # Send email to teacher $db = DB::getHandle(); $sql = "select email from lcUsers where username='".$u->activeClassTaken->facultyId."'"; $db->queryOne($sql); $email = $db->record['email']; $subject = $this->displayName." completed by ".$u->profile->values['firstname']." ".$u->profile->values['lastname']; if ( mail($email, $subject, $qstans) ) { return TRUE; } return FALSE; } # Pulls in the last log entry for an assessment function getLastLogEntry($username) { include_once(LIB_PATH.'AssessmentLog.php'); $log = AssessmentLogPeer::doSelect("assessment_id='".$this->assessmentId."' AND id_student='".$username."' ORDER BY start_date DESC LIMIT 1"); return $log[0]; } # Loads answers onto questions object # And unserializes the matching and multiple answer questions for you automatcially function getQuestionsAndAnswers($studentId, $id_classes) { $questions = $this->getAssessmentQuestions(); $answers = AssessmentAnswerPeer::doSelect("assessment_id='".$this->assessmentId."' AND student_id='".$studentId."' AND id_classes='".$id_classes."'"); #debug($answers,1); $this->questionCount = count($questions); $answerCount = count($answers); for ($i=0; $i<$this->questionCount; $i++) { $num = $i +1; $questionId = $questions[$i]->assessmentQuestionId; for($x=0; $x<$answerCount; $x++) { if ($answers[$x]->assessmentQuestionId == $questionId) { #$questions[$i]->grade($answers[$x]); $questions[$i]->answer = $answers[$x]; # debug($questions[$i],1); if ($questions[$i]->questionType == QUESTION_MATCHING || $questions[$i]->questionType == QUESTION_MANSWER) { $questions[$i]->answer->assessmentAnswerValues = unserialize($questions[$i]->answer->assessmentAnswerValues); } else { $qstans .= "Answer: ".$questions[$i]->answer->assessmentAnswerValues."\n\n"; } } $this->pointsEarned += $questions[$i]->answer->pointsEarned; } $this->totalPoints += $questions[$i]->questionPoints; } return $questions; } # Loads the answers for a student for a given class and # update the gradebook score # Normally called in assessements/grade/event=updatePoints # MAK added 9/4/03 # always update gradebook scores in entries table to fix previous problem function updateGradebookScore($studentId, $id_classes) { $answer = AssessmentAnswerPeer::doSelect("student_id='$studentId' AND id_classes='$id_classes' AND assessment_id='".$this->assessmentId."'"); $count = count($answer); for ($i=0; $i<$count; $i++) { if ($answer[$i]->pointsGiven) { $totalPoints += $answer[$i]->pointsGiven; } else { $totalPoints += $answer[$i]->pointsEarned; } } $entry = $this->loadGradebookEntry($studentId); if (is_object($entry) ) { $entryId = $entry->getPrimaryKey(); $val = $this->loadGradebookVal($entryId, $studentId); if (is_object($val) ) { $val->score = $totalPoints; $val->save(); return $totalPoints; } else { # create val entry $val = new ClassGradebookVal(); $val->idClasses = $id_classes; $val->username = $studentId; $val->score = $totalPoints; $val->dateCreated = date('Y-m-d H:i:s'); $val->idClassGradebookEntries = $entryId; //__FIXME__ make comments field accept nulls // class_gradebook_val $val->save(); return $totalPoints; } } return $totalPoints; } function loadGradebookEntry($studentId) { include_once(LIB_PATH.'ClassGradebookEntries.php'); $entry = ClassGradebookEntriesPeer::doSelect("assessment_id='".$this->assessmentId."'"); $this->idClassGradebookEntries = $entry[0]->idClassGradebookEntries; return $entry[0]; } function loadGradebookVal($entryId, $studentId) { include_once(LIB_PATH.'ClassGradebookVal.php'); $val = ClassGradebookValPeer::doSelect("id_class_gradebook_entries='".$entryId."' AND username='".$studentId."'"); return $val[0]; } # Returns BOOL if the test has already been taken # or started by a student function isTaken() { include_once(LIB_PATH.'AssessmentLog.php'); $log = AssessmentLogPeer::doSelect("assessment_id='".$this->assessmentId."' AND id_classes='".$this->classId."'"); $count = count($log); if ($count) { return TRUE; } return FALSE; } } ?> |
From: Mark K <har...@us...> - 2007-11-02 22:25:29
|
Update of /cvsroot/logicampus/logicampus/data In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23591/data Added Files: lob_class_activity.mysql.sql Log Message: Small schema changes to support tests and activities at the bare minimum. --- NEW FILE: lob_class_activity.mysql.sql --- -- Dumping SQL for project logicampus -- entity version: 0.0 -- DB type: mysql -- generated on: 09.29.2007 DROP TABLE IF EXISTS `lob_class_activity`; CREATE TABLE `lob_class_activity` ( `lob_class_activity_id` integer (11) NOT NULL auto_increment, `lob_class_repo_id` integer (11) NOT NULL, `response_type_id` tinyint (4) NOT NULL, PRIMARY KEY (lob_class_activity_id) ); CREATE INDEX lob_class_repo_idx ON lob_class_activity (lob_class_repo_id); |
From: Mark K <har...@us...> - 2007-11-02 22:24:33
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/classmgr In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23191/src/logicreate/services/classmgr Modified Files: assignmentManage.lcp Log Message: Quick fix for grading assignments. Index: assignmentManage.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classmgr/assignmentManage.lcp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** assignmentManage.lcp 27 Oct 2007 17:26:45 -0000 1.27 --- assignmentManage.lcp 2 Nov 2007 22:24:30 -0000 1.28 *************** *** 573,577 **** $sql = ' INSERT INTO class_assignments_grades ! SET id_class_assignments='.(int)$lc->getvars['id_class_assignments'].', comments=\''. str_replace("'", '\'\'', stripslashes($lc->postvars['teachercomments'])). '\', grade='. number_format($lc->postvars['grade'], 2). ', --- 573,577 ---- $sql = ' INSERT INTO class_assignments_grades ! SET id_class_assignments='.(int)$lc->postvars['seqId'].', comments=\''. str_replace("'", '\'\'', stripslashes($lc->postvars['teachercomments'])). '\', grade='. number_format($lc->postvars['grade'], 2). ', *************** *** 920,924 **** $t['studentId'] = $studentId; ! $t['attachments'] = $this->getAssignmentsByType(1, $studentId, $u->activeClassTaught->id_classes, --- 920,924 ---- $t['studentId'] = $studentId; ! $t['attachments'] = $this->getAssignmentsByType($t['activity']->lobSub->responseTypeId, $studentId, $u->activeClassTaught->id_classes, |
From: Mark K <har...@us...> - 2007-11-02 22:23:25
|
Update of /cvsroot/logicampus/logicampus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22754 Modified Files: build.properties build.xml Log Message: Finalize win special build. Index: build.xml =================================================================== RCS file: /cvsroot/logicampus/logicampus/build.xml,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** build.xml 27 Sep 2007 15:08:21 -0000 1.40 --- build.xml 2 Nov 2007 22:23:20 -0000 1.41 *************** *** 52,60 **** --> - </target> - - <target name="dist" depends="init" - description="generate an LC dist for Logicampus"> <tarfileset dir="${lcsrc}" prefix="${package.prefix}/logicreate/" id="srcdir" defaultexcludes="yes"> --- 52,56 ---- *************** *** 109,112 **** --- 105,113 ---- </tarfileset> + <tarfileset id="translate" dir="lang" prefix="${package.prefix}/logicreate/lang/"> + <include name="lct.en_US.php"/> + <include name="lct.es_MX.php"/> + <include name="lct.zh_CN.php"/> + </tarfileset> *************** *** 115,118 **** --- 116,124 ---- </tarfileset> + </target> + + + <target name="dist" depends="init" + description="generate an LC dist for Logicampus"> <!-- before files are copied to temp dir, put DB info into defines.php --> *************** *** 137,148 **** <antcall target="translate"/> - <tarfileset id="translate" dir="lang" prefix="${package.prefix}/logicreate/lang/"> - <include name="lct.en_US.php"/> - <include name="lct.es_MX.php"/> - <include name="lct.zh_CN.php"/> - </tarfileset> - - - <tar tarfile="${dist}/logicampus-${lc.version}.tar.gz" compression="gzip"> --- 143,146 ---- *************** *** 159,163 **** <echo message="Tar saved as 'dist/${lc.version}.tar.gz'!" /> - <!-- <zip destfile="${dist}/logicampus-${lc.version}.zip"> <tarfileset refid="srcdir"/> --- 157,160 ---- *************** *** 172,175 **** --- 169,173 ---- </zip> <echo message="Zip saved as 'dist/${lc.version}.zip'!" /> + <!-- --> <delete dir="filtertmp"/> *************** *** 182,211 **** ! <!-- need to recopy images because they shouldn't be filtered by the filterset tag --> ! <!-- ! <copy todir="${build}/public_html/" overwrite="true"> ! <fileset dir="${src}"> ! <include name="templates/private/images/**"/> ! <include name="templates/default/images/**"/> ! <exclude name="templates/**/*CVS*"/> ! <exclude name="templates/**/*~"/> ! </fileset> ! </copy> - <copy todir="${build}/logicreate/"> - <fileset dir="${src}"> - <include name="content/**"/> - <exclude name="content/**/*CVS*"/> - <exclude name="content/**/*~"/> - </fileset> - </copy> ! <copy file="${src}/images/lc-logo.gif" tofile="${build}/public_html/templates/default/images/lc-logo.gif" overwrite="true"/> - --> <!-- apply LCPL to files --> --- 180,262 ---- ! <!-- apply LCPL to files --> ! <!-- ! <antcall target="apply_license"/> ! --> ! <echo message="Archive saved in 'dist/' directory!" /> ! </target> ! <target name="specialwindist" depends="init, specialwininit" ! description="generate an LC dist for window with 7zip installer"> ! ! <!-- before files are copied to temp dir, put DB info into defines.php --> ! <antcall target="setup"/> ! ! <mkdir dir="filtertmp"/> ! <filter token="version.number" value="${version.number}"/> ! <filter token="build.date" value="${build.date}"/> ! <filter token="version.extra" value="${version.extra}"/> ! <copy file="${src}/index.php" todir="filtertmp" filtering="true"/> ! <copy file="${src}/defines.php" todir="filtertmp" filtering="true"/> ! <copy file="${src}/defines.template.php" todir="filtertmp" filtering="true"/> ! <copy file="${src}/settings.advanced.php" todir="filtertmp" filtering="true"/> ! <copy file="${src}/settings.simple.php" todir="filtertmp" filtering="true"/> ! ! <!-- build translation files and install --> ! <antcall target="translate"/> ! ! <!-- copy xampplite zip to dist --> ! <!-- ! --> ! <copy file="win-setup/xamppcampus-win32-1.6.4.zip" todir="${dist}"/> ! ! ! <!-- ! <zip destfile="${dist}/logicampus-${lc.version}.zip"> ! --> ! ! <!-- ! --> ! <antcall target="specialwininit"/> ! <!-- ! --> ! <zip destfile="${dist}/xamppcampus-win32-1.6.4.zip" update="yes"> ! <tarfileset refid="xsrcdir" /> ! <tarfileset refid="xscripts" /> ! <tarfileset refid="xdatadir" /> ! <tarfileset refid="xdatascripts" /> ! <tarfileset refid="xdocs" /> ! <tarfileset refid="xhtml" /> ! <tarfileset refid="xhtmlfilter" /> ! <tarfileset refid="xpatches" /> ! <tarfileset refid="xtranslate" /> ! </zip> ! <echo message="Zip saved as 'dist/xamppcampus-win32-1.6.4.zip'!" /> ! <!-- ! --> ! <delete dir="filtertmp"/> ! <!-- ! --> + <echo message="Starting 7zip compression..." /> + <mkdir dir="7ziptmp"/> + <unzip src="${dist}/xamppcampus-win32-1.6.4.zip" dest="7ziptmp" overwrite="false"/> + <move todir="7ziptmp/logicampus-server-${lc.version}" preservelastmodified="true"> + <fileset dir="7ziptmp/xampplite" /> + </move> + <exec executable="/bin/bash" dir="win-setup" failonerror="true"> + <arg line="compress.sh"/> + <arg line="logicampus-server-${lc.version}"/> + </exec> + + <move file="7ziptmp/logicampus-server-${lc.version}.exe" todir="${dist}" preservelastmodified="true"/> + + <echo message="Cleaning up 7zip temp dir..." /> + <delete dir="7ziptmp"/> <!-- apply LCPL to files --> *************** *** 218,221 **** --- 269,341 ---- + <target name="specialwininit"> + <property name="xampp.prefix" value="xampplite/htdocs" /> + <tarfileset dir="${lcsrc}" prefix="${xampp.prefix}/logicreate/" id="xsrcdir" defaultexcludes="yes"> + <include name="classLibrary/**"/> + <include name="cache/**"/> + <include name="data/**"/> + <include name="lib/**"/> + <include name="services/**"/> + <exclude name="services/unitTest"/> + <include name="content/**"/> + <include name="lang/fallback.php"/> + </tarfileset> + + <tarfileset id="xscripts" dir="${scripts}" prefix="${xampp.prefix}/logicreate/scripts/" defaultexcludes="yes"> + <include name="**"/> + </tarfileset> + + <tarfileset id="xdatascripts" dir="${data}" prefix="${xampp.prefix}/logicreate/scripts/" defaultexcludes="yes"> + <include name="wipe_clean.sh"/> + <include name="install_metainfo.sh"/> + </tarfileset> + + + <tarfileset id="xdatadir" dir="${data}" prefix="${xampp.prefix}/logicreate/data/"> + <include name="*.sql"/> + </tarfileset> + + + <tarfileset id="xdocs" dir="./" prefix="${xampp.prefix}"> + <include name="${docs}license.txt"/> + <include name="${docs}INSTALL" /> + <include name="${docs}SAMPLE_DATA" /> + <include name="README" /> + <include name="LICENSE" /> + <include name="changelog.txt" /> + <include name="changelog.html" /> + </tarfileset> + + + <tarfileset id="xhtml" dir="${src}" prefix="${xampp.prefix}/" > + <include name="herc/**"/> + <include name="htmlarea/**"/> + <exclude name="herc/wysiwyg"/> + <exclude name="herc/content.php" /> + <include name="images/**"/> + <include name="license.txt"/> + <include name="ua.js"/> + <include name="templates/**"/> + <exclude name="templates/*/images/"/> + <include name="install/**"/> + <include name="commentrec/**"/> + </tarfileset> + + <tarfileset id="xhtmlfilter" dir="filtertmp" prefix="${xampp.prefix}/"> + <include name="**"/> + </tarfileset> + + <tarfileset id="xtranslate" dir="lang" prefix="${xampp.prefix}/logicreate/lang/"> + <include name="lct.en_US.php"/> + <include name="lct.es_MX.php"/> + <include name="lct.zh_CN.php"/> + </tarfileset> + + <tarfileset id="xpatches" dir="patches" prefix="${xampp.prefix}/patches"> + <include name="**"/> + </tarfileset> + </target> + + <target name="apply_license" description="uses a combination of bash and perl in the build/ dir to apply a common license to all code files" Index: build.properties =================================================================== RCS file: /cvsroot/logicampus/logicampus/build.properties,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** build.properties 19 Sep 2007 21:06:21 -0000 1.18 --- build.properties 2 Nov 2007 22:23:20 -0000 1.19 *************** *** 1,4 **** ! version.number=2.1.0 ! version.extra=pr2 db.host=localhost db.user=root --- 1,4 ---- ! version.number=3.0.0 ! version.extra=-20071102 db.host=localhost db.user=root |
From: Mark K <har...@us...> - 2007-11-02 22:23:25
|
Update of /cvsroot/logicampus/logicampus/win-setup In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22754/win-setup Modified Files: compress.sh Added Files: logicampus_start_page.url Log Message: Finalize win special build. Index: compress.sh =================================================================== RCS file: /cvsroot/logicampus/logicampus/win-setup/compress.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** compress.sh 30 Oct 2007 20:33:31 -0000 1.1 --- compress.sh 2 Nov 2007 22:23:20 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- #!/bin/sh cd ../7ziptmp + cp ../win-setup/logicampus_start_page.url ./$1/ ../win-setup/p7zip_4.55/bin/7z a $1.7z $1 cat ../win-setup/7z.win.sfx $1.7z > $1.exe --- NEW FILE: logicampus_start_page.url --- [InternetShortcut] URL=http://127.0.0.1/ |
From: Mark K <har...@us...> - 2007-11-02 21:54:47
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11226/lib Modified Files: lc_lesson.php Log Message: Fix classroom portal lookup of activities for the student. Index: lc_lesson.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/lc_lesson.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lc_lesson.php 2 Oct 2007 18:16:18 -0000 1.4 --- lc_lesson.php 2 Nov 2007 21:54:39 -0000 1.5 *************** *** 141,144 **** --- 141,169 ---- return $this->lessonDo->inactiveOn < time(); } + + /** + * Store a lesson into the users' session + */ + function storeLessonInSession($lessonId, &$u) { + $ut = time(); + $db = DB::getHandle(); + $sql = "select * from class_lessons + where id_class_lessons='".$lesson_id."' + and id_classes='{$u->activeClassTaken->id_classes}'"; + if (!$u->isFaculty()) + $sql .= " and (activeOn < ".time()." + and inactiveOn > ".time().')'; + + $db->queryOne($sql); + $u->sessionvars['activeLesson'] = $db->record; + } + + /** + * Find a lesson ID for a particular sequence + */ + function getLessonIdForSequenceId($seqId) { + $seqObj = ClassLessonSequence::load($seqId); + return $seqObj->lessonId; + } } ?> |