logicampus-cvs Mailing List for Logicampus (Page 2)
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: <fah...@us...> - 2009-02-27 11:37:48
|
Revision: 1286 http://logicampus.svn.sourceforge.net/logicampus/?rev=1286&view=rev Author: faheemkhan Date: 2009-02-27 11:37:44 +0000 (Fri, 27 Feb 2009) Log Message: ----------- Added Paths: ----------- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_manswer.html Added: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_manswer.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_manswer.html (rev 0) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_manswer.html 2009-02-27 11:37:44 UTC (rev 1286) @@ -0,0 +1,100 @@ +<h3><?= lct('Multiple Answer Question');?></h3> +<?=$t['error'];?> +<form method="POST"> + <table border="0" width="600"> + <tr> + <td valign="top">*<b>Question</b></td> + <td> + <textarea rows="5" cols="50" name="questionText" <?= $t['disableFlag'];?>><?=$t['q']->questionText;?></textarea> + </td> + </tr> + <tr> + <td colspan=2 height=25> </td> + </tr> + <tr> + <td><b>Answers</b></td> + <td>(check boxes to indicate the correct responses)</td> + </tr> + <?// debug($t['q']); ?> + <? for ($x=0;$x<10;++$x) { ?> + <? $qc = $t['q']->questionChoices[$x]; ?> + <? //debug($qc); ?> + + <tr> + <td align="right"> + <? if ($x <= 1) {echo '*';} else { echo ' '; } ?> + <? printf('%d',$x+1);?>. + </td> + <td NOWRAP> + <? $x <= 1 ? '*' : ''; ?> + <input name="labels[<?=$x;?>]" type="text" value="<?= htmlentities($qc->label);?>" size="50" <?= $t['disableFlag'];?> /> + <input name="correct[<?=$x;?>]" value="On" type="checkbox"<?= $qc->correct ? ' CHECKED':'';?> /> + </td> + </tr> + <? } ?> + + <tr> + <td> </td> + <td> +<style> + + div.over { + overflow: scroll; + height: 220px; + width: 240px; + } + +</style> + <FIELDSET valign="middle" style="width: 235px; height: 245px; padding: 2px;"> + + <select name="imagesMenu" id="imagesMenu" + style="width: 235px;" + onChange="document.getElementById('previewfile').src='<?=appurl('lobrepo/exam/event=viewImage/id=');?>' + this.value;" + > + <option value="">Select Image</option> +<?php + $images_array = array(); + $images_array = $t['images']; + + foreach( $images_array as $img) + { ?> + <option value="<?=$img['lob_repo_entry_id']?>"><?=$img['lob_title']?> + </option> + <? } + ?> + </select> + <div class="over" align="center" valign="middle"> + <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> + <tr> + + <td valign="middle" align="center" height="100%" width="100%"> + <img alt="" name="previewfile" id="previewfile" > + <? if( isset($t['imgId']) ){ ?> + <script language="JavaScript" type="text/javascript"> + document.getElementById('imagesMenu').value = <?=$t['imgId']?>; + document.getElementById('previewfile').src='<?=appurl('lobrepo/exam/event=viewImage/id=').$t['imgId'];?>'; + </script> + <? } ?> + + </td> + </tr> + </table> + </div> + + </FIELDSET> + </td> + </tr> + + <tr> + <td> </td> + <td> + <input type="submit" name="sbmt_button" value="<?=lct('Continue ->');?>"/> + <input type="hidden" name="event" value="saveQuestion"/> + <input type="hidden" name="qidx" value="<?=$t['qidx'];?>"/> + <input type="hidden" name="questionType" value="<?= $t['questionType'];?>"/> + </td> + </tr> + </table> +</form> + +<p>* denotes a required field.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fah...@us...> - 2009-02-27 11:36:40
|
Revision: 1285 http://logicampus.svn.sourceforge.net/logicampus/?rev=1285&view=rev Author: faheemkhan Date: 2009-02-27 11:36:31 +0000 (Fri, 27 Feb 2009) Log Message: ----------- Added Paths: ----------- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html Added: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html (rev 0) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html 2009-02-27 11:36:31 UTC (rev 1285) @@ -0,0 +1,121 @@ +<?=$t['sectionheader'];?> +<h3><?= lct('Fill in the Blank');?></h3> +<?=$t['error'];?> +<form method="POST"> + <table border="0" width="600"> + <tr> + <td valign="top">*<b>Question</b></td> + <td><textarea rows="5" cols="50" name="questionText"><?=$t['q']->questionText;?></textarea></td> + </tr> + <tr> + <td width="12"> + <b>Answer</b> + </td> + <td width="100"> + <input name="labels[0]" type="text" value="<?=$t['q']->questionChoices[0]->label;?>"> + </td> + </tr> + <tr> + <td colspan=2 height=25> </td> + </tr> + <tr> + <td> + + </td> + <td> + <b>Alternate Answer Help</b> + <br> + If you would like to enter alternate answers that you will accept, enter them + below. Example: If the if you are looking for the president of the U.S. and + the student enters 'George Washington' which is the correct answer. However, + another student enters just 'Washington'. If you have 'Washington' as an + alternate answer below, the student will receive credit for their entry. + </td> + </tr> + <tr> + <td valign="top"> + <b>Alternate Answers</b> + </td> + <td valign="top" width="100"> + <table border=0 cellpadding=2 cellspacing=0> + <? for ($x=1;$x<11;++$x) { ?> + <? $qc = $t['q']->questionChoices[$x]; ?> + <tr> + <td><? printf('%d',$x);?>.</td> + <td><? $x <= 1 ? '*' : ''; ?> + <input name="labels[<?=$x;?>]" type="text" value="<?=$qc->label;?>"></td> + </tr> + <? } ?> + </table> + </td> + </tr> + <tr> + <td> </td> + <td colspan=2> +<style> + + div.over { + overflow: scroll; + height: 220px; + width: 240px; + } + +</style> + <FIELDSET valign="middle" style="width: 235px; height: 245px; padding: 2px;"> + + <select name="imagesMenu" id="imagesMenu" + style="width: 235px;" + onChange="document.getElementById('previewfile').src='<?=appurl('lobrepo/exam/event=viewImage/id=');?>' + this.value;" + > + <option value="">Select Image</option> + <?php + $images_array = array(); + $images_array = $t['images']; + + foreach( $images_array as $img) + { ?> + <option value="<?=$img['lob_repo_entry_id']?>"><?=$img['lob_title']?> + </option> + <? } + ?> + </select> + + + <div class="over" align="center" valign="middle"> + <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> + <tr> + + <td valign="middle" align="center" height="100%" width="100%"> + <img alt="" name="previewfile" id="previewfile"> + <? if( isset($t['imgId']) ){ ?> + <script language="JavaScript" type="text/javascript"> + document.getElementById('imagesMenu').value = <?=$t['imgId']?>; + document.getElementById('previewfile').src='<?=appurl('lobrepo/exam/event=viewImage/id=').$t['imgId'];?>'; + </script> + <? } ?> + + + </td> + </tr> + </table> + </div> + + </FIELDSET> + + </td> + </tr> + <tr> + <td> + + </td> + <td> + <input type="submit" value="<?=lct('Continue ->');?>"> + <input type="hidden" name="event" value="saveQuestion"> + <input type="hidden" name="qidx" value="<?=$t['qidx'];?>"/> + <input type="hidden" name="questionType" value="<?= $t['questionType'];?>"/> + </form> + </td> + </tr> + </table> + +<p>* denotes a required field.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fah...@us...> - 2009-02-27 11:35:53
|
Revision: 1284 http://logicampus.svn.sourceforge.net/logicampus/?rev=1284&view=rev Author: faheemkhan Date: 2009-02-27 11:35:47 +0000 (Fri, 27 Feb 2009) Log Message: ----------- Added Paths: ----------- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_essay.html Added: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_essay.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_essay.html (rev 0) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_essay.html 2009-02-27 11:35:47 UTC (rev 1284) @@ -0,0 +1,84 @@ +<h3><?= lct('Essay Type Question');?></h3> +<?=$t['error'];?> +<form method="post"> + + <table border="0" width="600"> + <tr> + <td valign="top"> + *<b>question</b><br/> + </td> + <td> + <textarea rows="5" cols="50" name="question_text" <?= $t['disableflag'];?>><?=$t['q']->questiontext;?></textarea> + <br/> + </td> + </tr> + <tr> + <td valign="top"><b>Select Image</b></td> + <td> + + <style> + + div.over { + overflow: scroll; + height: 220px; + width: 240px; + } + + </style> + + <fieldset valign="middle" style="width: 235px; height: 245px; padding: 2px;"> + + <select name="imagesMenu" id="imagesMenu" + style="width: 235px;" + onChange="document.getElementById('previewfile').src='<?=appurl('lobrepo/exam/event=viewImage/id=');?>' + this.value;" + > + <option value="">Select Image</option> + <?php + $images_array = array(); + $images_array = $t['images']; + + foreach( $images_array as $img) + { ?> + <option value="<?=$img['lob_repo_entry_id']?>"><?=$img['lob_title']?> + </option> + <? } + ?> + </select> + + + <div class="over" align="center" valign="middle"> + <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> + <tr> + + <td valign="middle" align="center" height="100%" width="100%"> + <img alt="" name="previewfile" id="previewfile"> + <? if( isset($t['imgId']) ){ ?> + <script language="JavaScript" type="text/javascript"> + document.getElementById('imagesMenu').value = <?=$t['imgId']?>; + document.getElementById('previewfile').src='<?=appurl('lobrepo/exam/event=viewImage/id=').$t['imgId'];?>'; + </script> + <? } ?> + + + </td> + </tr> + </table> + </div> + + </fieldset> + + </td> + </tr> + <tr> + <td> </td> + <td> + <input type="submit" name="sbmt_button" value="<?=lct('Continue ->');?>"/> + <input type="hidden" name="event" value="saveQuestion"/> + <input type="hidden" name="qidx" value="<?=$t['qidx'];?>"/> + <input type="hidden" name="questionType" value="<?= $t['questionType'];?>"/> + </form> + </td> + </tr> + </table> + +<p>* denotes a required field.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fah...@us...> - 2009-02-27 11:34:57
|
Revision: 1283 http://logicampus.svn.sourceforge.net/logicampus/?rev=1283&view=rev Author: faheemkhan Date: 2009-02-27 11:34:48 +0000 (Fri, 27 Feb 2009) Log Message: ----------- Removed Paths: ------------- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_essay.html logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_manswer.html logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_matching.html logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_mchoice.html logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_truefalse.html Deleted: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_essay.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_essay.html 2009-02-27 10:10:57 UTC (rev 1282) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_essay.html 2009-02-27 11:34:48 UTC (rev 1283) @@ -1,78 +0,0 @@ -<h3><?= lct('Multiple Answer Question');?></h3> -<?=$t['error'];?> -<form method="post"> - - <table border="0" width="600"> - <tr> - <td valign="top"> - *<b>question</b><br/> - </td> - <td> - <textarea rows="5" cols="50" name="question_text" <?= $t['disableflag'];?>><?=$t['q']->questiontext;?></textarea> - <br/> - </td> - </tr> - <tr> - <td valign="top"><b>select image</b></td> - <td> - - <style> - - div.over { - overflow: scroll; - height: 220px; - width: 240px; - } - - </style> - - <fieldset valign="middle" style="width: 235px; height: 245px; padding: 2px;"> - - <select name="filehash" - style="width: 235px;" - onchange="document.getelementbyid('previewfile').src='<?=appurl('classroom/viewcontent/fhash=');?>' + this.value;" - > - <option value="">select image</option> - <?php - foreach($t['images'] as $myizimage) - { - echo ' - <option value="'.$myizimage['dahasha'].'"'. - ($t['q']->filehash == $myizimage['dahasha'] ? ' selected' : '').'>'. - $myizimage['displayname'].'</option>'; - } - - ?> - </select> - - - <div class="over" align="center" valign="middle"> - <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> - <tr> - - <td valign="middle" align="center" height="100%" width="100%"> - <img alt="" src="<?= $t['q']->filehash ? appurl('classroom/viewcontent/fhash=').$t['q']->filehash : images_url.'spacer.gif'; ?>" id="previewfile"> - - - </td> - </tr> - </table> - </div> - - </fieldset> - - </td> - </tr> - <tr> - <td> </td> - <td> - <input type="submit" name="sbmt_button" value="<?=lct('Continue ->');?>"/> - <input type="hidden" name="event" value="saveQuestion"/> - <input type="hidden" name="qidx" value="<?=$t['qidx'];?>"/> - <input type="hidden" name="questionType" value="<?= $t['questionType'];?>"/> - </form> - </td> - </tr> - </table> - -<p>* denotes a required field.</p> Deleted: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html 2009-02-27 10:10:57 UTC (rev 1282) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html 2009-02-27 11:34:48 UTC (rev 1283) @@ -1,113 +0,0 @@ -<?=$t['sectionheader'];?> - -<?=$t['error'];?> -<form method="POST"> - <table border="0" width="600"> - <tr> - <td valign="top">*<b>Question</b></td> - <td><textarea rows="5" cols="50" name="questionText"><?=$t['q']->questionText;?></textarea></td> - </tr> - <tr> - <td width="12"> - <b>Answer</b> - </td> - <td width="100"> - <input name="labels[0]" type="text" value="<?=$t['q']->questionChoices[0]->label;?>"> - </td> - </tr> - <tr> - <td colspan=2 height=25> </td> - </tr> - <tr> - <td> - - </td> - <td> - <b>Alternate Answer Help</b> - <br> - If you would like to enter alternate answers that you will accept, enter them - below. Example: If the if you are looking for the president of the U.S. and - the student enters 'George Washington' which is the correct answer. However, - another student enters just 'Washington'. If you have 'Washington' as an - alternate answer below, the student will receive credit for their entry. - </td> - </tr> - <tr> - <td valign="top"> - <b>Alternate Answers</b> - </td> - <td valign="top" width="100"> - <table border=0 cellpadding=2 cellspacing=0> - <? for ($x=1;$x<11;++$x) { ?> - <? $qc = $t['q']->questionChoices[$x]; ?> - <tr> - <td><? printf('%d',$x);?>.</td> - <td><? $x <= 1 ? '*' : ''; ?> - <input name="labels[<?=$x;?>]" type="text" value="<?=$qc->label;?>"></td> - </tr> - <? } ?> - </table> - </td> - </tr> - <tr> - <td> </td> - <td colspan=2> -<style> - - div.over { - overflow: scroll; - height: 220px; - width: 240px; - } - -</style> - <FIELDSET valign="middle" style="width: 235px; height: 245px; padding: 2px;"> - - <select name="fileHash" - style="width: 235px;" - onChange="document.getElementById('previewfile').src='<?=appurl('classroom/viewContent/fhash=');?>' + this.value;" - > - <option value="">Select Image</option> -<?php - foreach($t['images'] as $myIzimage) - { - echo ' - <option value="'.$myIzimage['daHasha'].'"'. - ($t['q']->fileHash == $myIzimage['daHasha'] ? ' SELECTED' : '').'>'. - $myIzimage['displayname'].'</option>'; - } - -?> - </select> - - - <div class="over" align="center" valign="middle"> - <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> - <tr> - - <td valign="middle" align="center" height="100%" width="100%"> - <img alt="" src="<?= $t['q']->fileHash ? appurl('classroom/viewContent/fhash=').$t['q']->fileHash : IMAGES_URL.'spacer.gif'; ?>" id="previewfile"> - - - </td> - </tr> - </table> - </div> - - </FIELDSET> - - </td> - </tr> - <tr> - <td> - - </td> - <td> - <input type="submit" value="Continue->"> - <input type="hidden" name="event" value="save"> - </form> - </td> - </tr> - </table> - -<p>* denotes a required field.</p> Deleted: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_manswer.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_manswer.html 2009-02-27 10:10:57 UTC (rev 1282) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_manswer.html 2009-02-27 11:34:48 UTC (rev 1283) @@ -1,97 +0,0 @@ -<h3><?= lct('Multiple Answer Question');?></h3> -<?=$t['error'];?> -<form method="POST"> - <table border="0" width="600"> - <tr> - <td valign="top">*<b>Question</b></td> - <td> - <textarea rows="5" cols="50" name="questionText" <?= $t['disableFlag'];?>><?=$t['q']->questionText;?></textarea> - </td> - </tr> - <tr> - <td colspan=2 height=25> </td> - </tr> - <tr> - <td><b>Answers</b></td> - <td>(check boxes to indicate the correct responses)</td> - </tr> - <?// debug($t['q']); ?> - <? for ($x=0;$x<10;++$x) { ?> - <? $qc = $t['q']->questionChoices[$x]; ?> - <? //debug($qc); ?> - - <tr> - <td align="right"> - <? if ($x <= 1) {echo '*';} else { echo ' '; } ?> - <? printf('%d',$x+1);?>. - </td> - <td NOWRAP> - <? $x <= 1 ? '*' : ''; ?> - <input name="labels[<?=$x;?>]" type="text" value="<?= htmlentities($qc->label);?>" size="50" <?= $t['disableFlag'];?> /> - <input name="correct[<?=$x;?>]" value="On" type="checkbox"<?= $qc->correct ? ' CHECKED':'';?> /> - </td> - </tr> - <? } ?> - - <tr> - <td> </td> - <td> -<style> - - div.over { - overflow: scroll; - height: 220px; - width: 240px; - } - -</style> - <FIELDSET valign="middle" style="width: 235px; height: 245px; padding: 2px;"> - - <select name="fileHash" - style="width: 235px;" - onChange="document.getElementById('previewfile').src='<?=appurl('classroom/viewContent/fhash=');?>' + this.value;" - > - <option value="">Select Image</option> -<?php - foreach($t['images'] as $myIzimage) - { - echo ' - <option value="'.$myIzimage['daHasha'].'"'. - ($t['q']->fileHash == $myIzimage['daHasha'] ? ' SELECTED' : '').'>'. - $myIzimage['displayname'].'</option>'; - } - -?> - </select> - - - <div class="over" align="center" valign="middle"> - <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> - <tr> - - <td valign="middle" align="center" height="100%" width="100%"> - <img alt="" src="<?= $t['q']->fileHash ? appurl('classroom/viewContent/fhash=').$t['q']->fileHash : IMAGES_URL.'spacer.gif'; ?>" id="previewfile"> - - - </td> - </tr> - </table> - </div> - - </FIELDSET> - </td> - </tr> - - <tr> - <td> </td> - <td> - <input type="submit" name="sbmt_button" value="<?=lct('Continue ->');?>"/> - <input type="hidden" name="event" value="saveQuestion"/> - <input type="hidden" name="qidx" value="<?=$t['qidx'];?>"/> - <input type="hidden" name="questionType" value="<?= $t['questionType'];?>"/> - </td> - </tr> - </table> -</form> - -<p>* denotes a required field.</p> Deleted: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_matching.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_matching.html 2009-02-27 10:10:57 UTC (rev 1282) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_matching.html 2009-02-27 11:34:48 UTC (rev 1283) @@ -1,103 +0,0 @@ -<?=$t['sectionheader'];?> - -<?=$t['error'];?> -<FIELDSET> -<LEGEND> -<b>Help</b> -</LEGEND> -Enter your questions in the left column and your answers in the right column. Answers will automatically be sorted for you when you preview on the next page. Questions will remain in the order you entered them. Each time you update this question the answers will be randomly sorted. -</FIELDSET> -<form method="POST" action="<?=modurl('question/event=save/id='.$t['id'].'/type='.$t['questionType']);?>"> - <table border="0" width="100%"> - <tr> - <td> </td> - <td colspan=2> - *<b>Instructions</b><br /> - <textarea rows="5" cols="50" name="questionText" <?= $t['disableFlag'];?>><?=$t['q']->questionText;?></textarea> - </td> - </tr> - <tr> - <td colspan=3> </td> - </tr> - <tr> - <td> </td> - <td><b>Questions (or definitions)</b></td> - <td><b>Answers (or terms)</b></td> - </tr> - <? for ($x=0;$x<20;++$x) { ?> - <? $qc = $t['q']->questionChoices[$x]; ?> - <tr> - <td align="right" valign="center"> - <? if ($x <= 1) {echo '*';} else { echo ' '; } ?> - <? printf('%d',$x+1);?>. - </td> - <td valign="center"> - <input name="labels[<?=$x;?>]" type="text" value="<?=$qc->label;?>" size="40" <?= $t['disableFlag'];?>> - </td> - <td> - <? $x <= 1 ? '*' : ''; ?> - <input name="correct[<?=$x?>]" value="<?=$qc->correct?>" size="20"> - </td> - </tr> - <? } ?> - - <tr> - <td colspan=3> - -<style> - - div.over { - overflow: scroll; - height: 220px; - width: 240px; - } - -</style> - <FIELDSET valign="middle" style="width: 235px; height: 245px; padding: 2px;"> - - <select name="fileHash" - style="width: 235px;" - onChange="document.getElementById('previewfile').src='<?=appurl('classroom/viewContent/fhash=');?>' + this.value;" - > - <option value="">Select Image</option> -<?php - foreach($t['images'] as $myIzimage) - { - echo ' - <option value="'.$myIzimage['daHasha'].'"'. - ($t['q']->fileHash == $myIzimage['daHasha'] ? ' SELECTED' : '').'>'. - $myIzimage['displayname'].'</option>'; - } - -?> - </select> - - - <div class="over" align="center" valign="middle"> - <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> - <tr> - - <td valign="middle" align="center" height="100%" width="100%"> - <img alt="" src="<?= $t['q']->fileHash ? appurl('classroom/viewContent/fhash=').$t['q']->fileHash : IMAGES_URL.'spacer.gif'; ?>" id="previewfile"> - - - </td> - </tr> - </table> - </div> - - </FIELDSET> - </td> - </tr> - - <tr> - <td> </td> - <td> - <input type="submit" name="submit" value="Save ->"> - <input type="hidden" name="event" value="save"> - </td> - </tr> - </table> -</form> - -<p>* denotes a required field.</p> Deleted: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_mchoice.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_mchoice.html 2009-02-27 10:10:57 UTC (rev 1282) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_mchoice.html 2009-02-27 11:34:48 UTC (rev 1283) @@ -1,49 +0,0 @@ -<h3><?= lct('Multiple Choice Question');?></h3> -<form method="POST" action="<?=modurl('exam/');?>"> - <table border="0" width="600"> - <tr> - <td valign="top">*<b><?= lct('Question');?></b></td> - <td> - <textarea rows="5" cols="50" name="questionText" <?= $t['disableFlag'];?>><?=$t['questionObj']->qstText;?></textarea> - </td> - </tr> - <tr> - <td><b><?= lct('Answers');?></b></td> - <td><?=lct('(check boxes to indicate the correct responses)');?></td> - </tr> - <? for ($x=0;$x<10;++$x) { ?> - <? $qc = $t['q']->qstChoices[$x]; ?> - - <tr> - <td align="right"> - <? if ($x <= 1) {echo '*';} else { echo ' '; } ?> - <? printf('%d',$x+1);?>. - </td> - <td NOWRAP> - <? $x <= 1 ? '*' : ''; ?> - <input name="labels[<?=$x;?>]" type="text" value="<?=$qc['label'];?>" size="50" <?= $t['disableFlag'];?>> - <input name="correct" value="<?=$x;?>" type="radio" <?= $qc['correct'] ? 'CHECKED':'';?>> - </td> - </tr> - <? } ?> - - <tr> - <td> </td> - <td> - </td> - </tr> - - <tr> - <td> </td> - <td> - <input type="submit" name="sbmt_button" value="<?=lct('Continue ->');?>"/> - <input type="hidden" name="event" value="saveQuestion"/> - <input type="hidden" name="qidx" value="<?=$t['qidx'];?>"/> - <input type="hidden" name="questionType" value="<?= $t['questionType'];?>"/> -</form> - </td> - </tr> - - </table> - -<p>* denotes a required field.</p> Deleted: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_truefalse.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_truefalse.html 2009-02-27 10:10:57 UTC (rev 1282) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_truefalse.html 2009-02-27 11:34:48 UTC (rev 1283) @@ -1,95 +0,0 @@ -<h3><?= lct('Multiple Answer Question');?></h3> - -<?=$t['error'];?> - -<form method="POST"> - <table border="0" width="600"> - <tr> - <td valign="top">*<b>Question</b></td> - <td colspan=2> - <textarea rows="5" cols="50" name="question_text" <?= $t['disableFlag'];?>><?=$t['q']->qstText;?></textarea> - </td> - </tr> - <tr> - <td colspan=3 height=25> </td> - </tr> - <tr> - <td>*<b>Answer</b></td> - <td colspan=2> </td> - </tr> - <? for ($x=0;$x<2;++$x) { ?> - <? $qc = $t['q']->qstChoices[$x]; ?> - <?// debug($t['q']);?> - <?// debug($qc);?> - <tr> - <td width=100 align="right"> - <? printf('%d',$x+1);?>. - </td> - <td width=50><?=$qc['label'];?></td> - <td> - <input name="correct" value="<?=$x;?>" type="radio" <?= $qc['correct'] ? 'CHECKED':'';?>> - </td> - </tr> - <? } ?> - <tr> - <td> </td> - <td colspan=2> -<style> - - div.over { - overflow: scroll; - height: 220px; - width: 240px; - } - -</style> - <FIELDSET valign="middle" style="width: 235px; height: 245px; padding: 2px;"> - - <select name="fileHash" - style="width: 235px;" - onChange="document.getElementById('previewfile').src='<?=appurl('classroom/viewContent/fhash=');?>' + this.value;" - > - <option value="">Select Image</option> -<?php - foreach($t['images'] as $myIzimage) - { - echo ' - <option value="'.$myIzimage['daHasha'].'"'. - ($t['q']->fileHash == $myIzimage['daHasha'] ? ' SELECTED' : '').'>'. - $myIzimage['displayname'].'</option>'; - } - -?> - </select> - - - <div class="over" align="center" valign="middle"> - <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> - <tr> - - <td valign="middle" align="center" height="100%" width="100%"> - <img alt="" src="<?= $t['q']->fileHash ? appurl('classroom/viewContent/fhash=').$t['q']->fileHash : IMAGES_URL.'spacer.gif'; ?>" id="previewfile"> - - - </td> - </tr> - </table> - </div> - - </FIELDSET> - </td> - </tr> - <tr> - <td> </td> - <td colspan=2> - <input type="submit" name="sbmt_button" value="<?=lct('Continue ->');?>"/> - <input type="hidden" name="event" value="saveQuestion"/> - <input type="hidden" name="qidx" value="<?=$t['qidx'];?>"/> - <input type="hidden" name="questionType" value="<?= $t['questionType'];?>"/> - </td> - </tr> - </table> - -</form> - -<p>* denotes a required field.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fah...@us...> - 2009-02-27 10:11:00
|
Revision: 1282 http://logicampus.svn.sourceforge.net/logicampus/?rev=1282&view=rev Author: faheemkhan Date: 2009-02-27 10:10:57 +0000 (Fri, 27 Feb 2009) Log Message: ----------- Added Paths: ----------- logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp Added: logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp (rev 0) +++ logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp 2009-02-27 10:10:57 UTC (rev 1282) @@ -0,0 +1,348 @@ +<?php + +include_once(LIB_PATH.'PBDO/LobContent.php'); +include_once(LIB_PATH.'PBDO/LobMetadata.php'); +include_once(LIB_PATH.'PBDO/LobUserLink.php'); +include_once(LIB_PATH.'AssessmentQuestion.php'); +include_once(LIB_PATH.'AssessmentLib.php'); + +include_once(LIB_PATH.'lob/lc_lob.php'); +include_once(LIB_PATH.'lob/lc_lob_test.php'); +include_once(LIB_PATH.'lc_table.php'); +include_once(LIB_PATH.'lc_table_renderer.php'); + +/** + * Learning Object Repository + */ +class Exam extends FacultyService { + + var $presentor='htmlPresentation'; + var $sectionTitle = 'Classroom Manager'; + var $navlinks = array ( + ''=>'' + ); + + + /** + * + */ + function run(&$db,&$u,&$lc,&$t) { + $lc->templateName = 'exam_main'; + $lobId = intval($lc->postvars['lob_id']); + + if (! is_object($u->sessionvars['test_obj']) ) { + $test = new Lc_Lob_Test($lobId); + $test->setTitle( $lc->postvars['title']); + $test->setInstructions( $lc->postvars['instructions']); + $test->loadQuestions(); + $t['testId'] = $test->get('lobRepoEntryId'); + $u->sessionvars['test_obj'] = $test; + } else { + $test = $u->sessionvars['test_obj']; + } + + $t['questionList'] = $u->sessionvars['test_obj']->questionObjs; + + + $totalPoints = 0; + foreach ($t['questionList'] as $q) { + $totalPoints += (int) $q->qstPoints; + } + $t['questions_total_points'] = sprintf('%d', $totalPoints); + $t['questions_count'] = sprintf('%d', $u->sessionvars['test_obj']->getQuestionCount()); + } + + + /** + */ + function editQuestionRun(&$db, &$u, &$lc, &$t) { + //load this question from the question array + if (isset($lc->getvars['qidx'])) { + $t['q'] = $u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]; + $t['qidx'] = intval($lc->getvars['qidx']); + // pass image lob id to template for state managment + $t['imgId'] = $u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]->imageContentId; + } else { + $t['q'] = new LobTestQst(); + $t['q']->qstChoices = array(); + $t['qidx'] = -1; + if ($qCode == 'QUESTION_TRUEFALSE') { + $t['q']->qstChoices = array( array('label'=>'True'), array('label'=>'False')); + } + } + + $qTypeId = $t['q']->questionTypeId; + if (!$qTypeId) { + $qCode = $this->findQuestionType($lc); + } else { + $qCode = $this->getCodeForId($qTypeId); + } + + $t['questionType'] = $qCode; + + $lc->templateName=$this->getTemplateName($qCode); + + /* + * PU Tasks: faheemkhan + * load *all* teacher LOBs and classroom lobs which this teacher has borrowed from other people + */ + // FULL OUTER JOIN is not supported by mysql so had to do it this way + $qry = "SELECT A.lob_repo_entry_id, A.lob_title FROM lob_repo_entry AS A " . + "LEFT JOIN lob_class_repo AS B " . + "ON A.lob_repo_entry_id = B.lob_repo_entry_id " . + "WHERE A.lob_sub_type = 'image' " . + "UNION " . + "SELECT B.lob_repo_entry_id, B.lob_title FROM lob_repo_entry AS A " . + "RIGHT JOIN lob_class_repo AS B " . + "ON A.lob_repo_entry_id = B.lob_repo_entry_id " . + "WHERE A.lob_sub_type = 'image'"; + + $db->query($qry); + $images_array = array(); + while( $db->nextRecord() ) + { + array_push($images_array, $db->record); + } + $t['images'] = $images_array; + } + + /** + * Helper function to translate a qestion type into a filename. + * + * @return String filename of template for this quesiton type + */ + function getTemplateName($qCode) { + switch ($qCode) { + case 'QUESTION_MCHOICE'; + return 'exam_question_mchoice'; + + case 'QUESTION_MANSWER'; + return 'exam_question_manswer'; + + case 'QUESTION_MATCHING'; + return 'exam_question_matching'; + + case 'QUESTION_TRUEFALSE'; + return 'exam_question_truefalse'; + + case 'QUESTION_ESSAY'; + return 'exam_question_essay'; + + case 'QUESTION_FILLINBLANK': + return 'exam_question_fillinblank'; + } + } + /** + * Helper function to inspect the get/post vars for a question type. + * + * @return String type of question from get/post + */ + function findQuestionType($lc) { + $type = 'unknown'; + if (isset($lc->postvars['questionType'])) { + switch($lc->postvars['questionType']) { + case 'mchoice': + case 'QUESTION_MCHOICE': + $type = 'QUESTION_MCHOICE'; + break; + case 'manswer': + case 'QUESTION_MANSWER': + $type = 'QUESTION_MANSWER'; + break; + case 'matching': + case 'QUESTION_MATCHING': + $type = 'QUESTION_MATCHING'; + break; + + case 'truefalse': + case 'QUESTION_TRUEFALSE': + $type = 'QUESTION_TRUEFALSE'; + break; + + case 'essay': + case 'QUESTION_ESSAY': + $type = 'QUESTION_ESSAY'; + break; + + case 'fillinblank': + case 'QUESTION_FILLINBLANK': + $type = 'QUESTION_FILLINBLANK'; + break; + } + } else { + if (isset($lc->getvars['mc_submit'])) + $type = 'QUESTION_MCHOICE'; + if (isset($lc->getvars['ma_submit'])) + $type = 'QUESTION_MANSWER'; + if (isset($lc->getvars['mq_submit'])) + $type = 'QUESTION_MATCHING'; + + if (isset($lc->getvars['tf_submit'])) + $type = 'QUESTION_TRUEFALSE'; + + if (isset($lc->getvars['es_submit'])) + $type = 'QUESTION_ESSAY'; + + if (isset($lc->getvars['fb_submit'])) + $type = 'QUESTION_FILLINBLANK'; + } + + return $type; + } + + function getCodeForId($qTypeId) { + $qTypeId = (int)$qTypeId; + switch($qTypeId) { + case QUESTION_TRUEFALSE: + return 'QUESTION_TRUEFALSE'; + + case QUESTION_MCHOICE: + return 'QUESTION_MCHOICE'; + + case QUESTION_MANSWER: + return 'QUESTION_MANSWER'; + + case QUESTION_MATCHING: + return 'QUESTION_MATCHING'; + + case QUESTION_FILLINBLANK: + return 'QUESTION_FILLINBLANK'; + + case QUESTION_ESSAY: + return 'QUESTION_ESSAY'; + } + return 'unknown'; + } + + + function saveQuestionRun(&$db, &$u, &$lc, &$t) { + if (! is_object($u->sessionvars['test_obj']) ) { + $u->sessionvars['test_obj'] = new Lc_Lob_Test(); + } + + $type = $this->findQuestionType($lc); + + if ($type == 'unknown') { + $u->addSessionMessage('Unknown question type.','e'); + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/exam/'); + return; + } + $test =& $u->sessionvars['test_obj']; + $qidx = intval($lc->postvars['qidx']); + if ($qidx > -1) { + $questionList =& $test->questionObjs; + } else { + $qidx = count($questionList); + } + + //make a new quesiton, or update an existing one + $u->sessionvars['test_obj']->setQuestion($qidx,$lc->postvars['question_text'], $type); + + $test =& $u->sessionvars['test_obj']; + $correct = $lc->postvars['correct']; + + // store the image lob id + $u->sessionvars['test_obj']->questionObjs[$qidx]->imageContentId = $lc->postvars['imagesMenu']; + + //handle choices/lables and correct choices + foreach ($lc->postvars['labels'] as $lidx => $label) { + $isCorrect = FALSE; + if ($label == '') { continue; } + + if (is_array($correct) && in_array($lidx, array_keys($correct))) { + $isCorrect = TRUE; + } else { + $isCorrect = ($correct == (int)$lidx); + } + if (!$u->sessionvars['test_obj']->addLabel($label, $isCorrect, $qidx)) { + die('failed label. label = '.$label); + } + } + + //handle true/false questions differently (radio buttons) + if ($type == 'QUESTION_TRUEFALSE') { + //reset all to false + + $test->questionObjs[$qidx]->qstChoices[0]['correct'] = FALSE; + $test->questionObjs[$qidx]->qstChoices[0]['label'] = 'True'; + + $test->questionObjs[$qidx]->qstChoices[1]['correct'] = FALSE; + $test->questionObjs[$qidx]->qstChoices[1]['label'] = 'False'; + $lidx = (int)$lc->postvars['correct']; + $test->questionObjs[$qidx]->qstChoices[$lidx]['correct'] = TRUE; + } + + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/exam/'); + } + + /** + */ + function deleteQuestionRun(&$db, &$u, &$lc, &$t) { + + //load this question from the question array + if (isset($lc->getvars['qidx'])) { + unset($u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]); + } + + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/exam/'); + } + + + /** + * Commit the test in the session to the database + */ + function saveTestRun(&$db, &$u, &$lc, &$t) { +// debug($u->sessionvars['test_obj'],1); + $u->sessionvars['test_obj']->save(); + + $lobUserObj = new LobUserLink(); + $lobUserObj->set('lobRepoEntryId',$u->sessionvars['test_obj']->repoObj->getPrimaryKey()); + $lobUserObj->set('userId',$u->userId); + $lobUserObj->set('lobKind','activity'); + $lobUserObj->save(); + + $u->sessionvars['test_obj'] = NULL; + unset($u->sessionvars['test_obj']); + + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/myobj/'); + } + + + /** + * Change the points for one question + */ + function savePointsRun(&$db, &$u, &$lc, &$t) { + $pointList = $lc->postvars['points']; + $test =& $u->sessionvars['test_obj']; + + foreach ($pointList as $qidx => $p) { + if ((int)$p > 126) { $p = 126;} + if ( isset($test->questionObjs[$qidx])) + $test->questionObjs[$qidx]->qstPoints = (int)$p; + } + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/exam/'); + } + + /** + * Test function to view image blob from database + */ + function viewImageRun(&$db, &$u, &$lc, &$t) { + + $id = $lc->getvars['id']; + $db->query("SELECT * FROM lob_content WHERE lob_repo_entry_id = '$id' "); + if( $db->nextRecord() ){ + echo $db->record['lob_binary']; + } else { + $db->query("SELECT * FROM lob_class_content WHERE lob_repo_entry_id = '$id' "); + $db->nextRecord(); + echo $db->record['lob_binary']; + } + } +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fah...@us...> - 2009-02-27 10:07:17
|
Revision: 1281 http://logicampus.svn.sourceforge.net/logicampus/?rev=1281&view=rev Author: faheemkhan Date: 2009-02-27 10:07:13 +0000 (Fri, 27 Feb 2009) Log Message: ----------- faheemkhan - PU Tasks: removing the older version, does not handle image lob display in drop down Removed Paths: ------------- logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp Deleted: logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp 2009-02-18 09:18:20 UTC (rev 1280) +++ logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp 2009-02-27 10:07:13 UTC (rev 1281) @@ -1,306 +0,0 @@ -<?php - -include_once(LIB_PATH.'PBDO/LobContent.php'); -include_once(LIB_PATH.'PBDO/LobMetadata.php'); -include_once(LIB_PATH.'PBDO/LobUserLink.php'); -include_once(LIB_PATH.'AssessmentQuestion.php'); -include_once(LIB_PATH.'AssessmentLib.php'); - -include_once(LIB_PATH.'lob/lc_lob.php'); -include_once(LIB_PATH.'lob/lc_lob_test.php'); -include_once(LIB_PATH.'lc_table.php'); -include_once(LIB_PATH.'lc_table_renderer.php'); - -/** - * Learning Object Repository - */ -class Exam extends FacultyService { - - var $presentor='htmlPresentation'; - var $sectionTitle = 'Classroom Manager'; - var $navlinks = array ( - ''=>'' - ); - - - /** - * - */ - function run(&$db,&$u,&$lc,&$t) { - $lc->templateName = 'exam_main'; - $lobId = intval($lc->postvars['lob_id']); - - if (! is_object($u->sessionvars['test_obj']) ) { - $test = new Lc_Lob_Test($lobId); - $test->setTitle( $lc->postvars['title']); - $test->setInstructions( $lc->postvars['instructions']); - $test->loadQuestions(); - $t['testId'] = $test->get('lobRepoEntryId'); - $u->sessionvars['test_obj'] = $test; - } else { - $test = $u->sessionvars['test_obj']; - } - - $t['questionList'] = $u->sessionvars['test_obj']->questionObjs; - - - $totalPoints = 0; - foreach ($t['questionList'] as $q) { - $totalPoints += (int) $q->qstPoints; - } - $t['questions_total_points'] = sprintf('%d', $totalPoints); - $t['questions_count'] = sprintf('%d', $u->sessionvars['test_obj']->getQuestionCount()); - } - - - /** - */ - function editQuestionRun(&$db, &$u, &$lc, &$t) { - - //load this question from the question array - if (isset($lc->getvars['qidx'])) { - $t['q'] = $u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]; - $t['qidx'] = intval($lc->getvars['qidx']); - } else { - $t['q'] = new LobTestQst(); - $t['q']->qstChoices = array(); - $t['qidx'] = -1; - if ($qCode == 'QUESTION_TRUEFALSE') { - $t['q']->qstChoices = array( array('label'=>'True'), array('label'=>'False')); - } - } - - $qTypeId = $t['q']->questionTypeId; - if (!$qTypeId) { - $qCode = $this->findQuestionType($lc); - } else { - $qCode = $this->getCodeForId($qTypeId); - } - - $t['questionType'] = $qCode; - - $lc->templateName=$this->getTemplateName($qCode); - } - - /** - * Helper function to translate a qestion type into a filename. - * - * @return String filename of template for this quesiton type - */ - function getTemplateName($qCode) { - switch ($qCode) { - case 'QUESTION_MCHOICE'; - return 'exam_question_mchoice'; - - case 'QUESTION_MANSWER'; - return 'exam_question_manswer'; - - case 'QUESTION_MATCHING'; - return 'exam_question_matching'; - - case 'QUESTION_TRUEFALSE'; - return 'exam_question_truefalse'; - - case 'QUESTION_ESSAY'; - return 'exam_question_essay'; - - case 'QUESTION_FILLINBLANK': - return 'exam_question_fillinblank'; - } - } - /** - * Helper function to inspect the get/post vars for a question type. - * - * @return String type of question from get/post - */ - function findQuestionType($lc) { - $type = 'unknown'; - if (isset($lc->postvars['questionType'])) { - switch($lc->postvars['questionType']) { - case 'mchoice': - case 'QUESTION_MCHOICE': - $type = 'QUESTION_MCHOICE'; - break; - case 'manswer': - case 'QUESTION_MANSWER': - $type = 'QUESTION_MANSWER'; - break; - case 'matching': - case 'QUESTION_MATCHING': - $type = 'QUESTION_MATCHING'; - break; - - case 'truefalse': - case 'QUESTION_TRUEFALSE': - $type = 'QUESTION_TRUEFALSE'; - break; - - case 'essay': - case 'QUESTION_ESSAY': - $type = 'QUESTION_ESSAY'; - break; - - case 'fillinblank': - case 'QUESTION_FILLINBLANK': - $type = 'QUESTION_FILLINBLANK'; - break; - } - } else { - if (isset($lc->getvars['mc_submit'])) - $type = 'QUESTION_MCHOICE'; - if (isset($lc->getvars['ma_submit'])) - $type = 'QUESTION_MANSWER'; - if (isset($lc->getvars['mq_submit'])) - $type = 'QUESTION_MATCHING'; - - if (isset($lc->getvars['tf_submit'])) - $type = 'QUESTION_TRUEFALSE'; - - if (isset($lc->getvars['es_submit'])) - $type = 'QUESTION_ESSAY'; - - if (isset($lc->getvars['fb_submit'])) - $type = 'QUESTION_FILLINBLANK'; - } - - return $type; - } - - function getCodeForId($qTypeId) { - $qTypeId = (int)$qTypeId; - switch($qTypeId) { - case QUESTION_TRUEFALSE: - return 'QUESTION_TRUEFALSE'; - - case QUESTION_MCHOICE: - return 'QUESTION_MCHOICE'; - - case QUESTION_MANSWER: - return 'QUESTION_MANSWER'; - - case QUESTION_MATCHING: - return 'QUESTION_MATCHING'; - - case QUESTION_FILLINBLANK: - return 'QUESTION_FILLINBLANK'; - - case QUESTION_ESSAY: - return 'QUESTION_ESSAY'; - } - return 'unknown'; - } - - - function saveQuestionRun(&$db, &$u, &$lc, &$t) { - if (! is_object($u->sessionvars['test_obj']) ) { - $u->sessionvars['test_obj'] = new Lc_Lob_Test(); - } - - $type = $this->findQuestionType($lc); - - if ($type == 'unknown') { - $u->addSessionMessage('Unknown question type.','e'); - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/exam/'); - return; - } - $test =& $u->sessionvars['test_obj']; - $qidx = intval($lc->postvars['qidx']); - if ($qidx > -1) { - $questionList =& $test->questionObjs; - } else { - $qidx = count($questionList); - } - - //make a new quesiton, or update an existing one - $u->sessionvars['test_obj']->setQuestion($qidx,$lc->postvars['question_text'], $type); - - $test =& $u->sessionvars['test_obj']; - $correct = $lc->postvars['correct']; - - //handle choices/lables and correct choices - foreach ($lc->postvars['labels'] as $lidx => $label) { - $isCorrect = FALSE; - if ($label == '') { continue; } - - if (is_array($correct) && in_array($lidx, array_keys($correct))) { - $isCorrect = TRUE; - } else { - $isCorrect = ($correct == (int)$lidx); - } - if (!$u->sessionvars['test_obj']->addLabel($label, $isCorrect, $qidx)) { - die('failed label. label = '.$label); - } - } - - //handle true/false questions differently (radio buttons) - if ($type == 'QUESTION_TRUEFALSE') { - //reset all to false - - $test->questionObjs[$qidx]->qstChoices[0]['correct'] = FALSE; - $test->questionObjs[$qidx]->qstChoices[0]['label'] = 'True'; - - $test->questionObjs[$qidx]->qstChoices[1]['correct'] = FALSE; - $test->questionObjs[$qidx]->qstChoices[1]['label'] = 'False'; - $lidx = (int)$lc->postvars['correct']; - $test->questionObjs[$qidx]->qstChoices[$lidx]['correct'] = TRUE; - } - - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/exam/'); - } - - - /** - */ - function deleteQuestionRun(&$db, &$u, &$lc, &$t) { - - //load this question from the question array - if (isset($lc->getvars['qidx'])) { - unset($u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]); - } - - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/exam/'); - } - - - /** - * Commit the test in the session to the database - */ - function saveTestRun(&$db, &$u, &$lc, &$t) { -// debug($u->sessionvars['test_obj'],1); - $u->sessionvars['test_obj']->save(); - - $lobUserObj = new LobUserLink(); - $lobUserObj->set('lobRepoEntryId',$u->sessionvars['test_obj']->repoObj->getPrimaryKey()); - $lobUserObj->set('userId',$u->userId); - $lobUserObj->set('lobKind','activity'); - $lobUserObj->save(); - - $u->sessionvars['test_obj'] = NULL; - unset($u->sessionvars['test_obj']); - - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/myobj/'); - } - - - /** - * Change the points for one question - */ - function savePointsRun(&$db, &$u, &$lc, &$t) { - $pointList = $lc->postvars['points']; - $test =& $u->sessionvars['test_obj']; - - foreach ($pointList as $qidx => $p) { - if ((int)$p > 126) { $p = 126;} - if ( isset($test->questionObjs[$qidx])) - $test->questionObjs[$qidx]->qstPoints = (int)$p; - } - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/exam/'); - } -} - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2009-02-18 09:18:24
|
Revision: 1280 http://logicampus.svn.sourceforge.net/logicampus/?rev=1280&view=rev Author: dewrax Date: 2009-02-18 09:18:20 +0000 (Wed, 18 Feb 2009) Log Message: ----------- Fixed: Fill in the Blanks template issue Added Paths: ----------- logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp Added: logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp (rev 0) +++ logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp 2009-02-18 09:18:20 UTC (rev 1280) @@ -0,0 +1,306 @@ +<?php + +include_once(LIB_PATH.'PBDO/LobContent.php'); +include_once(LIB_PATH.'PBDO/LobMetadata.php'); +include_once(LIB_PATH.'PBDO/LobUserLink.php'); +include_once(LIB_PATH.'AssessmentQuestion.php'); +include_once(LIB_PATH.'AssessmentLib.php'); + +include_once(LIB_PATH.'lob/lc_lob.php'); +include_once(LIB_PATH.'lob/lc_lob_test.php'); +include_once(LIB_PATH.'lc_table.php'); +include_once(LIB_PATH.'lc_table_renderer.php'); + +/** + * Learning Object Repository + */ +class Exam extends FacultyService { + + var $presentor='htmlPresentation'; + var $sectionTitle = 'Classroom Manager'; + var $navlinks = array ( + ''=>'' + ); + + + /** + * + */ + function run(&$db,&$u,&$lc,&$t) { + $lc->templateName = 'exam_main'; + $lobId = intval($lc->postvars['lob_id']); + + if (! is_object($u->sessionvars['test_obj']) ) { + $test = new Lc_Lob_Test($lobId); + $test->setTitle( $lc->postvars['title']); + $test->setInstructions( $lc->postvars['instructions']); + $test->loadQuestions(); + $t['testId'] = $test->get('lobRepoEntryId'); + $u->sessionvars['test_obj'] = $test; + } else { + $test = $u->sessionvars['test_obj']; + } + + $t['questionList'] = $u->sessionvars['test_obj']->questionObjs; + + + $totalPoints = 0; + foreach ($t['questionList'] as $q) { + $totalPoints += (int) $q->qstPoints; + } + $t['questions_total_points'] = sprintf('%d', $totalPoints); + $t['questions_count'] = sprintf('%d', $u->sessionvars['test_obj']->getQuestionCount()); + } + + + /** + */ + function editQuestionRun(&$db, &$u, &$lc, &$t) { + + //load this question from the question array + if (isset($lc->getvars['qidx'])) { + $t['q'] = $u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]; + $t['qidx'] = intval($lc->getvars['qidx']); + } else { + $t['q'] = new LobTestQst(); + $t['q']->qstChoices = array(); + $t['qidx'] = -1; + if ($qCode == 'QUESTION_TRUEFALSE') { + $t['q']->qstChoices = array( array('label'=>'True'), array('label'=>'False')); + } + } + + $qTypeId = $t['q']->questionTypeId; + if (!$qTypeId) { + $qCode = $this->findQuestionType($lc); + } else { + $qCode = $this->getCodeForId($qTypeId); + } + + $t['questionType'] = $qCode; + + $lc->templateName=$this->getTemplateName($qCode); + } + + /** + * Helper function to translate a qestion type into a filename. + * + * @return String filename of template for this quesiton type + */ + function getTemplateName($qCode) { + switch ($qCode) { + case 'QUESTION_MCHOICE'; + return 'exam_question_mchoice'; + + case 'QUESTION_MANSWER'; + return 'exam_question_manswer'; + + case 'QUESTION_MATCHING'; + return 'exam_question_matching'; + + case 'QUESTION_TRUEFALSE'; + return 'exam_question_truefalse'; + + case 'QUESTION_ESSAY'; + return 'exam_question_essay'; + + case 'QUESTION_FILLINBLANK': + return 'exam_question_fillinblank'; + } + } + /** + * Helper function to inspect the get/post vars for a question type. + * + * @return String type of question from get/post + */ + function findQuestionType($lc) { + $type = 'unknown'; + if (isset($lc->postvars['questionType'])) { + switch($lc->postvars['questionType']) { + case 'mchoice': + case 'QUESTION_MCHOICE': + $type = 'QUESTION_MCHOICE'; + break; + case 'manswer': + case 'QUESTION_MANSWER': + $type = 'QUESTION_MANSWER'; + break; + case 'matching': + case 'QUESTION_MATCHING': + $type = 'QUESTION_MATCHING'; + break; + + case 'truefalse': + case 'QUESTION_TRUEFALSE': + $type = 'QUESTION_TRUEFALSE'; + break; + + case 'essay': + case 'QUESTION_ESSAY': + $type = 'QUESTION_ESSAY'; + break; + + case 'fillinblank': + case 'QUESTION_FILLINBLANK': + $type = 'QUESTION_FILLINBLANK'; + break; + } + } else { + if (isset($lc->getvars['mc_submit'])) + $type = 'QUESTION_MCHOICE'; + if (isset($lc->getvars['ma_submit'])) + $type = 'QUESTION_MANSWER'; + if (isset($lc->getvars['mq_submit'])) + $type = 'QUESTION_MATCHING'; + + if (isset($lc->getvars['tf_submit'])) + $type = 'QUESTION_TRUEFALSE'; + + if (isset($lc->getvars['es_submit'])) + $type = 'QUESTION_ESSAY'; + + if (isset($lc->getvars['fb_submit'])) + $type = 'QUESTION_FILLINBLANK'; + } + + return $type; + } + + function getCodeForId($qTypeId) { + $qTypeId = (int)$qTypeId; + switch($qTypeId) { + case QUESTION_TRUEFALSE: + return 'QUESTION_TRUEFALSE'; + + case QUESTION_MCHOICE: + return 'QUESTION_MCHOICE'; + + case QUESTION_MANSWER: + return 'QUESTION_MANSWER'; + + case QUESTION_MATCHING: + return 'QUESTION_MATCHING'; + + case QUESTION_FILLINBLANK: + return 'QUESTION_FILLINBLANK'; + + case QUESTION_ESSAY: + return 'QUESTION_ESSAY'; + } + return 'unknown'; + } + + + function saveQuestionRun(&$db, &$u, &$lc, &$t) { + if (! is_object($u->sessionvars['test_obj']) ) { + $u->sessionvars['test_obj'] = new Lc_Lob_Test(); + } + + $type = $this->findQuestionType($lc); + + if ($type == 'unknown') { + $u->addSessionMessage('Unknown question type.','e'); + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/exam/'); + return; + } + $test =& $u->sessionvars['test_obj']; + $qidx = intval($lc->postvars['qidx']); + if ($qidx > -1) { + $questionList =& $test->questionObjs; + } else { + $qidx = count($questionList); + } + + //make a new quesiton, or update an existing one + $u->sessionvars['test_obj']->setQuestion($qidx,$lc->postvars['question_text'], $type); + + $test =& $u->sessionvars['test_obj']; + $correct = $lc->postvars['correct']; + + //handle choices/lables and correct choices + foreach ($lc->postvars['labels'] as $lidx => $label) { + $isCorrect = FALSE; + if ($label == '') { continue; } + + if (is_array($correct) && in_array($lidx, array_keys($correct))) { + $isCorrect = TRUE; + } else { + $isCorrect = ($correct == (int)$lidx); + } + if (!$u->sessionvars['test_obj']->addLabel($label, $isCorrect, $qidx)) { + die('failed label. label = '.$label); + } + } + + //handle true/false questions differently (radio buttons) + if ($type == 'QUESTION_TRUEFALSE') { + //reset all to false + + $test->questionObjs[$qidx]->qstChoices[0]['correct'] = FALSE; + $test->questionObjs[$qidx]->qstChoices[0]['label'] = 'True'; + + $test->questionObjs[$qidx]->qstChoices[1]['correct'] = FALSE; + $test->questionObjs[$qidx]->qstChoices[1]['label'] = 'False'; + $lidx = (int)$lc->postvars['correct']; + $test->questionObjs[$qidx]->qstChoices[$lidx]['correct'] = TRUE; + } + + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/exam/'); + } + + + /** + */ + function deleteQuestionRun(&$db, &$u, &$lc, &$t) { + + //load this question from the question array + if (isset($lc->getvars['qidx'])) { + unset($u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]); + } + + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/exam/'); + } + + + /** + * Commit the test in the session to the database + */ + function saveTestRun(&$db, &$u, &$lc, &$t) { +// debug($u->sessionvars['test_obj'],1); + $u->sessionvars['test_obj']->save(); + + $lobUserObj = new LobUserLink(); + $lobUserObj->set('lobRepoEntryId',$u->sessionvars['test_obj']->repoObj->getPrimaryKey()); + $lobUserObj->set('userId',$u->userId); + $lobUserObj->set('lobKind','activity'); + $lobUserObj->save(); + + $u->sessionvars['test_obj'] = NULL; + unset($u->sessionvars['test_obj']); + + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/myobj/'); + } + + + /** + * Change the points for one question + */ + function savePointsRun(&$db, &$u, &$lc, &$t) { + $pointList = $lc->postvars['points']; + $test =& $u->sessionvars['test_obj']; + + foreach ($pointList as $qidx => $p) { + if ((int)$p > 126) { $p = 126;} + if ( isset($test->questionObjs[$qidx])) + $test->questionObjs[$qidx]->qstPoints = (int)$p; + } + $this->presentor = 'redirectPresentation'; + $t['url'] = appurl('lobrepo/exam/'); + } +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2009-02-18 09:16:31
|
Revision: 1279 http://logicampus.svn.sourceforge.net/logicampus/?rev=1279&view=rev Author: dewrax Date: 2009-02-18 09:16:25 +0000 (Wed, 18 Feb 2009) Log Message: ----------- Removing file to add the fix where Fill in the Blanks questions do not show Add/Edit template Removed Paths: ------------- logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp Deleted: logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp 2008-10-29 11:32:49 UTC (rev 1278) +++ logicampus/trunk/src/logicreate/services/lobrepo/exam.lcp 2009-02-18 09:16:25 UTC (rev 1279) @@ -1,295 +0,0 @@ -<?php - -include_once(LIB_PATH.'PBDO/LobContent.php'); -include_once(LIB_PATH.'PBDO/LobMetadata.php'); -include_once(LIB_PATH.'PBDO/LobUserLink.php'); -include_once(LIB_PATH.'AssessmentQuestion.php'); -include_once(LIB_PATH.'AssessmentLib.php'); - -include_once(LIB_PATH.'lob/lc_lob.php'); -include_once(LIB_PATH.'lob/lc_lob_test.php'); -include_once(LIB_PATH.'lc_table.php'); -include_once(LIB_PATH.'lc_table_renderer.php'); - -/** - * Learning Object Repository - */ -class Exam extends FacultyService { - - var $presentor='htmlPresentation'; - var $sectionTitle = 'Classroom Manager'; - var $navlinks = array ( - ''=>'' - ); - - - /** - * - */ - function run(&$db,&$u,&$lc,&$t) { - $lc->templateName = 'exam_main'; - $lobId = intval($lc->postvars['lob_id']); - - if (! is_object($u->sessionvars['test_obj']) ) { - $test = new Lc_Lob_Test($lobId); - $test->setTitle( $lc->postvars['title']); - $test->setInstructions( $lc->postvars['instructions']); - $test->loadQuestions(); - $t['testId'] = $test->get('lobRepoEntryId'); - $u->sessionvars['test_obj'] = $test; - } else { - $test = $u->sessionvars['test_obj']; - } - - $t['questionList'] = $u->sessionvars['test_obj']->questionObjs; - - - $totalPoints = 0; - foreach ($t['questionList'] as $q) { - $totalPoints += (int) $q->qstPoints; - } - $t['questions_total_points'] = sprintf('%d', $totalPoints); - $t['questions_count'] = sprintf('%d', $u->sessionvars['test_obj']->getQuestionCount()); - } - - - /** - */ - function editQuestionRun(&$db, &$u, &$lc, &$t) { - - //load this question from the question array - if (isset($lc->getvars['qidx'])) { - $t['q'] = $u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]; - $t['qidx'] = intval($lc->getvars['qidx']); - } else { - $t['q'] = new LobTestQst(); - $t['q']->qstChoices = array(); - $t['qidx'] = -1; - if ($qCode == 'QUESTION_TRUEFALSE') { - $t['q']->qstChoices = array( array('label'=>'True'), array('label'=>'False')); - } - } - - $qTypeId = $t['q']->questionTypeId; - if (!$qTypeId) { - $qCode = $this->findQuestionType($lc); - } else { - $qCode = $this->getCodeForId($qTypeId); - } - - $t['questionType'] = $qCode; - - $lc->templateName=$this->getTemplateName($qCode); - } - - /** - * Helper function to translate a qestion type into a filename. - * - * @return String filename of template for this quesiton type - */ - function getTemplateName($qCode) { - switch ($qCode) { - case 'QUESTION_MCHOICE'; - return 'exam_question_mchoice'; - - case 'QUESTION_MANSWER'; - return 'exam_question_manswer'; - - case 'QUESTION_MATCHING'; - return 'exam_question_matching'; - - case 'QUESTION_TRUEFALSE'; - return 'exam_question_truefalse'; - - case 'QUESTION_ESSAY'; - return 'exam_question_essay'; - } - } - /** - * Helper function to inspect the get/post vars for a question type. - * - * @return String type of question from get/post - */ - function findQuestionType($lc) { - $type = 'unknown'; - if (isset($lc->postvars['questionType'])) { - switch($lc->postvars['questionType']) { - case 'mchoice': - case 'QUESTION_MCHOICE': - $type = 'QUESTION_MCHOICE'; - break; - case 'manswer': - case 'QUESTION_MANSWER': - $type = 'QUESTION_MANSWER'; - break; - case 'matching': - case 'QUESTION_MATCHING': - $type = 'QUESTION_MATCHING'; - break; - - case 'truefalse': - case 'QUESTION_TRUEFALSE': - $type = 'QUESTION_TRUEFALSE'; - break; - - case 'essay': - case 'QUESTION_ESSAY': - $type = 'QUESTION_ESSAY'; - break; - } - } else { - if (isset($lc->getvars['mc_submit'])) - $type = 'QUESTION_MCHOICE'; - if (isset($lc->getvars['ma_submit'])) - $type = 'QUESTION_MANSWER'; - if (isset($lc->getvars['mq_submit'])) - $type = 'QUESTION_MATCHING'; - - if (isset($lc->getvars['tf_submit'])) - $type = 'QUESTION_TRUEFALSE'; - - if (isset($lc->getvars['es_submit'])) - $type = 'QUESTION_ESSAY'; - } - - return $type; - } - - function getCodeForId($qTypeId) { - $qTypeId = (int)$qTypeId; - switch($qTypeId) { - case QUESTION_TRUEFALSE: - return 'QUESTION_TRUEFALSE'; - - case QUESTION_MCHOICE: - return 'QUESTION_MCHOICE'; - - case QUESTION_MANSWER: - return 'QUESTION_MANSWER'; - - case QUESTION_MATCHING: - return 'QUESTION_MATCHING'; - - case QUESTION_FILLINBLANK: - return 'QUESTION_FILLINBLANK'; - - case QUESTION_ESSAY: - return 'QUESTION_ESSAY'; - } - return 'unknown'; - } - - - function saveQuestionRun(&$db, &$u, &$lc, &$t) { - if (! is_object($u->sessionvars['test_obj']) ) { - $u->sessionvars['test_obj'] = new Lc_Lob_Test(); - } - - $type = $this->findQuestionType($lc); - - if ($type == 'unknown') { - $u->addSessionMessage('Unknown question type.','e'); - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/exam/'); - return; - } - $test =& $u->sessionvars['test_obj']; - $qidx = intval($lc->postvars['qidx']); - if ($qidx > -1) { - $questionList =& $test->questionObjs; - } else { - $qidx = count($questionList); - } - - //make a new quesiton, or update an existing one - $u->sessionvars['test_obj']->setQuestion($qidx,$lc->postvars['question_text'], $type); - - $test =& $u->sessionvars['test_obj']; - $correct = $lc->postvars['correct']; - - //handle choices/lables and correct choices - foreach ($lc->postvars['labels'] as $lidx => $label) { - $isCorrect = FALSE; - if ($label == '') { continue; } - - if (is_array($correct) && in_array($lidx, array_keys($correct))) { - $isCorrect = TRUE; - } else { - $isCorrect = ($correct == (int)$lidx); - } - if (!$u->sessionvars['test_obj']->addLabel($label, $isCorrect, $qidx)) { - die('failed label. label = '.$label); - } - } - - //handle true/false questions differently (radio buttons) - if ($type == 'QUESTION_TRUEFALSE') { - //reset all to false - - $test->questionObjs[$qidx]->qstChoices[0]['correct'] = FALSE; - $test->questionObjs[$qidx]->qstChoices[0]['label'] = 'True'; - - $test->questionObjs[$qidx]->qstChoices[1]['correct'] = FALSE; - $test->questionObjs[$qidx]->qstChoices[1]['label'] = 'False'; - $lidx = (int)$lc->postvars['correct']; - $test->questionObjs[$qidx]->qstChoices[$lidx]['correct'] = TRUE; - } - - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/exam/'); - } - - - /** - */ - function deleteQuestionRun(&$db, &$u, &$lc, &$t) { - - //load this question from the question array - if (isset($lc->getvars['qidx'])) { - unset($u->sessionvars['test_obj']->questionObjs[$lc->getvars['qidx']]); - } - - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/exam/'); - } - - - /** - * Commit the test in the session to the database - */ - function saveTestRun(&$db, &$u, &$lc, &$t) { -// debug($u->sessionvars['test_obj'],1); - $u->sessionvars['test_obj']->save(); - - $lobUserObj = new LobUserLink(); - $lobUserObj->set('lobRepoEntryId',$u->sessionvars['test_obj']->repoObj->getPrimaryKey()); - $lobUserObj->set('userId',$u->userId); - $lobUserObj->set('lobKind','activity'); - $lobUserObj->save(); - - $u->sessionvars['test_obj'] = NULL; - unset($u->sessionvars['test_obj']); - - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/myobj/'); - } - - - /** - * Change the points for one question - */ - function savePointsRun(&$db, &$u, &$lc, &$t) { - $pointList = $lc->postvars['points']; - $test =& $u->sessionvars['test_obj']; - - foreach ($pointList as $qidx => $p) { - if ((int)$p > 126) { $p = 126;} - if ( isset($test->questionObjs[$qidx])) - $test->questionObjs[$qidx]->qstPoints = (int)$p; - } - $this->presentor = 'redirectPresentation'; - $t['url'] = appurl('lobrepo/exam/'); - } -} - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-10-29 12:22:44
|
Revision: 1278 http://logicampus.svn.sourceforge.net/logicampus/?rev=1278&view=rev Author: dewrax Date: 2008-10-29 11:32:49 +0000 (Wed, 29 Oct 2008) Log Message: ----------- User: dewrax (PU Tasks) Dated: Oct 29, 08 Added Paths: ----------- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_matching.html Added: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_matching.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_matching.html (rev 0) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_matching.html 2008-10-29 11:32:49 UTC (rev 1278) @@ -0,0 +1,103 @@ +<?=$t['sectionheader'];?> + +<?=$t['error'];?> +<FIELDSET> +<LEGEND> +<b>Help</b> +</LEGEND> +Enter your questions in the left column and your answers in the right column. Answers will automatically be sorted for you when you preview on the next page. Questions will remain in the order you entered them. Each time you update this question the answers will be randomly sorted. +</FIELDSET> +<form method="POST" action="<?=modurl('question/event=save/id='.$t['id'].'/type='.$t['questionType']);?>"> + <table border="0" width="100%"> + <tr> + <td> </td> + <td colspan=2> + *<b>Instructions</b><br /> + <textarea rows="5" cols="50" name="questionText" <?= $t['disableFlag'];?>><?=$t['q']->questionText;?></textarea> + </td> + </tr> + <tr> + <td colspan=3> </td> + </tr> + <tr> + <td> </td> + <td><b>Questions (or definitions)</b></td> + <td><b>Answers (or terms)</b></td> + </tr> + <? for ($x=0;$x<20;++$x) { ?> + <? $qc = $t['q']->questionChoices[$x]; ?> + <tr> + <td align="right" valign="center"> + <? if ($x <= 1) {echo '*';} else { echo ' '; } ?> + <? printf('%d',$x+1);?>. + </td> + <td valign="center"> + <input name="labels[<?=$x;?>]" type="text" value="<?=$qc->label;?>" size="40" <?= $t['disableFlag'];?>> + </td> + <td> + <? $x <= 1 ? '*' : ''; ?> + <input name="correct[<?=$x?>]" value="<?=$qc->correct?>" size="20"> + </td> + </tr> + <? } ?> + + <tr> + <td colspan=3> + +<style> + + div.over { + overflow: scroll; + height: 220px; + width: 240px; + } + +</style> + <FIELDSET valign="middle" style="width: 235px; height: 245px; padding: 2px;"> + + <select name="fileHash" + style="width: 235px;" + onChange="document.getElementById('previewfile').src='<?=appurl('classroom/viewContent/fhash=');?>' + this.value;" + > + <option value="">Select Image</option> +<?php + foreach($t['images'] as $myIzimage) + { + echo ' + <option value="'.$myIzimage['daHasha'].'"'. + ($t['q']->fileHash == $myIzimage['daHasha'] ? ' SELECTED' : '').'>'. + $myIzimage['displayname'].'</option>'; + } + +?> + </select> + + + <div class="over" align="center" valign="middle"> + <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> + <tr> + + <td valign="middle" align="center" height="100%" width="100%"> + <img alt="" src="<?= $t['q']->fileHash ? appurl('classroom/viewContent/fhash=').$t['q']->fileHash : IMAGES_URL.'spacer.gif'; ?>" id="previewfile"> + + + </td> + </tr> + </table> + </div> + + </FIELDSET> + </td> + </tr> + + <tr> + <td> </td> + <td> + <input type="submit" name="submit" value="Save ->"> + <input type="hidden" name="event" value="save"> + </td> + </tr> + </table> +</form> + +<p>* denotes a required field.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-10-29 12:22:33
|
Revision: 1277 http://logicampus.svn.sourceforge.net/logicampus/?rev=1277&view=rev Author: dewrax Date: 2008-10-29 11:30:59 +0000 (Wed, 29 Oct 2008) Log Message: ----------- user: dewrax (PU Tasks) Dated: Oct 29,08 Added Paths: ----------- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html Added: logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html =================================================================== --- logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html (rev 0) +++ logicampus/trunk/src/logicreate/services/lobrepo/templates/exam_question_fillinblank.html 2008-10-29 11:30:59 UTC (rev 1277) @@ -0,0 +1,113 @@ +<?=$t['sectionheader'];?> + +<?=$t['error'];?> +<form method="POST"> + <table border="0" width="600"> + <tr> + <td valign="top">*<b>Question</b></td> + <td><textarea rows="5" cols="50" name="questionText"><?=$t['q']->questionText;?></textarea></td> + </tr> + <tr> + <td width="12"> + <b>Answer</b> + </td> + <td width="100"> + <input name="labels[0]" type="text" value="<?=$t['q']->questionChoices[0]->label;?>"> + </td> + </tr> + <tr> + <td colspan=2 height=25> </td> + </tr> + <tr> + <td> + + </td> + <td> + <b>Alternate Answer Help</b> + <br> + If you would like to enter alternate answers that you will accept, enter them + below. Example: If the if you are looking for the president of the U.S. and + the student enters 'George Washington' which is the correct answer. However, + another student enters just 'Washington'. If you have 'Washington' as an + alternate answer below, the student will receive credit for their entry. + </td> + </tr> + <tr> + <td valign="top"> + <b>Alternate Answers</b> + </td> + <td valign="top" width="100"> + <table border=0 cellpadding=2 cellspacing=0> + <? for ($x=1;$x<11;++$x) { ?> + <? $qc = $t['q']->questionChoices[$x]; ?> + <tr> + <td><? printf('%d',$x);?>.</td> + <td><? $x <= 1 ? '*' : ''; ?> + <input name="labels[<?=$x;?>]" type="text" value="<?=$qc->label;?>"></td> + </tr> + <? } ?> + </table> + </td> + </tr> + <tr> + <td> </td> + <td colspan=2> +<style> + + div.over { + overflow: scroll; + height: 220px; + width: 240px; + } + +</style> + <FIELDSET valign="middle" style="width: 235px; height: 245px; padding: 2px;"> + + <select name="fileHash" + style="width: 235px;" + onChange="document.getElementById('previewfile').src='<?=appurl('classroom/viewContent/fhash=');?>' + this.value;" + > + <option value="">Select Image</option> +<?php + foreach($t['images'] as $myIzimage) + { + echo ' + <option value="'.$myIzimage['daHasha'].'"'. + ($t['q']->fileHash == $myIzimage['daHasha'] ? ' SELECTED' : '').'>'. + $myIzimage['displayname'].'</option>'; + } + +?> + </select> + + + <div class="over" align="center" valign="middle"> + <table cellpadding="2" cellspacing="0" border="0" width="100%" height="100%"> + <tr> + + <td valign="middle" align="center" height="100%" width="100%"> + <img alt="" src="<?= $t['q']->fileHash ? appurl('classroom/viewContent/fhash=').$t['q']->fileHash : IMAGES_URL.'spacer.gif'; ?>" id="previewfile"> + + + </td> + </tr> + </table> + </div> + + </FIELDSET> + + </td> + </tr> + <tr> + <td> + + </td> + <td> + <input type="submit" value="Continue->"> + <input type="hidden" name="event" value="save"> + </form> + </td> + </tr> + </table> + +<p>* denotes a required field.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Mark K <har...@us...> - 2008-08-13 22:08:26
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31525/logicreate/lib Modified Files: LC_include.php Log Message: Change the way errors are displayed so that it doesn't put HTML before the start HTML tag. Index: LC_include.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/LC_include.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** LC_include.php 8 Oct 2007 14:35:28 -0000 1.38 --- LC_include.php 13 Aug 2008 22:08:22 -0000 1.39 *************** *** 287,292 **** $obj->menu = menuObj::getVisibleCached($obj->user->groups); - # Shopping cart menu - #shop::getMenu($obj->menu,$t['cart']); #CART /***** * Faculty classes taught --- 287,290 ---- *************** *** 311,314 **** --- 309,315 ---- */ + //log errors + lcSystem::logErrors(); + /***** * Private Messages *************** *** 328,339 **** } ! if (defined('DEBUG') && DEBUG) { ! $e =& ErrorStack::_singleton(); ! if ($e->count) { ! echo <<<END <form id="errorbox"> ! <div style="position:absolute;top:80px;left:70px;padding:3px;width:40em;background-color:#C0C0C0;border-style:outset"> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> --- 329,368 ---- } ! } ! ! function logErrors() { ! if ((defined('DEBUG') && !DEBUG) || !defined('DEBUG')) { ! $e =& ErrorStack::_singleton(); ! if ($e->count) { ! $errlog = ErrorStack::logStack(); ! $date = date('m-d-Y'); ! $time = time(); ! $u = lcUser::getCurrentUser(); ! $log = $time.':'.$u->username.':' . base64_encode($errlog); ! $touch = 0; ! system("touch /tmp/lcerrlog/$date.log",$touch); ! if ($touch) { ! system("mkdir /tmp/lcerrlog/"); ! system("touch /tmp/lcerrlog/$date.log",$touch); ! } ! system("echo $log >> /tmp/lcerrlog/$date.log"); ! } ! } ! } ! ! function getErrorBox() { ! ! if ((defined('DEBUG') && !DEBUG) || !defined('DEBUG')) { ! return; ! } ! $e =& ErrorStack::_singleton(); ! if (!$e->count) { ! return; ! } ! echo <<<END <form id="errorbox"> ! <div style="position:absolute;top:80px;left:70px;padding:3px;width:50em;background-color:#C0C0C0;border-style:outset"> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> *************** *** 403,432 **** END; - - $errlog = ErrorStack::logStack(); - //add your own email name here - //mail('er...@ow...','ERRORS ON CAMPUS',$errlog); - unset($errlog); - } - } else { - $e =& ErrorStack::_singleton(); - if ($e->count) { - $errlog = ErrorStack::logStack(); - $date = date('m-d-Y'); - $time = time(); - $u = lcUser::getCurrentUser(); - $log = $time.':'.$u->username.':' . base64_encode($errlog); - $touch = 0; - system("touch /tmp/lcerrlog/$date.log",$touch); - if ($touch) { - system("mkdir /tmp/lcerrlog/"); - system("touch /tmp/lcerrlog/$date.log",$touch); - } - system("echo $log >> /tmp/lcerrlog/$date.log"); - } - } - } - } --- 432,436 ---- |
From: Mark K <har...@us...> - 2008-08-13 22:08:26
|
Update of /cvsroot/logicampus/logicampus/src/public_html/templates/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31525/public_html/templates/default Modified Files: header.html.php Log Message: Change the way errors are displayed so that it doesn't put HTML before the start HTML tag. Index: header.html.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/public_html/templates/default/header.html.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** header.html.php 16 Nov 2006 20:51:30 -0000 1.2 --- header.html.php 13 Aug 2008 22:08:22 -0000 1.3 *************** *** 47,76 **** ! <? if ($t['lc_message']) { ?> ! <!-- div layover for messages should go here --> ! <div class="notice" id="lc_warning"> ! <div style="float:right;margin-right:5px;border-width:2px;border-style:solid;margin-top:3px;" ! onclick="document.getElementById('lc_warning').style.visibility='hidden';">X</div> ! <b><?= $t['lc_message'];?></b> ! <br/> ! <?= $t['lc_message_details'];?> ! <br/> ! <br/> ! </div> ! <? } ?> - <? if ($t['lc_warning']) { ?> - <!-- div layover for messages should go here --> - <div class="warning" id="lc_warning"> - <div style="float:right;margin-right:5px;border-width:2px;border-style:solid;margin-top:3px;" - onclick="document.getElementById('lc_warning').style.visibility='hidden';">X</div> - <b><?= $t['lc_warning'];?></b> - <br/> - <?= $t['lc_warning_details'];?> - <br/> - <br/> - </div> - <? } ?> --- 47,64 ---- + <?php + $sysMessages = $obj->user->getSessionMessages(); + if ( count($sysMessages) ) { + foreach ($sysMessages as $msgType => $msgText) { + echo lcMessageBox($msgText, $msgType); + } + } + if (isset($t['_newPrivMsgs'])) { + echo lcMessageBox('Someone sent you a new private message. Do you want to read them? <a href="'.appurl('pm').'">Yes, take me to my private messages.</a>','q'); + } ! lcSystem::getErrorBox(); ! ?> |
From: Mark K <har...@us...> - 2008-08-13 22:08:26
|
Update of /cvsroot/logicampus/logicampus/src/public_html/templates/private In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31525/public_html/templates/private Modified Files: header.html.php Log Message: Change the way errors are displayed so that it doesn't put HTML before the start HTML tag. Index: header.html.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/public_html/templates/private/header.html.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** header.html.php 5 Jul 2007 13:36:10 -0000 1.18 --- header.html.php 13 Aug 2008 22:08:22 -0000 1.19 *************** *** 173,176 **** --- 173,178 ---- echo lcMessageBox('Someone sent you a new private message. Do you want to read them? <a href="'.appurl('pm').'">Yes, take me to my private messages.</a>','q'); } + + lcSystem::getErrorBox(); ?> |
From: Mark K <har...@us...> - 2008-08-13 22:08:26
|
Update of /cvsroot/logicampus/logicampus/src/public_html/templates/sinorca In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31525/public_html/templates/sinorca Modified Files: header.html.php Log Message: Change the way errors are displayed so that it doesn't put HTML before the start HTML tag. Index: header.html.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/public_html/templates/sinorca/header.html.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** header.html.php 5 Oct 2007 19:28:57 -0000 1.19 --- header.html.php 13 Aug 2008 22:08:22 -0000 1.20 *************** *** 201,203 **** --- 201,205 ---- echo lcMessageBox('Someone sent you a new private message. Do you want to read them? <a href="'.appurl('pm').'">Yes, take me to my private messages.</a>','q'); } + + lcSystem::getErrorBox(); ?> |
From: Mark K <har...@us...> - 2008-06-19 15:41:20
|
Update of /cvsroot/logicampus/logicampus In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19297 Added Files: THIS_CVS_REPO_IS_DEAD.txt Log Message: Moving to subversion. --- NEW FILE: THIS_CVS_REPO_IS_DEAD.txt --- Use subversion. |
From: Mark K <har...@us...> - 2008-06-19 15:39:30
|
Update of /cvsroot/logicampus/logicampus In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18523 Modified Files: build.xml Log Message: Version bump. Index: build.xml =================================================================== RCS file: /cvsroot/logicampus/logicampus/build.xml,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** build.xml 2 Nov 2007 22:23:20 -0000 1.41 --- build.xml 19 Jun 2008 15:14:03 -0000 1.42 *************** *** 442,449 **** --- 442,455 ---- end="08 February 2007"/> --> + <!-- <cvschangelog dir="." destfile="changelog.xml" start="10 March 2006" end="12 April 2007"/> + --> + <cvschangelog dir="." + destfile="changelog.xml" + start="12 April 2007" + end="02 November 2007"/> |
From: Mark K <har...@us...> - 2008-06-19 15:38:46
|
Update of /cvsroot/logicampus/logicampus/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18893/docs Modified Files: course_export_sample.xml Log Message: Adding lesson name and description to sample LOB XML file. Index: course_export_sample.xml =================================================================== RCS file: /cvsroot/logicampus/logicampus/docs/course_export_sample.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** course_export_sample.xml 21 Sep 2007 16:00:00 -0000 1.8 --- course_export_sample.xml 19 Jun 2008 15:14:48 -0000 1.9 *************** *** 124,127 **** --- 124,130 ---- <lesson:lesson guid=""> + <lesson:name></lesson:name> + <lesson:description></lesson:description> + <lesson:objective></lesson:objective> <lesson:standard></lesson:standard> |
From: Mark K <har...@us...> - 2008-06-19 15:13:40
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/unitTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18498/src/logicreate/services/unitTest Modified Files: learningobjectTest.php Log Message: Update LOB test to use new library locations. Index: learningobjectTest.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/unitTest/learningobjectTest.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** learningobjectTest.php 1 Feb 2008 03:11:09 -0000 1.4 --- learningobjectTest.php 19 Jun 2008 15:13:35 -0000 1.5 *************** *** 1,7 **** <? ! include(LIB_PATH.'lc_lob_content.php'); ! include(LIB_PATH.'lc_lob_class.php'); ! include(LIB_PATH.'lc_lob_test.php'); class LearningObjectTest extends UnitTestCase { --- 1,7 ---- <? ! include(LIB_PATH.'lob/lc_lob_content.php'); ! include(LIB_PATH.'lob/lc_lob_class.php'); ! include(LIB_PATH.'lob/lc_lob_test.php'); class LearningObjectTest extends UnitTestCase { *************** *** 97,101 **** $lob->repoObj->lobRepoEntryId = 1; ! $classContent = $lob->useInClass($classId,'notify'); $e = ErrorStack::pullError('php'); //e might be an error saying that the repo doesn't have all its data. --- 97,101 ---- $lob->repoObj->lobRepoEntryId = 1; ! $classContent = $lob->useInClass($classId, 'notify'); $e = ErrorStack::pullError('php'); //e might be an error saying that the repo doesn't have all its data. |
From: Mark K <har...@us...> - 2008-04-13 18:57:22
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26750/lib Modified Files: LC_mysql.php Log Message: Quiet notices. Index: LC_mysql.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/LC_mysql.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** LC_mysql.php 26 Jan 2008 02:09:13 -0000 1.22 --- LC_mysql.php 13 Apr 2008 18:57:18 -0000 1.23 *************** *** 162,165 **** --- 162,166 ---- function freeResult() { $stuff = array_pop($this->resultSet); + if (is_resource($stuff)) mysql_free_result($stuff); } |
From: Mark K <har...@us...> - 2008-04-13 18:56:05
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25977/lib Modified Files: _classAssignmentObj.php Assessment.php Log Message: Style fixes. Index: _classAssignmentObj.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/_classAssignmentObj.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _classAssignmentObj.php 8 Oct 2007 14:35:29 -0000 1.3 --- _classAssignmentObj.php 13 Apr 2008 18:55:58 -0000 1.4 *************** *** 39,43 **** $temp = new classAssignmentObj(); $temp->_dsn = $dsn; ! $temp->__loaded = true; $temp->id_class_assignments = $db->record['id_class_assignments']; $temp->title = $db->record['title']; --- 39,43 ---- $temp = new classAssignmentObj(); $temp->_dsn = $dsn; ! $temp->__loaded = TRUE; $temp->id_class_assignments = $db->record['id_class_assignments']; $temp->title = $db->record['title']; *************** *** 66,70 **** $temp = new classAssignmentObj(); $temp->_dsn = $dsn; ! $temp->__loaded = true; $temp->id_class_assignments = $db->record['id_class_assignments']; $temp->title = $db->record['title']; --- 66,70 ---- $temp = new classAssignmentObj(); $temp->_dsn = $dsn; ! $temp->__loaded = TRUE; $temp->id_class_assignments = $db->record['id_class_assignments']; $temp->title = $db->record['title']; *************** *** 86,90 **** ! function _loadArray($array, $pkeyFlag=false) { if ($pkeyFlag) { $this->id_class_assignments = $array['id_class_assignments']; --- 86,90 ---- ! function _loadArray($array, $pkeyFlag=FALSE) { if ($pkeyFlag) { $this->id_class_assignments = $array['id_class_assignments']; *************** *** 103,107 **** function _genPkey($len=50) { ! return str_replace(".","",uniqid(str_replace(" ","",microtime()), $len)); } --- 103,107 ---- function _genPkey($len=50) { ! return str_replace(".", "", uniqid(str_replace(" ", "", microtime()), $len)); } Index: Assessment.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/Assessment.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Assessment.php 8 Nov 2007 17:08:04 -0000 1.9 --- Assessment.php 13 Apr 2008 18:55:58 -0000 1.10 *************** *** 3,7 **** class AssessmentBase { ! var $_new = true; //not pulled from DB var $_modified; //set() called var $_version = '1.6'; //PBDO version number --- 3,7 ---- class AssessmentBase { ! var $_new = TRUE; //not pulled from DB var $_modified; //set() called var $_version = '1.6'; //PBDO version number *************** *** 62,82 **** function save($dsn="default") { if ( $this->isNew() ) { ! $this->setPrimaryKey(AssessmentPeer::doInsert($this,$dsn)); } else { ! AssessmentPeer::doUpdate($this,$dsn); } } ! function load($key,$dsn="default") { if (is_array($key) ) { ! while (list ($k,$v) = @each($key) ) { $where .= "$k='$v' and "; } ! $where = substr($where,0,-5); } else { $where = "assessment_id='".$key."'"; } ! $array = AssessmentPeer::doSelect($where,$dsn); return $array[0]; } --- 62,82 ---- function save($dsn="default") { if ( $this->isNew() ) { ! $this->setPrimaryKey(AssessmentPeer::doInsert($this, $dsn)); } else { ! AssessmentPeer::doUpdate($this, $dsn); } } ! function load($key, $dsn="default") { if (is_array($key) ) { ! while (list ($k, $v) = @each($key) ) { $where .= "$k='$v' and "; } ! $where = substr($where, 0, -5); } else { $where = "assessment_id='".$key."'"; } ! $array = AssessmentPeer::doSelect($where, $dsn); return $array[0]; } *************** *** 84,94 **** function loadAll($dsn="default") { ! $array = AssessmentPeer::doSelect('',$dsn); return $array; } ! function delete($deep=false,$dsn="default") { ! AssessmentPeer::doDelete($this,$deep,$dsn); } --- 84,94 ---- function loadAll($dsn="default") { ! $array = AssessmentPeer::doSelect('', $dsn); return $array; } ! function delete($deep=FALSE, $dsn="default") { ! AssessmentPeer::doDelete($this, $deep, $dsn); } *************** *** 112,125 **** /** * only sets if the new value is !== the current value ! * returns true if the value was updated ! * also, sets _modified to true on success */ ! function set($key,$val) { if ($this->{$key} !== $val) { ! $this->_modified = true; $this->{$key} = $val; ! return true; } ! return false; } --- 112,125 ---- /** * only sets if the new value is !== the current value ! * returns TRUE if the value was updated ! * also, sets _modified to TRUE on success */ ! function set($key, $val) { if ($this->{$key} !== $val) { ! $this->_modified = TRUE; $this->{$key} = $val; ! return TRUE; } ! return FALSE; } *************** *** 131,138 **** var $tableName = 'assessment'; ! function doSelect($where,$dsn="default") { //use this tableName $db = DB::getHandle($dsn); ! $st = new PBDO_SelectStatement("assessment",$where); $st->fields['assessment_id'] = 'assessment_id'; $st->fields['display_name'] = 'display_name'; --- 131,138 ---- var $tableName = 'assessment'; ! function doSelect($where, $dsn="default") { //use this tableName $db = DB::getHandle($dsn); ! $st = new PBDO_SelectStatement("assessment", $where); $st->fields['assessment_id'] = 'assessment_id'; $st->fields['display_name'] = 'display_name'; *************** *** 158,162 **** } ! function doInsert(&$obj,$dsn="default") { //use this tableName $db = DB::getHandle($dsn); --- 158,162 ---- } ! function doInsert(&$obj, $dsn="default") { //use this tableName $db = DB::getHandle($dsn); *************** *** 190,195 **** $db->executeQuery($st); ! $obj->_new = false; ! $obj->_modified = false; $id = $db->getInsertID(); return $id; --- 190,195 ---- $db->executeQuery($st); ! $obj->_new = FALSE; ! $obj->_modified = FALSE; $id = $db->getInsertID(); return $id; *************** *** 197,201 **** } ! function doUpdate(&$obj,$dsn="default") { //use this tableName $db = DB::getHandle($dsn); --- 197,201 ---- } ! function doUpdate(&$obj, $dsn="default") { //use this tableName $db = DB::getHandle($dsn); *************** *** 228,236 **** $st->key = 'assessment_id'; $db->executeQuery($st); ! $obj->_modified = false; } ! function doReplace($obj,$dsn="default") { //use this tableName $db = DB::getHandle($dsn); --- 228,236 ---- $st->key = 'assessment_id'; $db->executeQuery($st); ! $obj->_modified = FALSE; } ! function doReplace($obj, $dsn="default") { //use this tableName $db = DB::getHandle($dsn); *************** *** 246,253 **** * remove an object */ ! function doDelete(&$obj,$deep=false,$dsn="default") { //use this tableName $db = DB::getHandle($dsn); ! $st = new PBDO_DeleteStatement("assessment","assessment_id = '".$obj->getPrimaryKey()."'"); $db->executeQuery($st); --- 246,253 ---- * remove an object */ ! function doDelete(&$obj, $deep=FALSE, $dsn="default") { //use this tableName $db = DB::getHandle($dsn); ! $st = new PBDO_DeleteStatement("assessment", "assessment_id = '".$obj->getPrimaryKey()."'"); $db->executeQuery($st); *************** *** 257,262 **** } ! $obj->_new = false; ! $obj->_modified = false; $id = $db->getInsertID(); return $id; --- 257,262 ---- } ! $obj->_new = FALSE; ! $obj->_modified = FALSE; $id = $db->getInsertID(); return $id; *************** *** 269,273 **** * send a raw query */ ! function doQuery(&$sql,$dsn="default") { //use this tableName $db = DB::getHandle($dsn); --- 269,273 ---- * send a raw query */ ! function doQuery(&$sql, $dsn="default") { //use this tableName $db = DB::getHandle($dsn); *************** *** 296,300 **** $x->possiblePoints = $row['possible_points']; ! $x->_new = false; return $x; } --- 296,300 ---- $x->possiblePoints = $row['possible_points']; ! $x->_new = FALSE; return $x; } *************** *** 323,330 **** 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]; } --- 323,330 ---- 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]; } *************** *** 333,337 **** 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; --- 333,337 ---- 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; *************** *** 339,344 **** } ! # 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 --- 339,344 ---- } ! # 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 *************** *** 365,369 **** $array = AssessmentQuestionPeer::doSelect('assessment_id = \''.$this->getPrimaryKey().'\' order by question_sort'); ! $cc = count ($array); for($x=0; $x<$cc; ++$x) { --- 365,369 ---- $array = AssessmentQuestionPeer::doSelect('assessment_id = \''.$this->getPrimaryKey().'\' order by question_sort'); ! $cc = count($array); for($x=0; $x<$cc; ++$x) { *************** *** 372,376 **** switch($superObj->questionType) { case QUESTION_TRUEFALSE: ! $subObj = new AssessmentQuestionTrueFalse(); break; case QUESTION_MCHOICE: --- 372,376 ---- switch($superObj->questionType) { case QUESTION_TRUEFALSE: ! $subObj = new AssessmentQuestionTRUEFalse(); break; case QUESTION_MCHOICE: *************** *** 394,402 **** if( $superObj->assessmentQuestionId ) ! $subObj->_new = false; else ! $subObj->_new = true; ! $subObj->_modified = false; $subObj->assessmentQuestionId = $superObj->assessmentQuestionId; $subObj->assessmentId = $superObj->assessmentId; --- 394,402 ---- if( $superObj->assessmentQuestionId ) ! $subObj->_new = FALSE; else ! $subObj->_new = TRUE; ! $subObj->_modified = FALSE; $subObj->assessmentQuestionId = $superObj->assessmentQuestionId; $subObj->assessmentId = $superObj->assessmentId; *************** *** 493,497 **** $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); --- 493,497 ---- $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); *************** *** 503,507 **** #$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) { --- 503,507 ---- #$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) { |
From: Mark K <har...@us...> - 2008-04-13 18:56:05
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25977/lang Modified Files: fallback.php Log Message: Style fixes. Index: fallback.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lang/fallback.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** fallback.php 16 Dec 2006 00:32:28 -0000 1.3 --- fallback.php 13 Apr 2008 18:55:59 -0000 1.4 *************** *** 1,5 **** <? ! function lct($key,$args="") { extract($args); --- 1,5 ---- <? ! function lct($key, $args="") { extract($args); *************** *** 17,21 **** $format .= " %s"; } ! return vsprintf($format,$newArgs); } ?> --- 17,21 ---- $format .= " %s"; } ! return vsprintf($format, $newArgs); } ?> |
From: Mark K <har...@us...> - 2008-03-03 00:12:17
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/classroom In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15461 Modified Files: content.lcp viewer.lcp Log Message: show plain text files as embedded content, not with the viewer. Index: viewer.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classroom/viewer.lcp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** viewer.lcp 1 Mar 2008 23:43:19 -0000 1.17 --- viewer.lcp 3 Mar 2008 00:12:14 -0000 1.18 *************** *** 34,38 **** $ut = time(); - //print_r($lc->getvars); $uniqCode = $lc->getvars[1]; $filename = addslashes(trim(urldecode($lc->getvars[2]))); --- 34,37 ---- Index: content.lcp =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classroom/content.lcp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** content.lcp 5 Jan 2008 19:53:28 -0000 1.15 --- content.lcp 3 Mar 2008 00:12:14 -0000 1.16 *************** *** 99,106 **** //choose a start URL, viewer or content if ( is_object($t['seqItems'][$nextIdx]) ) { ! if ($t['seqItems'][$nextIdx]->lobMime == 'text/html') { ! $t['nextUrl'] = appurl('classroom/content/'.$uniqCode.'/'.$t['seqItems'][$nextIdx]->linkText); } else { ! $t['nextUrl'] = appurl('classroom/viewer/'.$uniqCode.'/'.$t['seqItems'][$nextIdx]->linkText); } } --- 99,106 ---- //choose a start URL, viewer or content if ( is_object($t['seqItems'][$nextIdx]) ) { ! if ($t['seqItems'][$nextIdx]->lobMime == 'text/html' || $t['seqItems'][$nextIdx]->lobMime == 'text/plain' ) { ! $t['nextUrl'] = appurl('classroom/content/'.$uniqCode.'/'.urlencode($t['seqItems'][$nextIdx]->linkText)); } else { ! $t['nextUrl'] = appurl('classroom/viewer/'.$uniqCode.'/'.urlencode($t['seqItems'][$nextIdx]->linkText)); } } *************** *** 133,137 **** $t['file']['title'] = $db->record['lob_title']; $t['file']['content'] = $db->record['lob_text']; ! $t['file']['mime'] = 'text/html'; } --- 133,137 ---- $t['file']['title'] = $db->record['lob_title']; $t['file']['content'] = $db->record['lob_text']; ! $t['file']['mime'] = $db->record['lob_mime']; } |
From: Mark K <har...@us...> - 2008-03-03 00:12:17
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/classroom/templates In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15461/templates Modified Files: viewer_main.html Log Message: show plain text files as embedded content, not with the viewer. Index: viewer_main.html =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classroom/templates/viewer_main.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** viewer_main.html 5 Oct 2007 22:37:38 -0000 1.19 --- viewer_main.html 3 Mar 2008 00:12:14 -0000 1.20 *************** *** 45,53 **** ! if ($t['file']['mime'] == 'text/html') { echo '<h3>'.$t['file']['title'].'</h3>'; echo "<br/>\n"; ! echo $t['file']['content']; } ?> --- 45,57 ---- ! if ($t['file']['mime'] == 'text/html' || $t['file']['mime'] == 'text/plain') { echo '<h3>'.$t['file']['title'].'</h3>'; echo "<br/>\n"; ! if ($t['file']['mime'] == 'text/plain') { ! echo nl2br($t['file']['content']); ! } else { ! echo $t['file']['content']; ! } } ?> |
From: Mark K <har...@us...> - 2008-03-02 22:45:32
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib/lob In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12503/lib/lob Modified Files: lc_lob.php Log Message: fix for meta data objects that aren't present. Index: lc_lob.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/lob/lc_lob.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** lc_lob.php 2 Mar 2008 21:59:00 -0000 1.3 --- lc_lob.php 2 Mar 2008 22:45:28 -0000 1.4 *************** *** 430,433 **** --- 430,437 ---- $this->lobSub = $content[0]; $this->lobMetaObj = LobMetadata::load(array('lob_repo_entry_id'=>$id)); + if (! is_object($this->lobMetaObj) ) { + $this->lobMetaObj = new LobMetadata(); + $this->lobMetaObj->createdOn = time(); + } } } |
From: Mark K <har...@us...> - 2008-03-02 22:43:40
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11668/lib Modified Files: lc_class.php Log Message: syntax errors Index: lc_class.php =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/lib/lc_class.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** lc_class.php 2 Oct 2007 18:16:18 -0000 1.13 --- lc_class.php 2 Mar 2008 22:43:36 -0000 1.14 *************** *** 3,7 **** include_once(LIB_PATH.'PBDO/Classes.php'); include_once(LIB_PATH.'semesterObj.php'); ! include_once(LIB_PATH.'lc_lesson.php'); class lcClass { --- 3,7 ---- include_once(LIB_PATH.'PBDO/Classes.php'); include_once(LIB_PATH.'semesterObj.php'); ! include_once(LIB_PATH.'lesson/lc_lesson.php'); class lcClass { *************** *** 34,43 **** /** ! * Load a LC_Lesson object * * @return boolean true if the class was loaded with no problems */ function loadLesson($lessonId) { ! $this->lessons[$lessonId] = new LC_Lesson($lessonId); if ($this->lessons[$lessonId]->lessonDo->idClasses != $this->classId) { unset($this->lessons[$lessonId]); --- 34,43 ---- /** ! * Load a Lc_Lesson object * * @return boolean true if the class was loaded with no problems */ function loadLesson($lessonId) { ! $this->lessons[$lessonId] = new Lc_Lesson($lessonId); if ($this->lessons[$lessonId]->lessonDo->idClasses != $this->classId) { unset($this->lessons[$lessonId]); |