Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ courses.dist
library-directory-tree.json
library-subject-tree.json
textbook-tree.json
development.yml
*~
<<<<<<< HEAD
/webwork3/public/js/bower_components/*
Expand Down
1 change: 1 addition & 0 deletions conf/defaults.config
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ $webservices = {
# The items below can be placed in localOverrides.conf override the settings in this file
# One can also use $showeditors{classlisteditor1}=0; to override a setting.
%showeditors = (
ww3 => 1,
classlisteditor1 => 0,
classlisteditor2 => 1,

Expand Down
4 changes: 2 additions & 2 deletions conf/localOverrides.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ $problemDefaults{max_attempts} = -1;
# These will disappear (or at least decrease in number) once the final editor verisons
# are determined.
%showeditors = (
ww3 => 1,
# classlisteditor1 => 1,
classlisteditor2 => 1,
classlisteditor3 => 1,

#
# homeworkseteditor1 => 1,
homeworkseteditor2 => 1,
homeworkseteditor3 => 1,
#
# librarybrowsernojs => 1,
librarybrowser1 => 1,
Expand Down
36 changes: 26 additions & 10 deletions conf/webwork.apache2-config.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
# The "show source" button is most useful for webwork "courses" used to train new authors
# It is not desirable to expose the code of regular homework questions to students

ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2


#ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2

PerlModule mod_perl2

Expand Down Expand Up @@ -97,7 +95,6 @@ eval "use lib '$pg_dir/lib'"; die $@ if $@;

require Apache::WeBWorK; # force compilation of pretty much everything


# At this point, the following configuration variables should be present for use
# in wiring WeBWorK into Apache:
#
Expand Down Expand Up @@ -149,18 +146,37 @@ if ($webwork_url eq "") {
$Location{$webwork_htdocs_url} = { SetHandler => "none" };
}

</Perl>

####################################################################
# The RESTful webservice is to be running on port 3000 and this allows
# proper connection to it.
####################################################################
##########################################################################
# WeBWork 3
# This sets up webwork 3 to be served via dancer via cgi
# If you want to serve webwork 3 directly through dancer comment
# out the following block, and then uncomment the proxy pass lines below
# You will need to start dancer manually, or set it up as service
##########################################################################

my $webwork3_htdocs_dir = $webwork_dir."/webwork3/public";
# Set up /webwork3 to point to the dispatch cgi
push @Alias, [ "/webwork3/js" => "$webwork3_htdocs_dir/js"];
push @Alias, [ "/webwork3/css" => "$webwork3_htdocs_dir/css"];
push @Alias, [ "/webwork3/images" => "$webwork3_htdocs_dir/images"];
push @PerlConfig, "ScriptAlias /webwork3 $webwork3_htdocs_dir/dispatch.fcgi";

# Allow cgi to run in the webwork3 dir
$Directory{"$webwork3_htdocs_dir"} = {
AllowOverride => "None",
Options => "+ExecCGI -MultiViews +SymLinksIfOwnerMatch",
Order => "allow,deny",
Allow => "from all",
AddHandler => "fastcgi-script .fcgi",
};

</Perl>

# These lines are for service WeBWork 3 through dancer directly.
#ProxyPass /webwork3 http://localhost:3000
#ProxyPassReverse /webwork3 http://localhost:3000


####################################################################
# WebworkSOAP handlers (for integration with moodle)
####################################################################
Expand Down
31 changes: 28 additions & 3 deletions conf/webwork.apache2.4-config.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
# The "show source" button is most useful for webwork "courses" used to train new authors
# It is not desirable to expose the code of regular homework questions to students

ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2


#ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2

PerlModule mod_perl2

Expand Down Expand Up @@ -145,8 +143,35 @@ if ($webwork_url eq "") {
$Location{$webwork_htdocs_url} = { SetHandler => "none" };
}

##########################################################################
# WeBWork 3
# This sets up webwork 3 to be served via dancer via cgi
# If you want to serve webwork 3 directly through dancer comment
# out the following block, and then uncomment the proxy pass lines below
# You will need to start dancer manually, or set it up as service
##########################################################################

my $webwork3_htdocs_dir = $webwork_dir."/webwork3/public";
# Set up /webwork3 to point to the dispatch cgi
push @Alias, [ "/webwork3/js" => "$webwork3_htdocs_dir/js"];
push @Alias, [ "/webwork3/css" => "$webwork3_htdocs_dir/css"];
push @Alias, [ "/webwork3/images" => "$webwork3_htdocs_dir/images"];
push @PerlConfig, "ScriptAlias /webwork3 $webwork3_htdocs_dir/dispatch.fcgi";

# Allow cgi to run in the webwork3 dir
$Directory{"$webwork3_htdocs_dir"} = {
AllowOverride => "None",
Options => "+ExecCGI -MultiViews +SymLinksIfOwnerMatch",
Require => "all granted",
AddHandler => "fastcgi-script .fcgi",
};

</Perl>

# These lines are for service WeBWork 3 through dancer directly.
#ProxyPass /webwork3 http://localhost:3000
#ProxyPassReverse /webwork3 http://localhost:3000

####################################################################
# WebworkSOAP handlers (for integration with moodle)
####################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# configuration file for development environment

# configuration file for WeBWorK 3. This is a YAML formatted file, not Perl
# formatted like the other configuration files. The webwork_dir, pg_dir,
# and database information needs to be set for WeBWorK 3 to work.
#
# The webwork directory needs to be set

webwork_dir: "/opt/webwork/webwork2"
pg_dir: "/opt/webwork/pg"

# the logger engine to use
# console: log messages to STDOUT (your console where you started the
# application server)
# file: log message to a file in log/
# file: log message to a file in logs/
# Note: If you are running through apache and not a stand alone server you
# wont be able to see the log information. To see the log information you
# need to change this to file and then make sure that webwork2/webwork3/logs
# is owned, readable and writable by the wwdata group.
logger: "console"

# the log level for this environment
Expand Down
16 changes: 12 additions & 4 deletions lib/WeBWorK/ContentGenerator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -754,14 +754,21 @@ sub links {
print CGI::end_li();
print CGI::start_li();
print CGI::start_ul();

# WW3 redirect
print CGI::li(&$makelink("${pfx}WW3", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{ww3};


#class list editor
print CGI::li(&$makelink("${pfx}UserList", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{classlisteditor1};
print CGI::li(&$makelink("${pfx}UserList2", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{classlisteditor2};
print CGI::li(&$makelink("${pfx}UserList3", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{classlisteditor3};

# the following is WW3 page which is being included elsewhere
# print CGI::li(&$makelink("${pfx}UserList3", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
# if $ce->{showeditors}->{classlisteditor3};


# Homework Set Editor
Expand All @@ -770,8 +777,9 @@ sub links {

print CGI::li(&$makelink("${pfx}ProblemSetList2", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{homeworkseteditor2};
print CGI::li(&$makelink("${pfx}ProblemSetList3", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
if $ce->{showeditors}->{homeworkseteditor3};
# the following is WW3 page which is being included elsewhere
# print CGI::li(&$makelink("${pfx}ProblemSetList3", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args))
# if $ce->{showeditors}->{homeworkseteditor3};

## only show editor link for non-versioned sets
if (defined $setID && $setID !~ /,v\d+$/ ) {
Expand Down
66 changes: 66 additions & 0 deletions lib/WeBWorK/ContentGenerator/Instructor/WW3.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
################################################################################
# WeBWorK Online Homework Delivery System
# Copyright � 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
# $CVSHeader:
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of either: (a) the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any later
# version, or (b) the "Artistic License" which comes with this package.
#
# This program 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 either the GNU General Public License or the
# Artistic License for more details.
################################################################################

package WeBWorK::ContentGenerator::Instructor::WW3;
use base qw(WeBWorK);
use base qw(WeBWorK::ContentGenerator::Instructor);
use JSON qw(to_json);

=head1 NAME

WeBWorK::ContentGenerator::Instructor::WW3 - provides redirect to WW3 tools

=cut




use strict;
use warnings;
#use CGI qw(-nosticky );
use WeBWorK::CGI qw/redirect/;
use WeBWorK::Debug;

sub footer(){
my $self = shift;
my $r = $self->r;
my $ce = $r->ce;
my $ww_version = $ce->{WW_VERSION}||"unknown -- set ww version VERSION";
my $pg_version = $ce->{PG_VERSION}||"unknown -- set pg version PG_VERSION link to ../pg/VERSION";
my $theme = $ce->{defaultTheme}||"unknown -- set defaultTheme in localOverides.conf";
my $copyright_years = $ce->{WW_COPYRIGHT_YEARS}||"1996-2011";
# print CGI::div({-id=>"last-modified"}, $r->maketext("Page generated at [_1]", timestamp($self)));
print CGI::div({-id=>"copyright",class=>"nav navbar-text"}, "WeBWorK &#169; $copyright_years", "| theme: $theme | ww_version: $ww_version | pg_version: $pg_version|", CGI::a({-href=>"http://webwork.maa.org/"}, $r->maketext("The WeBWorK Project"), ));
return ""
}


sub pre_header_initialize {
my $self = shift;
my $r = $self->r;
my $urlpath = $r->urlpath;
print redirect("/webwork3/courses/". $urlpath->arg("courseID") . "/manager");

}



1;
=head1 AUTHOR

Written by Peter Staab at (pstaab at fitchburgstate.edu)

=cut
60 changes: 40 additions & 20 deletions lib/WeBWorK/URLPath.pm
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ our %pathTypes = (
instructor_tools => {
name => 'Instructor Tools',
parent => 'set_list',
kids => [ qw/instructor_user_list instructor_user_list2 instructor_user_list3 instructor_set_list instructor_set_list2 instructor_set_list3
kids => [ qw/ww3_course_manager instructor_user_list instructor_user_list2
instructor_set_list instructor_set_list2
instructor_add_users instructor_achievement_list
instructor_set_assigner instructor_file_manager
instructor_problem_editor instructor_problem_editor2 instructor_problem_editor3 instructor_simple_editor
Expand All @@ -374,6 +375,23 @@ our %pathTypes = (
display => 'WeBWorK::ContentGenerator::Instructor::Index',
},

################################################################################
#
# Link to WW3 Course Manager
#
################################################################################

ww3_course_manager => {
name => 'WeBWorK3',
parent => 'instructor_tools',
kids => [ qw// ],
match => qr|^ww3/|,
capture => [ qw// ],
produce => 'ww3',
display => 'WeBWorK::ContentGenerator::Instructor::WW3',

},

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

instructor_user_list => {
Expand All @@ -394,15 +412,16 @@ our %pathTypes = (
produce => 'users2/',
display => 'WeBWorK::ContentGenerator::Instructor::UserList2',
},
instructor_user_list3 => {
name => 'Classlist Manager',
parent => 'instructor_tools',
kids => [ qw/instructor_user_detail/ ],
match => qr|^users3/|,
capture => [ qw// ],
produce => 'users3/',
display => 'WeBWorK::ContentGenerator::Instructor::UserList3',
},
# This is a WW3 page that is being included else.
# instructor_user_list3 => {
# name => 'Classlist Manager',
# parent => 'instructor_tools',
# kids => [ qw/instructor_user_detail/ ],
# match => qr|^users3/|,
# capture => [ qw// ],
# produce => 'users3/',
# display => 'WeBWorK::ContentGenerator::Instructor::UserList3',
# },
instructor_user_detail => {
name => 'Sets assigned to $userID',
parent => 'instructor_user_list',
Expand Down Expand Up @@ -442,16 +461,17 @@ our %pathTypes = (
produce => 'sets2/',
display => 'WeBWorK::ContentGenerator::Instructor::ProblemSetList2',
},

instructor_set_list3 => {
name => 'Homework Manager',
parent => 'instructor_tools',
kids => [ qw/instructor_set_detail/ ],
match => qr|^sets3/|,
capture => [ qw// ],
produce => 'sets3/',
display => 'WeBWorK::ContentGenerator::Instructor::ProblemSetList3',
},
# This is a WW3 page that is being included elsewhere
#
# instructor_set_list3 => {
# name => 'Homework Manager',
# parent => 'instructor_tools',
# kids => [ qw/instructor_set_detail/ ],
# match => qr|^sets3/|,
# capture => [ qw// ],
# produce => 'sets3/',
# display => 'WeBWorK::ContentGenerator::Instructor::ProblemSetList3',
# },


instructor_set_detail => {
Expand Down
Loading