use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.
the class ImsQTI21InteractionsTest method qti21MultipleInput.
/**
* This is an assessment item with severals
* different interactions.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21MultipleInput(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Gap match QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_multi-input.zip");
File qtiTestFile = new File(qtiTestUrl.toURI());
navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// to the test and spot it
qtiPage.clickToolbarBack().assertOnAssessmentItem().answerSingleChoice("Some people are afraid of a woman").answerInlineChoice("A2").answerGapText("wicked king", "RESPONSE3").answerGapMatch(1, "family", true).answerGapMatch(2, "castle", true).answerGapMatch(3, "horse", true).saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Legend", 4);
}
use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.
the class ImsQTI21InteractionsTest method qti21GraphicOrderInteraction.
/**
* Check if the graphic order interaction returns 1 point
* if answered correctly.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21GraphicOrderInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Graphic order QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_graphic_order_ims.zip");
File qtiTestFile = new File(qtiTestUrl.toURI());
navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// to the test and spot it
qtiPage.clickToolbarBack().assertOnAssessmentItem().answerGraphicOrderById("A").answerGraphicOrderById("D").answerGraphicOrderById("C").answerGraphicOrderById("B").saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Flying Home", 1);
}
use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.
the class ImsQTI21InteractionsTest method qti21AssociateInteraction.
/**
* Check if the associate interaction return its 4 points.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21AssociateInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Associate QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_associate_ims.zip");
File qtiTestFile = new File(qtiTestUrl.toURI());
navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// to the test and spot it
qtiPage.clickToolbarBack().assertOnAssessmentItem().answerAssociate("Antonio", 1, true).answerAssociate("Prospero", 1, false).answerAssociate("Capulet", 2, true).answerAssociate("Montague", 2, false).answerAssociate("Demetrius", 3, true).answerAssociate("Lysander", 3, false).saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Shakespearian Rivals", 4);
}
use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.
the class ImsQTI21InteractionsTest method qti21PositionObjectInteraction.
/**
* Check if the position object interaction returns 3 points
* if answered correctly.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21PositionObjectInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Position object QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_position_object_ims.zip");
File qtiTestFile = new File(qtiTestUrl.toURI());
navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// to the test and spot it
qtiPage.clickToolbarBack().assertOnAssessmentItem().answerPositionObject(0, 118, 184).answerPositionObject(1, 150, 235).answerPositionObject(2, 96, 114).saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Airport Locations", 3);
}
use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.
the class ImsQTI21InteractionsTest method qti21MatchInteraction.
/**
* Check if the classic match interaction return its 3 points.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21MatchInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Match QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_match_ims.zip");
File qtiTestFile = new File(qtiTestUrl.toURI());
navBar.openAuthoringEnvironment().uploadResource(qtiTestTitle, qtiTestFile).clickToolbarRootCrumb();
QTI21Page qtiPage = QTI21Page.getQTI12Page(browser);
qtiPage.options().showResults(Boolean.TRUE, QTI21AssessmentResultsOptions.allOptions()).save();
// to the test and spot it
qtiPage.clickToolbarBack().assertOnAssessmentItem().answerMatch("Prospero", "Romeo and Juliet", true).answerMatch("Capulet", "Romeo and Juliet", true).answerMatch("Demetrius", "A Midsummer", true).answerMatch("Lysander", "A Midsummer", true).answerMatch("Prospero", "Romeo and Juliet", false).answerMatch("Prospero", "The Tempest", true).saveAnswer().endTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Characters and Plays", 3);
}
Aggregations