use of org.olat.selenium.page.qti.QTI21Page in project OpenOLAT by OpenOLAT.
the class ImsQTI21InteractionsTest method qti21SliderInteraction.
/**
* Check if the slider interaction returns 1 point
* if answered correctly.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21SliderInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Slider QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_slider_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().answerVerticalSlider(16).saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Jedi Knights", 1);
}
use of org.olat.selenium.page.qti.QTI21Page in project OpenOLAT by OpenOLAT.
the class ImsQTI21InteractionsTest method qti21GapMatchInteraction.
/**
* Check if the gap match returns 3 points
* if answered correctly.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21GapMatchInteraction(@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_gap_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().answerGapMatch(1, "winter", true).answerGapMatch(2, "summer", true).saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Richard III", 3);
}
use of org.olat.selenium.page.qti.QTI21Page in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class ImsQTI21InteractionsTest method qti21EndInteraction.
/**
* Check if hint with modal and inline feedbacks used
* with choice interaction.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21EndInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "End QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_end_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().hint().assertFeedbackText("Tony lives in the United Kingdom").answerSingleChoiceWithParagraph("Tony").saveAnswer().assertFeedbackText("No, the correct answer is Vicente Fox").assertFeedbackInline("No, he is the Prime Minister of England.").assertNoFeedbackText("Tony lives in the United Kingdom").answerSingleChoiceWithParagraph("George").saveAnswer().assertFeedbackText("No, the correct answer is Vicente Fox").assertFeedbackInline("No, he is the President of the USA.").assertNoFeedbackText("Tony lives in the United Kingdom").assertNoFeedbackInline("No, he is the Prime Minister of England.").answerSingleChoiceWithParagraph("Vicente").saveAnswer().assertFeedbackText("Yes, that is correct").assertNoFeedbackText("Tony lives in the United Kingdom").assertNoFeedbackInline("No, he is the Prime Minister of England.").assertNoFeedbackInline("No, he is the President of the USA.").endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Mexican President", 1);
}
use of org.olat.selenium.page.qti.QTI21Page in project OpenOLAT by OpenOLAT.
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);
}
Aggregations