|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjitas.core.Tutor
public class Tutor
The main class for the JITAS class library (core classes). All other applications will use this class to interface with JITAS. This class provides all the necessary functionality for a higher level application to act as an Intelligent Tutoring System. To use this class it needs to be imported by the calling class, which can then directly call methods on this class.
Constructor Summary | |
---|---|
Tutor()
The default constructor for the tutor class. |
|
Tutor(java.lang.String domainsFilePath)
Constructor that takes in a file path for the domains.xml file |
Method Summary | |
---|---|
void |
addAllowedDomain(java.lang.String userName,
java.lang.String domainName)
This method will attempt to give the user access to the specific domain. |
void |
addAllowedDomain(java.lang.String userName,
java.lang.String domainName,
boolean bypassSecurity)
|
void |
addUser(java.lang.String userName,
java.lang.String password,
java.lang.String domainName)
Adds a user to the JITAS system and authorize them to access domains. |
void |
addUser(java.lang.String userName,
java.lang.String password,
java.lang.String domainName,
boolean bypassSecurity)
|
void |
changePassword(java.lang.String userName,
java.lang.String oldPassword,
java.lang.String newPassword)
Change user's existing password to a new password. |
void |
deleteUser(java.lang.String userName)
Delete a user from the JITAS system. |
java.util.Set<java.lang.String> |
getAllDomainNames()
Returns the names of all the domains this tutor knows about (loaded or otherwise) |
java.util.Map<java.lang.String,java.lang.String> |
getAllLongDomainNames()
This gets the long domain names for all loaded domains |
java.util.SortedMap<java.lang.Integer,Problem> |
getAllProblems(java.lang.String userName,
java.lang.String domainName)
Gets all the problems in the current working subdomain of the domain and returns them as a SortedMap. |
java.util.Set<java.lang.String> |
getAllStudentUsernames()
|
java.util.Set<java.lang.String> |
getAllStudentUsernames(java.lang.String filter)
|
boolean |
getLoginStatus(java.lang.String userName,
java.lang.String domainName)
Get the login status for the user, for all the domains a student is logged into (i.e. |
Problem |
getNextProblem(int problemNumber,
java.lang.String userName,
java.lang.String domainName)
Gets the next problem, specified by the user. |
Problem |
getNextProblem(java.lang.String userName,
java.lang.String domainName)
Gets the next problem, based on the current problem number. |
Problem |
getProblem(java.lang.String userName,
java.lang.String domainName)
Gets the next problem, specified by the system. |
java.lang.String |
getProblemStatus(java.lang.String userName,
java.lang.String domainName,
int problemID)
Get the status of a problem for a particular domain and user. |
java.util.Set<java.lang.String> |
getSubdomains(java.lang.String domainName)
Returns a set of all the subdomain names in a given domain, as Strings. |
boolean |
isStudentAllowedInDomain(java.lang.String userName,
java.lang.String domainName)
|
boolean |
isUserCreationAllowed(java.lang.String domainName)
|
void |
loadDomain(java.lang.String domainName)
Load the domain from XML |
void |
login(java.lang.String userName,
java.lang.String password,
java.lang.String domainName)
Login method. |
void |
logout(java.lang.String userName,
java.lang.String domainName)
Logs a specified user out of the domain. |
void |
refreshStudentList()
|
void |
removeUser(java.lang.String userName,
java.lang.String domainName)
Remove a user from a domain. |
void |
selectSubdomain(java.lang.String userName,
java.lang.String subdomainName,
java.lang.String domainName)
Allows a user to select a subdomain to work on. |
void |
setCustomFeedback(java.lang.String domainName,
java.lang.String fileName)
Set the custom feedback object for a domain. |
void |
setCustomProblemSelectionAlgorithm(java.lang.String domainName,
java.lang.String fileName)
Set the custom problem selection algorithm for a domain. |
Feedback |
submitSolution(Solution studentSolution,
java.lang.String userName,
java.lang.String domainName)
Used when a student wishes to submit their solution to the current problem. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tutor() throws java.io.IOException
java.io.IOException
public Tutor(java.lang.String domainsFilePath) throws java.io.IOException
domainsFilePath
- The path to an xml file containing information
about all the domains. The path must include the filename.
java.io.IOException
Method Detail |
---|
public void login(java.lang.String userName, java.lang.String password, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, InvalidLoginException, java.rmi.RemoteException, UserNotFoundException
TutorInterface
login
in interface TutorInterface
userName
- The user name of the user.password
- The password for the user.domainName
- The Domain name the user wants to log into.
DomainNotFoundException
- If the domain is not found.
DomainNotLoadedException
- If the domain is not loaded.
InvalidLoginException
- If the login is invalid (wrong password).
java.rmi.RemoteException
UserNotFoundException
- If the user does not exist.public void logout(java.lang.String userName, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, UserNotFoundException, UserNotLoggedInException, java.rmi.RemoteException
TutorInterface
logout
in interface TutorInterface
userName
- The user to be logged out.domainName
- The Domain name the user wants to log out of.
DomainNotFoundException
- If the domain is not found.
DomainNotLoadedException
- If the domain is not loaded.
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user was not logged in.
java.rmi.RemoteException
public boolean getLoginStatus(java.lang.String userName, java.lang.String domainName) throws UserNotFoundException, java.rmi.RemoteException
TutorInterface
getLoginStatus
in interface TutorInterface
userName
- The user name of the user who wants to log out.domainName
- The Domain name.
UserNotFoundException
- If the user could not be found.
java.rmi.RemoteException
public void addUser(java.lang.String userName, java.lang.String password, java.lang.String domainName) throws AddUserDeniedException, DomainNotFoundException, DomainNotLoadedException, IllegalUserNameException, StudentModelAlreadyExistsException, java.rmi.RemoteException
TutorInterface
addUser
in interface TutorInterface
userName
- The user name of the new user.password
- The password for the new user.domainName
- The Domain name the user wants to create an account for.
AddUserDeniedException
- If new users are not allowed to be added to the domain.
DomainNotFoundException
- If the domain could not be found.
DomainNotLoadedException
- If the requested domain is not loaded.
IllegalUserNameException
- If the user specified an illegal username.
StudentModelAlreadyExistsException
- If a student model already exists.
java.rmi.RemoteException
public void addUser(java.lang.String userName, java.lang.String password, java.lang.String domainName, boolean bypassSecurity) throws AddUserDeniedException, DomainNotFoundException, DomainNotLoadedException, IllegalUserNameException, StudentModelAlreadyExistsException, java.rmi.RemoteException
AddUserDeniedException
DomainNotFoundException
DomainNotLoadedException
IllegalUserNameException
StudentModelAlreadyExistsException
java.rmi.RemoteException
public void removeUser(java.lang.String userName, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, UserNotFoundException, UserNotLoggedInException, java.rmi.RemoteException
TutorInterface
removeUser
in interface TutorInterface
userName
- The user name of the user.domainName
- The name of the Domain the user is to be removed from.
DomainNotFoundException
- If the domain could not be found.
DomainNotLoadedException
- If the requested domain is not loaded.
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user was not logged in.
java.rmi.RemoteException
public void deleteUser(java.lang.String userName) throws DomainNotFoundException, DomainNotLoadedException, UserNotFoundException, UserNotLoggedInException, java.rmi.RemoteException
TutorInterface
deleteUser
in interface TutorInterface
userName
- The user name of the user.
DomainNotFoundException
- If the domain could not be found.
DomainNotLoadedException
- If the user is logged into a domain that's not loaded.
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user was not logged in.
java.rmi.RemoteException
public void addAllowedDomain(java.lang.String userName, java.lang.String domainName) throws AddUserDeniedException, DomainNotFoundException, DomainNotLoadedException, StudentModelAlreadyExistsException, UserNotFoundException, java.rmi.RemoteException
TutorInterface
addAllowedDomain
in interface TutorInterface
userName
- the user name of the userdomainName
- the name of the domain the student wishes to have access to.
AddUserDeniedException
- If new users are not allowed to be added to the domain.
DomainNotFoundException
- thrown if the domain with domainName is not found.
DomainNotLoadedException
- If the requested domain is not loaded.
StudentModelAlreadyExistsException
- If a student model already exists
UserNotFoundException
- thrown if the student with user name userName is not found
java.rmi.RemoteException
public void addAllowedDomain(java.lang.String userName, java.lang.String domainName, boolean bypassSecurity) throws AddUserDeniedException, DomainNotFoundException, DomainNotLoadedException, StudentModelAlreadyExistsException, UserNotFoundException, java.rmi.RemoteException
AddUserDeniedException
DomainNotFoundException
DomainNotLoadedException
StudentModelAlreadyExistsException
UserNotFoundException
java.rmi.RemoteException
public void changePassword(java.lang.String userName, java.lang.String oldPassword, java.lang.String newPassword) throws InvalidPasswordException, UserNotFoundException, java.rmi.RemoteException
TutorInterface
changePassword
in interface TutorInterface
userName
- The user name of the user.oldPassword
- The users current passwordnewPassword
- The new password that the user wants to change to.
InvalidPasswordException
- if the current password given is invalid
java.rmi.RemoteException
UserNotFoundException
public java.util.Set<java.lang.String> getAllStudentUsernames()
public java.util.Set<java.lang.String> getAllStudentUsernames(java.lang.String filter)
public boolean isStudentAllowedInDomain(java.lang.String userName, java.lang.String domainName) throws UserNotFoundException
UserNotFoundException
public boolean isUserCreationAllowed(java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException
DomainNotFoundException
DomainNotLoadedException
public void refreshStudentList() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.util.Set<java.lang.String> getAllDomainNames() throws java.rmi.RemoteException
getAllDomainNames
in interface TutorInterface
java.rmi.RemoteException
public java.util.Map<java.lang.String,java.lang.String> getAllLongDomainNames() throws java.rmi.RemoteException
getAllLongDomainNames
in interface TutorInterface
java.rmi.RemoteException
public java.util.Set<java.lang.String> getSubdomains(java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, java.rmi.RemoteException
TutorInterface
getSubdomains
in interface TutorInterface
domainName
- The name of the domain.
DomainNotFoundException
- if the domain is not found (or not loaded).
DomainNotLoadedException
- If the requested domain is not loaded
java.rmi.RemoteException
public void loadDomain(java.lang.String domainName) throws DomainNotFoundException, java.rmi.RemoteException
loadDomain
in interface TutorInterface
domainName
- The name of the domain you want to load.
DomainNotFoundException
- if the Domain is not found.
java.rmi.RemoteException
public void selectSubdomain(java.lang.String userName, java.lang.String subdomainName, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, ProblemsNotFoundException, SubdomainNotFoundException, UserNotFoundException, UserNotLoggedInException, java.rmi.RemoteException
TutorInterface
selectSubdomain
in interface TutorInterface
userName
- The name of the user.subdomainName
- The name of the subdomain the student wants to work on.domainName
- The name of the domain the student is working on.
DomainNotFoundException
- If the domain could not be found.
DomainNotLoadedException
- If the requested domain is not loaded.
ProblemsNotFoundException
- If no problems could be found for the subdomain.
SubdomainNotFoundException
- If the Subdomain is not found.
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user is not logged in to the domain.
java.rmi.RemoteException
public Problem getNextProblem(int problemNumber, java.lang.String userName, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, InvalidProblemException, UserNotFoundException, UserNotLoggedInException, java.rmi.RemoteException
TutorInterface
getNextProblem
in interface TutorInterface
problemNumber
- The number(id) of the problem the user wants.userName
- The name of the user.domainName
- The name of the domain.
DomainNotFoundException
- If the domain cannot be found.
DomainNotLoadedException
- If the requested domain is not loaded.
InvalidProblemException
- If the problem cannot be found.
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user is not logged in to the domain.
java.rmi.RemoteException
public Problem getNextProblem(java.lang.String userName, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, InvalidProblemException, UserNotFoundException, UserNotLoggedInException, java.rmi.RemoteException
TutorInterface
getNextProblem
in interface TutorInterface
userName
- The name of the user who wants the problem.domainName
- The name of the domain.
DomainNotFoundException
- If the domain cannot be found.
DomainNotLoadedException
- If the requested domain is not loaded.
InvalidProblemException
- If the problem cannot be found.
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user is not logged in to the domain.
java.rmi.RemoteException
public void setCustomProblemSelectionAlgorithm(java.lang.String domainName, java.lang.String fileName) throws DomainNotFoundException, DomainNotLoadedException
TutorInterface
setCustomProblemSelectionAlgorithm
in interface TutorInterface
domainName
- The domain namefileName
- The class name of the class in the jar
DomainNotFoundException
- If the domain doesn't exist
DomainNotLoadedException
- If the domain is not loadedpublic void setCustomFeedback(java.lang.String domainName, java.lang.String fileName) throws DomainNotFoundException, DomainNotLoadedException
TutorInterface
setCustomFeedback
in interface TutorInterface
domainName
- The domain nameefileName
- The class name of the class in the jar
DomainNotFoundException
- If the domain doesn't exist
DomainNotLoadedException
- If the domain is not loadedpublic Problem getProblem(java.lang.String userName, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.rmi.RemoteException, UserNotFoundException, InvalidProblemException
TutorInterface
getProblem
in interface TutorInterface
userName
- The name of the user who wants the problem.domainName
- The name of the domain.
DomainNotFoundException
- If the domain cannot be found.
DomainNotLoadedException
- If the requested domain is not loaded.
java.lang.InstantiationException
- If instantiation fails.
java.lang.IllegalAccessException
- when an application tries to reflectively
create an instance (other than an array),set or get a field, or invoke a method.
java.rmi.RemoteException
UserNotFoundException
InvalidProblemException
public java.util.SortedMap<java.lang.Integer,Problem> getAllProblems(java.lang.String userName, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, UserNotFoundException, UserNotLoggedInException, java.rmi.RemoteException
TutorInterface
getAllProblems
in interface TutorInterface
userName
- The name of the user who wants the problem.domainName
- The name of the domain.
DomainNotFoundException
- If the domain cannot be found.
DomainNotLoadedException
- If the requested domain is not loaded.
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user is not logged in to the domain.
java.rmi.RemoteException
public java.lang.String getProblemStatus(java.lang.String userName, java.lang.String domainName, int problemID) throws UserNotFoundException, UserNotLoggedInException, java.rmi.RemoteException, DomainNotFoundException, DomainNotLoadedException
TutorInterface
getProblemStatus
in interface TutorInterface
userName
- The name of the userdomainName
- The name of the domainproblemID
- The id of the problem you want the status of
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user is not logged in to the domain.
java.rmi.RemoteException
DomainNotFoundException
- If the domain cannot be found.
DomainNotLoadedException
- If the requested domain is not loaded.public Feedback submitSolution(Solution studentSolution, java.lang.String userName, java.lang.String domainName) throws DomainNotFoundException, DomainNotLoadedException, InvalidSolutionException, StudentModelNotFoundException, UserNotFoundException, UserNotLoggedInException, jess.JessException, java.rmi.RemoteException
TutorInterface
submitSolution
in interface TutorInterface
studentSolution
- the students attempt, in a String of key-value pairs.userName
- The name of the user who wants the problem.domainName
- The name of the domain.
DomainNotFoundException
- If the supplied domain cannot be found.
DomainNotLoadedException
- If the requested domain is not loaded.
InvalidSolutionException
- If either the students or ideal solution is invalid.
StudentModelNotFoundException
- If the students StudentModel cannot be found.
UserNotFoundException
- If the user could not be found.
UserNotLoggedInException
- If the user is not logged in to the domain.
jess.JessException
- If something goes wrong in Jess (the rule engine)
java.rmi.RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |