[system] / trunk / webwork2 / lib / WeBWorK / Problem.pm Repository:
ViewVC logotype

View of /trunk/webwork2/lib/WeBWorK/Problem.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 376 - (download) (as text) (annotate)
Tue Jun 18 19:24:38 2002 UTC (17 years, 8 months ago) by sh002i
File size: 683 byte(s)
small changes.
-sam

    1 ################################################################################
    2 # WeBWorK mod_perl (c) 1995-2002 WeBWorK Team, Univeristy of Rochester
    3 # $Id$
    4 ################################################################################
    5 
    6 package WeBWorK::Problem;
    7 
    8 use strict;
    9 use warnings;
   10 use Class::Struct;
   11 
   12 struct map { $_ => '$' } our @FIELDS = qw(
   13   id
   14   set_id
   15   login_id
   16   source_file
   17   value
   18   max_attempts
   19   problem_seed
   20   status
   21   attempted
   22   last_answer
   23   num_correct
   24   num_incorrect
   25 );
   26 
   27 sub toString($) {
   28   my $self = shift;
   29   my $result;
   30   foreach (@FIELDS) {
   31     $result .= "$_ => ";
   32     $result .= defined $self->$_() ? $self->$_() : "";
   33     $result .= "\n";
   34   }
   35   return $result;
   36 }
   37 
   38 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9