use of org.olat.selenium.page.qti.QTI21EditorPage in project OpenOLAT by OpenOLAT.
the class ImsQTI21EditorTest method qti21EditorNumericalInput_exact.
/**
* An author make a test with 2 questions using numerical input,
* the first with the score set if all answers are correct, the second
* with scoring per answers. The numerical input have all the tolerance
* mode set to EXACT.<br>
* A first user make the test, but doesn't answer all questions
* correctly, log out and a second user make the perfect test.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21EditorNumericalInput_exact(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
String qtiTestTitle = "Numerical QTI 2.1 " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createQTI21Test(qtiTestTitle).clickToolbarBack();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
QTI21EditorPage qtiEditor = qtiPage.edit();
// start a blank test
qtiEditor.selectNode("Single choice").deleteNode();
// add a numerical input: all answers score, tolerance exact
QTI21GapEntriesEditorPage fibEditor = qtiEditor.addNumerical().appendContent("One plus two: ").addNumericalInput("3", "three", ToleranceMode.EXACT, null, null).saveNumericInput().editNumericalInput("9", "nine", ToleranceMode.EXACT, null, null, 2).saveNumericInput().save();
// set max score
fibEditor.selectScores().selectAssessmentMode(ScoreEvaluation.allCorrectAnswers).setMaxScore("2").save();
// set feedbacks
fibEditor.selectFeedbacks().setHint("Hint", "The second is the first power two").setCorrectSolution("Correct solution", "I know you know").setCorrectFeedback("Correct feedback", "Your answer is correct").setIncorrectFeedback("Incorrect", "Your answer is not correct").save();
// add a gap entry: score per answer, tolerance exact
fibEditor = qtiEditor.addNumerical().appendContent("More difficult: 34 + 23 ").addNumericalInput("57", "57", ToleranceMode.EXACT, null, null).saveNumericInput().editNumericalInput("8", "64squareroot", ToleranceMode.EXACT, null, null, 2).saveNumericInput().save();
// set max score
fibEditor.selectScores().selectAssessmentMode(ScoreEvaluation.perAnswer).setMaxScore("4").setScore("57", "2").setScore("8", "3").save();
// set feedbacks
fibEditor.selectFeedbacks().setHint("Hint", "The second is the square root of 64").setCorrectSolution("Correct solution", "This is an information about the correct solution").setCorrectFeedback("Correct feedback", "Your answer is correct").setIncorrectFeedback("Incorrect", "Your answer is not correct").save();
qtiPage.clickToolbarBack();
// access to all
qtiPage.accessConfiguration().setUserAccess(UserAccess.guest).clickToolbarBack();
// show results
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// a user search the content package
LoginPage userLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
userLoginPage.loginAs(ryomou.getLogin(), ryomou.getPassword()).resume();
NavigationPage userNavBar = new NavigationPage(participantBrowser);
userNavBar.openMyCourses().openSearch().extendedSearch(qtiTestTitle).select(qtiTestTitle).start();
// first user make the test
QTI21Page ryomouQtiPage = QTI21Page.getQTI12Page(participantBrowser);
ryomouQtiPage.assertOnAssessmentItem().answerGapTextWithPlaceholder("2", "three").answerGapTextWithPlaceholder("25", "nine").saveAnswer().assertFeedback("Incorrect").assertCorrectSolution("Correct solution").hint().assertFeedback("Hint").answerGapTextWithPlaceholder("3", "three").answerGapTextWithPlaceholder("9", "nine").saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerGapTextWithPlaceholder("57", "57").answerGapTextWithPlaceholder("9", "64squareroot").saveAnswer().assertCorrectSolution("Correct solution").assertFeedback("Incorrect").endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 2 points from the first question, 4 from the second
4);
// a second user search the content package
LoginPage reiLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
reiLoginPage.loginAs(rei.getLogin(), rei.getPassword()).resume();
NavigationPage reiNavBar = new NavigationPage(participantBrowser);
reiNavBar.openMyCourses().openSearch().extendedSearch(qtiTestTitle).select(qtiTestTitle).start();
// make the test with all the correct answers
QTI21Page.getQTI12Page(participantBrowser).assertOnAssessmentItem().answerGapTextWithPlaceholder("3", "three").answerGapTextWithPlaceholder("9", "nine").saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerGapTextWithPlaceholder("57", "57").answerGapTextWithPlaceholder("8", "64squareroot").saveAnswer().endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 2 points from the first question, 4 from the second
6);
}
use of org.olat.selenium.page.qti.QTI21EditorPage in project OpenOLAT by OpenOLAT.
the class ImsQTI21EditorTest method qti21EditorMatch.
/**
* An author make a test with 2 matches. A match with "multiple selection"
* and score "all answers", a second with "single selection" and score
* "per answers".<br>
* A first user make the test, but doesn't answer all questions
* correctly, log out and a second user make the perfect test.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21EditorMatch(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
UserVO melissa = new UserRestClient(deploymentUrl).createRandomUser("Melissa");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
String qtiTestTitle = "Match QTI 2.1 " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createQTI21Test(qtiTestTitle).clickToolbarBack();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
QTI21EditorPage qtiEditor = qtiPage.edit();
// start a blank test
qtiEditor.selectNode("Single choice").deleteNode();
// add a match, multiple selection
QTI21MatchEditorPage matchEditor = qtiEditor.addMatch();
matchEditor.setSource(0, "Eclipse").setSource(1, "vim").setTarget(0, "IDE").setTarget(1, "TextProcessor").addColumn().setTarget(2, "TextEditor").setMatch(0, 0, true).setMatch(1, 2, true).save();
// change max score
matchEditor.selectScores().setMaxScore("4").save();
// set some feedbacks
matchEditor.selectFeedbacks().setHint("Hint", "This is only an hint").setCorrectSolution("Correct solution", "This is the correct solution").setCorrectFeedback("Correct feedback", "This is correct").setIncorrectFeedback("Incorrect", "Your answer is not correct").save();
// second match
matchEditor = qtiEditor.addMatch().setSingleChoices().setSource(0, "Java").setSource(1, "C").addRow().setSource(2, "PHP").setTarget(0, "CodeIgniter").setTarget(1, "VisualStudio").addColumn().setTarget(2, "Eclipse").setMatch(0, 2, true).setMatch(1, 1, true).setMatch(2, 0, true).save();
// select score "per answer" and set the scores
matchEditor.selectScores().selectAssessmentMode(ScoreEvaluation.perAnswer).setMaxScore("6").setScore(0, 0, "0.0").setScore(0, 1, "0.0").setScore(0, 2, "2.0").setScore(1, 0, "0.0").setScore(1, 1, "3.0").setScore(1, 2, "0.0").setScore(2, 0, "1.0").setScore(2, 1, "0.0").setScore(2, 2, "0.0").save();
matchEditor.selectFeedbacks().setHint("Hint", "The hint").setCorrectSolution("Correct solution", "This is the correct solution").setCorrectFeedback("Correct feedback", "This is correct").setIncorrectFeedback("Incorrect", "Your answer is not correct").save();
qtiPage.clickToolbarBack();
// access to all
qtiPage.accessConfiguration().setUserAccess(UserAccess.guest).clickToolbarBack();
// show results
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// a user search the content package
LoginPage reiLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
reiLoginPage.loginAs(rei.getLogin(), rei.getPassword()).resume();
NavigationPage reiNavBar = new NavigationPage(participantBrowser);
reiNavBar.openMyCourses().openSearch().extendedSearch(qtiTestTitle).select(qtiTestTitle).start();
// make the test
QTI21Page reiQtiPage = QTI21Page.getQTI12Page(participantBrowser);
reiQtiPage.assertOnAssessmentItem().answerMatch("Eclipse", "IDE", true).answerMatch("vim", "IDE", true).saveAnswer().assertFeedback("Incorrect").assertCorrectSolution("Correct solution").hint().assertFeedback("Hint").answerMatch("vim", "IDE", false).answerMatch("vim", "TextEditor", true).saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerMatch("Java", "Eclipse", true).answerMatch("C", "CodeIgniter", true).answerMatch("PHP", "VisualStudio", true).saveAnswer().assertCorrectSolution("Correct solution").assertFeedback("Incorrect").endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 4 points from the first question, 2 from the second
6);
// a second user search the content package
LoginPage melLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
melLoginPage.loginAs(melissa.getLogin(), melissa.getPassword()).resume();
NavigationPage melNavBar = new NavigationPage(participantBrowser);
melNavBar.openMyCourses().openSearch().extendedSearch(qtiTestTitle).select(qtiTestTitle).start();
// make the test
QTI21Page.getQTI12Page(participantBrowser).assertOnAssessmentItem().answerMatch("Eclipse", "IDE", true).answerMatch("vim", "TextEditor", true).saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerMatch("Java", "Eclipse", true).answerMatch("C", "CodeIgniter", true).answerMatch("PHP", "VisualStudio", true).saveAnswer().answerMatch("C", "CodeIgniter", false).answerMatch("PHP", "VisualStudio", false).answerMatch("C", "VisualStudio", true).answerMatch("PHP", "CodeIgniter", true).saveAnswer().endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 4 points from the first question, 6 from the second
10);
}
use of org.olat.selenium.page.qti.QTI21EditorPage in project OpenOLAT by OpenOLAT.
the class ImsQTI21EditorTest method qti21EditorHottext.
/**
* An author make a test with a question with 2 hot texts, one checked,
* one not. A user make the test. The test is limited because I cannot
* edit the text within the hot text via the web driver.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21EditorHottext(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
String qtiTestTitle = "Hottext QTI 2.1 " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createQTI21Test(qtiTestTitle).clickToolbarBack();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
QTI21EditorPage qtiEditor = qtiPage.edit();
// start a blank test
qtiEditor.selectNode("Single choice").deleteNode();
// add a hot text with score: all answers
QTI21HottextEditorPage hottextEditor = qtiEditor.addHottext().appendContent("I cannot modify the hottext ").addHottext().uncheck(2).check(1).save();
// change max score
hottextEditor.selectScores().setMaxScore("3").save();
// set some feedbacks
hottextEditor.selectFeedbacks().setHint("Hint", "This is an hint").setCorrectSolution("Correct solution", "First not, second yes").setCorrectFeedback("Correct feedback", "This is correct").setIncorrectFeedback("Incorrect", "Your answer is not correct").save();
qtiPage.clickToolbarBack();
// access to all
qtiPage.accessConfiguration().setUserAccess(UserAccess.guest).clickToolbarBack();
// show results
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// a user search the content package
LoginPage userLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
userLoginPage.loginAs(ryomou.getLogin(), ryomou.getPassword()).resume();
NavigationPage userNavBar = new NavigationPage(participantBrowser);
userNavBar.openMyCourses().openSearch().extendedSearch(qtiTestTitle).select(qtiTestTitle).start();
// make the test
QTI21Page ryomouQtiPage = QTI21Page.getQTI12Page(participantBrowser);
ryomouQtiPage.assertOnAssessmentItem().answerHottext(2).saveAnswer().assertFeedback("Incorrect").assertCorrectSolution("Correct solution").hint().assertFeedback("Hint").answerHottext(1).answerHottext(// un select it
2).saveAnswer().assertFeedback("Correct feedback").endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 3 points from the first question
3);
}
use of org.olat.selenium.page.qti.QTI21EditorPage in project OpenOLAT by OpenOLAT.
the class ImsQTI21EditorTest method qti21EditorMultipleChoices_complexConditionalFeedback.
/**
* Test the conditional feedback with 3 conditions based
* on attempts (and an incorrect feedback used as marker),
* on score and on response. It's done with a multiple
* choice with score per answer and a negative min. score.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21EditorMultipleChoices_complexConditionalFeedback(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
String qtiTestTitle = "Choices QTI 2.1 " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createQTI21Test(qtiTestTitle).clickToolbarBack();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
QTI21EditorPage qtiEditor = qtiPage.edit();
qtiEditor.selectNode("Single choice").deleteNode();
// add a single choice: all answers score
QTI21MultipleChoiceEditorPage mcEditor = qtiEditor.addMultipleChoice();
mcEditor.setAnswer(0, "Ok").setCorrect(0).addChoice(1).setCorrect(1).setAnswer(1, "Correct").addChoice(2).setAnswer(2, "Faux").addChoice(3).setAnswer(3, "Falsch").save();
// add negative scores to play with
mcEditor.selectScores().selectAssessmentMode(ScoreEvaluation.perAnswer).setScore("Ok", "3").setScore("Correct", "1").setScore("Faux", "-1").setScore("Falsch", "-1").setMaxScore("4").save();
// set a conditional feedback
mcEditor.selectFeedbacks().setIncorrectFeedback("Incorrect", "Not the right response").addConditionalFeedback(1, "NegativeFirstAttempts", "Negative score").setCondition(1, 1, Variable.attempts, Operator.equals, "1").addCondition(1, 1).setCondition(1, 2, Variable.score, Operator.smaller, "0").addConditionalFeedback(2, "FauxAnswer", "You choose the 'Faux' answer").setCondition(2, 1, Variable.response, Operator.equals, "Faux").addConditionalFeedback(3, "Positive", "Score between 0 and 3").setCondition(3, 1, Variable.score, Operator.biggerEquals, "0").addCondition(3, 1).setCondition(3, 2, Variable.score, Operator.smaller, "3").save();
qtiPage.clickToolbarBack().assertOnAssessmentItem().answerMultipleChoice("Falsch", "Faux").saveAnswer().assertFeedback("Incorrect").assertFeedback("FauxAnswer").assertFeedback("NegativeFirstAttempts").assertNoFeedback("Positive").deselectAnswerMultipleChoice("Faux", "Falsch").answerMultipleChoice("Faux", "Correct").saveAnswer().assertFeedback("Incorrect").assertFeedback("FauxAnswer").assertFeedback("Positive").assertNoFeedback("NegativeFirstAttempts").deselectAnswerMultipleChoice("Faux").answerMultipleChoice("Ok").saveAnswer().assertNoFeedback().endTest();
}
use of org.olat.selenium.page.qti.QTI21EditorPage in project OpenOLAT by OpenOLAT.
the class ImsQTI21EditorTest method qti21EditorEssay.
/**
* An author make a test with an essai and its special feedback.<br>
* A user make the test and check the feedback.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21EditorEssay(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// make a test
String qtiTestTitle = "Essai QTI 2.1 " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createQTI21Test(qtiTestTitle).clickToolbarBack();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
QTI21EditorPage qtiEditor = qtiPage.edit();
// start a blank test
qtiEditor.selectNode("Single choice").deleteNode();
// add an essay interaction
QTI21LobEditorPage essayEditor = qtiEditor.addEssay();
essayEditor.setQuestion("Write a small story").save().selectScores().setMaxScore("3.0").save();
essayEditor.selectFeedbacks().setHint("Hint", "Did you search inspiration?").setCorrectSolution("Correct solution", "It is very personal.").setAnsweredFeedback("Full", "Well done").setEmpytFeedback("Empty", "Please, a little effort.").save();
qtiPage.clickToolbarBack();
// access to all
qtiPage.accessConfiguration().setUserAccess(UserAccess.guest).clickToolbarBack();
// show results
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// a user search the content package
LoginPage reiLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
reiLoginPage.loginAs(rei.getLogin(), rei.getPassword()).resume();
NavigationPage reiNavBar = new NavigationPage(participantBrowser);
reiNavBar.openMyCourses().openSearch().extendedSearch(qtiTestTitle).select(qtiTestTitle).start();
// make the test
QTI21Page reiQtiPage = QTI21Page.getQTI12Page(participantBrowser);
reiQtiPage.assertOnAssessmentItem().saveAnswer().assertFeedback("Empty").hint().assertFeedback("Hint");
reiQtiPage.answerEssay("What can I write?").saveAnswer().assertFeedback("Full").endTest().assertOnAssessmentResults().assertOnAssessmentResultEssay("What");
}
Aggregations