version 1.410, 2009/11/02 12:10:34
|
version 1.411.2.6, 2010/11/08 19:47:04
|
Line 41 use Apache::lonratedt();
|
Line 41 use Apache::lonratedt();
|
use Apache::lonxml; |
use Apache::lonxml; |
use Apache::lonclonecourse; |
use Apache::lonclonecourse; |
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
|
use Apache::londocsgci; |
use HTML::Entities; |
use HTML::Entities; |
use GDBM_File; |
use GDBM_File; |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 2478 ENDHEADERS
|
Line 2479 ENDHEADERS
|
('select_form_order' => |
('select_form_order' => |
['',1..$currentversion,'mostrecent'], |
['',1..$currentversion,'mostrecent'], |
'' => '', |
'' => '', |
'mostrecent' => 'most recent', |
'mostrecent' => &mt('most recent'), |
map {$_,$_} (1..$currentversion)))); |
map {$_,$_} (1..$currentversion)))); |
$r->print('</span></td></tr><tr><td></td>'); |
$r->print('</span></td></tr><tr><td></td>'); |
my $lastold=1; |
my $lastold=1; |
Line 2618 sub handler {
|
Line 2619 sub handler {
|
return OK if $r->header_only; |
return OK if $r->header_only; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
|
|
|
my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
if ($coursedom eq 'gcitest') { |
|
my $coursenum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'}); |
|
if ($allowed) { |
|
&concept_test_builder($r,$coursedom,$coursenum); |
|
return OK; |
|
} |
|
} |
|
|
# --------------------------------------------- Initialize help topics for this |
# --------------------------------------------- Initialize help topics for this |
foreach my $topic ('Adding_Course_Doc','Main_Course_Documents', |
foreach my $topic ('Adding_Course_Doc','Main_Course_Documents', |
Line 3532 sub generate_edit_table {
|
Line 3542 sub generate_edit_table {
|
return $form; |
return $form; |
} |
} |
|
|
|
sub concept_test_builder { |
|
my ($r,$cdom,$cnum) = @_; |
|
&Apache::londocsgci::setdefaults(); |
|
if ($env{'form.context'} eq 'requestcrs') { |
|
if ($env{'form.phase'} eq 'storemap') { |
|
&Apache::londocsgci::evaluate(); |
|
my $error = &Apache::londocsgci::store('requestcrs',$cdom,$cnum); |
|
my $output = '<p>'; |
|
if ($error) { |
|
$output .= '<span class="LC_error">'. |
|
&mt('An error occurred saving your concept test: [_1].',$error). |
|
'</span>'; |
|
} else { |
|
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
|
$output .= &mt('Your concept test has been saved.'); |
|
} |
|
$output .= '</p>'; |
|
if (&Apache::lonrequestcourse::generate_page($r,'new','chooseitems')) { |
|
my $formname = 'requestcrs'; |
|
$r->print('<br /><form name="'.$formname.'" method="post" action="/adm/requestcourse">'); |
|
my $title = &mt('Concept Test Created'); |
|
&Apache::lonrequestcourse::roster_upload_form($r,$output,$formname,$title); |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
|
return; |
|
} |
|
} |
|
my $js = ' |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
'. |
|
&Apache::londocsgci::builder_javascript(). |
|
' |
|
// ]]> |
|
</script> |
|
'; |
|
$r->print(&Apache::loncommon::start_page('Assemble Test',$js)); |
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'/adm/coursedocs', |
|
text=>"Assemble Test"}); |
|
if ($env{'form.phase'} eq 'storemap') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'/adm/coursedocs?phase=storemap', |
|
text=>"Validate Test"}); |
|
&Apache::londocsgci::evaluate(); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
|
('Build Concept Test','Concept_Test_Assembly')); |
|
$r->print(&Apache::londocsgci::store('edit',$cdom,$cnum)); |
|
} elsif ($env{'form.phase'} eq 'storeparms') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'/adm/coursedocs?phase=storeparms', |
|
text=>"Set Availability"}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
|
('Build Concept Test','Concept_Test_Assembly')); |
|
$r->print(&Apache::londocsgci::store_dates_parms($cdom,$cnum)); |
|
$r->print(&Apache::loncommon::end_page()); |
|
return; |
|
} else { |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
|
('Build Concept Test','Concept_Test_Assembly')); |
|
} |
|
&Apache::londocsgci::load(); |
|
&Apache::londocsgci::listresources($r,'edit',$cdom,$cnum); |
|
$r->print(&Apache::loncommon::end_page()); |
|
return; |
|
} |
|
|
sub editing_js { |
sub editing_js { |
my ($udom,$uname) = @_; |
my ($udom,$uname) = @_; |
my $now = time(); |
my $now = time(); |