use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.
the class ImsQTI21EditorTest method importQuestionsCSVMatchVariants.
/**
* Create a test, import a CSV with some match variants,
* remove the first single choice which come if someone
* create a test. Change the delivery settings of the test
* to show the detailled results.<br>
* Run the test and check the results.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void importQuestionsCSVMatchVariants(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "ExcelMatch QTI 2.1 " + UUID.randomUUID();
navBar.openAuthoringEnvironment().createQTI21Test(qtiTestTitle).clickToolbarBack();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
QTI21EditorPage qtiEditor = qtiPage.edit();
// import a single choice, a multiple and 2 gap texts
qtiEditor.importTable().importFile("qti21/import_qti21_excel_match.txt").next().assertOnNumberOfQuestions(3).finish();
// remove the single choice which come from the creation
// of the test
qtiEditor.selectNode("Single choice").deleteNode();
// go to options and show the results
qtiPage.clickToolbarBack().options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// go to the test
qtiPage.clickToolbarBack().assertOnAssessmentItem().answerMatch("Berlin", "Deutschland", true).answerMatch("Bern", "Schweiz", true).answerMatch("Paris", "Frankreich", true).saveAnswer().nextAnswer().assertOnAssessmentItem("Afrika").answerMatchDropSourceToTarget("Nairobi", "Kenia").answerMatchDropSourceToTarget("Windhoek", "Namibia").answerMatchDropSourceToTarget("Algier", "Algerien").saveAnswer().assertOnAssessmentItem("Europa").answerMatch("Paris", TrueFalse.right, true).answerMatch("Bern", TrueFalse.right, true).answerMatch("Stockholm", TrueFalse.wrong, true).saveAnswer().endTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentTestScore(9).assertOnAssessmentTestMaxScore(9);
}
use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.
the class ImsQTI21EditorTest method qti21EditorMatch_distractors.
/**
* 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". They are distractors, the assessed user must let them blank.<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_distractors(@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, "nano").setTarget(0, "IDE").setTarget(1, "WordProcessor").addColumn().setTarget(2, "CAD").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, "Lynx").setTarget(1, "Netscape").addColumn().setTarget(2, "Pixel").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, "1.0").setScore(1, 0, "0.0").setScore(1, 1, "1.0").setScore(1, 2, "0.0").setScore(2, 0, "2.0").setScore(2, 1, "0.0").setScore(2, 2, "-0.5").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", "WordProcessor", true).answerMatch("nano", "CAD", true).saveAnswer().assertFeedback("Incorrect").assertCorrectSolution("Correct solution").hint().assertFeedback("Hint").answerMatch("nano", "CAD", false).answerMatch("Eclipse", "WordProcessor", false).saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerMatch("Java", "Pixel", true).answerMatch("C", "Lynx", true).answerMatch("PHP", "Pixel", true).saveAnswer().assertCorrectSolution("Correct solution").assertFeedback("Incorrect").endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 4 points from the first question, 0.5 from the second
"4.5");
// 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().saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerMatch("Java", "Pixel", true).answerMatch("C", "Pixel", true).answerMatch("PHP", "Lynx", true).saveAnswer().assertFeedback("Incorrect").assertCorrectSolution("Correct solution").answerMatch("Java", "Pixel", false).answerMatch("C", "Pixel", false).answerMatch("PHP", "Lynx", false).saveAnswer().assertFeedback("Correct feedback").endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 4 points from the first question, 6 from the second
10);
}
use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.
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.QTI21Page in project openolat by klemens.
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.QTI21Page in project openolat by klemens.
the class ImsQTI21EditorTest method qti21EditorMatchTrueFalse.
/**
* An author make a test with 2 matches of the True/false variant. A match
* with score "all answers", a second with 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 qti21EditorMatchTrueFalse(@InitialPage LoginPage authorLoginPage, @Drone @User WebDriver participantBrowser) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
UserVO asuka = new UserRestClient(deploymentUrl).createRandomUser("Asuka");
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
String qtiTestTitle = "True false 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, score "all answers"
QTI21MatchEditorPage matchEditor = qtiEditor.addMatchTrueFalse();
matchEditor.setSource(0, "Eclipse is a Java IDE").setSource(1, "vim is Database viewer").setMatch(0, 1, 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.addMatchTrueFalse().setSource(0, "Java has several IDE like Eclipse").setSource(1, "C is object oriented").addRow().setSource(2, "What do you think of PHP?").setMatch(0, 1, true).setMatch(1, 2, true).setMatch(2, 0, true).save();
// select score "per answer" and set the scores
matchEditor.selectScores().selectAssessmentMode(ScoreEvaluation.perAnswer).setMaxScore("3").setScore(0, 0, "0.0").setScore(0, 1, "1.0").setScore(0, 2, "0.0").setScore(1, 0, "0.0").setScore(1, 1, "0.0").setScore(1, 2, "1.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", TrueFalse.right, true).answerMatch("vim", TrueFalse.right, true).saveAnswer().assertFeedback("Incorrect").assertCorrectSolution("Correct solution").hint().assertFeedback("Hint").answerMatch("vim", TrueFalse.wrong, true).saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerMatch("Java", TrueFalse.right, true).answerMatch("oriented", TrueFalse.wrong, true).answerMatch("PHP", TrueFalse.wrong, 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 asukaLoginPage = LoginPage.getLoginPage(participantBrowser, deploymentUrl);
asukaLoginPage.loginAs(asuka.getLogin(), asuka.getPassword()).resume();
NavigationPage asukaNavBar = new NavigationPage(participantBrowser);
asukaNavBar.openMyCourses().openSearch().extendedSearch(qtiTestTitle).select(qtiTestTitle).start();
// make the test
QTI21Page.getQTI12Page(participantBrowser).assertOnAssessmentItem().answerMatch("Eclipse", TrueFalse.right, true).answerMatch("vim", TrueFalse.wrong, true).saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerMatch("Java", TrueFalse.right, true).answerMatch("oriented", TrueFalse.wrong, true).saveAnswer().endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 4 points from the first question, 6 from the second
7);
}
Aggregations