Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Perl Automateaching -- part 1: brainstorming

by Discipulus (Abbot)
on Mar 15, 2020 at 17:20 UTC ( #11114303=perlmeditation: print w/replies, xml ) Need Help??

Hello monks!

I'm away from active perl coding since last june but I have this idea hunting me and, being forced to stay at home, as many others europeans, maybe is a good ocasion to start coding again on this.

The main goal is to produce a module able to ask perl question and evaluate answers given by the user. The code provided by the user will not arrive on STDIN but instead I would opt to a document based approach: the user is provided with a file to edit and the possibility to submit it to be reviewed, multiple time if needed.

The module name will be something like Perl::Tutor or Camel::Tamer or Camel::Trainer or Perl::Teacher or I can use the automateaching word.. but for the moment let's assume the main object will be $tutor for brevity.

The module will provide some general methods to build up the configuration (path to perl executable, folder to save works..), others to ask questions and to read user's input but these are trivial and I dont want to bother you with such details (for the moment ;).

The part where I want to hear from you is the judging process of the provided perl document. I imagine something like this:

$tutor->assignement( question => "Create an array with 5 elements and fill it with +first 5 letters of the English alphabet.\n". "Then remove the first and last one elements using + two perl list operator.\n". "Join these two removed elements and assign the re +sult to a scalar named \$result\n". "Both the array and the scalar have to be lexicall +y scoped.\n", file => 'array_ex_03.pl', initial_content => '#nothing atm. strict and warnings and ot +her content more on', hints => [ 'declare viariables using "my"', 'see shift and pop documentation' ], documentation => [ 'https://perldoc.perl.org/5.30.0/funct +ions/my.html', 'https://perldoc.perl.org/perlfunc.htm +l#Perl-Functions-by-Category', 'https://perldoc.perl.org/5.30.0/funct +ions/shift.html', 'https://perldoc.perl.org/5.30.0/funct +ions/pop.html', ], solution => 'some text to provide when the task is succesful +ly completed and to add as comment to the resulting script', tests => \@basics_tests, \@tests, );

And hic sunt leones infact the hard part is how @tests is constructed and how tests are run. This first meditation is about a general brainstorming on which tools to use and how build up the process of judging. My ideas:

1) PPI will be very useful and is the main reason for the $tutor being document oriented. This has also the plus that user will end with a lot or recipes to review. PPI is able to find every kind of statement inside a perl program with PPI::Statement::Variable for example.

2) Perl-Critic which I must confess and didnt love, probably because I dont know it well, can be handy, becuase, if I understand it correctly, $tutor can apply standard and custom policies to the user provided perl program.

3) Simple scripts can be just inspected by the mean of their output and general funcionality: in this light Test::Script can be the right tool.

4) Testing.. I'd love to use the powerfull perl testing framework in its whole but will be problematic being standalone scripts and not modules. This is a problem hunting me since years.. More complex tasks given to the pupil possibly can be modules but not at start. Code provided can be copied into a temporary file and modified to be a Modulino but his seems complicate and fragile solution. Well PPI can be used to extract all subs of a script and to wrap the rest into a main one, but is maybe too much an artificious.

I want to hear from you about the above idea and its possible pitfalls. I still dont know how to implement it: any suggestion will be welcome! Help on Perl-Critic and PPI and on testing implementation in the module will be very welcome!!

L*

updtate automateaching -- part 2: proof of concept is out!

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re: Perl Automateaching -- part 1: brainstorming
by AnomalousMonk (Bishop) on Mar 15, 2020 at 18:43 UTC

    The first brainstorm to have when considering the problem of automating teaching is the realization that the underlying problem is to understand how human behavior, most particularly operant behavior, is shaped and maintained in the process of teaching.

    B. F. Skinner investigated operant behavior and came to some very interesting and useful conclusions decades ago with regard to teaching practices (see The Technology of Teaching; http://www.bfskinner.org/wp-content/uploads/2016/04/ToT.pdf for free automatic (update: i.e., push) download), insights that have lain fallow for nearly two generations now. The nascent technology that Skinner and those associated with him were applying to the problem of teaching was extremely simple in comparison to the computer technology available today. The crucial element was and remains a clear understanding of human behavior.


    Give a man a fish:  <%-{-{-{-<

Re: Perl Automateaching -- part 1: brainstorming
by bliako (Prior) on Mar 15, 2020 at 21:58 UTC

    You could provide Automateaching as a set of modules the user must install locally and then run simple commands like submit --file mysolution.pl, markme, get-more-assignments, pay-course-fees to progress and finally graduate. (example: NYTProf requires to have a module installed and run a few command line utilities to get job done. Or git with all its cli git functionality - especially if you envision a web interface requiring central db, credentials, competitions). The assignments can still be self-contained, independent files, but you will make sure the user has all the Test and other frameworks installed as well.

    Once you do that, of course you can package this functionality into a plugin to an existing integrated development environment (IDE). You can see how an IDE offers git functionality for example and more or less follow that.

    I always liked building a large system using small utilities specialising in something small. Just like Unix. Then you can glue things together using scripts or the IDE plugin.

    So, if I may, one could start with 1) a Makefile to check on required modules, 2) an assignment/lesson file format (which can also include multimedia, slides, code), 3) a small perl script to request a first assignment, have it downloaded (with credentials perhaps), 4) a small perl script to mark a solution, 5) a way to present the lesson and its multimedia - a web browser perhaps?.

    Providing an exam-like environment so schools can use to have IT exams would also be a great selling (I mean "selling") point.

    bw, bliako

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://11114303]
Front-paged by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-11-28 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?