Mathspring Version 2.0 compatible with AWS
This repo can be cloned or forked but you will still need to do some setup.
This repo contains the Java source files that make up the server side of mathspring and the Javascript/HTML/CSS that makes up the client side.
The project is set up to work with Eclipse Oxygen.1a Release (4.7.1a) edition.
There is a large amount of math content that is also not part of this repo. You can still develop and run the tutor without it but if you need to see math problems as part of your testing, then you will need to get this. That is explained below in step 6.
---INSTALLATION INSTRUCTIONS---
Mathspring developers: Clone the repository on your local machine.
Useful video for installing Java on a MAC, and updating path variables:
https://www.youtube.com/watch?v=sNYvYTmOGhU
A few videos that were useful for installing Eclipse for the MAC: https://www.youtube.com/watch?v=CL36-szyr1c
There is a Video here where Ankit explains how to set up Eclipse with Maven and Tomcat and the database: https://drive.google.com/drive/u/0/folders/1QdoEQaZ1iBiVH0J6bGjFv6BiZ9xHQDoY
We got an error at the end, as apparently it needed Java 8 and no later. See here how to install an older version of Java on a MAC: https://support.planwithvoyant.com/hc/en-us/articles/209725003-Install-or-revert-to-a-prior-version-of-Java-Mac-OS-X
Project dependencies are managed by Maven so you will want to make sure you have the eclipse with maven plugin installed. The project is maintained as a single module (pom.xml) with all the dependencies and plugins configured under them.You should make changes to the Project's pom.xml unless you need to bring in new libraries to support what you are doing (take a look at whats in there, as there are likely libraries that will be useful).
The META-INF/context.xml is how mathspring knows how to connect to a database.The web.xml file in web/WEB-INF/web.xml defines an init-paramter called wodb.datasource. It should be set to jdbc/wodblocal if you want to connect to your local db. Thus your context.xml must have a resource like:
<Resource name="jdbc/wodblocal" type="javax.sql.DataSource"
auth="Container" description="Mysql database for Mathforum"
maxActive="100" maxIdle="30" maxWait="10000" username="MyDBUser"
password="MyDBPassword" removeAbandoned="true" removeAbandonedTimeout="60"
logAbandoned="true" testWhileIdle="true"
testOnBorrow="true"
testOnReturn="true"
timeBetweenEvictionRunMillis="600000"
numTestsPerEvictionRun="10"
validationQuery="SELECT 1"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/wayangoutpostdb?autoReconnect=true" />
If you want to connect to a database elsewhere (e.g. on the rose server) you will need to add additional resources to the context.xml and set the web.xml init parameter wodb.datasource so it uses them.
Use Mysql Workbench and make sure this user and password is defined for your database (with only localhost access to be safe) and that it has select,insert,delete,update access.
Note: The database was originally designed on a Windows machine where table names are not case sensitive. When you install the database on other systems that have case sensitive file systems, you will need to configure mysql (ubuntu has a my.cnf file in /etc/mysql that you can edit to have lower_case_table_names = 1 )
Next you need to get the mathspring math content and unzip it. This is a dir called mscontent and it must be placed in your woServer/webResources/mathspring dir (you will need to create these dirs). Get the latest mscontent zip from rose.cs.umass.edu/mathspring/backup/ The result should be /woServer/webResources/mathspring/mscontent. If you run mathspring and get a bunch of 404 errors so that it doesn't show the learning companion and math problems, it will be because you didn't do this right.
Once you have created the project, add the server and configured them to your project in eclipse. Go to project settings and open the deployment asssembly tab and make sure you have the following entries there Source Deploy Path /src WEB-INF/classes /resources / /web / Maven Dependencies WEB-INF/lib
set "JRE_HOME=%ProgramFiles%\Java\jre1.8.0_202" (change to your JRE version)
exit /b 0
org.codehaus.mojo:wagon-maven-plugin:upload-single -Dwagon.fromFile=path\to\MathSpring\release\ms.war -Dwagon.url=file://path\to\webapps\folder\under\tomcat\
\Apache Software Foundation\Tomcat 9.0\webapps\
should be replaced by
\Apache%20Software%20Foundation\Tomcat%209.0\webapps\
-e clean package -P local
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
http://localhost:8080/ms/welcome.html