MonthDayYear

From WeBWorK_wiki
Revision as of 11:56, 11 July 2013 by Travis (talk | contribs) (Created page with "<h2>Comments (for Instructors) Visible in the Library Browser: PG Code Snippet</h2> <!-- Header for these sections -- no modification needed --> <p style="background-colo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Comments (for Instructors) Visible in the Library Browser: PG Code Snippet


This code snippet shows the essential PG code to include comments for instructors that are visible only when the PG file is viewed in the Library Browser. Note that this is an insertion, not a complete PG file. This code will have to be incorporated into the problem file on which you are working.

Problem Techniques Index

PG problem file Explanation

$date = $formattedOpenDate;   # Built-in WeBWorK variable
$date =~s/ .*//;                        # Prune off the detailed starting time
@parts = split('/',$date);            # Break apart month, day and year which are separated by /
$month = $parts[0];        
$day = $parts[1];
$year = $parts[2];

BEGIN_TEXT
For the given problem set, 
$PAR $PAR
the Open Date Month is  $month
$PAR
the Open Date Day is  $day
$PAR
the Open Date Year is  $year
END_TEXT
      

Use this code fragment to obtain variables dependent upon the open month, day and/or year.

Problem Techniques Index