[SAK-37266] Add method to allow importing QTI to Samigo via Web services. Created: 15-Jul-2010  Updated: 17-Apr-2018  Resolved: 08-Mar-2012

Status: RESOLVED
Project: Sakai
Component/s: Tests & Quizzes (Samigo)
Affects Version/s: 2.6.1
Fix Version/s: 2.8.0

Type: (Deprecated) Contributed Patch Priority: Major
Reporter: Earle R Nietzel Assignee: Earle R Nietzel
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: XML File exportAssessment.xml     Text File importTest.txt     Text File samlite.patch    
Issue Links:
Cloners
cloned from SAK-37248 Importing archives via web services i... RESOLVED
Depend
is depended on by SAK-18952 Web services for Samigo CLOSED
Duplicate
is duplicated by SAK-34832 Create a public API that can be used ... CLOSED
Previous Issue Keys: SAM-942

 Description   

Needed to add siteid to:

QTIService.createImportedAssessment(document, QTIVersion.VERSION_1_2, null, templateId, site.getId());

So that an word2qti assessment can be imported using samlite api to a site from a web service.



 Comments   
Comment by Earle R Nietzel [ 16-Jul-2010 ]

Here is a patch that creates the SamLite webservice that can then be used.

This patch requires the previous patch I attached to be present as it uses those api's.

Comment by Earle R Nietzel [ 16-Jul-2010 ]

I have tested with these 2 patches I am able to import (word2qti) assessments directly into a site using samlite through a web service.

Comment by Steve Swinsburg [ 18-Jul-2010 ]

Seems a useful feature. CAn the Samigo team add this to trunk (just the API). The web services probably need a new JIRA.

Comment by Steve Swinsburg [ 22-Jul-2010 ]

Reuploaded samlite patch to remove the sam prefix to the file paths as that may not be the case for everyone's source code.

Comment by Yuanhua Qu [ 06-Aug-2010 ]

The previous patch that Earle created allows importing an assessment from a text data with word2qti format as per attachment importTest.txt .

In order to be able to create an assessment from an exported assessment xml file with qti type, I created a patch added a method to XmlUtil.java

XmlUtil.readDocument(File file)

and also added another service call

createAssessment(String sessionid, String siteid, String siteproperty, String filepath)

Thus, we may just give an absolute path of the exported assessment file in your system and make a webservice call to import the test. It's really handy for us to create test for a new site from an existing site in any of the environments, especially useful for our load test sites setup.

Comment by Earle R Nietzel [ 06-Aug-2010 ]

Uploaded new version of the samlite web service to include 2 new endpoints to handle QTI Documents.

public boolean createAssessmentFromText(String sessionid, String siteid, String siteproperty, String title, String description, String template, String textdata)
public boolean createAssessmentFromXml(String sessionid, String siteid, String siteproperty, String xmlstring)
public boolean createAssessmentFromXmlFile(String sessionid, String siteid, String siteproperty, String xmlfile)

Thanks to Yuanha for the input,
Earle

Comment by Yuanhua Qu [ 06-Aug-2010 ]

I removed the importFromExportedAssessmentFile.patch since Earle's new version of the SamLite.jws

public boolean createAssessmentFromXmlFile(String sessionid, String siteid, String siteproperty, String xmlfile)

is doing the same thing. Cool.

Comment by Steve Swinsburg [ 11-Aug-2010 ]

Can the API methods please be reviewed? These are required in order for the web services to be added (SAK-18952)

Comment by Jigar Joshi (Inactive) [ 12-Aug-2010 ]

Can I have a well documented steps which if I perform, i will get the WebServices for samigo.

Comment by Earle R Nietzel [ 12-Aug-2010 ]

Hi Jigar,

Just need to patch Samigo with the samlite.patch that is attached to this issue.

After that Steve opened a new issue SAK-18952 which contains the patch for the the web services piece.

Hope this helps,
Earle

Comment by Earle R Nietzel [ 12-Aug-2010 ]

I have removed the axis-samlite patch from this issue since there is another issue to handle the web service piece.

Please see issue SAK-18952 to get the web service patch.

Comment by Jigar Joshi (Inactive) [ 12-Aug-2010 ]

I have downloaded this .patch file attached.
then executed as follow

C:\Documents and Settings\argus\My Documents\NetBeansProjects\Sakai\sakai-src-2.
7.0\Samigo>patch -p0 < d:\samlite.patch
patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.

Comment by Karen Tsao [ 12-Aug-2010 ]

Merged: revision 81160.

Because trunk has newer version of AuthoringHelper.java, I have to make some changes on Earle's patch there. However, there should not require any changes in axis-samlite.patch.

Steve,

If you encounter any issue when you work on SAK-18952, please let me know.

Thanks,
Karen

Comment by Steve Swinsburg [ 12-Aug-2010 ]

Hi Karen,

So we are good to go with the web services using these API's? Great!

thanks,
Steve

Comment by Jigar Joshi (Inactive) [ 12-Aug-2010 ]

Hi Karen,

I tried the axis-samlite.patch from http://jira.sakaiproject.org/browse/SAK-18952.

It is showing me,

C:\Documents and Settings\argus\My Documents\NetBeansProjects\Sakai\sakai-src-2.
7.0\sam>patch -p0 < d:\axis-samlite.patch
patching file axis/src/webapp/SamLite.jws
can't find file to patch at input line 314
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------

Index: axis/pom.xml
===================================================================
— axis/pom.xml (revision 301)
+++ axis/pom.xml (revision 405)
--------------------------
File to patch:
Comment by Earle R Nietzel [ 13-Aug-2010 ]

Hi Jigar,

The patch from SAK-18952 needs to be applied from <sakai-src>/webservices. In the above output you were in <sakai-src>/sam.

Earle

Comment by Ashish (Inactive) [ 20-Aug-2010 ]

Hi:
i have applied patch axis-samlite.patch @ webservice folder and done successfully.
then i applied patch samlite.patch @ samigo folder and i got following output:

E:\Sakai\sakai-src-2.7.0\samiGo>patch -p0<e:\samlite.patch
patching file samigo-api/src/java/xml/xsl/dataTransform/import/v1p2/extractItem.
xsl
Hunk #1 FAILED at 127.
1 out of 1 hunk FAILED – saving rejects to file samigo-api/src/java/xml/xsl/dat
aTransform/import/v1p2/extractItem.xsl.rej
patching file samigo-services/src/java/org/sakaiproject/tool/assessment/facade/A
ssessmentFacadeQueriesAPI.java
patching file samigo-services/src/java/org/sakaiproject/tool/assessment/facade/A
ssessmentFacadeQueries.java
patching file samigo-services/src/java/org/sakaiproject/tool/assessment/services
/assessment/AssessmentService.java
patching file samigo-qti/src/java/org/sakaiproject/tool/assessment/services/qti/
QTIService.java
Hunk #1 succeeded at 70 (offset 3 lines).
patching file samigo-qti/src/java/org/sakaiproject/tool/assessment/qti/helper/Au
thoringHelper.java
Hunk #1 succeeded at 494 with fuzz 2 (offset 21 lines).
Hunk #2 succeeded at 519 with fuzz 2 (offset 24 lines).
patch unexpectedly ends in middle of line
patch unexpectedly ends in middle of line

Then i tried to build samigo module
E:\Sakai\sakai-src-2.7.0\samiGo>mvn clean install -Dmaven.skip.test=true

I got following error:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

E:\Sakai\sakai-src-2.7.0\samiGo\samigo-qti\src\java\org\sakaiproject\tool\assess
ment\qti\helper\AuthoringHelper.java:[518,64] cannot find symbol
symbol : variable isRespondus
location: class org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper

E:\Sakai\sakai-src-2.7.0\samiGo\samigo-qti\src\java\org\sakaiproject\tool\assess
ment\qti\helper\AuthoringHelper.java:[549,10] cannot find symbol
symbol : variable isRespondus
location: class org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper

E:\Sakai\sakai-src-2.7.0\samiGo\samigo-qti\src\java\org\sakaiproject\tool\assess
ment\qti\helper\AuthoringHelper.java:[594,57] cannot find symbol
symbol : variable isRespondus
location: class org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper

E:\Sakai\sakai-src-2.7.0\samiGo\samigo-qti\src\java\org\sakaiproject\tool\assess
ment\qti\helper\AuthoringHelper.java:[613,50] cannot find symbol
symbol : variable isRespondus
location: class org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper

E:\Sakai\sakai-src-2.7.0\samiGo\samigo-qti\src\java\org\sakaiproject\tool\assess
ment\qti\helper\AuthoringHelper.java:[618,47] cannot find symbol
symbol : variable isRespondus
location: class org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper

E:\Sakai\sakai-src-2.7.0\samiGo\samigo-qti\src\java\org\sakaiproject\tool\assess
ment\qti\helper\AuthoringHelper.java:[621,16] cannot find symbol
symbol : variable failedMatchingQuestions
location: class org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper

E:\Sakai\sakai-src-2.7.0\samiGo\samigo-qti\src\java\org\sakaiproject\tool\assess
ment\qti\helper\AuthoringHelper.java:[622,13] cannot find symbol
symbol : variable failedMatchingQuestions
location: class org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper

Pls help me to solve this problem.

Comment by Anthony Whyte [ 01-Dec-2010 ]

In 2.8.x

Comment by Jeremy Kusnetz [ 15-Feb-2012 ]

It appears that there is a problem in 2.8.0. I've been applying the patches to our 2.6 instance and a 2.7 instance and things have been working okay. It looks like the patches have been already applied in 2.8.0 but I get an exception when I try using it:

2012-02-15 17:25:51,186 ERROR http-43501-Processor10 org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper -
java.lang.NullPointerException
at org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper.createImportedAssessment(AuthoringHelper.java:706)
at org.sakaiproject.tool.assessment.qti.helper.AuthoringHelper.createImportedAssessment(AuthoringHelper.java:497)
at org.sakaiproject.tool.assessment.services.qti.QTIService.createImportedAssessment(QTIService.java:83)
at SamLite.createAssessment(SamLite.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.sakaiproject.util.RemoteHostFilter.doFilter(RemoteHostFilter.java:188)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:688)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:581)
at org.apache.catalina.connector.RemoteIpValve.invoke(RemoteIpValve.java:609)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:662)

Comment by Karen Tsao [ 21-Feb-2012 ]

Jeremy,

I don't have a way to test Web services. Can you try to debug yourself?

Maybe you can let me know what is line 706 in AuthoringHelper.java in your system and I will see if I can guess the reason?

Thanks,
Karen

Comment by Karen Tsao [ 21-Feb-2012 ]

Hi Earle,

Is it possible you can help on this issue?

Thanks,
Karen

Comment by Earle R Nietzel [ 21-Feb-2012 ]

Hi Karen,

I will work on this issue and report back.

Earle

Comment by Karen Tsao [ 21-Feb-2012 ]

Hi Earle,

Thanks a lot for your quick response. I really appreciate it.

Karen

Comment by Earle R Nietzel [ 27-Feb-2012 ]

I believe this to be fixed now please see SAK-18952 as the problem was on the web service end.

Comment by Jeremy Kusnetz [ 28-Feb-2012 ]

I'm still working with Earle, but line 706 is:

String siteTitle = SiteService.getSite(ToolManager.getCurrentPlacement().getContext()).getTitle();

Comment by Earle R Nietzel [ 08-Mar-2012 ]

This issue is specific to the rSmart CLE and is being resolved there.

This issue can be marked as resolved, as I have tested this functionality in trunk and it is working.

Comment by Karen Tsao [ 08-Mar-2012 ]

Earle,

Thanks a lot for your help!

Karen

Generated at Thu Sep 19 00:05:34 CDT 2019 using Jira 8.0.3#800011-sha1:073e8b433c2c0e389c609c14a045ffa7abaca10d.