[Logicampus-cvs] logicampus/src/logicreate/services/lobrepo/templates add_test.html, NONE, 1.1 exa
Brought to you by:
trilexcom
From: Mark K <har...@us...> - 2007-10-05 21:35:52
|
Update of /cvsroot/logicampus/logicampus/src/logicreate/services/lobrepo/templates In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16642/services/lobrepo/templates Modified Files: add_activity.html Added Files: add_test.html exam_main.html exam_question_mchoice.html Log Message: Adding support to make a test with multiple choice questions. --- NEW FILE: add_test.html --- <h4>Student Test</h4> <a href="<?=appurl('lobrepo/');?>">Learning Objects Home</a> • <a href="<?=appurl('lobrepo/myobj');?>">My Learning Objects</a> • <a href="<?=appurl('lobrepo/import');?>">Import Learning Objects</a> • <a href="<?=appurl('lobrepo/add');?>">Add Learning Objects</a> <hr/> <form action="<?=appurl('lobrepo').'/exam/';?>" method="POST" enctype="application/x-www-form-urlencoded"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td valign="top" class="row1">*Title</td> <td valign="top" class=""><input type="text" id="title" name="title" value="" size="40" maxlength="50"></td> </tr> <tr> <td valign="top" class="row1" valign="top">*Instructions for students</td> <td valign="top" class=""> <textarea name="instructions" cols="40" rows="5" id="instructions"></textarea> </td> </tr> <tr> <td valign="top" class="row1" valign="top">Notes (only for faculty)</td> <td valign="top" class=""> <textarea name="notes" cols="40" rows="5" id="notes"></textarea> </td> </tr> <tr> <td colspan="2" valign="top" class=""> </td> </tr> <tr> <td valign="top" class="row1"> <input type="hidden" name="lob_id" value="<?=$t['lob']->get('lobRepoEntryId');?>"> </td> <td valign="top" class=""><input type="submit" id="sbmt_button" name="sbmt_button" value="Add Questions"></td> </tr> </table> </form> <div style="font-size: 85%">*denotes a required field</div> Index: add_activity.html =================================================================== RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/lobrepo/templates/add_activity.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** add_activity.html 4 Oct 2007 18:54:48 -0000 1.2 --- add_activity.html 5 Oct 2007 21:35:48 -0000 1.3 *************** *** 51,55 **** </tr> <tr> ! <td valign="top" class="row1"></td> <td valign="top" class=""><input type="submit" id="sbmt_button" name="sbmt_button" value="Add Activity"></td> </tr> --- 51,57 ---- </tr> <tr> ! <td valign="top" class="row1"> ! <input type="hidden" name="lob_id" value="<?=$t['lob']->get('lobRepoEntryId');?>"> ! </td> <td valign="top" class=""><input type="submit" id="sbmt_button" name="sbmt_button" value="Add Activity"></td> </tr> --- NEW FILE: exam_question_mchoice.html --- <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> --- NEW FILE: exam_main.html --- <? if ($t['message']) { ?> <div style="color: blue;"><?=$t['message'];?></div> <br> <? } ?> <form method="GET" action="<?=modurl('exam/event=editQuestion/id='.$t['testId']);?>"> <FIELDSET> <LEGEND>ADD a question</LEGEND> <table width="100%" border="0"> <tr> <td align="center"> <input type="submit" name="type" id="mc_submit" value="Multiple Choice" style="width:130px;"> </td> <td align="center"> <input type="submit" name="type" id="ma_submit" value="Multiple Answer" style="width:130px;"> </td> <td align="center"> <input type="submit" name="type" id="mq_submit" value="Matching Question" style="width:130px;"> </td> <td align="center"> <input type="submit" name="type" id="tf_submit" value="True/False" style="width:130px;"> </td> <td align="center"> <input type="submit" name="type" id="fb_submit" value="Fill in the Blank" style="width:130px;"> </td> <td align="center"> <input type="submit" name="type" id="es_submit" value="Essay" style="width:130px;"> </td> </tr> </table> </FIELDSET> </form> <p> </p> <form method="POST"> <table width="100%" border="0"> <tr> <td> <span style="color: green;">Green Text</span> = Correct Answers </td> <td align="right"> <?=lct('Points');?>: <?= $t['questions_total_points'];?> </td> </tr> <tr> <td> <span style="color: #000000;background: #FFFF00">Yellow Text</span> = Possible mis-spelled word </td> <td align="right"> <?=lct('Question');?>: <?= $t['questions_count'];?> </td> </tr> <tr> <td> </td> <td align="right"> <!-- <a href="<?=modurl('main/event=spellcheck/id='.$t['assessment']->assessmentId);?>">SPELL CHECK</a> --> </td> </tr> </table> <?php $a_jscript = array(); foreach($t['questionList'] as $k=>$v) { $a_jscript[] = 'points'.$v->lobTestQstId; ?> <FIELDSET> <LEGEND><a href="<?=APP_URL?>lobrepo/exam/event=editQuestion/qidx=<?=$k;?>">EDIT</a> — <a href="<?=APP_URL?>lobrepo/exam/event=deleteQuestion/qidx=<?=$k;?>" onclick="return confirm('Are you sure?');">DELETE</a></LEGEND> <table width="100%" border="0"> <tr> <td> <?= ($k+1);?>) </td> <td width="15%"> <i><?= $v->qstText; ?></i> </td> <td width="90%" align="right" colspan="1"> Points <input type="text" size="3" name="points[<?=$v->assessmentQuestionId?>]" value="<?=$v->questionPoints?>" id="points<?=$v->assessmentQuestionId?>"> </td> </tr> <tr> <td colspan="1" valign="bottom"> </td> <td colspan="2"> <b><?= $v->questionText; ?></b> </td> </tr> <? //show choices $count = $v->qstChoices; // neeed to know total while (list ($cc,$c) = @each($v->qstChoices) ) { // mgk 10/19/03 - FIXME - put this in to help display issue, but it might // be a bigger issue. every mchoice question has 10 answers, with most blank // AIMed mark - no answer yet if (trim($c['label'])!='') { // matching questions have this data in here. if ( $cc === 'randomAnswers' ) continue; ?> <tr> <td colspan="1" valign="bottom"> </td> <td colspan="1" align="right"> <?=chr($cc+65);?>. </td> <td colspan="1" align="left"> <? # ALL FIB answers are considered to be good answers # but we need to print them a little different and print # the alternate answers separate if ($v->questionTypeId == QUESTION_FILLINBLANK) { if ($cc == 0) { ?> <div style="color: green; font-size: 105%"> <?= $c['label'];?> </div> <? if ($count >= 2) { echo '</td></tr><tr><td colspan="2"><b>Alternate Answers</b></td></tr>'; } continue; } else { echo $c->label; continue; } } if ($v->questionTypeId == QUESTION_MATCHING) { if ($c['label'] == '') { echo '<i>no question entered</i>'; } ?> <?= $c['label'];?> ( <span style="color: green; font-size: 105%"> <?=$c['correct'];?> </span>) <? continue; } // end MATCHING IF if ($c['correct'] === true) { ?> <div style="color: green; font-size: 105%"> <?= $c['label'];?> </div> <? } else { ?> <?=$c['label'];?> <? } ?> </td> </tr> <? } // end if label!=''?> <? } ?> <tr> <td colspan='3' align="right"> Change Position: <select name="order[<?=$k?>]" onChange="document.q<?=$v->assessmentQuestionId;?>.submit();"> <?=makeOptions($t['dropDownData'], $k+1);?> </select> <input type="submit" name="sort" value="go"/> </td></tr> </table> </FIELDSET> <br> <? } ?> <script> var pointsarray = new Object(); <?php foreach($a_jscript as $myId) { echo ' pointsarray["'.$myId.'"] = true;'; } ?> function checkPoints() { var tmp_element; for (field in pointsarray) { tmp_element = document.getElementById(field); if (tmp_element.value == "" || tmp_element.value == 0 || tmp_element.value == "0") { alert('You must apply at least 1 point per question'); return false; } } return true; } </script> <p align="right"> <input type="hidden" name="event" value="updatePoints"> <input type="submit" name="submit" value="Update Points" onClick="return checkPoints();"> <input type="hidden" name="assessmentId" value="<?=$t['assessment']->assessmentId?>"> </p> </form> |