@Component public class CopyManagerImpl extends java.lang.Object implements CopyManager
Constructor and Description |
---|
CopyManagerImpl() |
Modifier and Type | Method and Description |
---|---|
int |
createAssistmentOwnership(int astId,
int contentCreatorId)
Add a row in assistment ownership for the ownership of astId by contentCreatorId
|
int |
createProblemSectionByAstId(int sequenceId,
int astId)
Add a row in section for the lowest level section, which is problem section
as well as the assistments_to_sequence_association table
|
int |
createSectionByChildSections(int sequenceId,
java.util.List<java.lang.Integer> childSectionIdList,
java.lang.String type,
java.lang.String parameters)
Add a row in section for the parent section of a list of child sections.
|
int |
createSectionByChildSections(int sequenceId,
java.util.List<java.lang.Integer> childSectionIdList,
java.lang.String type,
java.lang.String parameters,
java.lang.String sectionName)
Add a row in section for the parent section of a list of child sections.
|
int |
createSequenceInfo(int oldSequenceId,
int newSequenceId)
Add a row in sequence info for the newly created sequence
|
int |
createSequenceOwnership(int contentCreatorId,
int sequenceId)
Add a row in sequence ownership for the ownership of sequenceId by contentCreatorId
|
int |
createTutorStrategy(int problemId,
java.lang.String type)
Add a row in tutor strategy for the newly created tutor strategy
|
int |
createUserGeneratedHint(int newProblemId,
int newSequenceId,
int contentCreatorId,
java.lang.String hint,
boolean hasAnswer,
boolean isGeneric)
Add a row in user generated hint after the customization for future learning and tracking...
|
int |
createVideoHint(int tutor_strategy_id,
java.lang.String videoHint)
Add a row in hint for a video hint
|
java.util.List<java.lang.Integer> |
deepCopyAnswers(java.util.List<AnswerRow> answerList,
int newProblemId)
Copy all the existing answers for the new problem and insert them into database
|
int |
deepCopyAssistment(Assistment ast)
Copy the chosen assistment for the assistment with video hint
|
int |
deepCopyAssistmentInfo(AssistmentInfo astInfo,
int toAstId)
Copy the existing assistment info for the new assistment and insert a row into database
|
java.util.List<java.lang.Integer> |
deepCopyHintsWithVideoHint(java.util.List<HintRow> hintList,
int newStrategyId,
java.lang.String videoHintStr)
Copy all the existing hints for the new tutor strategy and insert them into database
The videoHintStr is the video hint embed code for mobile server.
|
int |
deepCopyProblem(ProblemRow problem,
int newAstId,
int scaffoldId)
Copy the existing problem for the new assistment and insert a row into database
|
int |
deepCopyScaffold(Scaffold scaffold,
int newStrategyId)
Copy the existing scaffold for new tutor strategy and insert a row into database
|
int |
deepCopySequence(Sequence sequence)
Copy the existing sequence.
|
int |
deepCopySequence(Sequence sequence,
java.lang.String parameters)
Copy the existing sequence with customized parameter
|
int |
deepCopySequence(Sequence sequence,
java.lang.String sequenceName,
java.lang.String sequenceDescription,
java.lang.String parameters)
Copy the existing sequence with customized parameter
|
int |
deepCopyTutorStrategy(TutorStrategy tutorStrategy,
int newProblemId)
Copy the existing tutor strategy for new problem and insert a row into database
|
public int deepCopyAssistment(Assistment ast)
CopyManager
deepCopyAssistment
in interface CopyManager
ast
- the original assistmentpublic int deepCopyProblem(ProblemRow problem, int newAstId, int scaffoldId)
CopyManager
deepCopyProblem
in interface CopyManager
problem
- the existing problemnewAstId
- the id of the new assistmentscaffoldId
- the scaffold if of the new problem. If there is no scaffold, pass in 0 as scaffoldId herepublic int createAssistmentOwnership(int astId, int contentCreatorId)
CopyManager
createAssistmentOwnership
in interface CopyManager
astId
- the assistment idcontentCreatorId
- the content creator id of a userpublic int deepCopyAssistmentInfo(AssistmentInfo astInfo, int toAstId)
CopyManager
deepCopyAssistmentInfo
in interface CopyManager
astInfo
- the existing assistment infotoAstId
- the id of the new assistmentpublic java.util.List<java.lang.Integer> deepCopyAnswers(java.util.List<AnswerRow> answerList, int newProblemId)
CopyManager
deepCopyAnswers
in interface CopyManager
answerList
- the existing answer listnewProblemId
- the id of the new problempublic java.util.List<java.lang.Integer> deepCopyHintsWithVideoHint(java.util.List<HintRow> hintList, int newStrategyId, java.lang.String videoHintStr)
CopyManager
deepCopyHintsWithVideoHint
in interface CopyManager
hintList
- the existing hint listnewStrategyId
- the id of the new tutor strategyvideoHintStr
- the string form hintpublic int deepCopyScaffold(Scaffold scaffold, int newStrategyId)
CopyManager
deepCopyScaffold
in interface CopyManager
scaffold
- the existing scaffoldnewStrategyId
- the id of the new tutor strategypublic int createTutorStrategy(int problemId, java.lang.String type)
CopyManager
createTutorStrategy
in interface CopyManager
problemId
- the problem that needs tutor strategytype
- the content type of the tutor strategy. Can be either Hint or Scaffoldpublic int createVideoHint(int tutor_strategy_id, java.lang.String videoHint)
CopyManager
createVideoHint
in interface CopyManager
tutor_strategy_id
- the tutor strategy id of that the hint comes fromvideoHint
- the string form embeded video codepublic int deepCopyTutorStrategy(TutorStrategy tutorStrategy, int newProblemId)
CopyManager
deepCopyTutorStrategy
in interface CopyManager
tutorStrategy
- the existing tutor strategynewProblemId
- the id of the new problempublic int createSequenceInfo(int oldSequenceId, int newSequenceId)
CopyManager
createSequenceInfo
in interface CopyManager
oldSequenceId
- the id of the original sequencenewSequenceId
- the id of the new sequencepublic int deepCopySequence(Sequence sequence)
CopyManager
deepCopySequence
in interface CopyManager
sequence
- the original sequencepublic int deepCopySequence(Sequence sequence, java.lang.String parameters)
CopyManager
deepCopySequence
in interface CopyManager
sequence
- the original sequencepublic int deepCopySequence(Sequence sequence, java.lang.String sequenceName, java.lang.String sequenceDescription, java.lang.String parameters)
CopyManager
deepCopySequence
in interface CopyManager
sequence
- the original sequencesequenceName
- the name of the new sequencesequenceDescription
- the description of the new sequencepublic int createSequenceOwnership(int contentCreatorId, int sequenceId)
CopyManager
createSequenceOwnership
in interface CopyManager
contentCreatorId
- the owner id of the sequencesequenceId
- the new sequence id that is seeking its owner :)public int createProblemSectionByAstId(int sequenceId, int astId)
CopyManager
createProblemSectionByAstId
in interface CopyManager
sequenceId
- the sequence id that problem section belongs toastId
- the sequencepublic int createSectionByChildSections(int sequenceId, java.util.List<java.lang.Integer> childSectionIdList, java.lang.String type, java.lang.String parameters)
CopyManager
createSectionByChildSections
in interface CopyManager
sequenceId
- the sequence id that the section belongs tochildSectionIdList
- the list of child sectiontype
- the type of the parent section (Mastery, Linear, Random ... )parameters
- the parameters of the section (new line should be \n in th string)public int createSectionByChildSections(int sequenceId, java.util.List<java.lang.Integer> childSectionIdList, java.lang.String type, java.lang.String parameters, java.lang.String sectionName)
CopyManager
createSectionByChildSections
in interface CopyManager
sequenceId
- the sequence id that the section belongs tochildSectionIdList
- the list of child sectiontype
- the type of the parent section (Mastery, Linear, Random ... )parameters
- the parameters of the section (new line should be \n in th string)sectionName
- the name of the section to be createdpublic int createUserGeneratedHint(int newProblemId, int newSequenceId, int contentCreatorId, java.lang.String hint, boolean hasAnswer, boolean isGeneric)
CopyManager
createUserGeneratedHint
in interface CopyManager
newProblemId
- the new problem id that is chosen to be customizednewSequenceId
- the if of the newly create sequencecontentCreatorId
- the content creator id for tracking who customized this sequencehint
- the URL of the video hinthasAnswer
- answer of the question for creator: Does this hint give the final answerisGeneric
- answer of the question for creator: Can we use this hint on similar questions?