Assessment Generator now delegates answer selection to methods
This commit is contained in:
parent
4a650ffd79
commit
899a0eb97f
1 changed files with 14 additions and 7 deletions
|
@ -22,7 +22,7 @@ public class AssessmentGenerator {
|
||||||
* @param wordList
|
* @param wordList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public LinkedList<Question> generateAssessment(LinkedList<DictionaryEntry> wordList){
|
public static LinkedList<Question> generateAssessment(LinkedList<DictionaryEntry> wordList){
|
||||||
LinkedList<Question> listOfAssessment = new LinkedList<>();
|
LinkedList<Question> listOfAssessment = new LinkedList<>();
|
||||||
LinkedList<DictionaryEntry> practiseList = Application.practiseList;
|
LinkedList<DictionaryEntry> practiseList = Application.practiseList;
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
@ -39,14 +39,14 @@ public class AssessmentGenerator {
|
||||||
//wordToTranslatePlace = rand.nextInt(Application.practiseList.size());
|
//wordToTranslatePlace = rand.nextInt(Application.practiseList.size());
|
||||||
//wordToTranslate = Application.practiseList.get(wordToTranslatePlace);
|
//wordToTranslate = Application.practiseList.get(wordToTranslatePlace);
|
||||||
|
|
||||||
generatedAssessment = generateWordEnter(practiseList);
|
generatedAssessment = generateTranslationTest(practiseList);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case (1): //1 Means six meanings test.
|
case (1): //1 Means six meanings test.
|
||||||
//wordToTranslatePlace = rand.nextInt(Application.practiseList.size());
|
//wordToTranslatePlace = rand.nextInt(Application.practiseList.size());
|
||||||
//wordToTranslate = Application.practiseList.get(wordToTranslatePlace);
|
//wordToTranslate = Application.practiseList.get(wordToTranslatePlace);
|
||||||
|
|
||||||
generatedAssessment = generateSixMeanings(practiseList);
|
generatedAssessment = generateSixMeanings(practiseList);
|
||||||
|
break;
|
||||||
case (2): //2 Means match meanings test.
|
case (2): //2 Means match meanings test.
|
||||||
// LinkedList<DictionaryEntry> wordsToTranslate = new LinkedList<>();
|
// LinkedList<DictionaryEntry> wordsToTranslate = new LinkedList<>();
|
||||||
// for (int i = 0; i < 3; i++) {
|
// for (int i = 0; i < 3; i++) {
|
||||||
|
@ -55,10 +55,13 @@ public class AssessmentGenerator {
|
||||||
// wordsToTranslate.toArray();
|
// wordsToTranslate.toArray();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
generatedAssessment = generateWordMatch(practiseList);
|
generatedAssessment = generateMatchMeaning(practiseList);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
listOfAssessment.add(generatedAssessment);
|
listOfAssessment.add(generatedAssessment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return listOfAssessment;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,8 +70,12 @@ public class AssessmentGenerator {
|
||||||
* practice words as the parameter.
|
* practice words as the parameter.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Question generateWordMatch(LinkedList<DictionaryEntry> a){
|
public static Question generateMatchMeaning(LinkedList<DictionaryEntry> practiceList){
|
||||||
return null;
|
Random rand = new Random();
|
||||||
|
DictionaryEntry selectedCorrectAnswer;
|
||||||
|
selectedCorrectAnswer = practiceList.get(rand.nextInt(practiceList.size()-1));
|
||||||
|
TranslationQuestion generatedQuestion = new TranslationQuestion(selectedCorrectAnswer);
|
||||||
|
return generatedQuestion;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +133,7 @@ public class AssessmentGenerator {
|
||||||
* the parameter.
|
* the parameter.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Question generateWordEnter(LinkedList<DictionaryEntry> a){
|
public static Question generateTranslationTest(LinkedList<DictionaryEntry> a){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue