Skip to content

Commit

Permalink
Merge pull request openwebwork#4 from mgage/master
Browse files Browse the repository at this point in the history
updates from Grant He
  • Loading branch information
aubreyja committed May 25, 2012
2 parents 911bd2c + 92fcea5 commit f317211
Show file tree
Hide file tree
Showing 34 changed files with 4,376 additions and 1,187 deletions.
481 changes: 104 additions & 377 deletions clients/checkProblem.pl

Large diffs are not rendered by default.

44 changes: 42 additions & 2 deletions clients/renderProblem.pl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ =head1 NAME
my $use_site;
#$use_site = 'test_webwork'; # select a rendering site
#$use_site = 'local'; # select a rendering site
$use_site = 'rochester_test'; # select a rendering site
$use_site = 'hosted2'; # select a rendering site


############################################################
Expand Down Expand Up @@ -116,7 +116,7 @@ =head1 NAME
$FORM_ACTION_URL = 'http://localhost:80/webwork2/html2xml';
$XML_PASSWORD = 'xmlwebwork';
$XML_COURSE = 'daemon_course';
} elsif ($use_site eq 'rochester_test') {
} elsif ($use_site eq 'hosted2') {

$XML_URL = 'https://hosted2.webwork.rochester.edu';
$FORM_ACTION_URL = 'https://hosted2.webwork.rochester.edu/webwork2/html2xml';
Expand Down Expand Up @@ -200,6 +200,10 @@ =head1 NAME

our $source;
our $rh_result;

# set fileName path to path for current file (this is a best guess -- may not always be correct)
my $fileName = $ARGV[0]; # should this be ARGV[0]?

# filter mode main code

{
Expand Down Expand Up @@ -229,8 +233,14 @@ =head1 NAME
courseName => $credentials{courseID}||'',
password => $credentials{password}||'',
site_password => $credentials{site_password}||'',
envir => $xmlrpc_client->environment(),

};


$fileName =~ s|/opt/webwork/libraries/NationalProblemLibrary|Library|;
$input->{envir}->{fileName} = $fileName;

#xmlrpcCall('renderProblem');
our $output;
our $result;
Expand All @@ -254,6 +264,36 @@ =head1 NAME

##################################################
# end input/output section


################################################################################
# Storage utilities section
################################################################################
#
# sub write_session_credentials {
# my $credentials = shift;
# my %credentials = %$credentials;
# my $string = "\$session_credentials = {session_key => $credentials{session_key},
# userID => $credentials{userID},
# courseID => $credentials{courseID},
# };\n";
# local(*FH);
# open(FH, '>'.CREDENTIALFILE) or die "Can't open file ".CREDENTIALFILE()." for writing";
# print FH $string;
# close(FH);
# }
#
# sub read_session_credentials {
# local(*FH);
# open(FH, '<'.CREDENTIALFILE) or die "Can't open file ".CREDENTIALFILE()." for writing";
# local ($|);
# my $string = <FH>; # slurp the contents
# my $session_credentials = eval( $string);
# close(FH);
# return $session_credentials;
# }
##################################################
# end input/output section
##################################################

sub pretty_print_rh {
Expand Down
27 changes: 21 additions & 6 deletions conf/global.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,11 @@ $webworkURLs{root} = "$webwork_url";
$webworkDirs{htdocs} = "$webwork_htdocs_dir" || "$webworkDirs{root}/htdocs";
$webworkURLs{htdocs} = "$webwork_htdocs_url";


# Location of web-accessible temporary files, such as equation images.
# These two should be set in prelocal.conf -- not here since this can be overwritten by new versions.
$webworkDirs{htdocs_temp} = (defined $webworkDirs{htdocs_temp} ) ? $webworkDirs{htdocs_temp} :"$webworkDirs{htdocs}/tmp";
$webworkURLs{htdocs_temp} = (defined $webworkURLs{htdocs_temp} ) ? $webworkURLs{htdocs_temp} :"$webworkURLs{htdocs}/tmp";

#$webworkURLs{htdocs_temp} = "$webworkURLs{htdocs}/tmp";
$webworkDirs{htdocs_temp} = "$webworkDirs{htdocs}/tmp";
$webworkURLs{htdocs_temp} = "$webworkURLs{htdocs}/tmp";

# Location of cached equation images.
$webworkDirs{equationCache} = "$webworkDirs{htdocs_temp}/equations";
Expand Down Expand Up @@ -276,8 +275,8 @@ $courseDirs{html_images} = "$courseDirs{html}/images";

# Location of web-accessible, course-specific temporary files, like static and
# dynamically-generated PG graphics.
$courseDirs{html_temp} = "$courseDirs{html}/tmp";
$courseURLs{html_temp} = "$courseURLs{html}/tmp";
$courseDirs{html_temp} = "$courseDirs{html}/tmp";
$courseURLs{html_temp} = "$courseURLs{html}/tmp";

# Location of course-specific logs, like the transaction log.
$courseDirs{logs} = "$courseDirs{root}/logs";
Expand Down Expand Up @@ -732,6 +731,7 @@ $authen{ldap_options} = {
download_hardcopy_view_errors =>"professor",
download_hardcopy_format_pdf => "guest",
download_hardcopy_format_tex => "ta",
download_hardcopy_format_tikz => "professor", # under_construction
);

# This is the default permission level given to new students and students with
Expand Down Expand Up @@ -1049,6 +1049,21 @@ $pgRoot = $pg{directories}{root};
pgproblemeditor1 => 1,
pgproblemeditor2 => 0,
);

################################################################################
# Webservices
################################################################################
$webservices = {
enableCourseActions => 0, # enable createCourse, addUser, dropUser
enableCourseActionsLog => 0,# enable logging of course actions
# will log when courses are created and
# when students are added or dropped
courseActionsLogfile => "$webworkDirs{logs}/courseactions.log",
# enable this to assign all visible homework sets to new students
# added by webservices
courseActionsAssignHomework => 0,
};

################################################################################
# Site wide overrides are entered into the file postlocal.conf
################################################################################
Expand Down
28 changes: 28 additions & 0 deletions conf/postlocal.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ $pg{displayModes} = [
"LaTeXMathML", # render TeX math expressions on the client side using LaTeXMathML
];

+# Default display mode. Should be an uncommented item listed above.
+$pg{options}{displayMode} = "images";

################################################################################
# The macro file search path. (Check with entries in global.conf before overriding)
################################################################################
Expand Down Expand Up @@ -279,4 +282,29 @@ $problemDefaults{max_attempts} = -1;
# pgproblemeditor2 => 1,
# );

################################################################################
# Directory for temporary files
################################################################################
# Location of web-accessible temporary files, such as equation images.
# Default which is set in global.conf.dist:
#$webworkDirs{htdocs_temp} = "$webworkDirs{htdocs}/tmp";
#$webworkURLs{htdocs_temp} = "$webworkURLs{htdocs}/tmp";

# Alternate locations -- this allows you to place temporary files in a location
# that is not backed up and is the recommended set up for most installations.
# See http://webwork.maa.org/wiki/Store_WeBWorK%27s_temporary_files_in_a_separate_directory_or_partition
# for more information. Note that the wwtmp directory (or partition) should be
# created under Apache's main server document root which is usually /var/www. If this
# is in a different location on your system, edit the lines below accordingly.
# To implement, uncomment the following 6 lines:
#$webworkDirs{htdocs_temp} = '/var/www/wwtmp';
#$webworkURLs{htdocs_temp} = '/wwtmp';
#$webworkDirs{equationCache} = "$webworkDirs{htdocs_temp}/equations";
#$webworkURLs{equationCache} = "$webworkURLs{htdocs_temp}/equations";
#$courseDirs{html_temp} = "/var/www/wwtmp/$courseName";
#$courseURLs{html_temp} = "/wwtmp/$courseName";

################################################################################


1; #final line of the file to reassure perl that it was read properly.
23 changes: 4 additions & 19 deletions conf/prelocal.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# URL of WeBWorK handler. If WeBWorK is to be on the web server root, use "". Note
# that using "" may not work so we suggest sticking with "/webwork2".
$webwork_url = "/webwork2";
$server_root_url = "";
$server_root_url = ""; # e.g. http://webwork.yourschool.edu or localhost
$server_userID = "wwadmin";
$server_groupID = "wwdata";

Expand Down Expand Up @@ -126,29 +126,14 @@ $externalPrograms{mysqldump} ="/usr/bin/mysqldump";
# these variables are used by database.conf. we define them here so that editing
# database.conf isn't necessary.

# You must initialize the database and set the password for webworkWrite
# You must initialize the database and set the password for webworkWrite.
# Uncomment the $database_password line and replace 'passwordRW' by the actual password used in the GRANT command above
# The other parameters are set as defaults in global.conf but you can modify them
# here if for example you want to use a mysql database on a remote machine.
################################################################################
$database_dsn ="dbi:mysql:webwork";
$database_username ="webworkWrite";
#$database_password ="passwordRW";

################################################################################
# Directory for temporary files
################################################################################
# Location of web-accessible temporary files, such as equation images.
Default:
#$webworkDirs{htdocs_temp} = "$webworkDirs{htdocs}/tmp";
#$webworkURLs{htdocs_temp} = "$webworkURLs{htdocs}/tmp";

# Alternate locations -- this allows you to place temporary files
# in a location that is not backed up.
#For example.
#$webworkDirs{htdocs_temp} = "/opt/htdocs/wwtmp";
#$webworkURLs{htdocs_temp} = "/wwtmp";

################################################################################
#$database_password ="passwordRW";

1; #final line of the file to reassure perl that it was read properly.

106 changes: 98 additions & 8 deletions conf/templates/math2/math2.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ h2.compound { float: right; margin: 0; padding: 0 }*/
-moz-border-radius-topright: 1.5ex; -moz-border-radius-topleft: 1.5ex;
margin-bottom: 1ex;
margin-top: 0;
width: 90%;
overflow: hidden;
}
.info-box h2,
Expand Down Expand Up @@ -279,11 +280,33 @@ clear: both;
}*/
/* [ww] instead of a search form, we want the loginstatus there */
/*#masthead form {*/

/*Loginstatus -- the element fixed on the top right corner of the page, which tells the user whether they are logged in or not, and provides them with a log out link if they are logged in.*/

#masthead #loginstatus {
float: right;
padding: 0;
margin: 1ex .5em .1ex .1em;
font-size: smaller;
}

/*Relative Positioning -- a alternate style for the loginstatus which uses relative positioning. Tested, but was decided that it didn't work great. Feel free to uncomment if you want to try it out.*/

/*#loginstatus {
color: white;
position: relative;
top: -140px;
left: 470px;
width: 150px;
text-align: center;
padding: 0;
margin: 1ex .5em .1ex .1em;
font-size: smaller;
}*/


#loginstatus a{
color: white;
}
#masthead #loginstatus #Nav {
padding: 1ex;
Expand Down Expand Up @@ -403,9 +426,10 @@ clear: both;
#InfoPanel {
font-size:100%;
float: right;
max-width: 400px;
max-width: 40%;
min-width: 0;
overflow: auto;
margin-right: -1px;
/*margin-right: -1px;*/
background-color: #fff;
}
#InfoPanel ol {
Expand All @@ -428,17 +452,17 @@ div.AuthorComment { background-color: #00E0E0; color: black; }
/*ul.LinksMenu ul { list-style: none; margin-left: 0.5em; padding-left: 0; }*/

/* background styles for success and failure messages */
div.WarningMessage { background-color: #ffcccc; padding: 3px 3px 3px 3px; }
div.WarningMessage { background-color: #FF9494; padding: 3px 3px 3px 3px; }
div.ResultsWithoutError { color: inherit; background-color: #8F8; } /* green */
div.ResultsWithError { color: #C33; background-color: inherit; } /* red */
div.ResultsWithError { color: #FF9494; background-color: inherit; } /* error red, from http://www.colourlovers.com/color/FF9494/error_red*/
div.ResultsAlert { color: #F60; background-color: inherit; } /* orange */
label.WarningMessage { background-color: #FF9494; padding: 3px 3px 3px 3px; }
label.ResultsWithoutError { color: inherit; background-color: #8F8; } /* green */
label.ResultsWithError { color: #FF9494; background-color: inherit; } /* error red, from http://www.colourlovers.com/color/FF9494/error_red*/
label.ResultsAlert { color: #F60; background-color: inherit; } /* orange */
span.WarningMessage { background-color: #FF9494; padding: 3px 3px 3px 3px; }
span.ResultsWithoutError { color: inherit; background-color: #8F8; } /* green */
span.ResultsWithError { color: #C33; background-color: inherit; } /* error red, from http://www.colourlovers.com/color/FF9494/error_red*/
span.ResultsWithError { color: #FF9494; background-color: inherit; } /* error red, from http://www.colourlovers.com/color/FF9494/error_red*/
span.ResultsAlert { color: #F60; background-color: inherit; } /* orange */
span.correct { color: inherit; background-color: #8F8; } /* green */
span.incorrect { color: #FF9494; background-color: inherit; } /* red */
Expand Down Expand Up @@ -682,7 +706,7 @@ span.gray_button{
}
#editor #form_div{
/*float: left;*/
float: left;
width: 100%;
}
Expand Down Expand Up @@ -728,14 +752,80 @@ span.gray_button{
margin-top: 10%;
margin-left: 10%;
margin-right: 10%;
}*/

#editor{
width: 585px;
}

#editor .pg_editor_input_span{
margin-bottom: 10px;
display: none;
}

/*These are styles for the tables of problem sets*/
#editor .pg_editor_input_div{
margin-top: 20px;
margin-left: 50px;
}

#editor #submit_input_div{
margin-top: 10px;
clear: both;
}

#pg_editor_header {
left: 790px;
position: absolute;
top: 130px;
}

#pg_editor_frame_id{
height: 474px;
left: 785px;
position: absolute;
top: 182px;
width: 50%;
overflow: scroll;
}

/*These are styles for the table of problem sets, found on the Homework Sets page. Most are simple alignment changes which makes it so everything isn't bunched up together.*/

.radio_span{
visibility: hidden;
}

table.problem_sets_table {
width: 640px;
float: left;
margin-bottom: 3%;
}

table.problem_sets_table caption {
}

table.problem_sets_table th{
width: 320px;
padding-bottom: 10px;
}

table.problem_sets_table td{
width: 320px;
}

div.problem_sets_options {
clear: both;
margin: 1% 1% 1% 1%;
}

/*This is the styling specifically for the tables of problems displayed for each problem set page*/
table.problem_set_table{
margin-top: 30px;
#width:30%;
text-align: left;
}
table.problem_set_table th{
padding-right: 30px;
}

table.problem_set_table td{
padding-right: 30px;
}
Loading

0 comments on commit f317211

Please sign in to comment.