[Building Sakai] Using web service to import test
Earle Nietzel
Earle.Nietzel at marist.edu
Fri Aug 6 08:20:15 PDT 2010
Hi Qu,
Maybe we should create 2 WS endpoints one that supports the Word2QTI for
those that need to import plain text assessments and then another endpoint
which imports assessments already in the IMS xml format?
Maybe these endpoints make sense:
public boolean createWordAssessment(String sessionid, String siteid,
String siteproperty, String title, String description, String template,
String data)
public boolean createXmlAssessment(String sessionid, String siteid, String
siteproperty, String title, String description, String template, String
xmldata)
regards,
Earle
From: "Qu, Yuanhua" <yq12 at txstate.edu>
To: Karen Tsao <ktsao at stanford.edu>
Cc: Sakai-Dev <sakai-dev at collab.sakaiproject.org>,
"earle.nietzel at marist.edu" <earle.nietzel at marist.edu>
Date: 08/06/2010 10:13 AM
Subject: Re: [Building Sakai] Using web service to import test
Thanks Karen.
With your guide, I just made it working the way I wanted - Importing the
exported assessment qti xml file directly into a site. I add another
XmlUtil.readDocument(File file) and did some modification with
SamLite.jws.
If it is useful, I’ll clean up the change and make a patch to the JIRA
SAM-942.
Thanks again for your help.
-Qu
On 8/5/10 1:22 PM, "Karen Tsao" <ktsao at stanford.edu> wrote:
Hi Yuanhua,
Please take a look at XmlUtil.readDocument. It gets you the Document
object. Once you have the document, skip those SamiLite process and pass
it directly into qtiService.createImportedAssessment (the new API that
Earlie created) . That is, commented out following lines:
SamLiteService samLiteService = (SamLiteService)
ComponentManager.get("org_sakaiproject_tool_assessment_services_samlite_SamLiteService");
...
QuestionGroup questionGroup =
samLiteService.parse(FormattedText.escapeHtml(title, false),
FormattedText.escapeHtml(description, false),
FormattedText.escapeHtml(data, false));
...
Please give this a try and let me know if this works for you.
Thanks,
Karen
On Wed, Aug 4, 2010 at 6:43 PM, Qu, Yuanhua <yq12 at txstate.edu> wrote:
I think I might find the reason why it failed me in the first place. --
It is “The format of the assessment file that is going to import”.
I tried with another file called importTest.txt as per attachment (I
guess this is the Word2QTI format) as per
http://confluence.sakaiproject.org/display/QTI/Home and used the same
perl script to call the web service and the test was imported with the
questions in the importTest.txt. It has the test and all the questions in
the site now.
Well, Is there a web service created for importing the exported assessment
like exportAssessment.xml directly? Any quick pointer to let me know
which method to call if I need to write my own web service for this
purpose?
Thanks.
-Qu
On 8/4/10 8:13 PM, "Qu, Yuanhua" <yq12 at txstate.edu <
http://yq12@txstate.edu> > wrote:
I was looking at http://jira.sakaiproject.org/browse/SAM-942 and saw that
Earle was able to import assessment by using the services included in the
patch. I didn’t have the luck and would like to see if you know what
might be wrong in my case.
I’m using sakai2.6.2 and applied both patches for SamLite APIs and web
services. I’m using Perl script to call the service to import the
assessment in file exportAssessment.xml
open FILE, "data/exportAssessment.xml" or die $!;
my $siteid = '5f852a89-eb01-4b0e-8f2f-f581eea945fc';
while (<FILE>) {
$data .= $_;
}
close FILE;
my $result = $scriptsoap->createAssessment($session, $siteid, "", "WS test
creation 3", "first test created by WS", "Default Assessment Type",
$data)->result;
I did see test named “WS test creation 3” created in the site, but the
question was not imported into the test.
I have no problem importing the assessment by using “Import” button in the
site. Any help would be appreciated?
Thanks.
-Qu
_______________________________________________
sakai-dev mailing list
sakai-dev at collab.sakaiproject.org
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
TO UNSUBSCRIBE: send email to
sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
"unsubscribe"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100806/f2f4b338/attachment.html
More information about the sakai-dev
mailing list