Search in sources :

Example 86 with QTI21Page

use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.

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);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 87 with QTI21Page

use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.

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);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 88 with QTI21Page

use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.

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);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 89 with QTI21Page

use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.

the class ImsQTI21InteractionsTest method qti21SelectPointInteraction.

/**
 * Check if the select point interaction returns 1 point
 * if answered correctly.
 *
 * @param authorLoginPage
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21SelectPointInteraction(@InitialPage LoginPage authorLoginPage) throws IOException, URISyntaxException {
    UserVO author = new UserRestClient(deploymentUrl).createAuthor();
    authorLoginPage.loginAs(author.getLogin(), author.getPassword());
    // upload a test
    String qtiTestTitle = "Select point QTI 2.1 " + UUID.randomUUID();
    URL qtiTestUrl = JunitTestHelper.class.getResource("file_resources/qti21/simple_QTI_21_select_point_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().answerSelectPoint(100, 110).saveAnswer().endTest().closeTest();
    // check the results
    qtiPage.assertOnAssessmentResults().assertOnAssessmentItemScore("Where is Edinburgh", 1);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 90 with QTI21Page

use of org.olat.selenium.page.qti.QTI21Page in project openolat by klemens.

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);
}
Also used : UserVO(org.olat.user.restapi.UserVO) File(java.io.File) URL(java.net.URL) UserRestClient(org.olat.test.rest.UserRestClient) QTI21Page(org.olat.selenium.page.qti.QTI21Page) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)96 Test (org.junit.Test)96 QTI21Page (org.olat.selenium.page.qti.QTI21Page)96 UserRestClient (org.olat.test.rest.UserRestClient)96 UserVO (org.olat.user.restapi.UserVO)96 File (java.io.File)60 URL (java.net.URL)60 QTI21EditorPage (org.olat.selenium.page.qti.QTI21EditorPage)46 LoginPage (org.olat.selenium.page.LoginPage)40 NavigationPage (org.olat.selenium.page.NavigationPage)40 QTI21MatchEditorPage (org.olat.selenium.page.qti.QTI21MatchEditorPage)10 QTI21MultipleChoiceEditorPage (org.olat.selenium.page.qti.QTI21MultipleChoiceEditorPage)8 QTI21SingleChoiceEditorPage (org.olat.selenium.page.qti.QTI21SingleChoiceEditorPage)8 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)6 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)6 QTI21ConfigurationCEPage (org.olat.selenium.page.qti.QTI21ConfigurationCEPage)6 QTI21GapEntriesEditorPage (org.olat.selenium.page.qti.QTI21GapEntriesEditorPage)6 QTI21HotspotEditorPage (org.olat.selenium.page.qti.QTI21HotspotEditorPage)6 QTI21LobEditorPage (org.olat.selenium.page.qti.QTI21LobEditorPage)6 WebElement (org.openqa.selenium.WebElement)6