use of org.olat.selenium.page.qti.QTI21EditorPage in project openolat by klemens.
the class ImsQTI21EditorTest method qti21EditorUpload.
/**
* An author make a test with 1 upload and feedbacks.<br>
* A user make the test, test hint and upload the file.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21EditorUpload(@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 = "Upload 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 upload interaction
QTI21LobEditorPage uploadEditor = qtiEditor.addUpload();
uploadEditor.setQuestion("Upload a file").save().selectScores().setMaxScore("2.0").save();
uploadEditor.selectFeedbacks().setHint("Hint", "Need a little help.").setCorrectSolution("Correct solution", "Only for Word").setAnsweredFeedback("Full", "You upload something").setEmpytFeedback("Empty", "You do not upload anything").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");
URL imageUrl = JunitTestHelper.class.getResource("file_resources/IMG_1482.JPG");
File imageFile = new File(imageUrl.toURI());
reiQtiPage.answerUpload(imageFile).saveAnswer().assertFeedback("Full").endTest().assertOnAssessmentResults().assertOnAssessmentResultUpload("IMG_1482");
}
use of org.olat.selenium.page.qti.QTI21EditorPage in project openolat by klemens.
the class ImsQTI21EditorTest method importQuestionsCSV.
/**
* Create a test, import the CSV example, 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 importQuestionsCSV(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Excel 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.txt").next().assertOnNumberOfQuestions(5).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().answerGapText("verbannen", "_RESPONSE_1").saveAnswer().nextAnswer().answerGapText(",", "_RESPONSE_1").answerGapText("", "_RESPONSE_2").answerGapText("", "_RESPONSE_3").saveAnswer().answerMultipleChoice("Deutschland", "Brasilien", "S\u00FCdafrika").saveAnswer().answerSingleChoiceWithParagraph("Italien").saveAnswer().answerCorrectKPrim("Deutschland", "Uruguay").answerIncorrectKPrim("Frankreich", "Spanien").saveAnswer().endTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentTestScore(9).assertOnAssessmentTestMaxScore(9);
}
use of org.olat.selenium.page.qti.QTI21EditorPage in project openolat by klemens.
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 qti21EditorNumericalInput_absolut.
/**
* An author make a test with 2 questions using numerical input to
* test the absolute tolerance mode.<br>
* A first user make the test, but doesn't answer all questions
* correctly, log out and a second user make the perfect test but
* on the limit.
*
* @param authorLoginPage
* @param participantBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21EditorNumericalInput_absolut(@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: 3.1 - 3.2
QTI21GapEntriesEditorPage fibEditor = qtiEditor.addNumerical().appendContent("Usefull for circles ").editNumericalInput("3.1416", "pi", ToleranceMode.ABSOLUTE, "3.2", "3.1", 1).saveNumericInput().save();
// use standard score setting
// set feedbacks
fibEditor.selectFeedbacks().setCorrectFeedback("Correct feedback", "Your answer is correct").setIncorrectFeedback("Incorrect", "Out of bounds").save();
// add a numerical input which represent a rounding issue
fibEditor = qtiEditor.addNumerical().appendContent("Check rounding issue ").editNumericalInput("14.923", "rounding", ToleranceMode.ABSOLUTE, "14.925", "14.915", 1).saveNumericInput().save();
// set feedbacks
fibEditor.selectFeedbacks().setCorrectFeedback("Correct feedback", "Your answer is correct").setIncorrectFeedback("Incorrect", "Your answer is not correct").save();
// add a numerical input with negative values
fibEditor = qtiEditor.addNumerical().appendContent("Check rounding issue ").editNumericalInput("-14.923", "negative", ToleranceMode.ABSOLUTE, "-14.921", "-14.931", 1).saveNumericInput().save();
// set feedbacks
fibEditor.selectFeedbacks().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("3", "pi").saveAnswer().assertFeedback("Incorrect").answerGapTextWithPlaceholder("3.15", "pi").saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerGapTextWithPlaceholder("14.914", "rounding").saveAnswer().assertFeedback("Incorrect").answerGapTextWithPlaceholder("14.915", "rounding").saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerGapTextWithPlaceholder("-14.932", "negative").saveAnswer().assertFeedback("Incorrect").answerGapTextWithPlaceholder("-14.920", "negative").saveAnswer().endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 1 point + 1 point + 0 point
2);
// 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.2", "pi").saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerGapTextWithPlaceholder("14.925", "rounding").saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerGapTextWithPlaceholder("-14.921", "negative").saveAnswer().assertFeedback("Correct feedback").endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(3);
}
use of org.olat.selenium.page.qti.QTI21EditorPage in project OpenOLAT by OpenOLAT.
the class ImsQTI21EditorTest method qti21EditorFib_text.
/**
* An author make a test with 2 questions using fill-in-blank,
* the first with the score set if all answers are correct, the second
* with scoring 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 qti21EditorFib_text(@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 = "FIB 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 gap entry: all answers score
QTI21GapEntriesEditorPage fibEditor = qtiEditor.addFib().appendContent("Usefull for circles ").addGapEntry("Pi", "314").saveGapEntry().editGapEntry("Ln", "lognat", 2).saveGapEntry().save();
// set max score
fibEditor.selectScores().selectAssessmentMode(ScoreEvaluation.allCorrectAnswers).setMaxScore("2").save();
// set feedbacks
fibEditor.selectFeedbacks().setHint("Hint", "This is a usefull hint").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();
// add a gap entry: score per anser
fibEditor = qtiEditor.addFib().appendContent("European rocket ").addGapEntry("Ariane", "ari").saveGapEntry().editGapEntry("Falcon9", "falc", 2).saveGapEntry().save();
// set max score
fibEditor.selectScores().selectAssessmentMode(ScoreEvaluation.perAnswer).setMaxScore("4").setScore("Ariane", "3").setScore("Falcon9", "1").save();
// set feedbacks
fibEditor.selectFeedbacks().setHint("Hint", "Think to space").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("Log", "314").answerGapTextWithPlaceholder("Sin", "lognat").saveAnswer().assertFeedback("Incorrect").assertCorrectSolution("Correct solution").hint().assertFeedback("Hint").answerGapTextWithPlaceholder("Pi", "314").answerGapTextWithPlaceholder("Ln", "lognat").saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerGapTextWithPlaceholder("Saturn 5", "ari").answerGapTextWithPlaceholder("Falcon9", "falc").saveAnswer().assertCorrectSolution("Correct solution").assertFeedback("Incorrect").endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 2 points from the first question, 1 from the second
3);
// 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("Pi", "314").answerGapTextWithPlaceholder("Ln", "lognat").saveAnswer().assertFeedback("Correct feedback").nextAnswer().answerGapTextWithPlaceholder("Ariane", "ari").answerGapTextWithPlaceholder("Falcon9", "falc").saveAnswer().endTest().assertOnAssessmentResults().assertOnAssessmentTestScore(// 2 points from the first question, 4 from the second
6);
}
Aggregations