[LON-CAPA-dev] Scripts to Automate Course Cloning and Accessibility/Enrollment Date Entry

Stuart Raeburn raeburn at msu.edu
Thu Mar 5 09:37:45 EST 2015


Hi,

I am replying to the lon-capa-dev list, which is publicly archived at:  
http://mail.lon-capa.org/pipermail/lon-capa-dev/ , but I have included  
the list of CCs in the original e-mail as BCCs so that they will still  
receive a reply (but their e-mail addresses will be excluded from the  
public posting). A side effect of that is that if any of those  
individuals are also subscribed to the lon-capa-dev list then they  
will receive this reply twice.

> ... We are wondering if anyone has been successful with  automating  
> these functions through scripting? If so, would you be  willing to  
> provide assistance/advice to us regarding this automation?

The Domain Coordinator's web interface includes:

Main Menu -> Course and community creation -> Create  
courses/communities by uploading an attributes file

which can be used to upload an XML file containing course information  
(including cloning details, access dates, and enrollment dates).

See: http://loncapa.purdue.edu/adm/help/Batch_Creation.hlp

for information about the format of that XML file (which may contain  
entries for multiple courses).

If you do not want to require a Domain Coordinator to upload a file  
via the web GUI, then it is also possible to add your XML file of  
course attributes to:

/home/httpd/perl/tmp/addcourse/purdue/auto/pending

and run /home/httpd/perl/Autocreate.pl as user www

For this to work you would first (as Domain Coordinator) need to use:

Main Menu -> Set domain configuration -> Display (Auto-course creation  
settings checked)

and check the "Yes" radio button for "Create pending official courses  
from XML files", and choose a Domain Coordinator from the list  
displayed in the "Course creation processed as: (choose Dom. Coord.)"  
row, then click "Save Changes".

There is an entry in /etc/cron.d/loncapa ...

# Run auto create script to create courses in:
# (a) /tmp/addcourse/$dom/auto/pending (XML-based course descriptions);
# (b) online course requests for official courses queued pending validation
#     of instructor of record status
30 2 * * *    www /home/httpd/perl/Autocreate.pl

which will run /home/httpd/perl/Autocreate.pl at 2.30 am daily,  
although you could obviously increae the frequency.

Alternatively, if you wanted Autocreate.pl to only be run from the  
command line, by a real person, then you should comment out the entry  
in /etc/cron.d/loncapa, if you have enabled: "Create pending official  
courses from XML files", and you plan to put XML files (owned by  
www:www) temporarily in:   
/home/httpd/perl/tmp/addcourse/$dom/auto/pending

LON-CAPA also supports faculty creation of their own courses, if you  
assign course request rights.  This works best if you can establish  
links between institutional data sources and your LON-CAPA instance by  
customizing /home/httpd/lib/perl/localenroll.pm.

This functionality has been used at MSU since 2009, whereby faculty  
create their own courses (between 50-60 courses each semester), at  
their own convenience.  See section 4 of the Domain Coordination  
manual: "Integration with Institutional Systems" for more information.

https://loncapa.purdue.edu/adm/help/domain.manual.pdf


Stuart Raeburn
LON-CAPA Academic Consortium


Quoting "Young, Joyce E" <young257 at purdue.edu>:

> We are currently using Lon-Capa on a small scale, but looking at   
> ramping up the usage for the upcoming terms. As we scale up, the   
> manual copying (cloning) of courses to the next term and entry of   
> accessibility/enrollment dates will become cumbersome and a source   
> of error. We are wondering if anyone has been successful with   
> automating these functions through scripting? If so, would you be   
> willing to provide assistance/advice to us regarding this automation?
>                                                                       
>                                                                       
>         Thanks,
>                                                                       
>                                                                       
>                         Joyce
>
> Joyce Young
> Programmer/Analyst
> ITAS - Student Systems Competency Center
> Purdue University
> 3495 Kent Avenue, Suite 100
> West Lafayette, IN 47906
> Phone: (765) 427-6340
> Fax: (765) 464-2233
> Campus Mail: ROSS
> young257 at purdue.edu<mailto:young257 at purdue.edu>



More information about the LON-CAPA-dev mailing list