Search in sources :

Example 1 with QTI21LobEditorPage

use of org.olat.selenium.page.qti.QTI21LobEditorPage in project OpenOLAT by OpenOLAT.

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");
}
Also used : QTI21EditorPage(org.olat.selenium.page.qti.QTI21EditorPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) QTI21LobEditorPage(org.olat.selenium.page.qti.QTI21LobEditorPage) File(java.io.File) LoginPage(org.olat.selenium.page.LoginPage) 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 2 with QTI21LobEditorPage

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

the class ImsQTI21EditorTest method qti21EditorEssay.

/**
 * An author make a test with an essai and its special feedback.<br>
 * A user make the test and check the feedback.
 *
 * @param authorLoginPage
 * @param participantBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21EditorEssay(@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 = "Essai 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 essay interaction
    QTI21LobEditorPage essayEditor = qtiEditor.addEssay();
    essayEditor.setQuestion("Write a small story").save().selectScores().setMaxScore("3.0").save();
    essayEditor.selectFeedbacks().setHint("Hint", "Did you search inspiration?").setCorrectSolution("Correct solution", "It is very personal.").setAnsweredFeedback("Full", "Well done").setEmpytFeedback("Empty", "Please, a little effort.").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");
    reiQtiPage.answerEssay("What can I write?").saveAnswer().assertFeedback("Full").endTest().assertOnAssessmentResults().assertOnAssessmentResultEssay("What");
}
Also used : QTI21EditorPage(org.olat.selenium.page.qti.QTI21EditorPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) QTI21LobEditorPage(org.olat.selenium.page.qti.QTI21LobEditorPage) LoginPage(org.olat.selenium.page.LoginPage) 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 3 with QTI21LobEditorPage

use of org.olat.selenium.page.qti.QTI21LobEditorPage 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");
}
Also used : QTI21EditorPage(org.olat.selenium.page.qti.QTI21EditorPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) QTI21LobEditorPage(org.olat.selenium.page.qti.QTI21LobEditorPage) File(java.io.File) LoginPage(org.olat.selenium.page.LoginPage) 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 4 with QTI21LobEditorPage

use of org.olat.selenium.page.qti.QTI21LobEditorPage in project OpenOLAT by OpenOLAT.

the class ImsQTI21EditorTest method qti21EditorDrawing.

/**
 * An author make a test with a drawing and its special feedback.<br>
 * A user make the test and check the feedback.
 *
 * @param authorLoginPage
 * @param participantBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21EditorDrawing(@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 = "Drawing 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 essay interaction
    QTI21LobEditorPage essayEditor = qtiEditor.addDrawing();
    URL backgroundImageUrl = JunitTestHelper.class.getResource("file_resources/house.jpg");
    File backgroundImageFile = new File(backgroundImageUrl.toURI());
    essayEditor.setQuestion("Draw an house").updloadDrawingBackground(backgroundImageFile).save().selectScores().setMaxScore("3.0").save();
    essayEditor.selectFeedbacks().setHint("Hint", "Did you search inspiration?").setCorrectSolution("Correct solution", "It is very personal.").setAnsweredFeedback("Full", "Well done").setEmpytFeedback("Empty", "Please, a little effort.").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");
    reiQtiPage.answerDrawing().saveAnswerMoveAndScrollTop().assertFeedback("Full").endTest().assertOnAssessmentResults().assertOnDrawing();
}
Also used : QTI21EditorPage(org.olat.selenium.page.qti.QTI21EditorPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) QTI21LobEditorPage(org.olat.selenium.page.qti.QTI21LobEditorPage) File(java.io.File) URL(java.net.URL) LoginPage(org.olat.selenium.page.LoginPage) 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 5 with QTI21LobEditorPage

use of org.olat.selenium.page.qti.QTI21LobEditorPage in project OpenOLAT by OpenOLAT.

the class ImsQTI21EditorTest method qti21EditorEssay.

/**
 * An author make a test with an essai and its special feedback.<br>
 * A user make the test and check the feedback.
 *
 * @param authorLoginPage
 * @param participantBrowser
 * @throws IOException
 * @throws URISyntaxException
 */
@Test
@RunAsClient
public void qti21EditorEssay(@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 = "Essai 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 essay interaction
    QTI21LobEditorPage essayEditor = qtiEditor.addEssay();
    essayEditor.setQuestion("Write a small story").save().selectScores().setMaxScore("3.0").save();
    essayEditor.selectFeedbacks().setHint("Hint", "Did you search inspiration?").setCorrectSolution("Correct solution", "It is very personal.").setAnsweredFeedback("Full", "Well done").setEmpytFeedback("Empty", "Please, a little effort.").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");
    reiQtiPage.answerEssay("What can I write?").saveAnswer().assertFeedback("Full").endTest().assertOnAssessmentResults().assertOnAssessmentResultEssay("What");
}
Also used : QTI21EditorPage(org.olat.selenium.page.qti.QTI21EditorPage) UserVO(org.olat.user.restapi.UserVO) NavigationPage(org.olat.selenium.page.NavigationPage) QTI21LobEditorPage(org.olat.selenium.page.qti.QTI21LobEditorPage) LoginPage(org.olat.selenium.page.LoginPage) 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)6 Test (org.junit.Test)6 LoginPage (org.olat.selenium.page.LoginPage)6 NavigationPage (org.olat.selenium.page.NavigationPage)6 QTI21EditorPage (org.olat.selenium.page.qti.QTI21EditorPage)6 QTI21LobEditorPage (org.olat.selenium.page.qti.QTI21LobEditorPage)6 QTI21Page (org.olat.selenium.page.qti.QTI21Page)6 UserRestClient (org.olat.test.rest.UserRestClient)6 UserVO (org.olat.user.restapi.UserVO)6 File (java.io.File)4 URL (java.net.URL)4