File:  [LON-CAPA] / loncom / homework / CAPA-converter / conversion_wrapper / README
Revision 1.1: download - view: text, annotated - select for diffs
Wed Mar 20 18:15:00 2002 UTC (22 years, 2 months ago) by albertel
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_X, version_2_5_99_1, version_2_5_99_0, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_X, version_2_3_99_0, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_X, version_2_2_99_1, version_2_2_99_0, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_X, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, version_2_1_99_0, version_2_1_3, version_2_1_2, version_2_1_1, version_2_1_0, version_2_12_X, version_2_11_X, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0_RC1, version_2_11_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, version_2_0_X, version_2_0_99_1, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, version_1_3_X, version_1_3_3, version_1_3_2, version_1_3_1, version_1_3_0, version_1_2_X, version_1_2_99_1, version_1_2_99_0, version_1_2_1, version_1_2_0, version_1_1_X, version_1_1_99_5, version_1_1_99_4, version_1_1_99_3, version_1_1_99_2, version_1_1_99_1, version_1_1_99_0, version_1_1_3, version_1_1_2, version_1_1_1, version_1_1_0, version_1_0_99_3, version_1_0_99_2, version_1_0_99_1, version_1_0_99, version_1_0_3, version_1_0_2, version_1_0_1, version_1_0_0, version_0_99_5, version_0_99_4, version_0_99_3, version_0_99_2, version_0_99_1, version_0_99_0, version_0_6_2, version_0_6, version_0_5_1, version_0_5, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, conference_2003, bz6209-base, bz6209, bz5969, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3, GCI_2, GCI_1, BZ5971-printing-apage, BZ5434-fox, BZ4492-merge, BZ4492-feature_horizontal_radioresponse, BZ4492-feature_Support_horizontal_radioresponse, BZ4492-Support_horizontal_radioresponse
- adding Ohio Universities CAPA -> LON-CAPA cleanup scripts


cnvprb - Provide pre- and post- conversion filtering in the translation
of CAPA problems into LON-CAPA problem format.

cnvprb was written at Ohio University as a way to massage problem
translations outside the framework of the flex-based translator.
There are a number of library-specific details that either (1) don't
belong in the main translator, or (2) are not easy to place there.

In overview, the perl script takes one or more files as input. It
performs pre-processing of the file (for example, problem number macros
are currently useless in the current system, so they are removed). The
file(s) are then passed to the flex-based converter. The output of the
converter is then post-processed. For example, if there is only one part
to a problem, the post-processor will remove the part tags. The output
of the perl script is sent to the standard output.

The script assumes the flex-based translator (convert) is available in
the PATH as capaconverter. This is easy enough to tweak in the script.

There are several tags which can be used to insert situation-specific
text into the problem.

-h [header file]

   The text in this file is placed directly after the <problem> tag and
   in front of any translated problem code.

-t [footer file]

   The text in this file is placed directly before the </problem> tag
   and after any translated problem code.

-s [script]

   The text in this file is excuted as perl code for each line of
   output. This can be used for situation-specific substitutions.

-f [file names]

   A list of files provided as input

-l [library references]
-i [import prefix]

   CAPA libraries tend to have rooted links and auxilliary files, such
   as figures, are referenced this way (for example,
   /serwaylib/Graphics/...). -l serwaylib would identify the string 
   serwaylib as a library reference. In processing it will be expanded
   to be preceded by the "import prefix".

   For example, "-l serwaylib -i /res/ohiou" would convert all
   occurences of "/serwaylib" to "/res/ohiou/serwaylib".

Output is sent to standard out.

In the distribution directory, I have placed a couple of sample files.
Executing the command:

cnvprb -h Std_header header -t footer -f serprob.txt \
-i /res/ohiou -l serwaylib -s script >serprob.problem

converts the problem serprob.txt(CAPA format) into serprob.problem
(lon-capa format).
It will have the files Std_header and header placed at the beginning,
footer will be inserted at the end, all occurences of /serwaylib will
be converted to /res/ohiou/serwaylib, and through the script file
"script", all occurences of block will be converted to bloke.



Comments: contact Mark Lucas at Ohio University (lucasm@ohiou.edu).
Authors: Robert McQueen and Mark Lucas at Ohio University

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>