Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
4fe696f
made script more robust.
pstaabp May 28, 2015
377a286
Added coloring to customized date/times for users that don't have the…
pstaabp May 28, 2015
59aa051
Fixed issue where on ProblemSetDetails View that the customize users …
pstaabp May 28, 2015
d5903cb
fixed a case where the coloring didn't work.
pstaabp May 28, 2015
c8dd5b5
Moved the problem set properties to the top to make it clearer how to…
pstaabp May 28, 2015
31b4e39
fixes an error when the user clicks on the icon in the menu that it d…
pstaabp May 28, 2015
adcc36c
Prevents the user from reordering problems when the set is open.
pstaabp May 28, 2015
18f05df
Added hide_hint to problem sets.
pstaabp May 29, 2015
30f3896
moved assignmentDate code into the AssignmentCalendar and removed it …
pstaabp May 29, 2015
3a95d16
removed code that wasn't doing anything
pstaabp May 29, 2015
c92ca69
Adds a Calendar to the Problem Set Details View.
pstaabp May 29, 2015
e45e9d3
Added number of problems to the Set Details subview
pstaabp May 29, 2015
6449c24
initial checkin of a Set Headers tab on the ProblemSetDeatils view.
pstaabp May 29, 2015
add0567
continued work on the set header viewer/editor.
pstaabp Jun 2, 2015
e7cb9d2
Merge branch 'ww3' of https://github.com/openwebwork/webwork2 into ww…
pstaabp Jun 2, 2015
167c0f8
hide the show and edit problem buttons.
pstaabp Jun 2, 2015
28c6760
fix an error with an update to underscorejs.
pstaabp Jun 2, 2015
b7bca24
Added validation to the problem value.
pstaabp Jun 3, 2015
458a08d
condensed some existing functionality and moved a method from config …
pstaabp Jun 3, 2015
2870a89
condensed some existing functionality and moved a method from config …
pstaabp Jun 3, 2015
e99ba13
added the ability to change the maximum attempts on each problem.
pstaabp Jun 3, 2015
62ecec8
In order to reuse the CalendarView, it needed to be not a subclass of…
pstaabp Jun 19, 2015
90ed853
Fixed an error in which the tab states were not saving.
pstaabp Jun 20, 2015
c04744f
removal of a logging statement.
pstaabp Jun 21, 2015
23b785c
Clean up some errors and some templates.
pstaabp Jun 21, 2015
7555045
Initial creation of mark all correct feature for a given problem in a…
pstaabp Jun 22, 2015
9bc9e03
Mark All Correct functionality is implemented.
pstaabp Jun 22, 2015
a6d607d
Some calendar fixes.
pstaabp Jun 22, 2015
3db36f7
Added gateway parameter edit capabilities in the Problem Set Detail v…
pstaabp Jun 22, 2015
7d45e02
submitting some initial testing of routes
pstaabp Jun 24, 2015
2b77790
Lots of debugging for adding a second problem with the same source.
pstaabp Jul 2, 2015
82d0378
Merge branch 'ww3' of https://github.com/openwebwork/webwork2 into ww…
pstaabp Jul 7, 2015
2d6c27e
More work on the adding of two problems with the same source file.
pstaabp Jul 8, 2015
1a3a3a7
Fix to an error that occurs on login.
pstaabp Jul 8, 2015
9c919f2
This fixes reordering of problem set, a regression.
pstaabp Jul 8, 2015
358bfab
Fixes to reordering of problems.
pstaabp Jul 8, 2015
ad038a6
Fixes an error in that a user couldn't delete a problem.
pstaabp Jul 9, 2015
f59bfaf
Fixed some bugs with the calendar and sidebar.
pstaabp Jul 9, 2015
06683ce
Fixed an issue where after deleting a problem in a set it couldn't be…
pstaabp Jul 9, 2015
988f371
Fixed an issue where after deleting a problem, they couldn't be reord…
pstaabp Jul 9, 2015
d33d6ee
Fixed an issue in the "Student Overrides" tab in that the show time, …
pstaabp Jul 9, 2015
957daf7
Fixed an issue where adding/removing users from a problem set didn't …
pstaabp Jul 9, 2015
7e934d3
Changes to student dates in the student overrides now shows a change …
pstaabp Jul 9, 2015
91fc9e6
Fixes/updates to ProblemSetDetails SetHeaders tab.
pstaabp Jul 9, 2015
5d30bb1
Cleanup of some debug statements.
pstaabp Jul 9, 2015
5bb06f8
More code cleanup.
pstaabp Jul 9, 2015
9cfcb17
Fixes to some of the messaging.
pstaabp Jul 9, 2015
0f078d6
Fixed the error checking on a problem for max_attempts and value.
pstaabp Jul 9, 2015
ee142bd
Fixed the Calendar on the ProblemSetDetails view
pstaabp Jul 9, 2015
c789625
Merge branch 'ww3' of https://github.com/openwebwork/webwork2 into ww…
pstaabp Jul 13, 2015
afc3d7c
Fixed an error where the reduced scoring date appeared where it shoul…
pstaabp Jul 13, 2015
a07dc5f
Fixes to messaging when problems are added/deleting from sets.
pstaabp Jul 13, 2015
b3f1b89
removed smartmatch operators.
pstaabp Jul 14, 2015
9c1f47d
Makes the Authen module of webwork3 a subclass of the Authen module o…
pstaabp Jul 16, 2015
a30fb89
Adds Data::Compare to check_modules and gets rid of some Dumper/debug…
pstaabp Jul 16, 2015
15841b2
Fixed a problem where changing the assignment type of one set altered…
pstaabp Jul 16, 2015
3724237
Fixes to visibility of reduced_credit rows in the Problem Set Detail …
pstaabp Jul 16, 2015
3fc8627
Mark All Correct on a given problem is now functional.
pstaabp Jul 16, 2015
545d7fc
If max_attempts on a problem is -1, it shows "unlimited"
pstaabp Jul 16, 2015
59de275
Fixes to make the reduced_scoring_date visible on the student overrid…
pstaabp Jul 16, 2015
263e752
Fix to errors in fetching set headers.
pstaabp Jul 17, 2015
6462995
Continued work on building timezone support into dancer and ww3. Als…
pstaabp Jul 17, 2015
461f608
continued work on the back end to simplify the routes.
pstaabp Jul 17, 2015
08d8c9d
Merge branch 'ww3-feature/tests' into ww3-feature/problem-set-details
pstaabp Jul 18, 2015
c76a9e0
More changes to get testing working.
pstaabp Jul 20, 2015
80a5a24
More work on tests for ww3.
pstaabp Jul 21, 2015
8e4ef15
Inclusion of a problem sets test suite and bug fixes.
pstaabp Jul 21, 2015
42bfb8c
Fixes to saving the timezone in the general settings.
pstaabp Jul 21, 2015
07f4802
Reverted the problem sets to not shift to UTC, this is done automatic…
pstaabp Jul 23, 2015
bdcc042
Added proctored gateway support.
pstaabp Jul 23, 2015
9bce742
Fixed a bug in which problems weren't rendering.
pstaabp Jul 27, 2015
1b6c692
Added problem_groups to ww3.
pstaabp Jul 27, 2015
aecf650
Removed login proctors from the User Manager.
pstaabp Jul 27, 2015
f59076e
Made errors out of a PG problem less scary.
pstaabp Jul 27, 2015
576b51f
More stability of the Problem Set Details related to reordering probl…
pstaabp Jul 27, 2015
712958c
Lots of bug fixes associated with reordering, deleting problems as we…
pstaabp Jul 28, 2015
4db83a5
Fix to the setHeader error.
pstaabp Jul 28, 2015
616bff4
Fixed an issue where saving a student override date reported the chan…
pstaabp Jul 29, 2015
2f5f3b8
More fixes on messaging
pstaabp Jul 29, 2015
f0cece6
The loginproctors are no longer sent from the server among all users.
pstaabp Jul 29, 2015
9b175e0
fix to assigning a user a problem set.
pstaabp Jul 29, 2015
13b4372
Continued work on reordering problems and deleting problems in a set.
pstaabp Jul 29, 2015
c2873a1
Fixes an error in the problem library.
pstaabp Jul 31, 2015
9136dba
Fix to a regression when adding a problem set.
pstaabp Aug 2, 2015
34afea7
Fixed an error when loading a classlist file generated an unnecessary…
pstaabp Aug 2, 2015
f1afa7a
Fixed an error where a problem set could not be dragged onto the Cour…
pstaabp Aug 4, 2015
9beb4ee
Removed View Hardcopy header from ProblemSetDetails.
pstaabp Aug 10, 2015
ab667cf
Fixed an error associated with Proctored Gateway Quizzes.
pstaabp Aug 10, 2015
2776381
fixed error where markProblemCorrect was not working.
pstaabp Aug 10, 2015
3723e43
Deletes problems from a set without renumbering the set. In addition…
pstaabp Aug 10, 2015
08df1d2
A couple of issues where problem_randorder property of a problem set …
pstaabp Aug 11, 2015
47fab08
Fixed an error where the reduced scoring sets were not being shown co…
pstaabp Aug 11, 2015
4240e9f
ProblemSetDetails now displays message for JITAR sets.
pstaabp Aug 11, 2015
ef675bb
changes such that problem set boolean fields save correctly.
pstaabp Aug 11, 2015
747149f
Changed the problem path (source_file) to an editable field.
pstaabp Aug 17, 2015
f3eaa75
Fixed an issue where the problem set data wasn't being parsed from th…
pstaabp Aug 22, 2015
5134ca4
Fixed an issue where you couldn't change weeks in the calendar.
pstaabp Aug 31, 2015
a34d2ed
Added webwork_root to ensure proper loading of the dancer app, fixed …
pstaabp Aug 31, 2015
3f2b2f3
fixed an issue where selecting the ProblemDetailView a second time ge…
pstaabp Aug 31, 2015
7f4b421
Changes the server side update to a user problem to only update those…
pstaabp Aug 31, 2015
5bfaa9b
Merge branch 'ww3' of https://github.com/openwebwork/webwork2 into ww…
pstaabp Sep 5, 2015
dba7375
fixed a syntax error.
pstaabp Sep 9, 2015
29e3548
fixes an error that occurs for student overrides in the Problem Set D…
pstaabp Sep 14, 2015
fe9c9e9
Fixes to saving the set header.
pstaabp Sep 15, 2015
f803bed
Fixed an issue where updating a user override returned an error.
pstaabp Sep 18, 2015
65d8248
changes so that all problems for a given set are viewable. This take…
pstaabp Sep 18, 2015
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: 1 addition & 0 deletions bin/check_modules.pl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
Dancer
Dancer::Plugin::Database
Data::Dumper
Data::Compare
Data::UUID
Date::Format
Date::Parse
Expand Down
302 changes: 155 additions & 147 deletions webwork3/bin/app.pl
Original file line number Diff line number Diff line change
@@ -1,151 +1,159 @@
#!/usr/bin/env perl
use Dancer;
use Dancer::Plugin::Database;

BEGIN {$ENV{MOD_PERL_API_VERSION}=2}

# link to WeBWorK code libraries
use lib config->{webwork_dir}.'/lib';
use lib config->{pg_dir}.'/lib';

use WeBWorK::CourseEnvironment;
use WeBWorK::DB;
use WeBWorK::Authen;

## note: Routes::Authenication must be passed first
use Routes::Authentication qw/buildSession setCourseEnvironment setCookie/;
use Routes::Course;
use Routes::Library;
use Routes::ProblemSets;
use Routes::User;
use Routes::Settings;
use Routes::PastAnswers;

set serializer => 'JSON';

hook 'before' => sub {

# for my $key (keys(%{request->params})){
# my $value = defined(params->{$key}) ? params->{$key} : '';
# debug($key . " : " . $value);
# }

};

## right now, this is to help handshaking between the original webservice and dancer.
## it does nothing except sets the session using the hook 'before' above.

post '/handshake' => sub {


debug "in /handshake";

setCourseEnvironment(params->{course_id});

debug session;
buildSession();
if (! session 'logged_in'){
send_error('You are no longer logged in. You may need to reauthenticate.',419);
}

return {msg => "If you get this message the handshaking between Dancer and WW2 worked."};
};


post '/courses/:course_id/login' => sub {

my $authen = new WeBWorK::Authen(vars->{ce});
$authen->set_params({
user => params->{user},
password => params->{password},
key => params->{session_key}
});

my $result = $authen->verify();

if($result){
my $key = $authen->create_session(params->{user});

session user => params->{user};
session key => $key;

my $permission = vars->{db}->getPermissionLevel(session->{user});
session permission => $permission->{permission};
session timestamp => time();

setCookie();

return {session_key=>$key, user=>params->{user},logged_in=>1};

} else {
return {logged_in=>0};
}
};


post '/courses/:course_id/logout' => sub {

my $deleteKey = vars->{db}->deleteKey(session 'user');
my $sessionDestroy = session->destroy;

my $hostname = vars->{ce}->{server_root_url};
$hostname =~ s/https?:\/\///;

if ($hostname ne "localhost" && $hostname ne "127.0.0.1") {
cookie "WeBWorK.CourseAuthen." . params->{course_id} => "", domain=>$hostname, expires => "-1 hour";
} else {
cookie "WeBWorK.CourseAuthen." . params->{course_id} => "", expires => "-1 hour";
}

return {logged_in=>0};
};


get '/app-info' => sub {
return {
environment=>config->{environment},
port=>config->{port},
content_type=>config->{content_type},
startup_info=>config->{startup_info},
server=>config->{server},
appdir=>config->{appdir},
template=>config->{template},
logger=>config->{logger},
session=>config->{session},
session_expires=>config->{session_expires},
session_name=>config->{session_name},
session_secure=>config->{session_secure},
session_is_http_only=>config->{session_is_http_only},
};
};

get '/courses/:course_id/info' => sub {

setCourseEnvironment(params->{course_id});

return {
course_id => params->{course_id},
webwork_dir => vars->{ce}->{webwork_dir},
webworkURLs => vars->{ce}->{webworkURLs},
webworkDirs => vars->{ce}->{webworkDirs}
};

};


sub checkCourse {
if (! defined(session->{course})) {
if (defined(params->{course_id})) {
session->{course} = params->{course_id};
} else {
send_error("The course has not been defined. You may need to authenticate again",401);
}

}

var ce => WeBWorK::CourseEnvironment->new({webwork_dir => config->{webwork_dir}, courseName=> session->{course}});

}


Dancer->dance;
use Dancer;
use WeBWorK3;



#package WeBWorK3;
#use Dancer;
#use Dancer::Plugin::Database;
#
## link to WeBWorK code libraries
#use lib config->{webwork_dir}.'/lib';
#use lib config->{pg_dir}.'/lib';
#
#use WeBWorK::CourseEnvironment;
#use WeBWorK::DB;
#use WeBWorK::Authen;
#
### note: Routes::Authenication must be passed first
#use Routes::Authentication qw/buildSession setCourseEnvironment setCookie/;
#use Routes::Course;
#use Routes::Library;
#use Routes::ProblemSets;
#use Routes::User;
#use Routes::Settings;
#use Routes::PastAnswers;
#
#set serializer => 'JSON';
#
#hook 'before' => sub {
#
# # for my $key (keys(%{request->params})){
# # my $value = defined(params->{$key}) ? params->{$key} : '';
# # debug($key . " : " . $value);
# # }
#
#};
#
### right now, this is to help handshaking between the original webservice and dancer.
### it does nothing except sets the session using the hook 'before' above.
#
#post '/handshake' => sub {
#
#
# debug "in /handshake";
#
# setCourseEnvironment(params->{course_id});
#
# debug session;
# buildSession();
# if (! session 'logged_in'){
# send_error('You are no longer logged in. You may need to reauthenticate.',419);
# }
#
# return {msg => "If you get this message the handshaking between Dancer and WW2 worked."};
#};
#
#
#post '/courses/:course_id/login' => sub {
#
# my $authen = new WeBWorK::Authen(vars->{ce});
# $authen->set_params({
# user => params->{user},
# password => params->{password},
# key => params->{session_key}
# });
#
# my $result = $authen->verify();
#
# if($result){
# my $key = $authen->create_session(params->{user});
#
# session user => params->{user};
# session key => $key;
#
# my $permission = vars->{db}->getPermissionLevel(session->{user});
# session permission => $permission->{permission};
# session timestamp => time();
#
# setCookie();
#
# return {session_key=>$key, user=>params->{user},logged_in=>1};
#
# } else {
# return {logged_in=>0};
# }
#};
#
#
#post '/courses/:course_id/logout' => sub {
#
# my $deleteKey = vars->{db}->deleteKey(session 'user');
# my $sessionDestroy = session->destroy;
#
# my $hostname = vars->{ce}->{server_root_url};
# $hostname =~ s/https?:\/\///;
#
# if ($hostname ne "localhost" && $hostname ne "127.0.0.1") {
# cookie "WeBWorKCourseAuthen." . params->{course_id} => "", domain=>$hostname, expires => "-1 hour";
# } else {
# cookie "WeBWorKCourseAuthen." . params->{course_id} => "", expires => "-1 hour";
# }
#
# return {logged_in=>0};
#};
#
#
#get '/app-info' => sub {
# return {
# appname => config->{appname},
# environment=>config->{environment},
# port=>config->{port},
# content_type=>config->{content_type},
# startup_info=>config->{startup_info},
# server=>config->{server},
# appdir=>config->{appdir},
# template=>config->{template},
# logger=>config->{logger},
# session=>config->{session},
# session_expires=>config->{session_expires},
# session_name=>config->{session_name},
# session_secure=>config->{session_secure},
# session_is_http_only=>config->{session_is_http_only},
# };
#};
#
#get '/courses/:course_id/info' => sub {
#
# setCourseEnvironment(params->{course_id});
#
# return {
# course_id => params->{course_id},
# webwork_dir => vars->{ce}->{webwork_dir},
# webworkURLs => vars->{ce}->{webworkURLs},
# webworkDirs => vars->{ce}->{webworkDirs}
# };
#
#};
#
#
#sub checkCourse {
# if (! defined(session->{course})) {
# if (defined(params->{course_id})) {
# session->{course} = params->{course_id};
# } else {
# send_error("The course has not been defined. You may need to authenticate again",401);
# }
#
# }
#
# var ce => WeBWorK::CourseEnvironment->new({webwork_dir => config->{webwork_dir}, courseName=> session->{course}});
#
#}


dance;
Loading