version 1.21, 2009/04/04 21:45:57
|
version 1.25, 2009/11/30 16:53:54
|
Line 81 function createWin() {
|
Line 81 function createWin() {
|
newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes") |
newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes") |
newWindow.document.open() |
newWindow.document.open() |
newWindow.document.write('$start_page') |
newWindow.document.write('$start_page') |
newWindow.document.write("<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]'>\\n") |
newWindow.document.write("<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]' />\\n") |
newWindow.document.write("<h3>$lt{'loca'}: <tt>$webpath</tt></h3><h3>$lt{'newd'}</h3>\\n") |
newWindow.document.write("<h3>$lt{'loca'}: <tt>$webpath</tt></h3><h3>$lt{'newd'}</h3>\\n") |
newWindow.document.write("<form name='fileaction' action='/adm/cfile' method='post'>\\n") |
newWindow.document.write("<form name='fileaction' action='/adm/cfile' method='post'>\\n") |
newWindow.document.write("$lt{'ente'}.<br /><br />") |
newWindow.document.write("$lt{'ente'}.<br /><br />") |
newWindow.document.write("<input type='hidden' name='filename' value='$webpath' />") |
newWindow.document.write("<input type='hidden' name='filename' value='$webpath' />") |
newWindow.document.write("<input type='hidden' name='action' value='newdir'>") |
newWindow.document.write("<input type='hidden' name='action' value='newdir' />") |
newWindow.document.write("<input type='hidden' name='callingmode' value='testbank' />") |
newWindow.document.write("<input type='hidden' name='callingmode' value='testbank' />") |
newWindow.document.write("$webpath<input type='text' name='newfilename' value='' />") |
newWindow.document.write("$webpath<input type='text' name='newfilename' value='' />") |
newWindow.document.write("<input type='button' value='$lt{'go'}' onClick='document.fileaction.submit();' /></form>") |
newWindow.document.write("<input type='button' value='$lt{'go'}' onClick='document.fileaction.submit();' /></form>") |
Line 508 sub display_zero {
|
Line 508 sub display_zero {
|
<li>'.&mt('Review the identified questions, choose which to convert, and (optionally) override the default filename to be used for each problem file.').'</li> |
<li>'.&mt('Review the identified questions, choose which to convert, and (optionally) override the default filename to be used for each problem file.').'</li> |
<li>'.&mt('Complete the import of questions.').'</li> |
<li>'.&mt('Complete the import of questions.').'</li> |
</ol><form name="info" method="post" action="/adm/testbank">'. |
</ol><form name="info" method="post" action="/adm/testbank">'. |
&topic_bar(1,&mt('Optional: create a sub-directory in which the testbank questions will be saved')). |
&Apache::lonhtmlcommon::topic_bar(1,&mt('Optional: create a sub-directory in which the testbank questions will be saved')). |
&mt('By default, LON-CAPA problems generated from the testbank file will be stored in the current directory.').' '.&mt('To store them in a new sub-directory:'). |
&mt('By default, LON-CAPA problems generated from the testbank file will be stored in the current directory.').' '.&mt('To store them in a new sub-directory:'). |
' <input type="button" name="createdir" value="'.&mt('Create sub-directory').'" onClick="javascript:createWin()" />'. |
' <input type="button" name="createdir" value="'.&mt('Create sub-directory').'" onClick="javascript:createWin()" />'. |
&page_footer($env{'form.newdir'},$uname,$fn,$page,$webpath).' |
&page_footer($env{'form.newdir'},$uname,$fn,$page,$webpath).' |
Line 522 sub display_one {
|
Line 522 sub display_one {
|
my %topics; |
my %topics; |
$topics{2} = &mt('Select the format of the question number - e.g., 1, 1., 1), (1 or (1) - ').' |
$topics{2} = &mt('Select the format of the question number - e.g., 1, 1., 1), (1 or (1) - ').' |
<select name="qnumformat"> |
<select name="qnumformat"> |
<option value = "-1" selected>'.&mt('Select').'</option> |
<option value="-1" selected="selected">'.&mt('Select').'</option> |
<option value="number">1</option> |
<option value="number">1</option> |
<option value="period">1.</option> |
<option value="period">1.</option> |
<option value="paren">(1)</option> |
<option value="paren">(1)</option> |
Line 533 sub display_one {
|
Line 533 sub display_one {
|
$r->print('<h3>'.&mt('Identification of blocks of questions').'</h3>'."\n". |
$r->print('<h3>'.&mt('Identification of blocks of questions').'</h3>'."\n". |
'<form method="post" name="display" action="/adm/testbank">'."\n". |
'<form method="post" name="display" action="/adm/testbank">'."\n". |
&show_uploaded_data($textref,$header)."\n". |
&show_uploaded_data($textref,$header)."\n". |
&topic_bar(2,$topics{2}).'<p>'. |
&Apache::lonhtmlcommon::topic_bar(2,$topics{2}).'<p>'. |
&mt('A number in the specified format should appear at the start of each question.').'<br />'. |
&mt('A number in the specified format should appear at the start of each question.').'<br />'. |
&mt('For multiple choice questions, the question number must begin the line that contains the question text; foils (starting (a), (i) etc.) should occur on subsequent lines.').'<br />'."\n". |
&mt('For multiple choice questions, the question number must begin the line that contains the question text; foils (starting (a), (i) etc.) should occur on subsequent lines.').'<br />'."\n". |
&mt('Correct answers should be numbered in the same way as the questions and should appear after <b>all</b> the questions (including question text and possible foils for all questions).').'<br />'."\n". |
&mt('Correct answers should be numbered in the same way as the questions and should appear after <b>all</b> the questions (including question text and possible foils for all questions).').'<br />'."\n". |
Line 556 sub display_one {
|
Line 556 sub display_one {
|
3. |
3. |
</pre>'. |
</pre>'. |
'</blockquote></p>'. |
'</blockquote></p>'. |
&topic_bar(3,$topics{3}).'<p>'. |
&Apache::lonhtmlcommon::topic_bar(3,$topics{3}).'<p>'. |
&mt('For example, you would enter <b>6</b> if your testbank file contained the following sequence of questions:').'</p><blockquote>'. |
&mt('For example, you would enter <b>6</b> if your testbank file contained the following sequence of questions:').'</p><blockquote>'. |
&mt('10 multiple choice questions').'<br />'. |
&mt('10 multiple choice questions').'<br />'. |
&mt('5 essay questions').'<br />'. |
&mt('5 essay questions').'<br />'. |
Line 608 sub display_two {
|
Line 608 sub display_two {
|
&mt('You also indicated that the <b>[quant,_1,question]</b> can be divided into <b>[quant,_2,block]</b> of questions of a particular question type.',$qcount,$blocks).'</p><p>'. |
&mt('You also indicated that the <b>[quant,_1,question]</b> can be divided into <b>[quant,_2,block]</b> of questions of a particular question type.',$qcount,$blocks).'</p><p>'. |
&mt('Provide additional information below, about the types of questions you have uploaded, and, if applicable, the format of answers and "foils" for specific types of questions.').'</p>'. |
&mt('Provide additional information below, about the types of questions you have uploaded, and, if applicable, the format of answers and "foils" for specific types of questions.').'</p>'. |
&show_uploaded_data($textref,$header). |
&show_uploaded_data($textref,$header). |
&topic_bar(4,$steptitle).'<p>'. |
&Apache::lonhtmlcommon::topic_bar(4,$steptitle).'<p>'. |
&mt('For <i>each</i> of the [_1] question blocks, specify the question numbers of the first and last questions in the block (e.g., 1 and 10), and the question type of the questions in the block.','<b>'.$blocks.'</b>').' '. |
&mt('For <i>each</i> of the [_1] question blocks, specify the question numbers of the first and last questions in the block (e.g., 1 and 10), and the question type of the questions in the block.','<b>'.$blocks.'</b>').' '. |
&mt('If required, provide additional information about foil formats and answer formats for the question types you select.').'</p><p>'. |
&mt('If required, provide additional information about foil formats and answer formats for the question types you select.').'</p><p>'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
Line 628 sub display_two {
|
Line 628 sub display_two {
|
'<td valign="top"> <input type="text" name="end_'.$i.'" value="'.$bl1end.'" size="5" /> </td>'."\n". |
'<td valign="top"> <input type="text" name="end_'.$i.'" value="'.$bl1end.'" size="5" /> </td>'."\n". |
'<td valign="top"> |
'<td valign="top"> |
<select name="qtype_'.$i.'" onChange="colSet('.$i.')"> |
<select name="qtype_'.$i.'" onChange="colSet('.$i.')"> |
<option value= "-1" selected>'.&mt('Select').'</option>'."\n"); |
<option value="-1" selected="selected">'.&mt('Select').'</option>'."\n"); |
foreach my $qtype (@types) { |
foreach my $qtype (@types) { |
$r->print('<option value="'.$qtype.'">'.$typenames{$qtype}.'</option>'."\n"); |
$r->print('<option value="'.$qtype.'">'.$typenames{$qtype}.'</option>'."\n"); |
} |
} |
Line 721 sub display_three {
|
Line 721 sub display_three {
|
$r->print('<h3>'.&mt('Review and selection of problems to convert').'</h3>'."\n". |
$r->print('<h3>'.&mt('Review and selection of problems to convert').'</h3>'."\n". |
'<form name="dataForm" method="post" action="/adm/testbank">'."\n". |
'<form name="dataForm" method="post" action="/adm/testbank">'."\n". |
&mt('Based on your previous responses your data have been split into a total of [quant,_1,question].',$numitems). |
&mt('Based on your previous responses your data have been split into a total of [quant,_1,question].',$numitems). |
&topic_bar(5,&mt('Choose which problems to convert and names to use for individual problem files'))); |
&Apache::lonhtmlcommon::topic_bar(5,&mt('Choose which problems to convert and names to use for individual problem files'))); |
if ($showheader) { |
if ($showheader) { |
$r->print($showheader.'<br />'); |
$r->print($showheader.'<br />'); |
} |
} |
Line 768 sub display_three {
|
Line 768 sub display_three {
|
} |
} |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td valign="top">'.$qnum.'.</td>'."\n". |
'<td valign="top">'.$qnum.'.</td>'."\n". |
'<td valign="top"><input name="createprob" type="checkbox" "checked="checked" value="'.$j.'" /></td>'."\n". |
'<td valign="top"><input name="createprob" type="checkbox" checked="checked" value="'.$j.'" /></td>'."\n". |
'<td valign="top"><b>'.$qtype[$i].'</b></td>'."\n". |
'<td valign="top"><b>'.$qtype[$i].'</b></td>'."\n". |
'<td valign="top"><input type="textbox" name="probfile_'.$j.'" value="'.$libfile.'" size="20" /></td>'. |
'<td valign="top"><input type="textbox" name="probfile_'.$j.'" value="'.$libfile.'" size="20" /></td>'. |
'<td valign="top">'.$showqn.'<br /><br />'."\n"); |
'<td valign="top">'.$showqn.'<br /><br />'."\n"); |
Line 829 sub display_three {
|
Line 829 sub display_three {
|
} |
} |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td valign="top">'.$qnum.'</td>'."\n". |
'<td valign="top">'.$qnum.'</td>'."\n". |
'<td valign="top"><input name="createprob" type="checkbox" "checked="checked" value="'.$j.'" /></td>'."\n". |
'<td valign="top"><input name="createprob" type="checkbox" checked="checked" value="'.$j.'" /></td>'."\n". |
'<td valign="top"><b>'.$qtype[$i].'</b></td>'."\n". |
'<td valign="top"><b>'.$qtype[$i].'</b></td>'."\n". |
'<td valign="top"><input type="textbox" name="probfile_'.$j.'" value="'.$libfile.'" size="20" /></td>'."\n". |
'<td valign="top"><input type="textbox" name="probfile_'.$j.'" value="'.$libfile.'" size="20" /></td>'."\n". |
'<td valign="top">'.$items->[$j].'</td>'."\n". |
'<td valign="top">'.$items->[$j].'</td>'."\n". |
Line 1032 sub final_display {
|
Line 1032 sub final_display {
|
for (my $i=0; $i<$numitems; $i++) { |
for (my $i=0; $i<$numitems; $i++) { |
$r->print('<input type="hidden" name="probfile_'.$i.'" value="'.$env{'form.probfile_'.$i}.'" />'."\n"); |
$r->print('<input type="hidden" name="probfile_'.$i.'" value="'.$env{'form.probfile_'.$i}.'" />'."\n"); |
} |
} |
$r->print(&topic_bar(6,&mt('Result of conversion of testbank questions to LON-CAPA problems'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar(6,&mt('Result of conversion of testbank questions to LON-CAPA problems'))); |
my $destdir = $dirpath; |
my $destdir = $dirpath; |
if ($destdir ne '' && $subdir ne '') { |
if ($destdir ne '' && $subdir ne '') { |
$subdir .= '/'; |
$subdir .= '/'; |
Line 1774 sub print_header {
|
Line 1774 sub print_header {
|
{'add_entries' => $loadentries}); |
{'add_entries' => $loadentries}); |
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { |
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { |
$output .= '<p class="LC_warning">' |
$output .= '<p class="LC_warning">' |
.&mt('Co-Author [_1]:[_2]',$uname,$udom) |
.&mt('Co-Author [_1]',$uname.':'.$udom) |
.'</p>'; |
.'</p>'; |
} |
} |
return $output; |
return $output; |
} |
} |
|
|
sub topic_bar { |
|
my ($imgnum,$title) = @_; |
|
my $output = ' |
|
<div class="LC_topic_bar"> |
|
<img alt="'.&mt('Step [_1]',$imgnum). |
|
' "src="/res/adm/pages/bl_step'.$imgnum.'.gif" /> '.$title.' |
|
</div> |
|
'; |
|
return $output; |
|
} |
|
|
|
# ---------------------------------------------------------------- Main Handler |
# ---------------------------------------------------------------- Main Handler |
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |