Web Conference Notes

From WeBWorK_wiki
Revision as of 13:45, 26 May 2011 by Glarose (talk | contribs)
Jump to navigation Jump to search

Prep 2011 Main Page > Web Conference 1 > Conference Notes

Notes from Web Conference 1

  • Introduction to the workshop
  • What WeBWorK problems are
  • An Introduction to problem authoring
    • WeBWorK is a Perl application, with layers on top of that. Therefore we start thinking about writing problems for WeBWorK using Perl.
      • Perl: basic ideas:
        • the pound sign # indicates a comment
        • a semicolon ; ends a line of code
        • datatypes:
          • scalar variables start with a dollar sign $: $string = "a string"; $number = 5;
          • array variables start with an at sign @: @stringarray = ( "one", "two" ); @numarray = ( 1, 3.14 );
          • an element in an array is a scalar, so we get it with a scalar variable name: $stringarray[1] is the string "two"
          • the number of elements in an array is available by using the notation $#stringarray; or scalar(@stringarray);
          • a set of elements from an array is an array, which can be obtained with a slice: e.g., @newarray = @stringarray[0..1];
          • finally, there is a "hash" datatype, which we aren't discussing here.
        • arithmetic in Perl:
          • Perl has the expected operations: +, -, *, /, ** (exponentiation), and % (modulo, or remainder)