[LON-CAPA-cvs] cvs: modules /jerf/tests Data.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Thu, 10 Jul 2003 19:35:33 -0000


This is a MIME encoded message

--bowersj21057865733
Content-Type: text/plain

bowersj2		Thu Jul 10 15:35:33 2003 EDT

  Added files:                 
    /modules/jerf/tests	Data.pm 
  Log:
  This file contains data necessary to run the test environment, and
  some data to describe the tests to run.
  
  
--bowersj21057865733
Content-Type: text/plain
Content-Disposition: attachment; filename="bowersj2-20030710153533.txt"


Index: modules/jerf/tests/Data.pm
+++ modules/jerf/tests/Data.pm
# The LearningOnline Network with CAPA
# testing data
#
# $Id: Data.pm,v 1.1 2003/07/10 19:35:33 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
# LON-CAPA is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LON-CAPA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
#
# (Testing: testing data

# This file contains data and information for testing. System-specific
# data will be up top, and down lower will some data that is just here
# so perl can use it, like a listing of the various things in the 
# data directory.

package Data;

use strict;

# The testing infrastructure needs the name of a user that is known
# to exist so it can ensure Utils::User is working correctly.
# This user should exist, but can have no roles. There's no problem with
# using a "real" user, I just use a fake, powerless user because *my* 
# user's name and password are getting committed into the CVS repository. 
#      ;-) - Jeremy
our $existsName = "jerftestere";
our $existsPassword = "flollop";
our $existsFirstname = 'Faked';
our $existsMiddlename = 'Up';
our $existsLastname = 'Tester';
our $existsGeneration = 'The Second';

# This information is for a user who will be transiently created and
# deleted as necessary. It should not exist before the tests are run,
# and is subject to extreme deletion, so do *not* use an important account
# for this!
# This is a minor security flaw, in that briefly while the test is running,
# "jerftester" will have various access privs, up to and possibly including
# domain coordinator. It is probably a good idea to actually shut off the web
# server for the duration of the test. It's "minor" because a human trying
# to exploit this in any meaningful way will be hardpressed to get the timing
# right, because the tests are actually exceeding the speed of the webserver,
# since they effectively directly interface to lonnet.
our $testName = "jerftester";
our $testPassword = "flollop";
our $testFirstName = "firstname";
our $testMiddleName = "middlename";
our $testLastName = "lastname";
our $testGeneration = "The Secondy-Fifth";


# Match this to the server you are running on
our $testServer = "103l5";
our $testHome = "103l5";
our $testDomain = "103";

# Need info for a domain coordinator on the $testServer so we can create
# courses. Again, since this is committed into a public CVS repository, 
# I store my domain coordinator's password in a file in the filesystem.
# *You* can put it in directly, as long as you never commit it.
our $dcName = "dcjerfg";
our $dcPassword = </home/jerf/dcPassword>;

# Need information for an account with authoring privs on this system.
# Again my password is obfuscated; there's no need for you to do the
# same unless you're going to commit this.
our $authorName = "testauthor";
# FIXME: May not need password, since we always log in directly,
#  so remove if unnecessary.
our $authorPassword = </home/jerf/authorPassword>;

# BELOW THIS LINE IS SYSTEM-INDEPENDENT DATA

# Some data relating to the various types of roles that are in the system.

# Roles that can be assigned to a course (unlike say, dc, which is domain-level)
# FIXME: Is there a way of extracting this from roles.tab or some
# other source?
our @courseRoles = ('cc', 'in', 'ta', 'ep', 'st', 'ad');
# Roles that can sensibly be assigned to course+section
our @sectionRoles = ('in', 'ta', 'ep', 'st', 'ad');


# DATA INFORMATION
# Information about the files contained in the data directory

# A list of all problems in the test data repository
our @problems = ('blank.problem', 'essay.problem', 'formula.problem',
		 'matching.problem', 'numerical.problem', 
		 'option.problem', 'plot.problem', 'radio.problem',
		 'ranking.problem', 'string.problem', 
		 'truefalse.problem');

# This maps problem types to the simple versions of that problem
# in the test repository
# Some of these aren't fundamental problem types, but hey, as long
# as I set them up, might as run them.
our %typesToProblems = ( blank => 'blank.problem',
			 essay => 'essay.problem',
			 formula => 'formula.problem',
			 match => 'matching.problem',
			 numerical => 'numerical.problem',
			 option => 'option.problem',
			 plot => 'plot.problem',
			 radiobutton => 'radio.problem',
			 truefalse => 'truefalse.problem',
			 multipart => 'harsh.multipart.problem');

our @HTMLResources = ('testhtml.html');

# Selected metadata results for some of the problems. This
# will help us re-catch the bug we had in .99.2-ish, where the
# metadata got screwed up.
our %metadata = ();

# This is 'simple' metadata, where PROBLEMTYPE is replaced by
# the type of the problem (radiobutton, string, etc.).
$metadata{simple} = {
    'parameter_package_part_0' => 'part,package',
    'parameter_package_PROBLEMTYPEresponse_0_11' => 'part,id,package',
    'stores_0_awarded' => 'part,name,type,display',
    'stores_0_solved' => 'part,name,type,display',
    'stores_0_tries' => 'part,name,type,display'
    };

# Match problems don't have 0_11
$metadata{match} = {
    'parameter_package_matchresponse_0_11' => undef,
    'parameter_package_matchresponse_0_1_3' => 'part,id,package',
    };

# Formula problems have tolerance
$metadata{formula} = {
    'parameter_0_11_tol' => 'part,id,name,type,default,display'
    };

# my "blank" problem has no response field in it
$metadata{blank} = {
    'parameter_package_blankresponse_0_11' => undef 
    };

# plot has lots of exciting things in it 
$metadata{plot} = {
    'parameter_package_plotresponse_0_11' => undef,
    'parameter_package_numericalresponse_0_11' => 'part,id,package',
    'parameter_0_11_sig' => 'part,id,name,type,default,display',
    'parameter_0_11_tol' => 'part,id,name,type,default,display'
    };

$metadata{truefalse} = {
    'parameter_package_optionresponse_0_11' => 'part,id,package',
    'parameter_package_truefalseresponse_0_11' => undef
};

$metadata{multipart} = {
    'parameter_package_multipartresponse_0_11' => undef, 
    'parameter_package_part_19' => 'part,package',
    'parameter_package_stringresponse_19_20' => 'part,id,package',
    'stores_26_awarded' => 'part,name,type,display',
    'stores_25_solved' => 'part,name,type,display',
    'stores_26_tries' => 'part,name,type,display',
    'stores_30_awarded' => 'part,name,type,display',
    'parameter_package_numericalresponse_28_29' => 'part,id,package',
    'stores_11_tries' => 'part,name,type,display',
    'parameter_package_part_33' => 'part,package',
    'stores_21_solved' => 'part,name,type,display',
    'stores_21_awarded' => 'part,name,type,display',
    'parameter_package_optionresponse_23_24' => 'part,id,package',
    'parameter_package_formularesponse_11_16' => 'part,id,package',
    'parameter_package_essayresponse_11_17' => 'part,id,package',
    'stores_31_solved' => 'part,name,type,display',
    'stores_11_solved' => 'part,name,type,display',
    'parameter_package_numericalresponse_11_15' => 'part,id,package',
    'stores_33_awarded' => 'part,name,type,display',
    'parameter_package_formularesponse_31_32' => 'part,id,package',
    'stores_31_awarded' => 'part,name,type,display',
    'parameter_package_rankresponse_25_1_5_1' => 'part,id,package',
    'stores_28_awarded' => 'part,name,type,display',
    'parameter_package_part_30' => 'part,package',
    'stores_11_awarded' => 'part,name,type,display',
    'parameter_package_matchresponse_11_1_1_6' => 'part,id,package',
    'parameter_package_radiobuttonresponse_26_27' =>
	'part,id,package',
	'parameter_package_part_28' => 'part,package',
	'parameter_package_part_21' => 'part,package',
	'stores_19_tries' => 'part,name,type,display',
	'stores_33_tries' => 'part,name,type,display',
	'stores_28_tries' => 'part,name,type,display',
	'parameter_package_part_11' => 'part,package',
	'parameter_package_essayresponse_33_34' => 'part,id,package',
	'parameter_package_imageresponse_33_35' => 'part,id,package',
	'parameter_package_optionresponse_11_13' => 'part,id,package',
	'stores_23_solved' => 'part,name,type,display',
	'stores_31_tries' => 'part,name,type,display',
	'stores_28_solved' => 'part,name,type,display',
	'parameter_package_radiobuttonresponse_11_14' =>
	'part,id,package',
	'stores_25_tries' => 'part,name,type,display',
	'parameter_package_part_25' => 'part,package',
	'stores_23_tries' => 'part,name,type,display',
	'stores_30_solved' => 'part,name,type,display',
	'stores_30_tries' => 'part,name,type,display',
	'parameter_package_part_31' => 'part,package',
	'stores_19_solved' => 'part,name,type,display',
	'stores_19_awarded' => 'part,name,type,display',
	'stores_23_awarded' => 'part,name,type,display',
	'parameter_package_imageresponse_11_18' => 'part,id,package',
	'parameter_package_optionresponse_21_22' => 'part,id,package',
	'parameter_package_part_26' => 'part,package',
	'parameter_package_part_23' => 'part,package',
	'parameter_package_matchresponse_30_1_8_1' =>
	'part,id,package',
	'stores_21_tries' => 'part,name,type,display',
	'parameter_package_stringresponse_11_12' => 'part,id,package',
	'stores_25_awarded' => 'part,name,type,display',
	'stores_26_solved' => 'part,name,type,display',
	'parameter_package_rankresponse_11_1_1_3' =>
	'part,id,package',
	'parameter_package_part_0' => undef,
	'stores_33_solved' => 'part,name,type,display',
	'stores_0_solved' => undef,
	'stores_0_awarded' => undef,
	'stores_0_tries' => undef
};

1;

--bowersj21057865733--