use of org.jboss.arquillian.container.test.api.RunAsClient in project OpenOLAT by OpenOLAT.
the class ImsQTI21InteractionsTest method qti21GraphicAssociateInteraction.
/**
* Check if the graphic associate interaction return its 2 points.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21GraphicAssociateInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Graphic associate QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_graphic_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().answerGraphicAssociate("B").answerGraphicAssociate("C").answerGraphicAssociate("C").answerGraphicAssociate("D").saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Low-cost Flying", 2);
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project OpenOLAT by OpenOLAT.
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.jboss.arquillian.container.test.api.RunAsClient in project OpenOLAT by OpenOLAT.
the class ImsQTI21InteractionsTest method qti21HotspotInteraction.
/**
* Check if the hotspot interaction send a "correct" feedback.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21HotspotInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Hotspot QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_hotspot.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().answerHotspot("circle").saveAnswer().assertFeedback("Correct!").endTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentTestScore(1).assertOnAssessmentTestMaxScore(1);
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project OpenOLAT by OpenOLAT.
the class ImsQTI21InteractionsTest method qti21OrderInteraction.
/**
* Check if the order interaction return its 1 point.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21OrderInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Order QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_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().answerOrderDropItem("Jenson").answerOrderDropItem("Rubens").answerOrderDropItem("Michael").saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Grand Prix of Bahrain", 1);
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project OpenOLAT by OpenOLAT.
the class ImsQTI21InteractionsTest method qti21GraphicGapInteraction.
/**
* Check if hint with modal and inline feedbacks used
* with choice interaction.
*
* @param authorLoginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void qti21GraphicGapInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
UserVO author = new UserRestClient(deploymentUrl).createAuthor();
authorLoginPage.loginAs(author.getLogin(), author.getPassword());
// upload a test
String qtiTestTitle = "Graphic Gap Match QTI 2.1 " + UUID.randomUUID();
URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_graphic_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().answerGraphicGapClick("GLA", "A").answerGraphicGapClick("EDI", "B").answerGraphicGapClick("MAN", "C").saveAnswer().endTest().closeTest();
// check the results
qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Airport Tags", 3);
}
Aggregations