You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(486) |
Jul
(201) |
Aug
(194) |
Sep
(87) |
Oct
(72) |
Nov
(72) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(41) |
Mar
(22) |
Apr
(4) |
May
(12) |
Jun
|
Jul
|
Aug
(42) |
Sep
(21) |
Oct
(14) |
Nov
(10) |
Dec
|
2007 |
Jan
(14) |
Feb
(34) |
Mar
(61) |
Apr
(54) |
May
(140) |
Jun
(184) |
Jul
(164) |
Aug
(130) |
Sep
(241) |
Oct
(175) |
Nov
(148) |
Dec
(96) |
2008 |
Jan
(5) |
Feb
(38) |
Mar
(30) |
Apr
(46) |
May
(25) |
Jun
(22) |
Jul
(5) |
Aug
(17) |
Sep
(2) |
Oct
(100) |
Nov
(83) |
Dec
(33) |
2009 |
Jan
(127) |
Feb
(43) |
Mar
(86) |
Apr
(34) |
May
(50) |
Jun
(168) |
Jul
(48) |
Aug
(66) |
Sep
(38) |
Oct
(75) |
Nov
(113) |
Dec
(72) |
2010 |
Jan
(123) |
Feb
(68) |
Mar
(26) |
Apr
(11) |
May
(39) |
Jun
(131) |
Jul
(56) |
Aug
(79) |
Sep
(69) |
Oct
(17) |
Nov
(166) |
Dec
(32) |
2011 |
Jan
(21) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(8) |
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris S. <san...@us...> - 2010-10-01 11:55:55
|
Update of /cvsroot/stack/stack-dev/sample_questions/diagnostictests In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv32304/sample_questions/diagnostictests Modified Files: DiagnosticTests.xml Removed Files: diagnostic-proof-Wason.xml diagnostic-proof-studentprofessor.xml Log Message: --- diagnostic-proof-Wason.xml DELETED --- --- diagnostic-proof-studentprofessor.xml DELETED --- Index: DiagnosticTests.xml =================================================================== RCS file: /cvsroot/stack/stack-dev/sample_questions/diagnostictests/DiagnosticTests.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DiagnosticTests.xml 30 Sep 2010 16:56:19 -0000 1.2 --- DiagnosticTests.xml 1 Oct 2010 11:55:46 -0000 1.3 *************** *** 1,111 **** <?xml version="1.0" encoding="UTF-8"?> ! <mathQuiz version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><assessmentItem version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><questionCasValues><questionStem type="CasText"><castext>In a railway journey of \(90km\) an increase of \(5\) kilometers per hour in the speed decreases the time taken by \(15\) minutes. ! <p>Write a system of equations (one equation per line) to represent this situation using \(v\) as the speed of the train and \(t\) as the time. ! <br /> ! #asys# <IEfeedback>asys</IEfeedback> ! <PRTfeedback>1</PRTfeedback> - <p>Eliminate \(t\) from your equations, writing a single equation only in \(v\) which represents this situation. - <br /> [...2874 lines suppressed...] ! \[ ! @f@=\frac{A}{@den1@} + \frac{B}{@den2@} + \frac{C}{@den2_squared@},\] ! ! then multiplying through by the denominator @den@ we have that ! ! \[ ! @numerat@ = @Aden2_squared@ + @Bden1_den2@+@Cden1@. ! \] ! ! Setting \(x = @mc@\) we see that \(A = @Aval@\) and letting \(x = @md@\) we find that \(C = @Cval@\). ! ! Putting \(x = 0\) we can also see that \(B = @Bval@\). Therefore ! ! \[ ! @f@=@answer@.\]</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></workedSolution><questionNote type="CasText"><castext>\[ ! @f@=@answer@.\]</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionNote></questionCasValues><questionparts><questionpart><name>ans1</name><inputType type="Meta"><selection>Algebraic Input</selection><default>Algebraic Input</default><values/></inputType><boxsize>20</boxsize><teachersAns type="CasString"><casString>answer</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans1</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/></questionpart><questionpart><name>con1</name><inputType type="Meta"><selection>Slider</selection><default>Algebraic Input</default><values/></inputType><boxsize>200</boxsize><teachersAns type="CasString"><casString>0</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>con1</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/></questionpart></questionparts><PotentialResponseTrees><PotentialResponseTree><prtname>PotResTree_Result</prtname><questionValue>1</questionValue><autoSimplify>true</autoSimplify><feedbackVariables></feedbackVariables><description type="Meta"><selection></selection><default></default><values/></description><PotentialResponses><PR id="0"><answerTest>PartFrac</answerTest><teachersAns>answer</teachersAns><studentAns>ans1</studentAns><testoptions>x</testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>1</rawMark><feedback></feedback><ansnote>ALG-RPF-TRUE</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>ALG-RPF-FALSE</ansnote><nextPR>1</nextPR></false><teacherNote></teacherNote></PR><PR id="1"><answerTest>AlgEquiv</answerTest><teachersAns>answer</teachersAns><studentAns>ans1</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>ALG-RPF-1-FALSE</ansnote><nextPR>2</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>ALG-RPF-2-FALSE</ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR><PR id="2"><answerTest>Equal_Com_Ass</answerTest><teachersAns>f</teachersAns><studentAns>ans1</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback><p>This seems to be the same expression that you started with.</p></feedback><ansnote>NO-CHANGE</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback><p>Although your expression is algebraically equal to the correct answer, it is not in partial fractions form.</p></feedback><ansnote>NOT-PARTIAL</ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>Diagnostic_ALG-RPF_2</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection>Expand a rational function with repeated factors in denominator as a sum of partial fractions.</selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://130.88.73.28/stack-1-0/</selection><default>http://matsrv6.bham.ac.uk/stem</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2010-09-01 11:10:54</selection><default>2010-08-31 14:20:41</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>Manchester, partial, fractions, diagnostic, A48I, ALG-RPF, A2</selection><default>Manchester, partial, fractions, diagnostic, A48I, ALG-RPF, A2</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>i</default><values><value>i</value><value>j</value><value>symi</value><value>symj</value></values><casKey>make_complexJ</casKey><casType>fun</casType><selected>i</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>SqrtSign</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>sqrtdispflag</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>Simplify</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>simp</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>MarkModMethod</name><type>list</type><default>Penalty</default><values><value>Penalty</value><value>First Answer</value><value>Last Answer</value></values><casKey></casKey><casType></casType><selected>Penalty</selected></stackoption><stackoption><name>AssumePos</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey>assume_pos</casKey><casType>ex</casType><selected>false</selected></stackoption><stackoption><name>TeacherEmail</name><type>string</type><default>s.h...@bh...</default><casKey></casKey><casType></casType><selected>Nie...@ma...</selected></stackoption><stackoption><name>Feedback</name><type>list</type><default>TGS</default><values><value>TGS</value><value>TG</value><value>GS</value><value>T</value><value>G</value><value>S</value><value>none</value></values><casKey></casKey><casType></casType><selected>G</selected></stackoption><stackoption><name>FeedbackGenericCorrect</name><type>html</type><default><span class='correct'>Correct answer, well done.</span></default><casKey></casKey><casType></casType><selected><span class='correct'>Correct answer, well done.</span></selected></stackoption><stackoption><name>FeedbackGenericIncorrect</name><type>html</type><default><span class='incorrect'>Incorrect answer.</span></default><casKey></casKey><casType></casType><selected><span class='incorrect'>Incorrect answer.</span></selected></stackoption><stackoption><name>FeedbackGenericPCorrect</name><type>html</type><default><span class='partially'>Your answer is partially correct.</span></default><casKey></casKey><casType></casType><selected><span class='partially'>You may have made a common error.</span></selected></stackoption><stackoption><name>OptWorkedSol</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption></ItemOptions><ItemTests><test><col><key>IE_ans1</key><value>answer</value></col><col><key>PRT_PotResTree_Result</key><value>ALG-RPF-TRUE</value></col><col><key>IE_con1</key><value></value></col></test><test><col><key>IE_ans1</key><value>7*x</value></col><col><key>PRT_PotResTree_Result</key><value>ALG-RPF-2-FALSE</value></col><col><key>IE_con1</key><value></value></col></test><test><col><key>IE_ans1</key><value>f</value></col><col><key>PRT_PotResTree_Result</key><value>NO-CHANGE</value></col><col><key>IE_con1</key><value></value></col></test></ItemTests></assessmentItem></mathQuiz> --- 1582,1584 ---- \end{eqnarray*} ! but substituting in the unique correct values for \(x\) and \(y\) the above equations should evaluate to @g1@ and @g2@ respectively.</feedback><ansnote>EQN-SIM-FALSE-0</ansnote><nextPR>1</nextPR></false><teacherNote></teacherNote></PR><PR id="1"><answerTest>AlgEquiv</answerTest><teachersAns>xy_rhserror</teachersAns><studentAns>xy_answer</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback><p>When you multiply an equation by a constant, remember to multiply both sides, the right hand-side as well as the left hand-side.</p></feedback><ansnote>UNMULTIPLIED_RHS</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>EQN-SIM-FALSE-1</ansnote><nextPR>2</nextPR></false><teacherNote></teacherNote></PR><PR id="2"><answerTest>AlgEquiv</answerTest><teachersAns>xy_signerror</teachersAns><studentAns>xy_answer</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback><p>It may be that you added the two equations when you should have subtracted one from the other.</p></feedback><ansnote>SIGN_ERROR</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>EQN-SIM-FALSE-2 </ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>Diasgnostic_EQN-SIM_2</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection>Two simultaneous linear equations</selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://130.88.73.28/stack-1-0/</selection><default>http://matsrv6.bham.ac.uk/stem</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2010-09-01 12:08:29</selection><default>2010-08-18 16:52:13</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>Manchester, A48A, foundation, diagnostic, EQN-SIM</selection><default>Manchester, A48A, foundation, diagnostic, EQN-SIM</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>i</default><values><value>i</value><value>j</value><value>symi</value><value>symj</value></values><casKey>make_complexJ</casKey><casType>fun</casType><selected>i</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>SqrtSign</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>sqrtdispflag</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>Simplify</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>simp</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>MarkModMethod</name><type>list</type><default>Penalty</default><values><value>Penalty</value><value>First Answer</value><value>Last Answer</value></values><casKey></casKey><casType></casType><selected>Penalty</selected></stackoption><stackoption><name>AssumePos</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey>assume_pos</casKey><casType>ex</casType><selected>false</selected></stackoption><stackoption><name>TeacherEmail</name><type>string</type><default>s.h...@bh...</default><casKey></casKey><casType></casType><selected>Nie...@ma...</selected></stackoption><stackoption><name>Feedback</name><type>list</type><default>TGS</default><values><value>TGS</value><value>TG</value><value>GS</value><value>T</value><value>G</value><value>S</value><value>none</value></values><casKey></casKey><casType></casType><selected>G</selected></stackoption><stackoption><name>FeedbackGenericCorrect</name><type>html</type><default><span class='correct'>Correct answer, well done.</span></default><casKey></casKey><casType></casType><selected><span class='correct'>Correct answer, well done.</span></selected></stackoption><stackoption><name>FeedbackGenericIncorrect</name><type>html</type><default><span class='incorrect'>Incorrect answer.</span></default><casKey></casKey><casType></casType><selected><span class='incorrect'>Incorrect answer.</span></selected></stackoption><stackoption><name>FeedbackGenericPCorrect</name><type>html</type><default><span class='partially'>Your answer is partially correct.</span></default><casKey></casKey><casType></casType><selected><span class='partially'>Your answer is partially correct.</span></selected></stackoption><stackoption><name>OptWorkedSol</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption></ItemOptions><ItemTests><test><col><key>IE_ans1</key><value>x_value</value></col><col><key>IE_ans2</key><value>y_value</value></col><col><key>PRT_PotResTree_combined_values</key><value>EQN-SIM-TRUE</value></col><col><key>IE_con1</key><value></value></col></test><test><col><key>IE_ans1</key><value>xrhserror</value></col><col><key>IE_ans2</key><value>yrhserror</value></col><col><key>PRT_PotResTree_combined_values</key><value>UNMULTIPLIED_RHS</value></col><col><key>IE_con1</key><value></value></col></test><test><col><key>IE_ans1</key><value>xsignerror</value></col><col><key>IE_ans2</key><value>ysignerror</value></col><col><key>PRT_PotResTree_combined_values</key><value>SIGN_ERROR</value></col><col><key>IE_con1</key><value></value></col></test></ItemTests></assessmentItem></mathQuiz> |
From: Simon H. <sim...@us...> - 2010-09-30 17:04:22
|
Update of /cvsroot/stack/stack-dev/install/update/updates In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv30452/install/update/updates Modified Files: TwoPointTwo.php Log Message: Remove debug output. Index: TwoPointTwo.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/update/updates/TwoPointTwo.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TwoPointTwo.php 30 Sep 2010 16:56:22 -0000 1.2 --- TwoPointTwo.php 30 Sep 2010 17:04:14 -0000 1.3 *************** *** 114,118 **** $sql = "UPDATE stackquestion SET line=".($i+1).", questionVariables=".$conn->dbSafeString($serialisedQV)." WHERE questionID=".$qid[$i]; $conn->query($sql); // row indices start at 1 ! echo $sql; // go back and check --- 114,118 ---- $sql = "UPDATE stackquestion SET line=".($i+1).", questionVariables=".$conn->dbSafeString($serialisedQV)." WHERE questionID=".$qid[$i]; $conn->query($sql); // row indices start at 1 ! //echo $sql; // go back and check |
From: Simon H. <sim...@us...> - 2010-09-30 16:57:03
|
Update of /cvsroot/stack/stack-dev/sample_questions In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/sample_questions Modified Files: interaction_element_test.xml Added Files: test_10.xml Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: interaction_element_test.xml =================================================================== RCS file: /cvsroot/stack/stack-dev/sample_questions/interaction_element_test.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** interaction_element_test.xml 11 Jan 2010 17:23:37 -0000 1.7 --- interaction_element_test.xml 30 Sep 2010 16:56:17 -0000 1.8 *************** *** 1,25 **** <?xml version="1.0" encoding="UTF-8"?> ! <mathQuiz version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><assessmentItem version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><questionCasValues><questionStem type="CasText"><castext>Type in the algebraic expression \[ @ta@ \] #ans# <IEfeedback>ans</IEfeedback><PRTfeedback>1</PRTfeedback> ! <p>The algebraic input box is the default input option. It can be used for all other kinds, for example ! <ul> ! <li> Sets <tt>{1,2,3}</tt> </li> ! <li> List <tt>[1,2,3]</tt> </li> ! <li> Martices <tt>matrix([1,2],[3,4])</tt> </li> ! </ul> ! </p></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionStem><questionVariables type="RawKeyVal"><rawKeyVals>ta = 1/(1+x^2)</rawKeyVals><forbidFloats>false</forbidFloats><simplify>true</simplify></questionVariables><workedSolution type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></workedSolution><questionNote type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionNote></questionCasValues><questionparts><questionpart><name>ans</name><inputType type="Meta"><selection>Algebraic Input</selection><default>Algebraic Input</default><values/></inputType><boxsize>15</boxsize><teachersAns type="CasString"><casString>ta</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/></questionpart></questionparts><PotentialResponseTrees><PotentialResponseTree><prtname>PotResTree_1</prtname><questionValue>1</questionValue><autoSimplify>true</autoSimplify><feedbackVariables></feedbackVariables><description type="Meta"><selection></selection><default></default><values/></description><PotentialResponses><PR id="0"><answerTest>AlgEquiv</answerTest><teachersAns>ta</teachersAns><studentAns>ans</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>1</rawMark><feedback></feedback><ansnote>1-0-T </ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>1-0-F </ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>interaction_element_test_alg</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection></selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://localhost/stack-dev</selection><default>http://localhost/stack-dev</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2009-11-03 11:50:39</selection><default>2009-11-03 11:50:37</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>demo, test</selection><default>demo, test</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>make_complexI</casKey><casType>fun</casType><selected>true</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>SqrtSign</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>sqrtdispflag</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>Simplify</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>simp</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>MarkModMethod</name><type>list</type><default>Penalty</default><values><value>Penalty</value><value>First Answer</value><value>Last Answer</value></values><casKey></casKey><casType></casType><selected>Penalty</selected></stackoption><stackoption><name>AssumePos</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey>assume_pos</casKey><casType>ex</casType><selected>false</selected></stackoption><stackoption><name>TeacherEmail</name><type>string</type><default></default><casKey></casKey><casType></casType><selected></selected></stackoption><stackoption><name>Feedback</name><type>list</type><default>TGS</default><values><value>TGS</value><value>TG</value><value>GS</value><value>T</value><value>G</value><value>S</value><value>none</value></values><casKey></casKey><casType></casType><selected>TGS</selected></stackoption><stackoption><name>FeedbackGenericCorrect</name><type>html</type><default><span class='correct'>Correct answer, well done.</span></default><casKey></casKey><casType></casType><selected><span class='correct'>Correct answer, well done.</span></selected></stackoption><stackoption><name>FeedbackGenericIncorrect</name><type>html</type><default><span class='incorrect'>Incorrect answer.</span></default><casKey></casKey><casType></casType><selected><span class='incorrect'>Incorrect answer.</span></selected></stackoption><stackoption><name>FeedbackGenericPCorrect</name><type>html</type><default><span class='partially'>Your answer is partially correct.</span></default><casKey></casKey><casType></casType><selected><span class='partially'>Your answer is partially correct.</span></selected></stackoption></ItemOptions><ItemTests><test><col><key>IE_ans</key><value>ta</value></col><col><key>PRT_PotResTree_1</key><value>1-0-T </value></col></test><test><col><key>IE_ans</key><value>0</value></col><col><key>PRT_PotResTree_1</key><value>1-0-F </value></col></test></ItemTests></assessmentItem><assessmentItem version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><questionCasValues><questionStem type="CasText"><castext>Choose ! \[ @ta@ = #ans# \] ! <IEfeedback>ans</IEfeedback><PRTfeedback>1</PRTfeedback> ! ! <p>This question demostrates an algebraic input box inside a displayed equation.<p></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionStem><questionVariables type="RawKeyVal"><rawKeyVals>ta = 1/(1+x^2)</rawKeyVals><forbidFloats>false</forbidFloats><simplify>true</simplify></questionVariables><workedSolution type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></workedSolution><questionNote type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionNote></questionCasValues><questionparts><questionpart><name>ans</name><inputType type="Meta"><selection>Algebraic Input</selection><default>Algebraic Input</default><values/></inputType><boxsize>15</boxsize><teachersAns type="CasString"><casString>ta</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/></questionpart></questionparts><PotentialResponseTrees><PotentialResponseTree><prtname>PotResTree_1</prtname><questionValue>1</questionValue><autoSimplify>true</autoSimplify><feedbackVariables></feedbackVariables><description type="Meta"><selection></selection><default></default><values/></description><PotentialResponses><PR id="0"><answerTest>AlgEquiv</answerTest><teachersAns>ta</teachersAns><studentAns>ans</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>1</rawMark><feedback></feedback><ansnote>1-0-T </ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>1-0-F </ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>interaction_element_test_alg_inequation</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection></selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://localhost/stack-dev</selection><default>http://localhost/stack-dev</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2009-11-03 11:50:52</selection><default>2009-11-03 11:50:37</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>demo, test</selection><default>demo, test</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>make_complexI</casKey><casType>fun</casType><selected>true</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>SqrtSign</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>sqrtdispflag</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>Simplify</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>simp</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>MarkModMethod</name><type>list</type><default>Penalty</default><values><value>Penalty</value><value>First Answer</value><value>Last Answer</value></values><casKey></casKey><casType></casType><selected>Penalty</selected></stackoption><stackoption><name>AssumePos</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey>assume_pos</casKey><casType>ex</casType><selected>false</selected></stackoption><stackoption><name>TeacherEmail</name><type>string</type><default></default><casKey></casKey><casType></casType><selected></selected></stackoption><stackoption><name>Feedback</name><type>list</type><default>TGS</default><values><value>TGS</value><value>TG</value><value>GS</value><value>T</value><value>G</value><value>S</value><value>none</value></values><casKey></casKey><casType></casType><selected>TGS</selected></stackoption><stackoption><name>FeedbackGenericCorrect</name><type>html</type><default><span class='correct'>Correct answer, well done.</span></default><casKey></casKey><casType></casType><selected><span class='correct'>Correct answer, well done.</span></selected></stackoption><stackoption><name>FeedbackGenericIncorrect</name><type>html</type><default><span class='incorrect'>Incorrect answer.</span></default><casKey></casKey><casType></casType><selected><span class='incorrect'>Incorrect answer.</span></selected></stackoption><stackoption><name>FeedbackGenericPCorrect</name><type>html</type><default><span class='partially'>Your answer is partially correct.</span></default><casKey></casKey><casType></casType><selected><span class='partially'>Your answer is partially correct.</span></selected></stackoption></ItemOptions><ItemTests><test><col><key>IE_ans</key><value>ta</value></col><col><key>PRT_PotResTree_1</key><value>1-0-T </value></col></test><test><col><key>IE_ans</key><value>0</value></col><col><key>PRT_PotResTree_1</key><value>1-0-F </value></col></test></ItemTests></assessmentItem><assessmentItem version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><questionCasValues><questionStem type="CasText"><castext>Enter ! \[ @ta@ \] ! #ans# <IEfeedback>ans</IEfeedback><PRTfeedback>1</PRTfeedback></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionStem><questionVariables type="RawKeyVal"><rawKeyVals>ta = b</rawKeyVals><forbidFloats>false</forbidFloats><simplify>true</simplify></questionVariables><workedSolution type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></workedSolution><questionNote type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionNote></questionCasValues><questionparts><questionpart><name>ans</name><inputType type="Meta"><selection>DropDownList</selection><default>Algebraic Input</default><values/></inputType><boxsize>15</boxsize><teachersAns type="CasString"><casString>ta</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters><parameter type="Meta" key="ddl_values"><selection>a,b,c,wrong</selection><default></default><values/></parameter></inputTypesParameters></questionpart></questionparts><PotentialResponseTrees><PotentialResponseTree><prtname>PotResTree_1</prtname><questionValue>1</questionValue><autoSimplify>true</autoSimplify><feedbackVariables></feedbackVariables><description type="Meta"><selection></selection><default></default><values/></description><PotentialResponses><PR id="0"><answerTest>AlgEquiv</answerTest><teachersAns>ta</teachersAns><studentAns>ans</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>1</rawMark><feedback></feedback><ansnote>1-0-T </ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>1-0-F </ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>interaction_element_test_DropDown</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection></selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://localhost/stack-dev</selection><default>http://localhost/stack-dev</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2009-11-03 11:50:46</selection><default>2009-11-03 11:50:37</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>demo, test</selection><default>demo, test</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>make_complexI</casKey><casType>fun</casType><selected>true</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>SqrtSign</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>sqrtdispflag</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>Simplify</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>simp</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>MarkModMethod</name><type>list</type><default>Penalty</default><values><value>Penalty</value><value>First Answer</value><value>Last Answer</value></values><casKey></casKey><casType></casType><selected>Penalty</selected></stackoption><stackoption><name>AssumePos</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey>assume_pos</casKey><casType>ex</casType><selected>false</selected></stackoption><stackoption><name>TeacherEmail</name><type>string</type><default></default><casKey></casKey><casType></casType><selected></selected></stackoption><stackoption><name>Feedback</name><type>list</type><default>TGS</default><values><value>TGS</value><value>TG</value><value>GS</value><value>T</value><value>G</value><value>S</value><value>none</value></values><casKey></casKey><casType></casType><selected>TGS</selected></stackoption><stackoption><name>FeedbackGenericCorrect</name><type>html</type><default><span class='correct'>Correct answer, well done.</span></default><casKey></casKey><casType></casType><selected><span class='correct'>Correct answer, well done.</span></selected></stackoption><stackoption><name>FeedbackGenericIncorrect</name><type>html</type><default><span class='incorrect'>Incorrect answer.</span></default><casKey></casKey><casType></casType><selected><span class='incorrect'>Incorrect answer.</span></selected></stackoption><stackoption><name>FeedbackGenericPCorrect</name><type>html</type><default><span class='partially'>Your answer is partially correct.</span></default><casKey></casKey><casType></casType><selected><span class='partially'>Your answer is partially correct.</span></selected></stackoption></ItemOptions><ItemTests><test><col><key>IE_ans</key><value>ta</value></col><col><key>PRT_PotResTree_1</key><value>1-0-T </value></col></test><test><col><key>IE_ans</key><value>0</value></col><col><key>PRT_PotResTree_1</key><value>1-0-F </value></col></test></ItemTests></assessmentItem><assessmentItem version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><questionCasValues><questionStem type="CasText"><castext>Choose all the even expressions.<br /> ! #ans# <IEfeedback>ans</IEfeedback><PRTfeedback>1</PRTfeedback></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionStem><questionVariables type="RawKeyVal"><rawKeyVals></rawKeyVals><forbidFloats>false</forbidFloats><simplify>true</simplify></questionVariables><workedSolution type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></workedSolution><questionNote type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionNote></questionCasValues><questionparts><questionpart><name>ans</name><inputType type="Meta"><selection>List</selection><default>Algebraic Input</default><values/></inputType><boxsize>15</boxsize><teachersAns type="CasString"><casString>[x^2,x^4]</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters><parameter type="Meta" key="list_input_type"><selection>checkbox</selection><default>radio</default><values><value key="radio">radio buttons</value><value key="dropdown">drop down list</value><value key="checkbox">check boxes</value></values></parameter><parameter type="Meta" key="list_no_display"><selection>4</selection><default>4</default><values><value key="4">4</value><value key="3">3</value><value key="2">2</value><value key="1">1</value></values></parameter><parameter type="QTTuple" key="list_correct_ans"><tupleitem type="Meta" index="list_label"><selection>x^2</selection><default></default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext>$x^2$</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></parameter><parameter type="qtlist" key="list_values"><listitem type="QTTuple" key="0"><tupleitem type="Meta" index="list_label"><selection>x</selection><default>x</default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext>$x$</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem><listitem type="QTTuple" key="1"><tupleitem type="Meta" index="list_label"><selection>x^3</selection><default>x^3</default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext>$x^3$</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem><listitem type="QTTuple" key="2"><tupleitem type="Meta" index="list_label"><selection>x^4</selection><default>x^4</default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext>$x^4$</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem><listitem type="QTTuple" key="3"><tupleitem type="Meta" index="list_label"><selection></selection><default></default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem><listitem type="QTTuple" key="4"><tupleitem type="Meta" index="list_label"><selection></selection><default></default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem></parameter></inputTypesParameters></questionpart></questionparts><PotentialResponseTrees><PotentialResponseTree><prtname>PotResTree_1</prtname><questionValue>1</questionValue><autoSimplify>true</autoSimplify><feedbackVariables></feedbackVariables><description type="Meta"><selection></selection><default></default><values/></description><PotentialResponses><PR id="0"><answerTest>AlgEquiv</answerTest><teachersAns>{x^2,x^4}</teachersAns><studentAns>setify(ans)</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>1</rawMark><feedback></feedback><ansnote>1-0-T </ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>1-0-F </ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>interaction_element_test_List_checkbox</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection></selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://localhost/stack-dev</selection><default>http://localhost/stack-dev</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2009-11-03 11:55:44</selection><default>2009-11-03 11:50:37</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>demo, test</selection><default>demo, test</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>make_complexI</casKey><casType>fun</casType><selected>true</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>SqrtSign</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>sqrtdispflag</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>Simplify</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>simp</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>MarkModMethod</name><type>list</type><default>Penalty</default><values><value>Penalty</value><value>First Answer</value><value>Last Answer</value></values><casKey></casKey><casType></casType><selected>Penalty</selected></stackoption><stackoption><name>AssumePos</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey>assume_pos</casKey><casType>ex</casType><selected>false</selected></stackoption><stackoption><name>TeacherEmail</name><type>string</type><default></default><casKey></casKey><casType></casType><selected></selected></stackoption><stackoption><name>Feedback</name><type>list</type><default>TGS</default><values><value>TGS</value><value>TG</value><value>GS</value><value>T</value><value>G</value><value>S</value><value>none</value></values><casKey></casKey><casType></casType><selected>TGS</selected></stackoption><stackoption><name>FeedbackGenericCorrect</name><type>html</type><default><span class='correct'>Correct answer, well done.</span></default><casKey></casKey><casType></casType><selected><span class='correct'>Correct answer, well done.</span></selected></stackoption><stackoption><name>FeedbackGenericIncorrect</name><type>html</type><default><span class='incorrect'>Incorrect answer.</span></default><casKey></casKey><casType></casType><selected><span class='incorrect'>Incorrect answer.</span></selected></stackoption><stackoption><name>FeedbackGenericPCorrect</name><type>html</type><default><span class='partially'>Your answer is partially correct.</span></default><casKey></casKey><casType></casType><selected><span class='partially'>Your answer is partially correct.</span></selected></stackoption></ItemOptions><ItemTests/></assessmentItem><assessmentItem version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><questionCasValues><questionStem type="CasText"><castext>Choose ! \[ @ta@ \] ! #ans# <IEfeedback>ans</IEfeedback><PRTfeedback>1</PRTfeedback></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionStem><questionVariables type="RawKeyVal"><rawKeyVals>ta = x^2</rawKeyVals><forbidFloats>false</forbidFloats><simplify>true</simplify></questionVariables><workedSolution type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></workedSolution><questionNote type="CasText"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionNote></questionCasValues><questionparts><questionpart><name>ans</name><inputType type="Meta"><selection>List</selection><default>Algebraic Input</default><values/></inputType><boxsize>15</boxsize><teachersAns type="CasString"><casString>ta</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters><parameter type="Meta" key="list_input_type"><selection>dropdown</selection><default>radio</default><values><value key="radio">radio buttons</value><value key="dropdown">drop down list</value><value key="checkbox">check boxes</value></values></parameter><parameter type="Meta" key="list_no_display"><selection>3</selection><default>3</default><values><value key="0">3</value><value key="1">2</value><value key="2">1</value></values></parameter><parameter type="QTTuple" key="list_correct_ans"><tupleitem type="Meta" index="list_label"><selection>x^2</selection><default></default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext>$x^2$</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></parameter><parameter type="qtlist" key="list_values"><listitem type="QTTuple" key="0"><tupleitem type="Meta" index="list_label"><selection>x</selection><default>x</default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext>$x$</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem><listitem type="QTTuple" key="1"><tupleitem type="Meta" index="list_label"><selection>x^3</selection><default>x^3</default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext>$x^3$</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem><listitem type="QTTuple" key="2"><tupleitem type="Meta" index="list_label"><selection>x^4</selection><default>x^4</default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext>$x^4$</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem><listitem type="QTTuple" key="3"><tupleitem type="Meta" index="list_label"><selection></selection><default></default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem><listitem type="QTTuple" key="4"><tupleitem type="Meta" index="list_label"><selection></selection><default></default><values/></tupleitem><tupleitem type="CasText" index="list_display"><castext></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></tupleitem></listitem></parameter></inputTypesParameters></questionpart></questionparts><PotentialResponseTrees><PotentialResponseTree><prtname>PotResTree_1</prtname><questionValue>1</questionValue><autoSimplify>true</autoSimplify><feedbackVariables></feedbackVariables><description type="Meta"><selection></selection><default></default><values/></description><PotentialResponses><PR id="0"><answerTest>AlgEquiv</answerTest><teachersAns>ta</teachersAns><studentAns>ans</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>1</rawMark><feedback></feedback><ansnote>1-0-T </ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>1-0-F </ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>interaction_element_test_List_drop</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection></selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://localhost/stack-dev</selection><default>http://localhost/stack-dev</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2009-11-03 11:50:54</selection><default>2009-11-03 11:50:37</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>demo, test</selection><default>demo, test</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>make_complexI</casKey><casType>fun</casType><selected>true</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</defaul... [truncated message content] |
From: Simon H. <sim...@us...> - 2010-09-30 16:57:01
|
Update of /cvsroot/stack/stack-dev/other In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/other Modified Files: load.js jquery.js Added Files: flyfeedback.js jquery.dataTables.js jquery.ui.js Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: load.js =================================================================== RCS file: /cvsroot/stack/stack-dev/other/load.js,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** load.js 19 Mar 2010 11:11:48 -0000 1.3 --- load.js 30 Sep 2010 16:56:12 -0000 1.4 *************** *** 44,48 **** // 0 means always load jsMath // ! autoload: 1, // --- 44,50 ---- // 0 means always load jsMath // ! // The load flag is used in reporting since jsMath elements are generated dynamically after page load. ! // ! autoload: (loadFlag != null ? 1 : 0), // --- NEW FILE: jquery.ui.js --- /*! * jQuery UI 1.8.2 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI */ (function(c){c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.2",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")== "hidden")return false;b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108, NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect", "none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x", 1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)? !a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}})(jQuery); (function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype= b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g= b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create(); this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f, h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a= b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); (function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&& this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault(); return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&& this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX- a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); (function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== "original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| 0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- (parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== "parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&& a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"), 10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft(): f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+ this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+ Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left- this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs= this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.2"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable"); if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper; c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver= 1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left; this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper= this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a= d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options; if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!= "HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX- b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()- c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this, width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&& o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t= p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&& (p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"), 10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery); (function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this); a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&& this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass); this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g= d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop", a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.2"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height; switch(c){case "fit":return i<e&&g<k&&j<f&&h<l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=i&& e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!= "none";if(c[f].visible){c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight};e=="mousedown"&&c[f]._activate.call(c[f],b)}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem|| a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e= d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})}}})(jQuery); (function(d){d.widget("ui.resizable",d.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");d.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element, _proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&d.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(d('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!d(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var e=0;e<c.length;e++){var g=d.trim(c[e]),f=d('<div class="ui-resizable-handle '+("ui-resizable-"+g)+'"></div>');/sw|se|ne|nw/.test(g)&&f.css({zIndex:++a.zIndex});"se"==g&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[g]=".ui-resizable-"+g;this.element.append(f)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== String)this.handles[i]=d(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=d(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}d(this.handles[i])}};this._renderAxis(this.element);this._handles=d(".ui-resizable-handle",this.element).disableSelection(); this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();d(this.element).addClass("ui-resizable-autohide").hover(function(){d(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){d(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){d(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(d(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), e=this.element;this.resizing=true;this.documentScroll={top:d(document).scrollTop(),left:d(document).scrollLeft()};if(e.is(".ui-draggable")||/absolute/.test(e.css("position")))e.css({position:"absolute",top:c.top,left:c.left});d.browser.opera&&/relative/.test(e.css("position"))&&e.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var g=m(this.helper.css("top"));if(a.containment){c+=d(a.containment).scrollLeft()||0;g+=d(a.containment).scrollTop()||0}this.offset= this.helper.offset();this.position={left:c,top:g};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:c,top:g};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: this.originalSize.width/this.originalSize.height||1;a=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor",a=="auto"?this.axis+"-resize":a);e.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,e=this._change[this.axis];if(!e)return false;c=e.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var e=this._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName);e=g&&d.ui.hasScroll(e[0],"left")?0:c.sizeDiff.height; g={width:c.size.width-(g?0:c.sizeDiff.width),height:c.size.height-e};e=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var f=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(d.extend(g,{top:f,left:e}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}d("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,e=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(e=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(e=="nw"){b.top= a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,e=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,g=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,f=k(b.width)&&a.minWidth&&a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(f)b.width=a.minWidth;if(h)b.height=a.minHeight;if(e)b.width=a.maxWidth;if(g)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(f&&l)b.left=i-a.minWidth;if(e&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(g&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var e=[c.css("borderTopWidth"), c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],g=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=d.map(e,function(f,h){f=parseInt(f,10)||0;h=parseInt(g[h],10)||0;return f+h})}d.browser.msie&&(d(b).is(":hidden")||d(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset= this.element.offset();if(this._helper){this.helper=this.helper||d('<div style="overflow:hidden;"></div>');var a=d.browser.msie&&d.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return d.extend(this._change.n.apply(this, arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){d.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});d.extend(d.ui.resizable, {version:"1.8.2"});d.ui.plugin.add("resizable","alsoResize",{start:function(){var b=d(this).data("resizable").options,a=function(c){d(c).each(function(){d(this).data("resizable-alsoresize",{width:parseInt(d(this).width(),10),height:parseInt(d(this).height(),10),left:parseInt(d(this).css("left"),10),top:parseInt(d(this).css("top"),10)})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else d.each(b.alsoResize,function(c){a(c)}); else a(b.alsoResize)},resize:function(){var b=d(this).data("resizable"),a=b.options,c=b.originalSize,e=b.originalPosition,g={height:b.size.height-c.height||0,width:b.size.width-c.width||0,top:b.position.top-e.top||0,left:b.position.left-e.left||0},f=function(h,i){d(h).each(function(){var j=d(this),l=d(this).data("resizable-alsoresize"),p={};d.each((i&&i.length?i:["width","height","top","left"])||["width","height","top","left"],function(n,o){if((n=(l[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(/relative/.test(j.css("position"))&& d.browser.opera){b._revertToRelativePosition=true;j.css({position:"absolute",top:"auto",left:"auto"})}j.css(p)})};typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?d.each(a.alsoResize,function(h,i){f(h,i)}):f(a.alsoResize)},stop:function(){var b=d(this).data("resizable");if(b._revertToRelativePosition&&d.browser.opera){b._revertToRelativePosition=false;el.css({position:"relative"})}d(this).removeData("resizable-alsoresize-start")}});d.ui.plugin.add("resizable","animate",{stop:function(b){var a= d(this).data("resizable"),c=a.options,e=a._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName),f=g&&d.ui.hasScroll(e[0],"left")?0:a.sizeDiff.height;g={width:a.size.width-(g?0:a.sizeDiff.width),height:a.size.height-f};f=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(d.extend(g,h&&f?{top:h,left:f}:{}),{duration:c.animateDuration,easing:c.animateEasing, step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};e&&e.length&&d(e[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});d.ui.plugin.add("resizable","containment",{start:function(){var b=d(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof d?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= d(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight}}else{var e=d(a),g=[];d(["Top","Right","Left","Bottom"]).each(function(i,j){g[i]=m(e.css("padding"+j))});b.containerOffset=e.offset();b.containerPosition=e.position();b.containerSize={height:e.innerHeight()-g[3],width:e.innerWidth()-g[1]};c=b.containerOffset; var f=b.containerSize.height,h=b.containerSize.width;h=d.ui.hasScroll(a,"left")?a.scrollWidth:h;f=d.ui.hasScroll(a)?a.scrollHeight:f;b.parentData={element:a,left:c.left,top:c.top,width:h,height:f}}}},resize:function(b){var a=d(this).data("resizable"),c=a.options,e=a.containerOffset,g=a.position;b=a._aspectRatio||b.shiftKey;var f={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))f=e;if(g.left<(a._helper?e.left:0)){a.size.width+=a._helper?a.position.left-e.left: a.position.left-f.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?e.left:0}if(g.top<(a._helper?e.top:0)){a.size.height+=a._helper?a.position.top-e.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?e.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-f.left:a.offset.left-f.left)+a.sizeDiff.width);e=Math.abs((a._helper?a.offset.top-f.top:a.offset.top- e.top)+a.sizeDiff.height);g=a.containerElement.get(0)==a.element.parent().get(0);f=/relative|absolute/.test(a.containerElement.css("position"));if(g&&f)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(e+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-e;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=d(this).data("resizable"),a=b.options,c=b.containerOffset,e=b.containerPosition, g=b.containerElement,f=d(b.helper),h=f.offset(),i=f.outerWidth()-b.sizeDiff.width;f=f.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f});b._helper&&!a.animate&&/static/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f})}});d.ui.plugin.add("resizable","ghost",{start:function(){var b=d(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=d(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=d(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});d.ui.plugin.add("resizable","grid",{resize:function(){var b= d(this).data("resizable"),a=b.options,c=b.size,e=b.originalSize,g=b.originalPosition,f=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-e.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-e.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a}else if(/^(ne)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}else{if(/^(sw)$/.test(f)){b.size.width=e.width+h;b.size.height= e.height+a}else{b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}b.position.left=g.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); (function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting"); b.unselecting=true;f._trigger("unselecting",c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f= this;this.dragged=true;if(!this.options.disabled){var d=this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected"); a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting= true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected= false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.2"})})(jQuery); (function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, {click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+ this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+ b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+ "px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(... [truncated message content] |
From: Simon H. <sim...@us...> - 2010-09-30 16:57:00
|
Update of /cvsroot/stack/stack-dev/lang/en In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lang/en Modified Files: stack.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lang/en/stack.php,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** stack.php 13 May 2010 16:09:53 -0000 1.154 --- stack.php 30 Sep 2010 16:56:21 -0000 1.155 *************** *** 33,36 **** --- 33,37 ---- $string['stackQuestion_questionVarsRaw'] = 'Question variables'; $string['stackQuestion_questionVars'] = '(Internal) Question variables'; + $string['stackQuestion_id.revision'] = 'id.revision'; $string['stackQuestion_questionStem'] = 'Question stem'; $string['stackQuestion_questionAns'] = "Teacher's answer"; *************** *** 47,51 **** $string['stackQuestion_questionName'] = 'Name'; ! $string['stackQuestion_questionKeywords'] = 'Keywords'; $string['stackQuestion_questionBody'] = 'Body'; $string['stackQuestion_questionUserLastEdited'] = 'User'; --- 48,54 ---- $string['stackQuestion_questionName'] = 'Name'; ! $string['stackQuestion_questionKeywordFilter'] = 'Keyword filter'; ! $string['stackQuestion_questionKeywordReset'] = '[reset]'; ! $string['stackQuestion_questionKeywordInvertFilter'] = 'Invert keywords'; $string['stackQuestion_questionBody'] = 'Body'; $string['stackQuestion_questionUserLastEdited'] = 'User'; *************** *** 65,75 **** $string['stackQuestion_questionRights'] = 'Rights statement'; $string['stackQuestion_questionValid'] = 'Valid'; $string['stackQuestion_questionStatus'] = 'Status'; $string['stackQuestion_questionDescription'] = 'Description'; ! $string['stackQuestion_questionDateLastEdited'] = 'Last edited on'; $string['stackQuestion_questionPublished'] = 'Privacy'; $string['stackQuestion_questionRelevance'] = 'Relevance'; ! $string['stackQuestion_questionNoDeployed'] = "# dep'd"; // Used in the question bank order select form to indicate no selection. --- 68,80 ---- $string['stackQuestion_questionRights'] = 'Rights statement'; + $string['stackQuestion_questionHeader'] = '<b>Name</b> (version): Description <small>keywords</small>'; $string['stackQuestion_questionValid'] = 'Valid'; $string['stackQuestion_questionStatus'] = 'Status'; $string['stackQuestion_questionDescription'] = 'Description'; ! $string['stackQuestion_questionDateLastEdited'] = 'Last edited'; $string['stackQuestion_questionPublished'] = 'Privacy'; $string['stackQuestion_questionRelevance'] = 'Relevance'; ! $string['stackQuestion_questionNoDeployed'] = "<abbr title='number deployed'>#</abbr>"; ! $string['stackQuestion_questionActions'] = "Actions"; // Used in the question bank order select form to indicate no selection. *************** *** 370,378 **** $string['FE_index_main'] = 'main menu'; $string['FE_index_Hints'] = 'Hints'; ! $string['FE_index_search'] = 'Search Questions'; $string['FE_peak_memory'] = 'Peak memory usage: '; $string['FE_publicCopied'] = 'Public question copied'; $string['FE_publicCopy'] = 'You may now '; ! $string['FE_publicCopy2'] = 'modify your personal copy'; $string['FE_publicCopy3'] = 'of the question.'; $string['FE_confirmDelete'] = 'Confirm Delete'; --- 375,384 ---- $string['FE_index_main'] = 'main menu'; $string['FE_index_Hints'] = 'Hints'; ! $string['FE_index_search'] = 'Search'; ! $string['FE_index_question(s)'] = 'question(s)'; $string['FE_peak_memory'] = 'Peak memory usage: '; $string['FE_publicCopied'] = 'Public question copied'; $string['FE_publicCopy'] = 'You may now '; ! $string['FE_publicCopy2'] = 'modify your personal copy'; $string['FE_publicCopy3'] = 'of the question.'; $string['FE_confirmDelete'] = 'Confirm Delete'; *************** *** 382,386 **** $string['FE_noCancel'] = 'No, Cancel'; $string['FE_testQuestion'] = 'Test Question'; ! $string['FE_deployQuestion'] = 'Deploy Question'; $string['FE_question'] = 'Question:'; --- 388,392 ---- $string['FE_noCancel'] = 'No, Cancel'; $string['FE_testQuestion'] = 'Test Question'; ! $string['FE_deployVersion'] = 'Deploy Version'; $string['FE_question'] = 'Question:'; *************** *** 388,401 **** $string['FE_deployQuestion_attemptingDeploy'] = 'Attempting to deploy {$a} instances.'; $string['FE_deployQuestion_deployedInstances'] = 'Deployed {$a} new instances.'; ! $string['FE_deployQuestion_dropping'] = 'Dropping version '; $string['FE_deployQuestion_auto'] = 'Automatically deployed single question instance'; ! $string['FE_deployQuestion_singletonDeployed'] = 'Singleton question deployed (\'Drop\' will re-deploy).'; ! $string['FE_deployQuestion_versions'] = ' instances currently cached.'; ! $string['FE_deployQuestion_version'] = '1 instance currently cached.'; $string['FE_deployQuestion_newversions'] = 'new random instances.'; $string['FE_deployQuestion_noi'] = 'No instances added yet.'; $string['FE_deployQuestion_norand'] = 'There are no random instances of this question, and hence no need to deploy more than one version.'; ! $string['FE_deployQuestion_instancesOfQuestion']= 'Instances of question '; $string['FE_deployQuestion_primedResponses'] = 'Primed responses'; $string['FE_validate'] = '{$a[0]} of {$a[1]} questions validated.'; --- 394,417 ---- $string['FE_deployQuestion_attemptingDeploy'] = 'Attempting to deploy {$a} instances.'; $string['FE_deployQuestion_deployedInstances'] = 'Deployed {$a} new instances.'; ! $string['FE_deployQuestion_droppedInstance'] = 'Dropped instance.'; $string['FE_deployQuestion_auto'] = 'Automatically deployed single question instance'; ! $string['FE_deployQuestion_singletonDeployed'] = 'Singleton question deployed (\'Undeploy\' will trigger redeploy).'; ! $string['FE_deployQuestion_xInstances'] = '{$a} instances '; ! $string['FE_deployQuestion_instanceDeployed'] = '1 instance deployed.'; $string['FE_deployQuestion_newversions'] = 'new random instances.'; $string['FE_deployQuestion_noi'] = 'No instances added yet.'; $string['FE_deployQuestion_norand'] = 'There are no random instances of this question, and hence no need to deploy more than one version.'; ! $string['FE_deployQuestion_instancesOfVersion']= 'Instances of question version'; ! $string['FE_deployQuestion_autoprime'] = 'automatically prime'; $string['FE_deployQuestion_primedResponses'] = 'Primed responses'; + $string['FE_deployQuestion_ofVersionXdeployed'] = 'of version {$a} deployed.'; + $string['FE_deployQuestion_newerVersion'] = 'There is a newer version of this question available: <strong>version {$a}</strong>. To redeploy with this you will first need to undeploy the instances below. Students will continue to be able to answer those instances if they have already started.'; + $string['FE_deployQuestion_dropInstance'] = 'Dropped an instance ({$a}).'; + $string['FE_deployQuestion_undeployAll'] = 'Undeploy all'; + $string['FE_deployQuestion_confirmUndeployAll'] = 'Are you sure want to drop all deployed instances of this question version?'; + $string['FE_deployQuestion_oldVersionDeployed'] = 'An older version of this question has been deployed. Before you can deploy instances of this latest version you will need to undeploy all instances of the older version below. Students already using this version will be able to continue.'; + $string['FE_deployQuestion_newerVersionCannotDeploy'] = 'There is now a newer version of this question. This means you cannot deploy any more instances from the older version.'; + $string['FE_deployQuestion_undeployOldVersion'] = 'To deploy instances of the latest version you will need to undeploy all instances of this version. '; + $string['FE_deployQuestion_primedResponsesBlurb'] = 'Pregenerated from the question tests, they can include correct answers as well as common mistakes. The cache can be primed to include their straightforward submission to save the work at quiz time.'; $string['FE_validate'] = '{$a[0]} of {$a[1]} questions validated.'; *************** *** 487,490 **** --- 503,507 ---- $string['stackQuestion_PR_AddAPR'] = 'Add a Potential Response'; $string['stackQuestion_PR_requirements'] = 'This Potential Response Tree will become active when the student has answered:'; + $string['PR_ERROR'] = 'Please alert your teacher that the marking algorithm has failed to work because of the following problems:'; $string['stackCas_invalidCommand'] = 'CAS commands not valid'; *************** *** 519,522 **** --- 536,540 ---- //buttons + $string['stackAuthor_qid'] = 'Question ID:'; $string['stackAuthor_button_update'] = 'Update'; $string['stackAuthor_button_addPRT'] = '+'; *************** *** 536,549 **** $string['stackAuthor_button_exportAsXml'] = 'Export as XML'; $string['chat_button'] = 'chat'; //author editor text $string['stackAuthor_title'] = 'Author Question'; ! $string['stackAuthor_qid'] = 'Question ID:'; $string['stackAuthor_name'] = 'Name:'; $string['stackAuthor_description'] = 'Description:'; $string['stackAuthor_keywords'] = 'Keywords:'; $string['stackAuthor_qvariables'] = 'Question Variables:'; ! $string['stackAuthor_stem'] = 'Question Stem:'; ! $string['stackAuthor_stemInfo'] = '#ans# denotes student answers<br /> @castext@ for castext<br /><html></html> for html <br />$\latex$ for latex'; $string['stackAuthor_workedSolution'] = 'Worked Solution: '; $string['stackAuthor_qnote'] = 'Question Note:'; --- 554,571 ---- $string['stackAuthor_button_exportAsXml'] = 'Export as XML'; $string['chat_button'] = 'chat'; + $string['stackQuiz_button_submit'] = 'Submit'; + $string['stackQuiz_button_finishQuiz'] = 'Finish quiz'; //author editor text + $string['stackAuthor_onlineGuide'] = 'Online Guide'; $string['stackAuthor_title'] = 'Author Question'; ! $string['stackAuthor_editingQuestion'] = 'Editing Question: '; ! $string['stackAuthor_stem'] = 'Stem'; $string['stackAuthor_name'] = 'Name:'; $string['stackAuthor_description'] = 'Description:'; $string['stackAuthor_keywords'] = 'Keywords:'; $string['stackAuthor_qvariables'] = 'Question Variables:'; ! $string['stackAuthor_questionStem'] = 'Question Stem:'; ! $string['stackAuthor_stemInfo'] = '#ans# denotes student answers<br /> @castext@ for castext<br /><html></html> for html <br />latex'; $string['stackAuthor_workedSolution'] = 'Worked Solution: '; $string['stackAuthor_qnote'] = 'Question Note:'; *************** *** 570,573 **** --- 592,597 ---- $string['stackAuthor_LowestTerms'] = 'Require lowest terms'; $string['stackAuthor_sameType'] = 'Check Students answer\'s type'; + $string['stackAuthor_studentVerify'] = 'Student must verify'; + $string['stackAuthor_hideFeedback'] = 'Hide feedback'; $string['stackAuthor_inputTypeOpt'] = 'Input Type Options'; $string['stackAuthor_noInputTypeOpt'] = 'No options'; *************** *** 576,580 **** ! $string['stackAuthor_metadata'] = 'Meta data'; $string['stackAuthor_qstatus'] = 'Question Status:'; $string['stackAuthor_lang'] = 'Language:'; --- 600,604 ---- ! $string['stackAuthor_metadata'] = 'Metadata'; $string['stackAuthor_qstatus'] = 'Question Status:'; $string['stackAuthor_lang'] = 'Language:'; *************** *** 620,634 **** //moodle additions to author interface ! $string['stackAuthor_moodleExport'] = 'Moodle Options'; ! $string['stackAuthor_addedMoodle'] = 'Added to Moodle'; $string['stackAuthor_moodleAddSucessful'] = 'Question added to Moodle successfully.'; ! $string['stackAuthor_moodleAddFailed'] = 'Failed to add question to Moodle.'; ! $string['stackAuthor_moodleEngIdFail'] = 'Engine ID missing, could not add to Moodle.'; $string['stackAuthor_moodleUpdateFail'] = 'Failed to update Moodle'; ! $string['stackAuthor_moodleQBFail'] = 'Could not update this question in Moodle\'s question bank.'; ! $string['stackAuthor_moodleSave1st'] = 'The question must be saved before it can be added to Moodle\'s question bank.'; ! $string['stackAuthor_inMoodle'] = 'This question is already in Moodle\'s question bank. Saving the question in STACK will automatically update Moodle.'; ! $string['stackAuthor_moodleSelectCat'] = 'You may add this question to one of Moodle\'s question banks. Select the required category.'; ! $string['stackAuthor_category'] = 'Category:'; $string['stackMoodle_passkeyInvalid'] = 'Invalid passkey for this server.'; --- 644,660 ---- //moodle additions to author interface ! $string['stackAuthor_moodleExport'] = 'Moodle Options'; ! $string['stackAuthor_addToMoodle'] = 'Add to Moodle'; ! $string['stackAuthor_addedMoodle'] = 'Added to Moodle'; $string['stackAuthor_moodleAddSucessful'] = 'Question added to Moodle successfully.'; ! $string['stackAuthor_moodleAddFailed'] = 'Failed to add question to Moodle.'; ! $string['stackAuthor_moodleEngIdFail'] = 'Engine ID missing, could not add to Moodle.'; $string['stackAuthor_moodleUpdateFail'] = 'Failed to update Moodle'; ! $string['stackAuthor_moodleQBFail'] = 'Could not update this question in Moodle\'s question bank.'; ! $string['stackAuthor_moodleSave1st'] = 'The question must be saved before it can be added to Moodle\'s question bank.'; ! $string['stackAuthor_inMoodle'] = 'This question is already in Moodle\'s question bank. Saving the question in STACK will automatically update Moodle.'; ! $string['stackAuthor_moodleSelectCat'] = 'You may add this question to one of Moodle\'s question banks. Select the required category.'; ! $string['stackAuthor_category'] = 'Category:'; ! $string['stackAuthor_savedVersions'] = 'Saved versions'; $string['stackMoodle_passkeyInvalid'] = 'Invalid passkey for this server.'; *************** *** 751,755 **** $string['stackIcon_success'] = 'correct.png'; $string['stackIcon_success_alt'] = 'Success'; ! //Authoring errors --- 777,784 ---- $string['stackIcon_success'] = 'correct.png'; $string['stackIcon_success_alt'] = 'Success'; ! $string['stackIcon_edit'] = 'Edit'; ! $string['stackIcon_try'] = 'Try'; ! $string['stackIcon_deploy'] = 'Deploy'; ! $string['stackIcon_xml'] = 'XML'; //Authoring errors *************** *** 1092,1095 **** --- 1121,1125 ---- $string['stackInputType_list'] = 'List'; $string['stackInputType_Textarea'] = 'Text area'; + $string['stackInputType_slider'] = 'Slider'; //Options editor *************** *** 1136,1140 **** ! //Reporting strings $string['stackReport_allAttempts'] = 'All Attempts'; $string['stackReport_lastAttempt'] = 'Last Attempt'; --- 1166,1223 ---- ! ! // Reporting Strings ! ! // New strings ! $string['stackReport_questions'] = 'Questions'; ! $string['stackReport_students'] = 'Students'; ! $string['stackReport_last100AttemptsScores'] = 'The scores of the last 100 attempts'; ! $string['stackReport_attemptsGraph'] = 'Attempts graph'; ! $string['stackReport_attemptsTable'] = 'Attempts table'; ! $string['stackReport_potentialResponseTrees'] = 'Potential Response Trees'; ! $string['stackReport_attemptsHistory'] = 'History of attempts'; ! $string['stackReport_workedSolution'] = 'Worked Solution'; ! ! // Reporting strings for javascript ! $string['stackReport_js_attemptInfoString'] = 'Student #[student] tried question #[question] on [date] and scored [score]'; ! $string['stackReport_js_prtName'] = 'PRT Name'; ! $string['stackReport_js_answerNote'] = 'Answer Note'; ! $string['stackReport_js_score'] = 'Score'; ! $string['stackReport_js_totalAttempts'] = 'Total Attempts'; ! $string['stackReport_js_percentage'] = 'Percentage'; ! $string['stackReport_js_tooltipHint'] = 'Move your mouse over a point on the graph to see more information about the attempt.'; ! $string['stackReport_js_questions'] = 'Questions'; ! $string['stackReport_js_questionsAttemptedBy'] = 'Questions which [name] attempted'; ! $string['stackReport_js_students'] = 'Students'; ! $string['stackReport_js_studentsWhoAttempted'] = 'Students who attempted question #[question]'; ! $string['stackReport_js_loading'] = 'Loading'; ! $string['stackReport_js_questionNotes'] = 'Question Notes'; ! $string['stackReport_js_noAttempts'] = 'No Attempts'; ! $string['stackReport_js_noPRTs'] = 'This question has no potential response trees.'; ! $string['stackReport_js_questionAttempts'] = 'Attempts over time for question #[id]'; ! $string['stackReport_js_questionGraph'] = 'Graph of scores obtained on question #[id]'; ! $string['stackReport_js_studentAttempts'] = 'Attempts over time for student #[id]'; ! $string['stackReport_js_studentGraph'] = 'Graph of scores obtained by [name]'; ! $string['stackReport_js_tryQuestion'] = 'Try the question'; ! $string['stackReport_js_errorRetrieving'] = 'There was an error retrieving this data'; ! $string['stackReport_js_noWorkedSolution'] = 'There is no worked solution'; ! $string['stackReport_js_tryQuestionInInterface'] = 'Try this question in the test question interface'; ! $string['stackReport_js_dataAboutAttempt'] = 'Data about student [studentID]\'s attempts at question [questionID]'; // note backslash escapes apostrophe ! ! // Reporting strings for datatables ! $string['stackReport_js_dataTable_loading'] = 'Loading'; ! $string['stackReport_js_dataTable_first'] = 'First'; ! $string['stackReport_js_dataTable_last'] = 'Last'; ! $string['stackReport_js_dataTable_next'] = 'Next'; ! $string['stackReport_js_dataTable_previous'] = 'Previous'; ! $string['stackReport_js_dataTable_tableInfo'] = 'Showing _START_ to _END_ of _TOTAL_ entries'; ! $string['stackReport_js_dataTable_tableInfoEmpty'] = 'Showing 0 to 0 of 0 entries'; ! $string['stackReport_js_dataTable_tableInfoFiltered'] = '(filtered from _MAX_ total entries)'; ! $string['stackReport_js_dataTable_processing'] = 'Procssing'; ! $string['stackReport_js_dataTable_search'] = 'Search'; ! $string['stackReport_js_dataTable_zeroRecords'] = 'No matching records found'; ! ! // Older strings from an reporting, may be no long needed ! $string['stackReport_questions'] = 'Questions'; $string['stackReport_allAttempts'] = 'All Attempts'; $string['stackReport_lastAttempt'] = 'Last Attempt'; *************** *** 1172,1176 **** $string['stackReport_rawmark'] = 'Raw Mark'; $string['stackReport_modmark'] = 'Mod Mark'; ! $string['stackReport_ansNote'] = 'Answer Note'; $string['stackReport_errors'] = 'Errors'; $string['stackReport_noMarks'] = 'No marks for this attempt.'; --- 1255,1259 ---- $string['stackReport_rawmark'] = 'Raw Mark'; $string['stackReport_modmark'] = 'Mod Mark'; ! $string['stackReport_answerNote'] = 'Answer Note'; $string['stackReport_errors'] = 'Errors'; $string['stackReport_noMarks'] = 'No marks for this attempt.'; *************** *** 1190,1219 **** $string['stackReport_IEfeedback'] = 'Invalid: full feedback as ALT-text to icon.'; $string['stackReport_feedback'] = 'Full feedback as ALT-text to icon.'; - $string['stackReport_last100AttemptsScores'] = 'The scores of the last 100 attempts'; - $string['stackReport_tooltipHint'] = 'Move your mouse over a point on the graph to see more information about the attempt.'; - $string['stackReport_attemptInfoString'] = 'Student #[student] tried question #[question] on [date] and scored [score]'; - $string['stackReport_studentsWhoAttempted'] = 'Students who attempted question #[question]'; - $string['stackReport_questionsAttemptedBy'] = 'Questions which [name] attempted'; - $string['stackReport_potentialResponseTrees'] = 'Potential Response Trees'; - $string['stackReport_workedSolution'] = 'Worked Solution'; - $string['stackReport_radarChart'] = 'Radar Chart'; - $string['stackReport_answerNote'] = 'Answer Note'; - $string['stackReport_percentage'] = 'Percentage'; - $string['stackReport_questionNotes'] = 'Question Notes'; - $string['stackReport_attemptsGraph'] = 'Attempts graph'; - $string['stackReport_attemptsTable'] = 'Attempts table'; - $string['stackReport_attemptsHistory'] = 'History of attempts'; - $string['stackReport_tryQuestion'] = 'Try question'; - $string['stackReport_loading'] = 'Loading'; - $string['stackReport_first'] = 'First'; - $string['stackReport_last'] = 'Last'; - $string['stackReport_next'] = 'Next'; - $string['stackReport_previous'] = 'Previous'; - $string['stackReport_tableInfo'] = 'Showing _START_ to _END_ of _TOTAL_ entries'; - $string['stackReport_tableInfoEmpty'] = 'Showing 0 to 0 of 0 entries'; - $string['stackReport_tableInfoFiltered'] = '(filtered from _MAX_ total entries)'; - $string['stackReport_processing'] = 'Procssing'; - $string['stackReport_search'] = 'Search'; - $string['stackReport_zeroRecords'] = 'No matching records found'; //Question search strings --- 1273,1276 ---- |
Update of /cvsroot/stack/stack-dev/opaque In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/opaque Modified Files: MoodleQuestionDeployment.php MoodleQuestionList.php MoodleDisplayItem.php MoodleStackReport.php StackServer.php newWSDL.wsdl Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: newWSDL.wsdl =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/newWSDL.wsdl,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** newWSDL.wsdl 5 Feb 2010 11:00:10 -0000 1.11 --- newWSDL.wsdl 30 Sep 2010 16:56:21 -0000 1.12 *************** *** 112,115 **** --- 112,116 ---- <sequence> <element name="id" nillable="true" type="xsd:int" /> + <element name="version" nillable="true" type="xsd:int" /> <element name="name" nillable="true" type="soapenc:string" /> <element name="description" nillable="true" type="soapenc:string" /> Index: MoodleStackReport.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/MoodleStackReport.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MoodleStackReport.php 16 Sep 2009 12:05:13 -0000 1.4 --- MoodleStackReport.php 30 Sep 2010 16:56:21 -0000 1.5 *************** *** 40,85 **** { ! if(!empty($param['type'])) ! { $reportType = $param['type']; $xhtml .= $this->report->displayResults($param); - } - $xhtml .= '<br />'; ! if($reportType == NULL) //if still null, display options ! { ! //display filter selector ! $xhtml = "<em>Only very simple reports are currently available</em><br />"; ! $xhtml .= '<p><a href="stackSessionPage.php?page=report&type=question">'.get_string('stackReport_question','stack').'</a></p>'; ! $xhtml .= '<p><a href="stackSessionPage.php?page=report&type=student">'.get_string('stackReport_student','stack').'</a></p>'; ! //$xhtml .= '<p><a href="stackSessionPage.php?page=report&type=markbook">'.get_string('stackReport_markbook','stack').'</a></p>'; ! } ! else ! { ! unset($param['type']); ! unset($param['page']); ! //switch($_GET['reportType']) ! switch($reportType) ! { ! case 'question': ! $xhtml .= $this->report->questionFilterInterface($param); ! break; ! case 'student': ! $xhtml .= $this->report->studentFilterInterface($param); ! break; ! case 'quiz': ! $xhtml .= $this->report->quizFilterInterface($param); ! break; ! case 'markbook': ! $xhtml .= $this->report->markbookFilterInterface($param); ! break; ! } ! $xhtml .= '<br /><br />'; ! $xhtml .= '<a href="stackSessionPage.php?page=report">'.get_string('stackReport_reportType','stack').'</a>'; ! } return $xhtml; --- 40,67 ---- { ! if (isset($param['type'])) { ! $reportType = $param['type']; $xhtml .= $this->report->displayResults($param); ! $xhtml .= '<p><a href="stackSessionPage.php?page=report">'.get_string('stackReport_reportType','stack').'</a></p>'; ! } else { ! ! $xhtml .= '<h1>Select a report type</h1>'; ! $xhtml .= '<div class="section"> ! <h3>Interactive report</h3> ! <p> <a href="stackSessionPage.php?page=report&type=interactive"><button >Load the interactive interface</button></a> </p> ! </div>'; ! $xhtml .= '<form action="stackSessionPage.php?page=report&type=question" method="post">' ! . $report->questionFilterInterface($param) ! . '</form>'; ! $xhtml .= '<form action="stackSessionPage.php?page=report&type=student" method="post">' ! . $report->studentFilterInterface($param) ! . '</form>'; ! } return $xhtml; Index: MoodleDisplayItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/MoodleDisplayItem.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MoodleDisplayItem.php 11 Jan 2010 17:23:36 -0000 1.12 --- MoodleDisplayItem.php 30 Sep 2010 16:56:21 -0000 1.13 *************** *** 54,58 **** * @param int quizId */ ! public function __construct($userId, $questionId, $reconstruct=false, $seed=NULL, $quizId=NULL) { $cache = new StackDBCache(); --- 54,58 ---- * @param int quizId */ ! public function __construct($userId, $versionId, $reconstruct=false, $seed=NULL, $quizId=NULL) { $cache = new StackDBCache(); *************** *** 65,69 **** } // Remember: a stateID of 0 indicates no questions deployed. ! $this->stateID = $cache->selectInitialState($seed, $questionId); $this->userID = $userId; $this->progress = 0; --- 65,69 ---- } // Remember: a stateID of 0 indicates no questions deployed. ! $this->stateID = $cache->selectInitialState($seed, $versionId); $this->userID = $userId; $this->progress = 0; *************** *** 168,175 **** // Extract and remove action from posted. ! $action = $posted['stackaction']; unset($posted['stackaction']); - $moodle_event = $posted['event']; unset($posted['event']); if(8 == $moodle_event) $action = 'Finish';// submission hack if(3 == $moodle_event) $action = 'Grade';// review hack --- 168,209 ---- // Extract and remove action from posted. ! $event = MoodleDisplayItem::mapStackEvent($posted); unset($posted['stackaction']); unset($posted['event']); + + // Either return xhtml for current state or invoke process to use cache. + if(0 == $event) { + $xhtml = $cache->getXHTML($this->stateID); + } else { + $xhtml = $this->processItem($posted, true, $event); + } + + $xhtml = $this->fillInputFields($posted, $xhtml); + + // add STACK buttons + // See bug #2890734 + $xhtml .= "<div class='mdl-align'>"; // submitbtns to be hidden in CSS styles.php + $xhtml .= "<input id='stacksubmit' name='stackaction' type='submit' value='".get_string('stackQuiz_button_submit','stack','')."' />"; + /* Some JavaScript hackery below to ensure we don't have to mess with attempt.php: + * We activate the (hidden) finish button with our own and hide our own on + * the review page. Tested with FF and IE. + */ + $xhtml .= "<input type=\"button\" id=\"stackfinish\" value=\"".get_string('stackQuiz_button_finishQuiz','stack','')."\" name=\"finishattempt\" " . + "onclick=\"document.getElementsByName('finishattempt')[0].click();\" />"; + $xhtml .= "<script>if(window.location.href.indexOf('attempt.php') == -1) {" . + "document.getElementById('stacksubmit').style.display = 'none'; " . + "document.getElementById('stackfinish').style.display = 'none'; " . + "}</script>"; + $xhtml .= "</div>"; + return $xhtml; + } + + /** + * Infers our internal STACK event from the post data supplied by Moodle. + * Factored static function to allow other access, e.g. for Diagnostic reporting + */ + public static function mapStackEvent($posted) { + $action = $posted['stackaction']; + $moodle_event = $posted['event']; if(8 == $moodle_event) $action = 'Finish';// submission hack if(3 == $moodle_event) $action = 'Grade';// review hack *************** *** 197,226 **** $event = 0; // default e.g. by navigating away } ! ! // Either return xhtml for current state or invoke process to use cache. ! if(0 == $event) { ! $xhtml = $cache->getXHTML($this->stateID); ! } else { ! $xhtml = $this->processItem($posted, true, $event); ! } ! ! $xhtml = $this->fillInputFields($posted, $xhtml); ! ! // add STACK buttons ! // See bug #2890734 ! $xhtml .= "<div class='mdl-align'>"; // submitbtns to be hidden in CSS styles.php ! $xhtml .= "<input id='stacksubmit' name='stackaction' type='submit' value='Submit' />"; ! /* Some JavaScript hackery below to ensure we don't have to mess with attempt.php: ! * We activate the (hidden) finish button with our own and hide our own on ! * the review page. Tested with FF and IE. ! */ ! $xhtml .= "<input type=\"button\" id=\"stackfinish\" value=\"Finish Quiz\" name=\"finishattempt\" " . ! "onclick=\"document.getElementsByName('finishattempt')[0].click();\" />"; ! $xhtml .= "<script>if(window.location.href.indexOf('attempt.php') == -1) {" . ! "document.getElementById('stacksubmit').style.display = 'none'; " . ! "document.getElementById('stackfinish').style.display = 'none'; " . ! "}</script>"; ! $xhtml .= "</div>"; ! return $xhtml; } --- 231,235 ---- $event = 0; // default e.g. by navigating away } ! return $event; } Index: MoodleQuestionList.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/MoodleQuestionList.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MoodleQuestionList.php 2 Feb 2010 13:44:19 -0000 1.9 --- MoodleQuestionList.php 30 Sep 2010 16:56:21 -0000 1.10 *************** *** 200,207 **** // get keywords array $keywords = $kwdb->getQuestionsKeywords($question['id']); ! $qlistArray[] = new QuestionListDT($question['id'], $question['questionName'], $question['questionDescription'], $question['valid'], $question['questionDateLastEdited'], $question['moodleCategories'], $question['published'], $question['nodeployed'], $keywords); } } ! //$this->logger->finest(print_r($qlistArray,true)); $xhtml .= '<hr />'.$this->HTMLHead; --- 200,207 ---- // get keywords array $keywords = $kwdb->getQuestionsKeywords($question['id']); ! $qlistArray[] = new QuestionListDT($question['id'], $question['questionName'], $question['questionDescription'], $question['valid'], stringUtil::prettifyDate($question['questionDateLastEdited']), $question['moodleCategories'], $question['published'], $question['nodeployed'], $keywords); } } ! $this->logger->debug(print_r($qlistArray,true)); $xhtml .= '<hr />'.$this->HTMLHead; *************** *** 283,286 **** --- 283,287 ---- $mdb = new MoodleDB(); $mdb->connect(); + //$this->logger->debug("cats:".print_r($param['categories'],1)); $result = $mdb->batchAdd($questions, $param['userID'], $param['stackEngine'], $param['categories']); $mdb->disconnect(); Index: MoodleQuestionDeployment.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/MoodleQuestionDeployment.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MoodleQuestionDeployment.php 2 Nov 2009 17:55:08 -0000 1.4 --- MoodleQuestionDeployment.php 30 Sep 2010 16:56:21 -0000 1.5 *************** *** 45,48 **** --- 45,49 ---- require_once($root.'/opaque/datatypes/CategoryDT.php'); + require_once $root . '/lib/Logger.php'; class MoodleQuestionDeployment *************** *** 55,58 **** --- 56,60 ---- private $db; + private $logger; /** * *************** *** 79,83 **** private $xhtml; - /** * Constructs the question deployment --- 81,84 ---- *************** *** 91,94 **** --- 92,97 ---- public function __construct($passKey, $paramKey, $paramVal, $head, $title=NULL) { + $this->logger = new Logger("MoodleQuestionDeployment"); + $this->db = new StackDBCache(); $this->db->connect(); *************** *** 100,104 **** $this->xhtml = ''; ! $this->deployment = new Deployment($this->param['id']); } --- 103,109 ---- $this->xhtml = ''; ! $this->logger->debug(print_r($this->param, 1)); ! ! $this->deployment = new Deployment($this->param['id'], $this->param['engineID']); } *************** *** 125,134 **** * List instances */ ! public function getList() { ! if(!$this->deployment->isSingleton()) { ! $this->xhtml .= $this->deployment->size().get_string('FE_deployQuestion_versions', 'stack').'<br />'.$this->deployment->formXHTML(); ! } else { ! $this->xhtml .= get_string('FE_deployQuestion_singletonDeployed', 'stack'); } foreach($this->deployment->getInstances() as $instance) { $item = $this->db->getDisplayItem($instance['id']); --- 130,168 ---- * List instances */ ! public function getList() { ! $itemDB = new StackDBItem(); ! $itemDB->connect(); ! $currentVersion = $itemDB->getLatestVersion($this->param['id']); ! ! if($currentVersion == $this->deployment->getVersion()) { // this is latest version ! $earliest = $this->deployment->earliestDeployedVersion(); ! if($currentVersion == $earliest || false == $earliest) { ! if($this->deployment->isSingleton()) $this->xhtml .= get_string('FE_deployQuestion_singletonDeployed', 'stack'); ! else $this->xhtml .= $this->deployment->formXHTML(); ! } else { ! $this->xhtml .= get_string('FE_deployQuestion_oldVersionDeployed', 'stack'); ! $this->deployment = new Deployment($earliest); ! if($this->deployment->size() > 0) { ! $this->xhtml .= '<p><a href="?id='.$this->param['id'].'&dropall='.$earliest.'">'.get_string('FE_deployQuestion_undeployAll', 'stack').'</a>'; ! } ! } ! } else { // this is an old version ! $this->xhtml .= get_string('FE_deployQuestion_newerVersionCannotDeploy', 'stack', $currentVersion); ! $this->xhtml .= '<a href="?id='.$currentVersion.'">deploy latest</a>'; ! } ! ! // original stuff below ! /* ! if($this->deployment->size() > 0 && $this->deployment->getVersion() != $currentVersion) { // out-of-date instances exist ! $this->xhtml .= '<p>'.get_string('FE_deployQuestion_newerVersion', 'stack', $currentVersion).'</p>'; ! } ! else { // can deploy more of this version ! if(!$this->deployment->isSingleton()) { ! $this->xhtml .= '<p>'.get_string('FE_deployQuestion_xInstances', 'stack', $this->deployment->size()).get_string('FE_deployQuestion_ofVersionXdeployed', 'stack', $this->deployment->getVersion()).'</p>'.$this->deployment->formXHTML(); ! } else { ! $this->xhtml .= get_string('FE_deployQuestion_singletonDeployed', 'stack'); ! } } + */ foreach($this->deployment->getInstances() as $instance) { $item = $this->db->getDisplayItem($instance['id']); *************** *** 136,139 **** --- 170,174 ---- $instancesReturn[] = new StackDeployedInstancesDT($instance['id'], $item->getQuestionNote(), $instance['xhtml'], $item->getQuestionSeed(), $this->deployment->isPrimed($instance['id'])); } + return new StackDeploymentPageDT($this->head, $this->xhtml, $instancesReturn); } Index: StackServer.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/StackServer.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** StackServer.php 21 Jan 2010 16:00:40 -0000 1.49 --- StackServer.php 30 Sep 2010 16:56:21 -0000 1.50 *************** *** 30,33 **** --- 30,34 ---- require_once $root . '/lib/items/Item.php'; require_once $root . '/lib/searching/StackSearch.php'; + require_once $root . '/lib/reporting/DiagnosticReport.php'; require_once $root . '/lib/Logger.php'; *************** *** 85,90 **** } ! public function getQuestionMetadata($questionID, $questionVersion, $questionBaseURL) { ! return 'Question Metadata for ' . "$questionID, $questionVersion, $questionBaseURL"; } --- 86,91 ---- } ! public function getQuestionMetadata($questionID, $line, $questionBaseURL) { ! return 'Question Metadata for ' . "$questionID, $line, $questionBaseURL"; } *************** *** 108,112 **** * */ ! public function start($questionID, $questionVersion, $questionBaseURL, $initialParamNames, $initialParamValues, $cachedResources) { $initialParams = array_combine($initialParamNames, $initialParamValues); --- 109,113 ---- * */ ! public function start($versionID, $version, $questionBaseURL, $initialParamNames, $initialParamValues, $cachedResources) { $initialParams = array_combine($initialParamNames, $initialParamValues); *************** *** 120,125 **** } ! //$this->logger->debug("init params in start ".print_r($initialParams, 1)); ! //$this->logger->debug("timeclose = $timeclose"); $startReturn = new StartReturnDT(); --- 121,130 ---- } ! //$this->logger->debug("init params in start ".print_r($initialParams, 1)); ! //$this->logger->debug("timeclose = $timeclose"); ! //$this->logger->debug("version is ".$version." and lineID is ".$lineID); ! ! // $questionID = substr($version, 1 + strpos($version, '.')); // quicker than regex match ! $questionID = substr($versionID, 1); // lop off leading q $startReturn = new StartReturnDT(); *************** *** 133,138 **** $startReturn->questionSession = $sessionID; - $questionID = substr($questionID, 1); - //check question exists $db = new StackDBItem(); --- 138,141 ---- *************** *** 251,254 **** --- 254,258 ---- global $config; $root = $config->get('docroot'); + $weburl = $config->get('weburl'); $param = array_combine($paramKey, $paramVal); *************** *** 299,303 **** case 'search' : - $search = new StackSearch($param, $param['userID'], true); $xhtml .= $search->displaySearchForm(); --- 303,306 ---- *************** *** 309,312 **** --- 312,327 ---- break; + case 'diagnostic' : + $diagnostic = new DiagnosticReport($param['userID'], $param['quiz']); + //$xhtml .= "param=".print_r($param,1); + $xhtml .= $diagnostic->display(); + $head = '<link rel="stylesheet" type="text/css" href="'.$weburl.'/other/jqplot/jquery.jqplot.css" />' . + '<!--[if IE]><script language="javascript" type="text/javascript" src="'.$weburl.'/other/jqplot/excanvas.js"></script><![endif]--> + <script type="text/javascript" src="'.$weburl.'/other/jqplot/jquery-1.3.2.min.js"></script>' . + '<script type="text/javascript" src="'.$weburl.'/other/jqplot/jquery.jqplot.min.js"></script>' . + '<script type="text/javascript" src="'.$weburl.'/other/jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>' . + '<script type="text/javascript" src="'.$weburl.'/other/jqplot/plugins/jqplot.barRenderer.min.js"></script>'; + break; + default : $xhtml = 'Could not find page "' . $pageName . '".'; *************** *** 378,382 **** /** ! * Returns an array of question id's to question names & description * * @access public --- 393,397 ---- /** ! * Returns an array of question ids to question names & description * * @access public *************** *** 387,391 **** $qList->processOperations(); $returning = $qList->getList(); - return $returning; } --- 402,405 ---- *************** *** 406,410 **** $param = array_combine($paramKey, $paramVal); } ! $this->logger->critical("processing deployment with param:".print_r($param, true)); $checkKey = new CheckPassKey($passKey, $userId); if ($checkKey->isValid()) { --- 420,424 ---- $param = array_combine($paramKey, $paramVal); } ! $this->logger->fine("processing deployment with param:".print_r($param, true)); $checkKey = new CheckPassKey($passKey, $userId); if ($checkKey->isValid()) { |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:59
|
Update of /cvsroot/stack/stack-dev/lib/deployment In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/deployment Modified Files: Deployment.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: Deployment.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/deployment/Deployment.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Deployment.php 11 Jan 2010 17:23:37 -0000 1.11 --- Deployment.php 30 Sep 2010 16:56:21 -0000 1.12 *************** *** 22,26 **** /** * This class manages the deployment of question instances. ! * It ensures that singletons are deployed only once. */ --- 22,26 ---- /** * This class manages the deployment of question instances. ! * It ensures that singletons are deployed only once and all instances are of the same version. */ *************** *** 28,38 **** private $cache; ! private $questionID; private $instances; public $autoDeployed; private $logger; ! public function __construct($questionID) { $this->logger = new Logger("Deployment"); --- 28,41 ---- private $cache; ! private $version; ! private $line; // lookup on demand private $instances; public $autoDeployed; + private $engineID; + private $logger; ! public function __construct($version, $engineid = NULL) { $this->logger = new Logger("Deployment"); *************** *** 41,64 **** $this->cache->connect(); ! // assign questionID ! $this->questionID = $questionID; // get deployed instances ! $this->instances = $this->cache->getInstances($this->questionID); // ensure one instance if a singleton $this->ensureSingletonDeployed(); } /* this should probably be elsewhere ~ sph 23/10/09 */ public function formXHTML() { ! //$xhtml = "<form method='POST' action='?id=".$this->questionID."'> $xhtml = "<input type='submit' name='submit' value='add'> <input type='text' name='add' value='1' size='3' maxlength='3'/> " . get_string('FE_deployQuestion_newversions', 'stack'); return $xhtml; } public function processOperations($param) { ! //$this->logger->debug("in processOperations, param = ".print_r($param, 1)); // add requests --- 44,74 ---- $this->cache->connect(); ! // assign version ! $this->version = $version; // get deployed instances ! $this->instances = $this->cache->getInstances($this->version); // ensure one instance if a singleton $this->ensureSingletonDeployed(); + + $this->engineID = $engineid; + $this->logger->debug("minstrels: ".$this->engineID); } /* this should probably be elsewhere ~ sph 23/10/09 */ public function formXHTML() { ! //$xhtml = "<form method='POST' action='?id=".$this->version."'> $xhtml = "<input type='submit' name='submit' value='add'> <input type='text' name='add' value='1' size='3' maxlength='3'/> " . get_string('FE_deployQuestion_newversions', 'stack'); + //" <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('FE_deployQuestion_autoprime', 'stack'); + /*" <input type='submit' onclick='return confirm(\"" . + get_string('FE_deployQuestion_confirmUndeployAll', 'stack')."\")' name='dropall' value='" . + get_string('FE_deployQuestion_undeployAll', 'stack')."'>";*/ return $xhtml; } public function processOperations($param) { ! $this->logger->debug("here in processOperations, param = ".print_r($param, 1)." and engineid = ".$this->engineID); // add requests *************** *** 66,70 **** if (!$this->isSingleton()) { $msg = get_string('FE_deployQuestion_attemptingDeploy', 'stack', $param['add']); ! $initialStates = $this->cache->deployCache($this->questionID, $param['add']); $msg .= ' '.get_string('FE_deployQuestion_deployedInstances', 'stack', sizeof($initialStates)); } --- 76,101 ---- if (!$this->isSingleton()) { $msg = get_string('FE_deployQuestion_attemptingDeploy', 'stack', $param['add']); ! $initialStates = $this->cache->deployCache($this->version, $param['add']); ! ! //if in Moodle, update ! //$engineID = $param['engineid']; ! if(!empty($this->engineID)) ! { ! $this->logger->debug('we is in moodle checking your engine ids'); ! $db = new MoodleDB(); ! $db->connect(); ! $inMoodle = $db->inMoodleQuestionBank($this->version, $this->engineID); ! if($inMoodle == true) ! { ! /*update Moodle's database. ! $result = $db->updateQuestion($this->version, $this->getLine(), $this->authorId, $engineID, $post['category']); ! if($result == false) ! { ! $this->userMessage .= '<h3>'.get_string('stackAuthor_moodleUpdateFail','stack','').'</h3>'.get_string('stackAuthor_moodleQBFail','stack',''); ! } ! //*/ ! } ! } ! $msg .= ' '.get_string('FE_deployQuestion_deployedInstances', 'stack', sizeof($initialStates)); } *************** *** 85,89 **** // drop requests if (isset ($param['drop']) && is_numeric($param['drop'])) { ! $msg = get_string('FE_deployQuestion_dropping', 'stack') . $param['drop'] . '<br />'; $this->cache->deinitialiseState($param['drop']);// students may have attempted $this->refreshInstances(); --- 116,120 ---- // drop requests if (isset ($param['drop']) && is_numeric($param['drop'])) { ! $msg = get_string('FE_deployQuestion_dropInstance', 'stack', $param['drop']) . '<br />'; $this->cache->deinitialiseState($param['drop']);// students may have attempted $this->refreshInstances(); *************** *** 91,94 **** --- 122,133 ---- } + // undeploy request (version) + if (isset($param['operation']) && $param['operation'] === 'undeploy' && is_numeric($param['version'])) { + $toDrop = new Deployment($param['version']); + $this->logger->debug('trying to drop version'.$param['version']); + $toDrop->drop($param['engine']); + } + + // prime requests if (isset ($param['operation']) && $param['operation'] == 'prime' && is_numeric($param['instance'])) { *************** *** 102,107 **** // ensure singletons are always instantiated public function ensureSingletonDeployed() { ! if ($this->size() === 0 && $this->isSingleton()) { ! $this->cache->deployCache($this->questionID, 1); $this->refreshInstances(); $this->autoDeployed = true; --- 141,148 ---- // ensure singletons are always instantiated public function ensureSingletonDeployed() { ! // check no earlier blocking instances ! ! if ($this->size() === 0 && $this->isSingleton() && $this->earliestDeployedVersion() === false) { ! $this->cache->deployCache($this->version, 1); $this->refreshInstances(); $this->autoDeployed = true; *************** *** 112,116 **** private function refreshInstances() { ! $this->instances = $this->cache->getInstances($this->questionID); } --- 153,158 ---- private function refreshInstances() { ! $this->instances = $this->cache->getInstances($this->version); ! } *************** *** 120,124 **** // Are random versions of this item available? $options = NULL; ! $item = new Item($options, $this->questionID); return $item->questionVariables->contains_rand() == false; } --- 162,166 ---- // Are random versions of this item available? $options = NULL; ! $item = new Item($options, $this->version); return $item->questionVariables->contains_rand() == false; } *************** *** 139,143 **** $this->logger->debug('in primeResponses with ids: ' . print_r($instanceIDs, 1)); $options = NULL; ! $item = new Item($options, $this->questionID); if($item->itemTests !== NULL) { // not guaranteed --- 181,185 ---- $this->logger->debug('in primeResponses with ids: ' . print_r($instanceIDs, 1)); $options = NULL; ! $item = new Item($options, $this->version); if($item->itemTests !== NULL) { // not guaranteed *************** *** 211,215 **** $options = NULL; ! $item = new Item($options, $this->questionID); if($item->itemTests !== NULL) { // not guaranteed --- 253,257 ---- $options = NULL; ! $item = new Item($options, $this->version); if($item->itemTests !== NULL) { // not guaranteed *************** *** 244,247 **** --- 286,351 ---- return true; } + + function getVersion() { + return $this->version; + } + + /* + * Removes all instances from this deployment by deinitialising all the states. + */ + function drop($engineID = NULL) { + if(!empty($this->instances)) { + foreach($this->instances as $instance) { + $this->cache->deinitialiseState($instance['id']); + } + $this->refreshInstances(); + } + + //if in Moodle, update + if(!empty($engineID)) + { + $db = new MoodleDB(); + $db->connect(); + $inMoodle = $db->inMoodleQuestionBank($this->version, $engineID); + if($inMoodle == true) + { + //update Moodle's database. + /*$result = $db->REMOVEQuestion($this->version, $this->authorId, $engineID, $post['category']); + if($result == false) + { + $this->userMessage .= '<h3>'.get_string('stackAuthor_moodleUpdateFail','stack','').'</h3>'.get_string('stackAuthor_moodleQBFail','stack',''); + } + */ + } + } + //*/ + } + + function earliestDeployedVersion() { + $itemDB = new StackDBItem(); + $itemDB->connect(); + $versions = $itemDB->getVersions($itemDB->getLine($this->version)); // returned in descending order + $itemDB->disconnect(); + + $earliest = false; + + // requires versions ordered by descending id + foreach($versions as $date => $id) { + if($this->cache->instancesDeployed($id)) { + $earliest = $id; + } + } + return $earliest; + } + + function getLine() { + if(!isset($this->line)) { + $itemDB = new StackDBItem(); + $itemDB->connect(); + $this->line = $itemDB->getLine($this->version); // returned in descending order + $itemDB->disconnect(); + } + return $this->line; + } } ?> \ No newline at end of file |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:59
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/opaque/moodleModule/opaque/stack Modified Files: soapPage.php stackQuestionList.php stackLib.php stackDeploy.php stackAuthor.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: stackDeploy.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackDeploy.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** stackDeploy.php 3 Nov 2009 11:27:51 -0000 1.4 --- stackDeploy.php 30 Sep 2010 16:56:21 -0000 1.5 *************** *** 61,65 **** break; ! case get_string('stackDeploy_button_delete', 'qtype_opaque'): if(!isset($_POST['instances'])) break; foreach($_POST['instances'] as $iid => $on) { --- 61,65 ---- break; ! case get_string('stackDeploy_button_undeploy', 'qtype_opaque'): if(!isset($_POST['instances'])) break; foreach($_POST['instances'] as $iid => $on) { *************** *** 88,91 **** --- 88,98 ---- } + // handle version undeploy + if(!empty($_GET['dropall']) && is_numeric($_GET['dropall'])) { + $specs['id'] = $_GET['id']; + $specs['version'] = $_GET['dropall']; + stackUndeployVersion($SESSION->stackSelectedEngine, $specs); + } + // handle single primings if(!empty($_GET['prime']) && is_numeric($_GET['prime'])) { *************** *** 100,108 **** $deployedPage = stackDeployedList($SESSION->stackSelectedEngine, $param); $deployedList = $deployedPage->deployedInstances; $engineName = getEngineName($SESSION->stackSelectedEngine); ! $strtitle = get_string('instantiationsOf', 'qtype_opaque').$param['id'].' : '.$engineName.get_string('qEngine', 'qtype_opaque'); $navlinks = array(); $navlinks[] = array('name' => get_string('StackQuestions', 'qtype_opaque', ''), 'link' => 'stackQuestionList.php', 'type' => 'title'); --- 107,117 ---- $deployedPage = stackDeployedList($SESSION->stackSelectedEngine, $param); + //echo '<pre>'.print_r($deployedPage, 1); + $deployedList = $deployedPage->deployedInstances; $engineName = getEngineName($SESSION->stackSelectedEngine); ! $strtitle = get_string('instancesOf', 'qtype_opaque').$param['id'];//.' : '.$engineName.get_string('qEngine', 'qtype_opaque'); $navlinks = array(); $navlinks[] = array('name' => get_string('StackQuestions', 'qtype_opaque', ''), 'link' => 'stackQuestionList.php', 'type' => 'title'); *************** *** 114,121 **** print_heading($strtitle); echo "<form method='POST' action='?id=".$_GET['id']."'>"; echo $deployedPage->xhtml; // may include form fields //echo " <input type='checkbox' name='autoprime' checked='checked'> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); ! echo " <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); if($deployedList == NULL) --- 123,132 ---- print_heading($strtitle); + echo '<p>'.get_string('nodeployed', 'qtype_opaque').': '.count($deployedList); + echo "<form method='POST' action='?id=".$_GET['id']."'>"; echo $deployedPage->xhtml; // may include form fields //echo " <input type='checkbox' name='autoprime' checked='checked'> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); ! //echo " <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); if($deployedList == NULL) *************** *** 146,159 **** '<a href="stackSessionPage.php?page=try&id='.$param['id'].'&instance='.$instance->id.'&seed='.$instance->seed.'" /><img alt="'.get_string('preview', 'qtype_opaque').'" title="'.get_string('preview', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/preview.gif" /></a> '. '<a href="stackDeploy.php?id='.$param['id'].'&prime='.$instance->id.'"><img alt="'.get_string('primed?', 'qtype_opaque').'" title="'.get_string('prime', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/go.gif" /></a> '. ! '<a onclick="return confirm(\''.get_string('confirmDeletion', 'qtype_opaque').'\')" href="stackDeploy.php?id='.$param['id'].'&drop='.$instance->id.'" ><img alt="'.get_string('delete', 'qtype_opaque').'" title="'.get_string('delete', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/delete.gif" /></a></td>'; $qID = 'q'.$instance->id; ! $previewBox = '<a href="javascript:;" onClick="$(\'#'.$qID.'\').slideToggle(\'fast\')" /><small>'.get_string('stackDeploy_showStem', 'qtype_opaque').'</small></a><div style="clear:both; border:#999 solid 1px; display:none; padding:10px" id="'.$qID.'">'.$instance->xhtml; echo '<td align="left">'.format_text($instance->qNote.$previewBox.'</div>', FORMAT_MOODLE, $opts).'</td>'; ! echo '<td>'.($instance->isPrimed ? '<img alt="'.get_string('primed', 'qtype_opaque').'." src="'.$CFG->wwwroot.'/pix/i/tick_green_small.gif" />':'').'</td>'; echo '</tr>'; } echo '</tbody></table>'; echo '<a href="javascript:;" onclick="$(\'.groupCB\').click()">'.get_string('invertSelection', 'qtype_opaque').'</a><br /><b>'.get_string('withSelected', 'qtype_opaque').':</b>'; ! echo '<input type="submit" value="'.get_string('stackDeploy_button_delete', 'qtype_opaque').'" name="submit" onclick="return confirm(\''.get_string('confirmDeletion','qtype_opaque').'\')" />'; echo '<input type="submit" value="'.get_string('stackDeploy_button_prime', 'qtype_opaque').'" name="submit" />'; echo '</form>'; --- 157,170 ---- '<a href="stackSessionPage.php?page=try&id='.$param['id'].'&instance='.$instance->id.'&seed='.$instance->seed.'" /><img alt="'.get_string('preview', 'qtype_opaque').'" title="'.get_string('preview', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/preview.gif" /></a> '. '<a href="stackDeploy.php?id='.$param['id'].'&prime='.$instance->id.'"><img alt="'.get_string('primed?', 'qtype_opaque').'" title="'.get_string('prime', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/go.gif" /></a> '. ! '<a onclick="return confirm(\''.get_string('confirmUndeploy', 'qtype_opaque').'\')" href="stackDeploy.php?id='.$param['id'].'&drop='.$instance->id.'" ><img alt="'.get_string('undeploy', 'qtype_opaque').'" title="'.get_string('undeploy', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/delete.gif" /></a></td>'; $qID = 'q'.$instance->id; ! $previewBox = ' <a href="javascript:;" onClick="$(\'#'.$qID.'\').slideToggle(\'fast\')" /><small>'.get_string('stackDeploy_showStem', 'qtype_opaque').'</small></a><div style="clear:both; border:#999 solid 1px; display:none; padding:10px" id="'.$qID.'">'.$instance->xhtml; echo '<td align="left">'.format_text($instance->qNote.$previewBox.'</div>', FORMAT_MOODLE, $opts).'</td>'; ! echo '<td align="center">'.($instance->isPrimed ? '<img alt="'.get_string('primed', 'qtype_opaque').'." src="'.$CFG->wwwroot.'/pix/i/tick_green_small.gif" />':'').'</td>'; echo '</tr>'; } echo '</tbody></table>'; echo '<a href="javascript:;" onclick="$(\'.groupCB\').click()">'.get_string('invertSelection', 'qtype_opaque').'</a><br /><b>'.get_string('withSelected', 'qtype_opaque').':</b>'; ! echo '<input type="submit" value="'.get_string('stackDeploy_button_undeploy', 'qtype_opaque').'" name="submit" Xonclick="return confirm(\''.get_string('confirmUndeploy','qtype_opaque').'\')" />'; echo '<input type="submit" value="'.get_string('stackDeploy_button_prime', 'qtype_opaque').'" name="submit" />'; echo '</form>'; Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackAuthor.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** stackAuthor.php 14 Jan 2010 14:31:12 -0000 1.15 --- stackAuthor.php 30 Sep 2010 16:56:21 -0000 1.16 *************** *** 110,113 **** --- 110,114 ---- $clean = stripslashes($post); $posted[$key] = $clean; + $posted[$key] = get_magic_quotes_gpc() ? $post : stripslashes($post); } } *************** *** 164,183 **** //echo '<input type="submit" name="submit" value="Update" /> <input type="submit" name="submit" value="Save" /> <input type="submit" name="submit" value="Save as New" /> <input type="submit" name="submit" value="Export as XML" />'; echo '<div id="authoringControls">'; ! print_heading($strtitle); echo '<input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_save','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_savenew','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_exportAsXml','qtype_opaque').'" />'; ?> ! <a href="#stem">Stem</a> ! <br /><a href="#parts" onClick="$('#partContainer').slideDown();">Interactions</a> ! <br /><a href="#prts" onClick="$('#prtContainer').slideDown();">Responses</a> ! <br /><a href="#options" onClick="$('#optionContainer').slideDown();">Options</a> ! <br /><a href="#tests" onClick="$('#testContainer').slideDown();">Tests</a> ! <br /><a href="#meta" onClick="$('#metaContainer').slideDown();">Meta</a> <?php echo '<p><small>'.get_string('stackAuthor_finish_reminder','qtype_opaque').'</small></p>'; echo '</div>'; - - - //echo '<hr>'; - //var_dump($_POST); } --- 165,183 ---- //echo '<input type="submit" name="submit" value="Update" /> <input type="submit" name="submit" value="Save" /> <input type="submit" name="submit" value="Save as New" /> <input type="submit" name="submit" value="Export as XML" />'; echo '<div id="authoringControls">'; ! //echo ! //print_heading($strtitle); echo '<input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_save','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_savenew','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_exportAsXml','qtype_opaque').'" />'; ?> ! <ul> ! <li><a href="#stem">Stem</a></li> ! <li><a href="#parts" onClick="$('#partContainer').slideDown();">Interactions</a></li> ! <li><a href="#prts" onClick="$('#prtContainer').slideDown();">Responses</a></li> ! <li><a href="#options" onClick="$('#optionContainer').slideDown();">Options</a></li> ! <li><a href="#tests" onClick="$('#testContainer').slideDown();">Tests</a></li> ! <li><a href="#meta" onClick="$('#metaContainer').slideDown();">Meta</a></li> ! </ul> <?php echo '<p><small>'.get_string('stackAuthor_finish_reminder','qtype_opaque').'</small></p>'; echo '</div>'; } *************** *** 185,188 **** --- 185,201 ---- echo '</form>'; + // bit of an optional hack to improve UI while keeping things SOAP page simple + ?> + <script language="JavaScript" type="text/javascript"> + $(document).ready(function() { + console.log($('#versionHistory').children('br').length); + // $('#authoringControls').append($('#versionHistory').detach().html()); // move + $('#authoringControls').append($('#versionHistory').html()); // copy + // would like to limit side to last n items since it is fixed and so doesn't scroll + + }); + </script> + + <?php print_box_end(); Index: stackQuestionList.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackQuestionList.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** stackQuestionList.php 5 Feb 2010 15:52:08 -0000 1.42 --- stackQuestionList.php 30 Sep 2010 16:56:21 -0000 1.43 *************** *** 57,84 **** print_header_simple($strtitle, '', $strtitle, '', $questionPage->head); print_box_start(); ! print_heading($strtitle); ! ! ! /*echo '<pre>'; ! var_dump($questionPage); ! echo '</pre>';*/ //$url = getStackURL($SESSION->stackSelectedEngine); $docsUrl = 'http://stack.bham.ac.uk/wiki/index.php/Main_Page'; ! echo '<div class="section80"> ! <h3 class="section">'.get_string('addquestion', 'qtype_opaque').'</h3> ! <ul class="horizontal"> ! ! <li><a href="stackAuthor.php?id=new">'.get_string('newQ', 'qtype_opaque').'</a></li> ! <li><a href="soapPage.php?page=import">'.get_string('import', 'qtype_opaque').'</a></li> ! <li><a href="soapPage.php?page=chat">'.get_string('chat', 'qtype_opaque').'</a></li> ! <li><a href="soapPage.php?page=search">'.get_string('search', 'qtype_opaque').'</a></li> ! <li><a href="stackSessionPage.php?page=report">'.get_string('reports', 'qtype_opaque').'</a></li> ! <!--<li><a href="soapPage.php?page=optionsEditor">'.get_string('stackOptions', 'qtype_opaque').'</a></li>--> ! <li><a href="'.$docsUrl.'">Stack Documentation</a></li> ! ! </ul> ! </div>'; $questionList = $questionPage->questionItems; --- 57,72 ---- print_header_simple($strtitle, '', $strtitle, '', $questionPage->head); print_box_start(); ! //print_heading($strtitle); //$url = getStackURL($SESSION->stackSelectedEngine); $docsUrl = 'http://stack.bham.ac.uk/wiki/index.php/Main_Page'; ! echo '<a href="stackAuthor.php?id=new">'.get_string('newQ', 'qtype_opaque').'</a> | ! <a href="soapPage.php?page=import">'.get_string('import', 'qtype_opaque').'</a> | ! <a href="soapPage.php?page=chat">'.get_string('chat', 'qtype_opaque').'</a> | ! <a href="soapPage.php?page=search">'.get_string('search', 'qtype_opaque').'</a> | ! <a href="stackSessionPage.php?page=report">'.get_string('reports', 'qtype_opaque').'</a> | ! <!--<li><a href="soapPage.php?page=optionsEditor">'.get_string('stackOptions', 'qtype_opaque').'</a>--> ! <a href="'.$docsUrl.'">Stack Documentation</a>'; $questionList = $questionPage->questionItems; *************** *** 198,219 **** echo '<table style="text-align: left; width: 100%;" border="0" cellpadding="4px" cellspacing="0"> <tbody> ! <tr><td>'; ! //$this->add_checkbox_controller(1, null, null, 1); ?> <input type="checkbox" onclick="c=this.checked;$('.groupingCheckbox').each(function() {this.checked = c})"> <?php ! echo '</td>'; ! ! /*echo '<pre>'; ! var_dump($questionList); ! echo '</pre>';*/ ! $tableHeadings['id'] = '<th class="header"><a href="stackQuestionList.php?sortBy=id&sortOrder=dec">'.get_string('id', 'qtype_opaque').'</a></th>'; ! $tableHeadings['name'] = '<th class="header"><a href="stackQuestionList.php?sortBy=name&sortOrder=asc">'.get_string('name', 'qtype_opaque').'</a></th>'; ! //$tableHeadings['name'] = '<th class="header"><a href="stackQuestionList.php?sortBy=name&sortOrder=asc">'.get_string('name', 'qtype_opaque').'</a>: '.get_string('keywords', 'qtype_opaque').'</th>'; ! $tableHeadings['keywords'] = '<th class="header">'.get_string('keywords', 'qtype_opaque').'</th>'; ! $tableHeadings['description'] = '<th class="header"><a href="stackQuestionList.php?sortBy=description&sortOrder=asc">'.get_string('description', 'qtype_opaque').'</a></th>'; ! $tableHeadings['valid'] = '<th class="header"><a href="stackQuestionList.php?sortBy=valid&sortOrder=asc">'.get_string('valid', 'qtype_opaque').'</a></th>'; ! $tableHeadings['nodeployed'] = '<th class="header" nowrap><a href="stackQuestionList.php?sortBy=nodeployed&sortOrder=asc">'.get_string('nodeployed', 'qtype_opaque').'</a></th>'; $tableHeadings['published'] = '<th class="header"><a href="stackQuestionList.php?sortBy=published&sortOrder=asc">'.get_string('published', 'qtype_opaque').'</a></th>'; $tableHeadings['dateEdited'] = '<th class="header"><a href="stackQuestionList.php?sortBy=dateEdited&sortOrder=asc">'.get_string('dateEdited', 'qtype_opaque').'</a></th>'; --- 186,198 ---- echo '<table style="text-align: left; width: 100%;" border="0" cellpadding="4px" cellspacing="0"> <tbody> ! <tr><th class="header">'; ?> <input type="checkbox" onclick="c=this.checked;$('.groupingCheckbox').each(function() {this.checked = c})"> <?php ! echo '</th>'; ! $tableHeadings['name'] = '<th class="header"><a href="stackQuestionList.php?sortBy=name&sortOrder=asc">'.get_string('name', 'qtype_opaque').'</a>: <span style="font-weight: normal">'.get_string('description', 'qtype_opaque').' <small>'.get_string('keywords', 'qtype_opaque').'</small></span></th>'; ! $tableHeadings['valid'] = '<th class="header"><a href="stackQuestionList.php?sortBy=valid&sortOrder=asc">'.get_string('valid', 'qtype_opaque').'</a></th>'; ! $tableHeadings['nodeployed'] = '<th class="header" nowrap><a href="stackQuestionList.php?sortBy=nodeployed&sortOrder=asc"><abbr title="'.get_string('nodeployed', 'qtype_opaque').'">#</abbr></a></th>'; $tableHeadings['published'] = '<th class="header"><a href="stackQuestionList.php?sortBy=published&sortOrder=asc">'.get_string('published', 'qtype_opaque').'</a></th>'; $tableHeadings['dateEdited'] = '<th class="header"><a href="stackQuestionList.php?sortBy=dateEdited&sortOrder=asc">'.get_string('dateEdited', 'qtype_opaque').'</a></th>'; *************** *** 256,263 **** echo '<td><input type="checkbox" class="groupingCheckbox" name="'.$questionList[$i]->id.'" value="selected" /></td>'; ! echo '<td>'.$questionList[$i]->id.'</td> ! <td>'.$questionList[$i]->name.'</td>'; ! echo '<td>'; ! if(!empty($questionList[$i]->keywords)) { $keywords = $questionList[$i]->keywords; asort($keywords); --- 235,242 ---- echo '<td><input type="checkbox" class="groupingCheckbox" name="'.$questionList[$i]->id.'" value="selected" /></td>'; ! //echo '<td>'.$questionList[$i]->id.'.'.$questionList[$i]->version.'</td>'; ! echo '<td><b>'.$questionList[$i]->name.'</b>: '.format_text($questionList[$i]->description, FORMAT_MOODLE, $opts); ! if(!empty($questionList[$i]->keywords)) { ! echo '<br /><small>'; $keywords = $questionList[$i]->keywords; asort($keywords); *************** *** 269,277 **** $kwLink = "<a href='?keywords=$keyword'>".$keyword."</a>"; echo $kwLink; - //echo $_GET['keywords'] == $keyword ? '<b>'.$kwLink.'</b>': $kwLink; } } ! echo '</td>' . ! '<td>'.format_text($questionList[$i]->description, FORMAT_MOODLE, $opts).'</td>'; echo '<td align="center">'; --- 248,255 ---- $kwLink = "<a href='?keywords=$keyword'>".$keyword."</a>"; echo $kwLink; } + echo '</small>'; } ! echo '</td>'; echo '<td align="center">'; *************** *** 339,343 **** <tbody> <tr> - <td>'.get_string('id', 'qtype_opaque').'</td> <td>'.get_string('name', 'qtype_opaque').'</td> <td>'.get_string('description', 'qtype_opaque').'</td> --- 317,320 ---- *************** *** 354,359 **** else echo '<tr class="odd">'; ! echo '<td>'.$questionList[$i]->id.'</td> ! <td>'.$questionList[$i]->name.'</td> <td>'.$questionList[$i]->description.'</td>'; --- 331,336 ---- else echo '<tr class="odd">'; ! //echo '<td>'.$questionList[$i]->id.'</td> ! echo '<td>'.$questionList[$i]->name.'</td> <td>'.$questionList[$i]->description.'</td>'; Index: soapPage.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/soapPage.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** soapPage.php 23 Jun 2009 16:18:28 -0000 1.14 --- soapPage.php 30 Sep 2010 16:56:21 -0000 1.15 *************** *** 33,37 **** redirect('stackEngineSelector.php?return=soapPage.php?page='.$param['page']); } ! if($pageRequest != 'chat') //caschat pages don't need permissions { --- 33,37 ---- redirect('stackEngineSelector.php?return=soapPage.php?page='.$param['page']); } ! if($pageRequest != 'chat' && $pageRequest != 'diagnostic') //caschat/diagnostic pages don't need permissions { Index: stackLib.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackLib.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** stackLib.php 14 Jan 2010 14:31:12 -0000 1.19 --- stackLib.php 30 Sep 2010 16:56:21 -0000 1.20 *************** *** 310,313 **** --- 310,317 ---- $values[] = $USER->id; } + + $keys[] = 'engineID'; + $values[] = $engineID; + $passkey = stackGetPassKey($engineID, $USER->id); *************** *** 319,323 **** /** ! * Drops an instance (or version) of a question given its cache ID. * * @param int engineID --- 323,327 ---- /** ! * Drops an instance of a question given its cache ID. * * @param int engineID *************** *** 359,362 **** --- 363,409 ---- /** + * Undeploys a question version. + * + * @param int engineID + * @param int id + */ + function stackUndeployVersion($engineID, $param) + { + $engine = load_engine_def($engineID); + if(is_string($engine)) + { + echo $engine; //error occured. + } + else + { + $connection = connect_to_engine($engine); + if (is_string($connection)) + { + echo $connection; + } + + global $USER; + $keys[] = 'userID'; + $values[] = $USER->id; + + $keys[] = 'id'; + $values[] = $param['id']; + + $passkey = stackGetPassKey($engineID, $USER->id); + + $keys[] = 'operation'; + $values[] = 'undeploy'; + + $keys[] = 'version'; + $values[] = $param['version']; + + $keys[] = 'engine'; + $values[] = $engineID; + + echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); + } + } + + /** * Adds an instance (or version) of a question. * |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:57
|
Update of /cvsroot/stack/stack-dev/lib/XML In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/XML Modified Files: ExportStackTwoItem.php ImportStackOneItem.php ImportStackTwoItem.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: ExportStackTwoItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/XML/ExportStackTwoItem.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ExportStackTwoItem.php 27 Aug 2009 16:23:00 -0000 1.11 --- ExportStackTwoItem.php 30 Sep 2010 16:56:16 -0000 1.12 *************** *** 208,212 **** { $node = $this->dom->createElement($title); ! $nodeText = $this->dom->createTextNode($text); $node->appendChild($nodeText); return $node; --- 208,212 ---- { $node = $this->dom->createElement($title); ! $nodeText = $this->dom->createTextNode(utf8_encode($text)); $node->appendChild($nodeText); return $node; Index: ImportStackTwoItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/XML/ImportStackTwoItem.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ImportStackTwoItem.php 16 Oct 2009 10:28:43 -0000 1.23 --- ImportStackTwoItem.php 30 Sep 2010 16:56:16 -0000 1.24 *************** *** 93,97 **** public function importQuestion($filename=NULL, $itemOptions=NULL, $validate=true) { - //echo $filename; if($filename != NULL) { --- 93,96 ---- Index: ImportStackOneItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/XML/ImportStackOneItem.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ImportStackOneItem.php 27 Aug 2009 16:23:00 -0000 1.25 --- ImportStackOneItem.php 30 Sep 2010 16:56:16 -0000 1.26 *************** *** 109,113 **** if($valid == true) { - //echo 'Correct'; $this->setDesc(); $this->setVars(); --- 109,112 ---- |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:57
|
Update of /cvsroot/stack/stack-dev/install In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/install Modified Files: healthcheck.php p4.php adodbinit.php installFunctions.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: p4.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/p4.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** p4.php 3 Feb 2010 11:22:29 -0000 1.11 --- p4.php 30 Sep 2010 16:56:19 -0000 1.12 *************** *** 140,145 **** <br /> <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_email','stack'); ?></span><span class="formw"><input type="text" name="adminemail" size="40" value=" ! <?php echo isset($_SESSION['Sadminemail'])?$_SESSION['Sadminemail']:''; ?>" /></span> </div> <div class="row"> --- 140,144 ---- <br /> <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_email','stack'); ?></span><span class="formw"><input type="text" name="adminemail" size="40" value="<?php echo isset($_SESSION['Sadminemail'])?$_SESSION['Sadminemail']:''; ?>" /></span> </div> <div class="row"> Index: adodbinit.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/adodbinit.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** adodbinit.php 21 Jan 2010 16:00:40 -0000 1.9 --- adodbinit.php 30 Sep 2010 16:56:19 -0000 1.10 *************** *** 31,36 **** require_once("../other/adodb5/adodb.inc.php"); ! define("NUM_TABLES", 10); ! define("EXPECTED_TABLE_NAMES", "'attempt_meta_PRT', 'attempt_meta_answer', 'display_cache', 'display_cache_sequence', 'keywords', 'opaque_sessions', 'question_keyword', 'question_attempts', 'response_trees', 'stackquestion'");; /** --- 31,36 ---- require_once("../other/adodb5/adodb.inc.php"); ! define("NUM_TABLES", 11); ! define("EXPECTED_TABLE_NAMES", "'attempt_meta_PRT', 'attempt_meta_answer', 'display_cache', 'display_cache_sequence', 'keywords', 'opaque_sessions', 'question_keyword', 'question_attempts', 'response_trees', 'stackquestion', 'question_lines'"); /** *************** *** 182,185 **** --- 182,186 ---- questionKeywords X, questionUserLastEdited I(11) UNSIGNED DEFAULT NULL, + line I(11) UNSIGNED, questionPublisher X, questionFormat X, *************** *** 206,209 **** --- 207,222 ---- } + // Table structure for table `question_lines` + $fields= + 'id I(11) UNSIGNED NOTNULL AUTO PRIMARY, + latestVersion I(11) UNSIGNED, + modified T NOTNULL DEFTIMESTAMP ON UPDATE '.$db->sysTimeStamp; + + $sqlarray = $dict->CreateTableSQL("question_lines", $fields, ""); + if(!$dict->ExecuteSQLArray($sqlarray)) + { + $toReturn = $dict->ErrorMsg().'<br /><br />'; + } + // Structure for `display_cache` table $fields= Index: installFunctions.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/installFunctions.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** installFunctions.php 24 May 2010 10:22:15 -0000 1.40 --- installFunctions.php 30 Sep 2010 16:56:19 -0000 1.41 *************** *** 146,150 **** $config .= ' ! $this->configArray["version"] = "STACK 2.0 beta"; $this->configArray["platform"] = '."'".$_SESSION['Splatform']."'".'; //server os / server mode $this->configArray["host"] = '."'".$_SESSION['Shost']."'".'; //server hostname --- 146,150 ---- $config .= ' ! $this->configArray["version"] = "STACK 2.2"; $this->configArray["platform"] = '."'".$_SESSION['Splatform']."'".'; //server os / server mode $this->configArray["host"] = '."'".$_SESSION['Shost']."'".'; //server hostname Index: healthcheck.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/healthcheck.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** healthcheck.php 12 Jan 2010 17:56:30 -0000 1.14 --- healthcheck.php 30 Sep 2010 16:56:19 -0000 1.15 *************** *** 98,102 **** $display = 'LaTeX'; ! $displayTestString = '\[ \sum_{n=1}^\infty \left( \frac{1}{n^2}\right) = \frac{\pi^2}{6}. \]'; require_once $root.'/lib/ui/frontend.php'; --- 98,102 ---- $display = 'LaTeX'; ! $displayTestString = '\[ \sum_{n=1}^\infty \left( \frac{1}{n^2}\right) = \frac{\pi^2}{6}. \]'; require_once $root.'/lib/ui/frontend.php'; *************** *** 150,159 **** <?php // Check the configuration of JSMath if it has been set - $jsmathroot = trim($config->get('jsmath')); - if ('' != $jsmathroot) { echo '<div class="box"><h3>'.get_string('stackInstall_jsmathcheck','stack','').'</h3>'; ! $f = 1; $c = 1;//1 for header, 2 for body, 3 for both $r = NULL; --- 150,166 ---- <?php // Check the configuration of JSMath if it has been set + // incremental checks to avoid confusing contradictory failures + + $jsmathroot = trim($config->get('jsmath')); + + if ('' != $jsmathroot) { echo '<div class="box"><h3>'.get_string('stackInstall_jsmathcheck','stack','').'</h3>'; + // firstly, is it on the same server? + if(false !== strpos($jsmathroot, $_SERVER['HTTP_HOST'])) { + echo '<p><span class="valid">'.get_string('stackInstall_success', 'stack','').'</span> '.get_string('stackInstall_jsmathsamehost', 'stack','').' <img src="'.$wroot.'/pix/'.get_string('stackIcon_success','stack').'" width="16" height="16" alt="'.get_string('stackIcon_success_alt','stack').'" /></p>'; ! // secondly, can load file be found? ! $f = 1; $c = 1;//1 for header, 2 for body, 3 for both $r = NULL; *************** *** 169,182 **** } else { echo '<p><span class="valid">'.get_string('stackInstall_success', 'stack','').'</span> '.get_string('stackInstall_jsmathok', 'stack','').' <img src="'.$wroot.'/pix/'.get_string('stackIcon_success','stack').'" width="16" height="16" alt="'.get_string('stackIcon_success_alt','stack').'" /></p>'; - } ! // is it on the same server? ! if(false !== strpos($jsmathroot, $_SERVER['HTTP_HOST'])) { ! echo '<p><span class="valid">'.get_string('stackInstall_success', 'stack','').'</span> '.get_string('stackInstall_jsmathsamehost', 'stack','').' <img src="'.$wroot.'/pix/'.get_string('stackIcon_success','stack').'" width="16" height="16" alt="'.get_string('stackIcon_success_alt','stack').'" /></p>'; ! } else { ! echo '<p><span class="failed">'.get_string('stackInstall_failed', 'stack','').'</span> '.get_string('stackInstall_jsmathdifferenthost', 'stack','').$_SERVER['HTTP_HOST'].' <img src="'.$wroot.'/pix/'.get_string('stackIcon_fail','stack').'" width="16" height="16" alt="'.get_string('stackIcon_fail_alt','stack').'" /></p>'; ! }; ! ! // is jsMath loaded? echo '<script type="text/javascript">' . 'if (!window.jsMath) document.write(\'<p><span class="failed">'.get_string('stackInstall_failed', 'stack','').'</span> '.get_string('stackInstall_jsmathnotfound', 'stack','').' <tt>'.$jsmathroot.'</tt> <img src="'.$wroot.'/pix/'.get_string('stackIcon_fail','stack').'" width="16" height="16" alt="'.get_string('stackIcon_fail_alt','stack').'" /></p>\');' . --- 176,181 ---- } else { echo '<p><span class="valid">'.get_string('stackInstall_success', 'stack','').'</span> '.get_string('stackInstall_jsmathok', 'stack','').' <img src="'.$wroot.'/pix/'.get_string('stackIcon_success','stack').'" width="16" height="16" alt="'.get_string('stackIcon_success_alt','stack').'" /></p>'; ! // finally, try to load and render with jsMath? echo '<script type="text/javascript">' . 'if (!window.jsMath) document.write(\'<p><span class="failed">'.get_string('stackInstall_failed', 'stack','').'</span> '.get_string('stackInstall_jsmathnotfound', 'stack','').' <tt>'.$jsmathroot.'</tt> <img src="'.$wroot.'/pix/'.get_string('stackIcon_fail','stack').'" width="16" height="16" alt="'.get_string('stackIcon_fail_alt','stack').'" /></p>\');' . *************** *** 187,190 **** --- 186,196 ---- '</script>'; + + } + + } else { // not same server + echo '<p><span class="failed">'.get_string('stackInstall_failed', 'stack','').'</span> '.get_string('stackInstall_jsmathdifferenthost', 'stack','').$jsmathroot.' <img src="'.$wroot.'/pix/'.get_string('stackIcon_fail','stack').'" width="16" height="16" alt="'.get_string('stackIcon_fail_alt','stack').'" /></p>'; + }; + echo '</div>'; } |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:57
|
Update of /cvsroot/stack/stack-dev/lib In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib Modified Files: stringUtil.php error.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: error.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/error.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** error.php 11 Jan 2010 17:23:36 -0000 1.22 --- error.php 30 Sep 2010 16:56:19 -0000 1.23 *************** *** 18,23 **** */ /** ! Error class ! Class for indicating and defining errors */ global $config; --- 18,23 ---- */ /** ! * Error class ! * Class for indicating and defining errors */ global $config; Index: stringUtil.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/stringUtil.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** stringUtil.php 11 Jan 2010 17:23:36 -0000 1.20 --- stringUtil.php 30 Sep 2010 16:56:19 -0000 1.21 *************** *** 584,587 **** --- 584,616 ---- return $array; } + + /** + * Returns a more intuitive datestamp + */ + public static function prettifyDate($datestamp) { + /* + * Rules: + * show time if this week + * show day + month if this year + * show month + year if not this year + */ + + $dayStart = strtotime("00:00"); + $monthAgo = strtotime('-1 month'); + $yearAgo = strtotime('-1 year'); + + //echo "yearstart: $yearStart monthStart: $monthStart dayStart: $dayStart"; + + $time = strtotime($datestamp); + + if($time >= $dayStart) return date("g:ia", $time);// today + if($time > $monthAgo) return date("g:ia, j M", $time);// not today + if($time > $yearAgo) return date("M Y", $time); // not this year + if($time > $yearAgo) return date("j M", $time); // not this month + + + // failed to prettify somehow + return $datestamp; + } } |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:56
|
Update of /cvsroot/stack/stack-dev/lib/CAS In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/CAS Modified Files: casText.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: casText.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/CAS/casText.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** casText.php 18 Feb 2010 11:01:07 -0000 1.39 --- casText.php 30 Sep 2010 16:56:14 -0000 1.40 *************** *** 169,172 **** --- 169,173 ---- function checkValidCASCommands() { + $toReturn = true; foreach($this->cmdArray as $cmd) *************** *** 185,189 **** foreach($this->cmdArray as $cmd) { ! $pat = "|([A-za-z0-9\(\)]+) ([A-za-z0-9\(\)]+)|"; if (preg_match($pat,$cmd)) { --- 186,190 ---- foreach($this->cmdArray as $cmd) { ! $pat = "|([A-Za-z0-9\(\)]+) ([A-Za-z0-9\(\)]+)|"; if (preg_match($pat,$cmd)) { *************** *** 266,270 **** } ! //check final character is not / * + - ^ £ # = & ~ | , ? foreach($this->cmdArray as $cmd) --- 267,271 ---- } ! //check final character is not / * + - ^ £ # = & ~ | , ? : ; foreach($this->cmdArray as $cmd) *************** *** 274,278 **** $lastChar = $cmd[($length -1)]; ! $disallowedChars = array('/','+','*','/','-','^','£','#','~','=','?',',','_','&','"','`','¬'); if(in_array($lastChar, $disallowedChars)) --- 275,279 ---- $lastChar = $cmd[($length -1)]; ! $disallowedChars = array('/','+','*','/','-','^','£','#','~','=','?',',','_','&','"','`','¬',';',':','$'); if(in_array($lastChar, $disallowedChars)) *************** *** 436,443 **** $i++; - $str = new stringUtil($cmd); - $cmd = $str->trimCommands(); - //$cmd = $this->trimCommands($cmd); - unset($str); $this->cmdArray[$label] = $cmd; } --- 437,440 ---- *************** *** 528,534 **** // We assume f and g are single letter functions. $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! ! $patterns[] = "|([0-9]+)([A-Za-eh-z])|"; // eg 3x ! $patterns[] = "|([0-9])([A-Za-z]\()|"; // eg 3 x ( ! $patterns[] = "|(\))([0-9A-Za-z])|"; // eg )a if ($this->security == 's') --- 525,531 ---- // We assume f and g are single letter functions. $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! ! $patterns[] = "|([0-9]+)([A-DF-Za-eh-z])|"; // eg 3x ! $patterns[] = "|([0-9])([A-DF-Za-z]\()|"; // eg 3 x ( ! $patterns[] = "|(\))([0-9A-DF-Za-z])|"; // eg )a if ($this->security == 's') *************** *** 536,541 **** // Teachers have more options for functions $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( ! $patterns[] = "|(^[A-Za-eh-z])(\()|"; // eg a( , that is a single letter. ! $patterns[] = "|(\*[A-Za-eh-z])(\()|"; } --- 533,538 ---- // Teachers have more options for functions $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( ! $patterns[] = "|(^[A-DF-Za-eh-z])(\()|"; // eg a( , that is a single letter. ! $patterns[] = "|(\*[A-DF-Za-eh-z])(\()|"; } *************** *** 598,605 **** { // We assume f and g are single letter functions. $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! ! $patterns[] = "|([0-9]+)([A-Za-eh-z])|"; // eg 3x ! $patterns[] = "|([0-9])([A-Za-z]\()|"; // eg 3 x ( ! $patterns[] = "|(\))([0-9A-Za-z])|"; // eg )a if ($this->security == 's') --- 595,603 ---- { // We assume f and g are single letter functions. + // We exclude E (capital eee) to enable 24E+1 to be a floating point number. $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! ! $patterns[] = "|([0-9]+)([A-DF-Za-eh-z])|"; // eg 3x ! $patterns[] = "|([0-9])([A-DF-Za-z]\()|"; // eg 3 x ( ! $patterns[] = "|(\))([0-9A-DF-Za-z])|"; // eg )a if ($this->security == 's') *************** *** 607,612 **** // Teachers have more options for functions $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( ! $patterns[] = "|(^[A-Za-eh-z])(\()|"; // eg a( , that is a single letter. ! $patterns[] = "|(\*[A-Za-eh-z])(\()|"; } --- 605,610 ---- // Teachers have more options for functions $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( ! $patterns[] = "|(^[A-DF-Za-eh-z])(\()|"; // eg a( , that is a single letter. ! $patterns[] = "|(\*[A-DF-Za-eh-z])(\()|"; } |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:56
|
Update of /cvsroot/stack/stack-dev/lib/ui In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/ui Modified Files: questionTest.php authorTest.php questionBank.php AuthorDisplay.php questionReview.php questionExporter.php OptionsEdit.php questionDeploy.php DisplayItem.php questionImporter.php report.php GhostWriter.php frontend.php Added Files: report.js report.css Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: questionImporter.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/questionImporter.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** questionImporter.php 28 Jul 2009 15:39:26 -0000 1.17 --- questionImporter.php 30 Sep 2010 16:56:15 -0000 1.18 *************** *** 21,28 **** --- 21,40 ---- */ + session_start(); + require_once('../../config.php'); $config = new stackConfig(); global $config; + $url = $config->get('weburl'); + $diemessage = "Please <a href='$url'>login</a>."; + if (array_key_exists('loggedin',$_SESSION)) { + $loggedin = $_SESSION['loggedin']; + if (!$loggedin) { die($diemessage); } + } else { + die($diemessage); + } + + $root = $config->get('docroot'); $webroot = $config->get('webroot'); Index: questionDeploy.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/questionDeploy.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** questionDeploy.php 2 Nov 2009 17:55:08 -0000 1.9 --- questionDeploy.php 30 Sep 2010 16:56:15 -0000 1.10 *************** *** 23,26 **** --- 23,36 ---- global $config; + $url = $config->get('weburl'); + $diemessage = "Please <a href='$url'>login</a>."; + if (array_key_exists('loggedin',$_SESSION)) { + $loggedin = $_SESSION['loggedin']; + if (!$loggedin) { die($diemessage); } + } else { + die($diemessage); + } + + $root = $config->get('docroot'); require_once('DisplayItem.php'); *************** *** 31,81 **** require_once $root.'/lib/deployment/Deployment.php'; $cache = new StackDBCache(); $cache->connect(); ! echo html_head(get_string('FE_deployQuestion', 'stack'),'../../',"@import \"../../styles.css\";\n"); ! $qid = $_GET['id']; // TODO: needs sanitization ?> - <body> ! <h1><?php echo get_string('FE_deployQuestion', 'stack').' '.$qid; ?></h1> <p><a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a> ! <a href="authorTest.php?id=<?php echo $qid ?>"><?php echo get_string('stackQuestion_filterLinkEdit','stack'); ?></a></p> <div class="section80"> ! <h3 class="section"><?php echo get_string('FE_deployQuestion_instancesOfQuestion', 'stack').' '.$qid; ?></h3> <p> <?php - $deployment = new Deployment($qid); // will auto-deploy as necessary - $request = $_POST + $_GET; // POST from this page with possible GET via Opaque if(!$deployment->isSingleton()) { // multiple versions - $result = $deployment->processOperations($request); if(!empty($result)) echo "<div class='warning'>".$result."</div>"; ! echo "<form method='POST' action='?id=".$qid."'>".$deployment->formXHTML()."</form"; } else { // single version echo "<div class='warning'>"; ! echo $deployment->processOperations($request); if($deployment->autoDeployed) { echo get_string('FE_deployQuestion_auto', 'stack'); } echo "</div>"; } ! //echo $deployment->listXHTML(); ! if($deployment->getInstances() == NULL) { echo '<i>'.get_string('FE_deployQuestion_noi', 'stack').'</i>'; } else { ! if (1 == count($deployment->getInstances())) { ! echo '<p>'.get_string('FE_deployQuestion_version', 'stack').'</p>'; } else { ! echo '<p>'.count($deployment->getInstances()).get_string('FE_deployQuestion_versions', 'stack').'</p>'; } echo '<table class="deploymentTable" border="1">'; echo '<tr><th>'; ! echo '</th><th>'; echo get_string('stackQuestion_questionStem', 'stack'); echo '</th><th>'; --- 41,121 ---- require_once $root.'/lib/deployment/Deployment.php'; + $id = $_GET['id']; // TODO: needs sanitization + + $itemDB = new StackDBItem(); + $itemDB->connect(); + $latestVersion = $itemDB->getLatestVersion($id); + $cache = new StackDBCache(); $cache->connect(); ! $deployment = new Deployment($id); // will auto-deploy as necessary ! $request = $_POST + $_GET; // POST from this page with possible GET via Opaque ! $result = $deployment->processOperations($request); + echo html_head(get_string('FE_deployVersion', 'stack'),'../../',"@import \"../../styles.css\";\n"); ?> <body> ! <h1><?php echo get_string('FE_deployVersion', 'stack').' '.$id; ?></h1> <p><a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a> ! <a href="authorTest.php?id=<?php echo $id ?>"><?php echo get_string('stackQuestion_filterLinkEdit','stack'); ?></a></p> <div class="section80"> ! <h3 class="section"> ! <?php ! if(isset($_GET['dropall'])) { ! $undeployment = new Deployment($_GET['dropall']); ! $undeployment->drop(); ! } ! ! echo get_string('FE_deployQuestion_instancesOfVersion', 'stack').' '.$id; ! ?></h3> <p> <?php + $earliest = $deployment->earliestDeployedVersion(); // any stale deployments? if(!$deployment->isSingleton()) { // multiple versions if(!empty($result)) echo "<div class='warning'>".$result."</div>"; ! if($latestVersion == $deployment->getVersion()) { // this is latest version ! if($latestVersion == $earliest || false == $earliest) { ! echo "<form method='POST' action='?id=".$id."'>".$deployment->formXHTML()."</form>"; ! } else { ! echo get_string('FE_deployQuestion_oldVersionDeployed', 'stack'); ! $deployment = new Deployment($earliest); ! echo '<p><a href="?id='.$id.'&dropall='.$earliest.'">'.get_string('FE_deployQuestion_undeployAll', 'stack').'</a>'; ! } ! } else { // this is an old version ! echo get_string('FE_deployQuestion_newerVersionCannotDeploy', 'stack', $latestVersion); ! echo '<a href="?id='.$latestVersion.'">deploy latest</a>'; ! } } else { // single version echo "<div class='warning'>"; ! echo $result;//$deployment->processOperations($request); if($deployment->autoDeployed) { echo get_string('FE_deployQuestion_auto', 'stack'); + } else { + echo get_string('FE_deployQuestion_oldVersionDeployed', 'stack'); + $deployment = new Deployment($earliest); } echo "</div>"; } ! $instances = $deployment->getInstances(); ! ! if($instances == NULL) { echo '<i>'.get_string('FE_deployQuestion_noi', 'stack').'</i>'; } else { ! if (1 == count($instances)) { ! echo '<p>'.get_string('FE_deployQuestion_instanceDeployed', 'stack').'</p>'; } else { ! echo '<p>'.get_string('FE_deployQuestion_xInstances', 'stack', $deployment->size()); } + echo get_string('FE_deployQuestion_ofVersionXdeployed', 'stack', $deployment->getVersion()).'</p>'; echo '<table class="deploymentTable" border="1">'; echo '<tr><th>'; ! //echo 'v';//get_string('stackQuestion_id.revision', 'stack'); ! //echo '</th><th>'; echo get_string('stackQuestion_questionStem', 'stack'); echo '</th><th>'; *************** *** 84,91 **** echo '</th></tr>'; ! foreach($deployment->getInstances() as $instance) { $item = $cache->getDisplayItem($instance['id']); echo '<tr>'; ! echo '<td>'. $instance['id'] .'</td>'; echo '<td>'. $instance['xhtml'] .'</td>'; echo '<td>'.$item->getQuestionNote().'</td>'; --- 124,132 ---- echo '</th></tr>'; ! foreach($instances as $instance) { ! //print_r($instance); $item = $cache->getDisplayItem($instance['id']); echo '<tr>'; ! //echo "<td>$instance[version]</td>"; echo '<td>'. $instance['xhtml'] .'</td>'; echo '<td>'.$item->getQuestionNote().'</td>'; *************** *** 99,113 **** ?> </div> - <div class="section80"> - <h3 class="section"><?php echo get_string('FE_deployQuestion_primedResponses', 'stack')?></h3> - Pregenerated from the question tests, they can include correct answers as well as common mistakes. The cache can be primed to include their straightforward submission to save the work at quiz time. - <form method="POST" action="questionDeploy.php?id=<?php echo $qid ?>"> - <input type="submit" value="Regenerate"> - </form> <?php $responses = $deployment->primeResponses(); if($responses === NULL) echo "No question tests defined!"; else echo sizeof($responses)." new responses primed."; // should output responses defined (counted) and their test result ?> </div> \ No newline at end of file --- 140,155 ---- ?> </div> <?php + if($earliest == $latestVersion) { + echo '<div class="section80">'; + echo '<h3 class="section">'.get_string('FE_deployQuestion_primedResponses', 'stack').'</h3>'; + echo get_string('FE_deployQuestion_primedResponsesBlurb', 'stack'); + echo '<form method="POST" action="questionDeploy.php?id='.$id.'"><input type="submit" value="Regenerate"></form>'; + $responses = $deployment->primeResponses(); if($responses === NULL) echo "No question tests defined!"; else echo sizeof($responses)." new responses primed."; // should output responses defined (counted) and their test result + } ?> </div> \ No newline at end of file Index: OptionsEdit.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/OptionsEdit.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OptionsEdit.php 4 Oct 2007 12:58:48 -0000 1.5 --- OptionsEdit.php 30 Sep 2010 16:56:15 -0000 1.6 *************** *** 19,23 **** $config = new stackConfig(); global $config; ! require_once('OptionsEditor.php'); $editor = new OptionsEditor(); --- 19,33 ---- $config = new stackConfig(); global $config; ! ! $url = $config->get('weburl'); ! $diemessage = "Please <a href='$url'>login</a>."; ! if (array_key_exists('loggedin',$_SESSION)) { ! $loggedin = $_SESSION['loggedin']; ! if (!$loggedin) { die($diemessage); } ! } else { ! die($diemessage); ! } ! ! require_once('OptionsEditor.php'); $editor = new OptionsEditor(); *************** *** 25,29 **** ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> --- 35,39 ---- ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> *************** *** 41,51 **** var optionsContainer; var copyContainer; ! window.onload = function() { optionsContainer = new fx.Height('options', {duration: 400}); copyContainer = new fx.Height('copy', {duration: 400}); ! //copyContainer.hide(); ! //optionsContainer.hide(); ! <?php //display last edited page. if(!empty($_POST['edit_new']) || !empty($_POST['edit_overwrite'])) --- 51,61 ---- var optionsContainer; var copyContainer; ! window.onload = function() { optionsContainer = new fx.Height('options', {duration: 400}); copyContainer = new fx.Height('copy', {duration: 400}); ! //copyContainer.hide(); ! //optionsContainer.hide(); ! <?php //display last edited page. if(!empty($_POST['edit_new']) || !empty($_POST['edit_overwrite'])) *************** *** 59,63 **** ?> } ! function toggleBoth() { --- 69,73 ---- ?> } ! function toggleBoth() { *************** *** 66,72 **** optionsContainer.toggle('optIcon', iconPath); } ! ! </script> ! <title>Question test</title> </head> --- 76,82 ---- optionsContainer.toggle('optIcon', iconPath); } ! ! </script> ! <title>Question test</title> </head> Index: authorTest.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/authorTest.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** authorTest.php 11 Jan 2010 17:23:36 -0000 1.16 --- authorTest.php 30 Sep 2010 16:56:15 -0000 1.17 *************** *** 17,26 **** --- 17,39 ---- */ session_start(); + require_once('../../config.php'); $config = new stackConfig(); global $config; + $url = $config->get('weburl'); + $diemessage = "Please <a href='$url'>login</a>."; + if (array_key_exists('loggedin',$_SESSION)) { + $loggedin = $_SESSION['loggedin']; + if (!$loggedin) { die($diemessage); } + } else { + die($diemessage); + } + + require_once('AuthorDisplay.php'); + require_once $config->get('docroot').'/lib/ui/frontend.php'; + if(empty($_SESSION['authorItem']) || ($_POST == NULL)) { *************** *** 48,104 **** //unset($_SESSION['authorItem']); $_SESSION['authorItem'] = serialize($author); - ?> - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - <html> - <head> - <style type="text/css" media="all"> - @import "../../styles.css"; - </style> - <script type="text/javascript" src="../../other/moo.fx/prototype.lite.js"></script> - <script type="text/javascript" src="../../other/moo.fx/moo.fx.js"></script> - <script type="text/javascript" src="../../other/jquery.js"></script> - <script type="text/javascript"> - // Initialise the effects - var metaContainer; - var optionsContainer; - var moodleContainer; - var prtContainer; - var qpContainer; - - - window.onload = function() { - metaContainer = new fx.Height('meta', {duration: 400}); - metaContainer.hide(); - optionsContainer = new fx.Height('options', {duration: 400}); - optionsContainer.hide(); - moodleContainer = new fx.Height('moptions', {duration: 400}); - moodleContainer.hide(); - prtContainer = new fx.Height('prtContainer', {duration: 400}); - qpContainer = new fx.Height('qpContainer', {duration: 400}); - - } ! </script> ! <script type="text/javascript"> ! function swapper(container, icon) ! { ! var iconPath = '<?php echo $config->get('weburl'); ?>/pix/'; ! container.toggle(icon, iconPath); ! } ! ! function toggleIcon(container) { ! var iconPath = '<?php echo $config->get('weburl'); ?>/pix/'; ! alert($(container).child()); ! } ! </script> ! <title>Question test</title> ! </head> <body> <form action="authorTest.php" method="POST"> <div id="authoringControls"> ! <h2><?php echo get_string('stackAuthor_title'.$key,'stack').' #'.$_GET['id'] ?></h2> ! <p><a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a></p> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_update','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_save','stack'); ?>" /> --- 61,71 ---- //unset($_SESSION['authorItem']); $_SESSION['authorItem'] = serialize($author); ! echo html_head(get_string('stackQuestion_authorEditQuestion', 'stack'),'../../',"@import \"../../styles.css\";\n", 'LaTeX', true); ! ?> <body> <form action="authorTest.php" method="POST"> <div id="authoringControls"> ! <a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a><p /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_update','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_save','stack'); ?>" /> *************** *** 107,116 **** <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /> <p> ! <a href="#stem">Stem</a> ! <br /><a href="#parts" onClick="$('#partContainer').slideDown();">Interactions</a> ! <br /><a href="#prts" onClick="$('#prtContainer').slideDown();">Responses</a> ! <br /><a href="#options" onClick="$('#optionContainer').slideDown();">Options</a> ! <br /><a href="#tests" onClick="$('#testContainer').slideDown();">Tests</a> ! <br /><a href="#meta" onClick="$('#metaContainer').slideDown();">Meta</a> </div> <?php --- 74,90 ---- <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /> <p> ! <ul> ! <li><a href="#stem">Stem</a></li> ! <li><a href="#parts" onClick="$('#partContainer').slideDown();">Interactions</a></li> ! <li><a href="#prts" onClick="$('#prtContainer').slideDown();">Responses</a></li> ! <li><a href="#options" onClick="$('#optionContainer').slideDown();">Options</a></li> ! <li><a href="#tests" onClick="$('#testContainer').slideDown();">Tests</a></li> ! <li><a href="#meta" onClick="$('#metaContainer').slideDown();">Meta</a></li> ! </ul> ! <?php ! // line history ! //echo $author->displayVersionHistory(); ! ?> ! </div> <?php *************** *** 118,122 **** ?> </form> ! <?php --- 92,100 ---- ?> </form> ! <script language="JavaScript" type="text/javascript"> ! $(document).ready(function() { ! $('#authoringControls').append($('#versionHistory').detach().html()); ! }); ! </script> <?php Index: DisplayItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/DisplayItem.php,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** DisplayItem.php 13 May 2010 16:09:53 -0000 1.99 --- DisplayItem.php 30 Sep 2010 16:56:15 -0000 1.100 *************** *** 309,313 **** /** Processes the question inserting in the students answer, answerboxes and feedback as needed. * Returns the XHTML representation of the question. ! * No caching; that logic is handled higher up. * * @param array $posted values --- 309,313 ---- /** Processes the question inserting in the students answer, answerboxes and feedback as needed. * Returns the XHTML representation of the question. ! * No display caching; that logic is handled higher up. * * @param array $posted values *************** *** 385,388 **** --- 385,389 ---- //check status, $status = $IE->getStatus(); + $hideFeedback = 'true' == $this->item->questionPart[$label]->getHideFeedback()->getSelected(); switch($status) *************** *** 403,406 **** --- 404,410 ---- //$full .= '<span class="solutionButton"> '.get_string('stackQuestionDisplay_viewSolution','stack','').'<input type="checkbox" value="true" name="'."SR__$label".'" />'; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 423,426 **** --- 427,433 ---- $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 436,439 **** --- 443,449 ---- } $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 452,455 **** --- 462,468 ---- $full .= '<br />'.get_string('stackQuestionDisplay_ThisCanDisplay','stack','').' <span class="SyntaxExample2">'.$this->cachedTAnsValue[$label].'</span> '; $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); *************** *** 769,772 **** --- 782,786 ---- //var_dump($implicitForbid); $this->studentAnswers->syntaxCheck($this->itemOpts, $this->item->getQuestionPartsByStudentAnsKey(), $implicitForbid); + $this->studentAnswers->scoreIfValid($this->item->getQuestionPartsByStudentAnsKey()); $this->studentAnswers->casValidate($this->itemOpts, $this->item->getSeed(), $this->item->getQuestionPartsByStudentAnsKey(), $this->cachedTAnsValue); *************** *** 1306,1309 **** --- 1320,1324 ---- } + public function getTestInput($test) { *************** *** 1362,1369 **** } ! //echo "<pre>"; print_r($test); echo "</pre>"; ! foreach ($test as $key => $val) { ! $test_post[$key] = $postcalc[$key]; ! } return $test_post; --- 1377,1396 ---- } ! ! //echo "<pre>.."; print_r($testIE); echo "..</pre>"; ! $questionParts = $this->item->getQuestionPartsByStudentAnsKey(); ! $test_post=array(); ! if(!empty($questionParts)) ! { ! foreach($questionParts as $SA => $QP) ! { ! $type = $QP->getInputType(); ! $inputType = new InputTypeController($type,$SA); ! $result = $inputType->getTestPostData($postcalc[$SA]); ! foreach($result as $key => $val) { ! $test_post['sAns__'.$key] = $val; ! } ! } ! } return $test_post; *************** *** 1559,1570 **** foreach($qpNames as $name) { if (array_key_exists('IE_'.$name,$QT)) { ! $tests[$key]['IE']['sAns__'.$name] = $QT['IE_'.$name]; } } ! foreach($PRTs as $name =>$PRT) { ! if (array_key_exists('PRT_'.$name,$QT)) { ! $tests[$key]['PRT'][$name] = $QT['PRT_'.$name]; ! } } } --- 1586,1599 ---- foreach($qpNames as $name) { if (array_key_exists('IE_'.$name,$QT)) { ! $tests[$key]['IE'][$name] = $QT['IE_'.$name]; } } ! if (!empty($PRTs)) { ! foreach($PRTs as $name =>$PRT) { ! if (array_key_exists('PRT_'.$name,$QT)) { ! $tests[$key]['PRT'][$name] = $QT['PRT_'.$name]; ! } ! } } } *************** *** 1610,1618 **** // If a PRT is not traversed then the answernote should not exist. // This is different from an answernote existing with the value "NONE", so unset where necessary. ! foreach($test['PRT'] as $key=>$val){ ! if ('NONE'==trim($val)) ! { ! unset($test['PRT'][$key]); ! } } --- 1639,1649 ---- // If a PRT is not traversed then the answernote should not exist. // This is different from an answernote existing with the value "NONE", so unset where necessary. ! if (array_key_exists('PRT',$test)) { ! foreach($test['PRT'] as $key=>$val){ ! if ('NONE'==trim($val)) ! { ! unset($test['PRT'][$key]); ! } ! } } Index: AuthorDisplay.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/AuthorDisplay.php,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** AuthorDisplay.php 11 Jan 2010 17:23:36 -0000 1.67 --- AuthorDisplay.php 30 Sep 2010 16:56:15 -0000 1.68 *************** *** 26,33 **** --- 26,35 ---- require_once $root.'/lib/ui/DisplayItem.php'; require_once $root.'/lib/translator.php'; + require_once $root.'/lib/stringUtil.php'; require_once $root.'/lib/XML/ExportStackTwoItem.php'; require_once $root.'/lib/ui/inputTypes/InputTypeController.php'; require_once($root.'/lib/database/MoodleDB.php'); require_once($root.'/lib/database/StackDBCache.php'); + require_once($root.'/lib/database/StackDBItem.php'); /** *************** *** 109,113 **** else { ! //load a question from the database, if it exists. (loads the itemOptions form the database too. $this->item = new Item(NULL, $questionId); } --- 111,115 ---- else { ! //load a question from the database, if it exists (loads the itemOptions form the database too). $this->item = new Item(NULL, $questionId); } *************** *** 138,141 **** --- 140,146 ---- $display = ''; } + + $display .= $this->displayJS(); + $display .= $this->displayStem(); *************** *** 152,155 **** --- 157,161 ---- $display .= $this->displayMeta(); $display .= $this->displayMoodleAuthor($engineID); + $display .= $this->displayVersionHistory($engineID); return $display; *************** *** 166,182 **** private function displayStem() { $stem = '<div id="stem" class="section">'; ! // var_dump($this); ! ! if($this->item->getQuestionId() != NULL) ! { ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qid', 'stack','').' </span><span class="formw">'.$this->item->getQuestionId().'</span></div>'; ! } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_name', 'stack','').' </span><span class="formw">'.$this->item->questionName->editWidget('questionName', 64).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_description', 'stack','').' </span><span class="formw"> '.$this->item->questionDescription->editWidget('questionDescription', 65,2,12).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_keywords', 'stack','').' </span><span class="formw"> '.$this->item->questionKeywords->editWidget('questionKeywords', 64).'</span></div>'; ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qvariables', 'stack','').' </span><span class="formw"> '.$this->item->questionVariables->editWidget('questionVariables', 65, 4, 12).'</span></div>'; if(!empty($this->authoringErrors['questionVariables']) && ($this->refreshCycle > 0)) --- 172,184 ---- private function displayStem() { + global $config; $stem = '<div id="stem" class="section">'; + // <h3>'.get_string('stackAuthor_stem', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'" href="http://stack.bham.ac.uk/wiki/index.php/Stem"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a></h3>'; ! $stem .= '<div id="authoringVersionID">v.'.$this->item->getQuestionId().'</div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_name', 'stack','').' </span><span class="formw">'.$this->item->questionName->editWidget('questionName', 64).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_description', 'stack','').' </span><span class="formw"> '.$this->item->questionDescription->editWidget('questionDescription', 65,2,12).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_keywords', 'stack','').' </span><span class="formw"> '.$this->item->questionKeywords->editWidget('questionKeywords', 64).'</span></div>'; ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qvariables', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/KeyVals#Question_variables"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a> </span> <span class="formw"> '.$this->item->questionVariables->editWidget('questionVariables', 65, 4, 12).'</span></div>'; if(!empty($this->authoringErrors['questionVariables']) && ($this->refreshCycle > 0)) *************** *** 188,192 **** //the question stem itself ! $stem .= '<br /><br /><div class="row"><span class="label"><strong>'.get_string('stackAuthor_stem', 'stack','').'</strong> <br /><br /><code>'.get_string('stackAuthor_stemInfo', 'stack','').'</code></span><span class="formw"> '.$this->item->questionStem->editWidget('questionStem', 65, 15, 30).'</span></div>'; $stem .= '<div class="clearer"> </div>'; --- 190,199 ---- //the question stem itself ! $stem .= '<br /><br /><div class="row"><span class="label"><strong>'.get_string('stackAuthor_questionStem', 'stack','') ! .'</strong> <br /><br /><code>'.get_string('stackAuthor_stemInfo', 'stack','').'</code>' ! .'<p />Preview<input onclick="$(\'#stemPreview\').slideToggle(\'fast\')" type="checkbox" name="previewstem"></span>'; ! $stem .= '<span class="formw" onkeyup="authorPreview(\'questionStem\',\'#stemPreview\')">'.$this->item->questionStem->editWidget('questionStem', 65, 15, 30).'</span></div>'; ! $stem .= '<div class="row"><span class="label"> </span><span class="formw"><div id="stemPreview" class="authorMath"></div></div></span>'; ! $stem .= '<script>authorPreview(\'questionStem\',\'#stemPreview\')</script>'; $stem .= '<div class="clearer"> </div>'; *************** *** 197,201 **** } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_workedSolution', 'stack','').'</span><span class="formw"> '.$this->item->workedSolution->editWidget('workedSolution', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; if(!empty($this->authoringErrors['workedSolution']) && ($this->refreshCycle > 0)) --- 204,211 ---- } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_workedSolution', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/CASText#Worked_solution"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a>'; ! $stem .= '<p />Preview<input onclick="$(\'#workedSolutionPreview\').slideToggle(\'fast\')" type="checkbox" name="previewstem"></span></span><span class="formw" onkeyup="authorPreview(\'workedSolution\',\'#workedSolutionPreview\')" class="formw"> '.$this->item->workedSolution->editWidget('workedSolution', 65, 2, 10).'</span></div>'; ! $stem .= '<div class="row"><span class="label"> </span><span class="formw"><div id="workedSolutionPreview" class="authorMath"></div></div></span>'; ! $stem .= '<script>authorPreview(\'workedSolution\',\'#workedSolutionPreview\')</script>'; $stem .= '<div class="clearer"> </div>'; if(!empty($this->authoringErrors['workedSolution']) && ($this->refreshCycle > 0)) *************** *** 204,208 **** } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qnote', 'stack','').' </span><span class="formw"> '.$this->item->questionNote->editWidget('questionNote', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; --- 214,218 ---- } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qnote', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/Question_note"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a></span><span class="formw"> '.$this->item->questionNote->editWidget('questionNote', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; *************** *** 215,218 **** --- 225,229 ---- //$stem .= '<div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; + $stem .= '<div class="clearer"> </div><br /> </div>'; return $stem; *************** *** 228,232 **** { global $config; ! $form = '<div id="prts" class="section"><h3><a onclick="$(\'#prtContainer\').slideToggle();swapper(prtContainer, \'prtIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="prtIcon" />'.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; //$form = '<div class="section"><h3><a onclick="prtContainer.toggle();"> '.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; $form .= '<div id="prtContainer">'; --- 239,249 ---- { global $config; ! $form = '<div id="prts" class="section"> ! <h3><a onclick="$(\'#prtContainer\').slideToggle();swapper(prtContainer, \'prtIcon\');"> ! <img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="prtIcon" /> '. ! get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a> ! <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Potential_response_trees"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$form = '<div class="section"><h3><a onclick="prtContainer.toggle();"> '.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; $form .= '<div id="prtContainer">'; *************** *** 245,253 **** } - $PRTs = $this->item->getPRTs(); if($PRTs != NULL) { - foreach($PRTs as $name => $PRT) { --- 262,268 ---- *************** *** 272,276 **** $widget = $PRT->feedbackVariables->editWidget($prefix.'-feedbackVariables', 65, 2, 6); ! $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackVariables', 'stack','').' <br /><br /></span><span class="formw">'.$widget.'</span></div>'; $form .= '<div style="clear: both"> </div>'; --- 287,291 ---- $widget = $PRT->feedbackVariables->editWidget($prefix.'-feedbackVariables', 65, 2, 6); ! $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackVariables', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/KeyVals#Feedback_variables"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a><br /><br /></span><span class="formw">'.$widget.'</span></div>'; $form .= '<div style="clear: both"> </div>'; *************** *** 325,329 **** { global $config; ! $xhtml = '<div id="parts" class="section"><h3><a onclick="$(\'#partContainer\').slideToggle();swapper(qpContainer, \'qpIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="qpIcon" />'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; //$xhtml = '<div class="section"><h3><a onclick="qpContainer.toggle();">'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; $xhtml .= '<div id="partContainer">'; --- 340,346 ---- { global $config; ! $xhtml = '<div id="parts" class="section"><h3><a onclick="$(\'#partContainer\').slideToggle();swapper(qpContainer, \'qpIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="qpIcon" />'.get_string('stackAuthor_interactionElements', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$xhtml = '<div class="section"><h3><a onclick="qpContainer.toggle();">'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; $xhtml .= '<div id="partContainer">'; *************** *** 335,340 **** $xhtml .= '<table class="interactionElementsTable" border="1" cellpadding="2" cellspacing="0"> <tbody> ! <tr> ! <td class="tableTitle">'.get_string('stackAuthor_studentAnsKey', 'stack','').'</td>'; foreach($qpNames as $name) --- 352,359 ---- $xhtml .= '<table class="interactionElementsTable" border="1" cellpadding="2" cellspacing="0"> <tbody> ! <tr><td class="IElabel"> </td> ! <td colspan="'.$noQPs.'">'.get_string('stackAuthor_studentAnsKey', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Students.27s_Answer_Key"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td></tr><tr><td class="IElabel"> </td>'; foreach($qpNames as $name) *************** *** 342,346 **** $xhtml .= '<td class="tableTitle">'.$name.'</td>'; } ! $xhtml .= "</tr><tr><td>".get_string('stackAuthor_inputType', 'stack','')."</td>"; //inputtypes --- 361,367 ---- $xhtml .= '<td class="tableTitle">'.$name.'</td>'; } ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_inputType', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Input_Type"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; //inputtypes *************** *** 354,358 **** } ! $xhtml .= '</tr><tr><td>'.get_string('stackAuthor_teachersAns', 'stack','').'</td>'; //teachers answer foreach($qpNames as $name) --- 375,381 ---- } ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_teachersAns', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Teacher.27s_Answer"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; //teachers answer foreach($qpNames as $name) *************** *** 366,370 **** //box size ! $xhtml .= '</tr><tr><td>'.get_string('stackAuthor_boxsize', 'stack','').'</td>'; foreach($qpNames as $name) { --- 389,395 ---- //box size ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_boxsize', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Box_Size"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) { *************** *** 374,378 **** } //allow informal syntax ! $xhtml .='</tr><tr><td>'.get_string('stackAuthor_strictsyntax', 'stack','').'</td>'; foreach($qpNames as $name) --- 399,405 ---- } //allow informal syntax ! $xhtml .='</tr><tr><td class="IElabel">'.get_string('stackAuthor_strictsyntax', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Strict_Syntax"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 385,389 **** //allow informal syntax ! $xhtml .='</tr><tr><td>'.get_string('stackAuthor_insertStars', 'stack','').'</td>'; foreach($qpNames as $name) --- 412,418 ---- //allow informal syntax ! $xhtml .='</tr><tr><td class="IElabel">'.get_string('stackAuthor_insertStars', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Insert_Stars"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 397,401 **** //syntax hint ! $xhtml .= '</tr><td>'.get_string('stackAuthor_syntaxHint', 'stack','').'</td>'; foreach($qpNames as $name) --- 426,432 ---- //syntax hint ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_syntaxHint', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Syntax_Hint"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 408,412 **** //forbidden words, comma separated. ! $xhtml .= '</tr><td>'.get_string('stackAuthor_forbiddenWords', 'stack','').'</td>'; foreach($qpNames as $name) --- 439,445 ---- //forbidden words, comma separated. ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_forbiddenWords', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Forbidden_words"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 430,434 **** //allowed words, same as forbidden words ! $xhtml .= '</tr><td>'.get_string('stackAuthor_allowedWords', 'stack','').'</td>'; foreach($qpNames as $name) --- 463,469 ---- //allowed words, same as forbidden words ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_allowedWords', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Allowed_words"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 452,456 **** //forbid floats ! $xhtml .= '</tr><td>'.get_string('stackAuthor_forbidFloats', 'stack','').'</td>'; foreach($qpNames as $name) --- 487,493 ---- //forbid floats ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_forbidFloats', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Forbid_Floats"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 463,467 **** //Require in lowest terms ! $xhtml .= '</tr><td>'.get_string('stackAuthor_LowestTerms', 'stack','').'</td>'; foreach($qpNames as $name) --- 500,506 ---- //Require in lowest terms ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_LowestTerms', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Require_lowest_terms"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 474,478 **** //SameType ! $xhtml .= '</tr><td>'.get_string('stackAuthor_sameType', 'stack','').'</td>'; foreach($qpNames as $name) --- 513,519 ---- //SameType ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_sameType', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Check_Students_answer.27s_type"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 487,493 **** } //finally add in any input type options ! $xhtml .= '</tr><td>'.get_string('stackAuthor_inputTypeOpt', 'stack').'</td>'; foreach($qpNames as $name) --- 528,568 ---- } + //StudentVerify + $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_studentVerify', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). + '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Student_must_verify"> + <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; + + foreach($qpNames as $name) + { + $prefix = 'qp-'.$name.'-studentVerify'; + $studentVerify = $this->item->questionPart[$name]->getStudentVerify(); + if($studentVerify !== NULL) + { + $widget = $studentVerify->editWidget($prefix); + $xhtml .= '<td>'.$widget.'</td>'; + } + } + + //HideFeedback + $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_hideFeedback', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). + '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Hide_feedback"> + <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; + + foreach($qpNames as $name) + { + $prefix = 'qp-'.$name.'-hideFeedback'; + $hideFeedback = $this->item->questionPart[$name]->getHideFeedback(); + if($hideFeedback !== NULL) + { + $widget = $hideFeedback->editWidget($prefix); + $xhtml .= '<td>'.$widget.'</td>'; + } + } + //finally add in any input type options ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_inputTypeOpt', 'stack').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 561,565 **** { global $config; ! $meta = '<div id="meta" class="section"><h3><a onclick="$(\'#metaContainer\').slideToggle();swapper(metaContainer, \'metaIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="metaIcon" />'.get_string('stackAuthor_metadata', 'stack','').'</a></h3>'; //$meta = '<div class="section"><h3><a onclick="metaContainer.toggle();">'.get_string('stackAuthor_metadata','stack','').'</a></h3>'; $meta .= '<div id="metaContainer">'; --- 636,643 ---- { global $config; ! $meta = '<div id="meta" class="section"><h3><a onclick="$(\'#metaContainer\').slideToggle();swapper(metaContainer, \'metaIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="metaIcon" />'.get_string('stackAuthor_metadata', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Metadata"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; ! //$meta = '<div class="section"><h3><a onclick="metaContainer.toggle();">'.get_string('stackAuthor_metadata','stack','').'</a></h3>'; $meta .= '<div id="metaContainer">'; *************** *** 589,593 **** { global $config; ! $opt = '<div id="options" class="section"><h3><a onclick="$(\'#optionContainer\').slideToggle();swapper(optionsContainer, \'optIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="optIcon" />'.get_string('stackAuthor_options', 'stack','').'</a></h3>'; //$opt = '<div class="section"><h3><a onclick="optionsContainer.toggle();">'.get_string('stackAuthor_options','stack','').'</a></h3>'; $opt .= '<div id="optionContainer">'; --- 667,673 ---- { global $config; ! $opt = '<div id="options" class="section"><h3><a onclick="$(\'#optionContainer\').slideToggle();swapper(optionsContainer, \'optIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="optIcon" />'.get_string('stackAuthor_options', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Options"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$opt = '<div class="section"><h3><a onclick="optionsContainer.toggle();">'.get_string('stackAuthor_options','stack','').'</a></h3>'; $opt .= '<div id="optionContainer">'; *************** *** 615,619 **** { global $config; ! $tests = '<div id="tests" class="section"><h3><a name="tests" onclick="$(\'#testContainer\').slideToggle();swapper(testsContainer, \'optIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="optIcon" />'.get_string('stackAuthor_questionTests', 'stack','').'</a></h3>'; $tests .= '<div id="testContainer">'; if(!empty($this->item->questionPart)) { --- 695,701 ---- { global $config; ! $tests = '<div id="tests" class="section"><h3><a name="tests" onclick="$(\'#testContainer\').slideToggle();swapper(testsContainer, \'optIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="optIcon" />'.get_string('stackAuthor_questionTests', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Testing"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; $tests .= '<div id="testContainer">'; if(!empty($this->item->questionPart)) { *************** *** 815,819 **** $valid = $this->gWriter->validate(); $this->item->store(); - if($this->item->valid == true) { --- 897,900 ---- *************** *** 836,840 **** } ! //if in Moodle, update if(!empty($engineID)) { --- 917,921 ---- } ! //if in Moodle, update via add if(!empty($engineID)) { *************** *** 846,850 **** //update Moodle's database. $qid = $this->item->getQuestionId(); ! $result = $db->addQuestion($qid, $this->authorId, $engineID, $post['category']); if($result == false) { --- 927,931 ---- //update Moodle's database. $qid = $this->item->getQuestionId(); ! $result = $db->addQuestion($qid, $this->item->getLine(), $this->authorId, $engineID, $post['category']); if($result == false) { *************** *** 873,877 **** case get_string('stackAuthor_button_exportAsXml','stack'): - //echo 'Would be exporting as XML now'; $valid = $this->gWriter->validate(); $this->item->store(); --- 954,957 ---- *************** *** 894,898 **** break; ! case 'Add to Moodle': $valid = $this->gWriter->validate(); --- 974,978 ---- break; ! case get_string('stackAuthor_addToMoodle','stack'): $valid = $this->gWriter->validate(); *************** *** 904,908 **** $db = new MoodleDB(); $db->connect(); ! $result = $db->addQuestion($qid, $this->authorId, $engineID, $post['category']); $db->disconnect(); unset($db); --- 984,988 ---- $db = new MoodleDB(); $db->connect(); ! $result = $db->addQuestion($qid, $this->item->getLine(), $this->authorId, $engineID, $post['category']); $db->disconnect(); unset($db); *************** *** 932,935 **** --- 1012,1096 ---- return $valid;*/ } + + public function displayVersionHistory($engineID = NULL) { + global $config; + // get itemdb connection + $db = new StackDBItem(); + $db->connect(); + // get array of versions time->id + + $versions = $db->getVersions($this->item->getLine()); + + if(!empty($versions)) { + $output = '<div class="section" id="versionHistory">'; + $output .= "<h3>".get_string('stackAuthor_savedVersions','stack','')."</h3>"; + foreach($versions as $date=>$id) { + if($engineID != NULL) { // for Moodle authoring + //if($this->item->getQuestionId() == $id) $output .= '<img src="'.$config->get('webroot').'/pix/transparent16x16.gif" /> <a href="questionTest.php?id='.$id.'"><img src="'.$config->get('webroot').'/pix/eye.png" alt="'.get_string('stackIcon_try','stack').'" /></a> <b>'.stringUtil::prettifyDate($date).'</b>'; + if($this->item->getQuestionId() == $id) $output .= '<img src="'.$config->get('webroot').'/pix/arrow_right.png" /> <a href="questionTest.php?id='.$id.'"><img src="'.$config->get('webroot').'/pix/eye.png" alt="'.get_string('stackIcon_try','stack').'" /></a> <b>'.stringUtil::prettifyDate($date).'</b>'; + else $output .= '<a href="stackAuthor.php?id='.$id.'"><img src="'.$config->get('webroot').'/pix/pencil.png" alt="'.get_string('stackIcon_edit','stack').'" /> <a href="stackSessionPage.php?page=try&id='.$id.'"> <img src="'.$config->get('webroot').'/pix/eye.png" alt="'.get_string('stackIcon_try','stack').'" /></a> '.stringUtil::prettifyDate($date); + + } else { // for standalone STACK authoring + if($this->item->getQuestionId() == $id) $output .= '<img src="'.$config->get('webroot').'/pix/transparent16x16.gif" /> <a href="questionTest.php?id='.$id.'"><img src="'.$config->get('webroot').'/pix/eye.png" alt="'.get_string('stackIcon_try','stack').'" /></a> <b>'.stringUtil::prettifyDate($date).'</b>'; + else $output .= '<a href="authorTest.php?id='.$id.'"><img src="'.$config->get('webroot').'/pix/pencil.png" alt="'.get_string('stackIcon_edit','stack').'" /> <a href="questionTest.php?id='.$id.'"> <img src="'.$config->get('webroot').'/pix/eye.png" alt="'.get_string('stackIcon_try','stack').'" /></a> '.stringUtil::prettifyDate($date); + } + $output .= '<br />'; + } + $output .= "</div>"; + } + + $db->disconnect(); + + return $output; + } + + public function displayJS() { + // get options required from each input type + $inputCont = new InputTypeController(); + + $output = "<script>"; + + $usedOptions = str_replace('\n','',json_encode(InputTypeController::getOptionsUsed())); + $optionDefaults = str_replace('\n','',json_encode(InputTypeController::getOptionDefaults())); + $output .= 'usedOptions = eval('.$usedOptions.');'; + $output .= 'optionDefaults = eval('.$optionDefaults.');'; + + $output .= "function updateOptions(name) { + key = name.match(/-(.*)-/)[1]; // gives answer key + type = $(\"*[name='\"+name+\"']\").val(); // e.g. True/False + shown = usedOptions[type]; + + $(\"*[name^='qp-\"+key+\"']\").each(function() { // for each option for this ans + optionName = $(this).attr('name'); // e.g. qp-a-syntaxHint + option = optionName.match(/-.+?-(.*)$/)[1]; // gives option name, e.g. syntaxHint + //console.log(option); + $(this).hide(); // assume hidden by default + + //$(this).css('border','1px solid red'); // for testing only + for(i = 0; i < shown.length; i++) { // search for option + if(shown[i] == option) { + $(this).show(); + //$(this).css('border','1px solid green');// for testing only + } + } + if(optionDefaults[type] && optionDefaults[type][option]) { + $(this).val(optionDefaults[type][option]); + } + }); + $(\"*[name*='inputTypeParam']\").show(); // always show IT params! + //$(\"input:hidden\").after(\"n/a\"); + } + + $(document).ready(function() { + // handle changes in input type + $(\"select[name$='inputType']\").change(function() { + updateOptions($(this).attr('name'))}); + // initial option hiding (can prolly be chained to above) + $(\"select[name$='inputType']\").each(function() { + updateOptions($(this).attr('name'))}); + }); + </script>"; + return $output; + } } Index: questionBank.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/questionBank.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d ... [truncated message content] |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:55
|
Update of /cvsroot/stack/stack-dev/lib/ui/inputTypes In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/ui/inputTypes Modified Files: DropDownList.php SingleCharIT.php StringIT.php TextArea.php AnswerInputType.php AlgebraIT.php InputTypeController.php ListIT.php TrueFalseIT.php Matrix.php Added Files: Slider.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: SingleCharIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/SingleCharIT.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SingleCharIT.php 27 Aug 2009 16:23:00 -0000 1.5 --- SingleCharIT.php 30 Sep 2010 16:56:13 -0000 1.6 *************** *** 104,108 **** return $box; } ! } --- 104,110 ---- return $box; } ! public static function getOptionsUsed() { ! return array('teacherAns', 'forbid', 'sameType', 'studentVerify', 'hideFeedback'); ! } } Index: AnswerInputType.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/AnswerInputType.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AnswerInputType.php 11 Jan 2010 17:23:36 -0000 1.11 --- AnswerInputType.php 30 Sep 2010 16:56:13 -0000 1.12 *************** *** 160,163 **** --- 160,176 ---- } + /** + * Default is to assume all options used. Subclasses can overide with more restrictive sets. + */ + public static function getOptionsUsed() { + return array('teacherAns', 'boxSize','informalSyntax','insertStars', 'syntaxHint', 'forbid','allow','floats','lowest','sameType','studentVerify', 'hideFeedback'); + } + + /** + * Default is to specify no defaults. Subclasses can overide with some. + */ + public static function getOptionDefaults() { + return NULL; + } } Index: DropDownList.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/DropDownList.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DropDownList.php 11 Jan 2010 17:23:36 -0000 1.7 --- DropDownList.php 30 Sep 2010 16:56:13 -0000 1.8 *************** *** 157,161 **** } ! } ?> \ No newline at end of file --- 157,167 ---- } ! public static function getOptionsUsed() { ! return array('teacherAns', 'studentVerify', 'hideFeedback'); ! } + public static function getOptionDefaults() { + return array('studentVerify'=>'false', 'hideFeedback'=>'true'); + } + } ?> \ No newline at end of file Index: TextArea.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/TextArea.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TextArea.php 26 Jul 2010 09:25:14 -0000 1.4 --- TextArea.php 30 Sep 2010 16:56:13 -0000 1.5 *************** *** 113,117 **** $rows = $this->modinput_tokenizer(substr($this->default, 1, -1)); // array("[a,b]","[c,d]"); ! $norows = count($rows)+4; $dispval = ''; $cols = $this->boxWidth; --- 113,117 ---- $rows = $this->modinput_tokenizer(substr($this->default, 1, -1)); // array("[a,b]","[c,d]"); ! $norows = count($rows)+3; $dispval = ''; $cols = $this->boxWidth; *************** *** 126,130 **** /** ! * Converts the inputs passed in into a textares into a Maxima list * * @param string|array $in --- 126,130 ---- /** ! * Converts the inputs passed in into a textareas into a Maxima list * * @param string|array $in *************** *** 134,137 **** --- 134,141 ---- public function transform($in) { + if(''==trim($in)) { + return(''); + } + $vals = explode("\n",$in); $out = '['; *************** *** 231,235 **** --- 235,254 ---- } + /** + * Returns an array in the form of the $_POST data, used for the question tests. + * + * @param string $value + * @access public + * @return array + */ + public function getTestPostData($value) + { + $post_data=substr($value,1,strlen($value)-2); + return array($this->name=>$post_data); + } + public static function getOptionDefaults() { + return array('boxSize'=>25, 'studentVerify'=>'true', 'hideFeedback'=>'false'); + } } ?> \ No newline at end of file --- NEW FILE: Slider.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Benjamin Holmes (ma...@be...) * * @package stackInputType */ global $config; require_once 'AnswerInputType.php'; // A jQuery UI slider, see http://jqueryui.com/demos/slider class Slider extends AnswerInputType { // Attributes //protected $min; //protected $max; //protected $step; public function __construct($name, $width = null, $default = null, $maxLength = null, $height = null, $param = null) { //if (!isset($width)) $width = '200'; $this->name = $name; $this->boxWidth = $width; if($param == NULL) { $this->parameters['slider_min'] = new Meta('required', '0'); $this->parameters['slider_max'] = new Meta('required', '100'); $this->parameters['slider_step'] = new Meta('required', '1'); } else $this->parameters = $param; // parent::__construct($name, $width); //$this->min = $param['min']; //$this->max = $param['max']; //$this->step = $param['step']; parent::__construct($name, $width, $default, $maxLength, $height, $param); } public function getXHTML() { $url = $GLOBALS['config']->get('weburl'); // include jQuery and jQuery UI scripts $slider = '<link rel="stylesheet" type="text/css" href="' . $url . '/other/jqueryCSS/jquery.ui.css" /> <script type="text/javascript" src="' . $url . '/other/jquery.js"></script> <script type="text/javascript" src="' . $url . '/other/jquery.ui.js"></script>'; $slider .= '<div id="' . $this->name . '_slider" style="width: ' . $this->boxWidth . 'px;"></div> <div id="' . $this->name . '_value">'.$this->default.'</div> <input id="' . $this->name . '" name="' . $this->name . '" type="hidden" value="'.$this->default.'" />'; $slider .= '<script type="text/javascript"> $(document).ready(function() { $("#' . $this->name . '_slider").slider({' . (is_numeric($this->default) ? "value: {$this->default}," : '') . (isset($this->parameters['slider_min']) ? "min: {$this->parameters['slider_min']}," : '') . (isset($this->parameters['slider_max']) ? "max: {$this->parameters['slider_max']}," : '') . (isset($this->parameters['slider_step']) ? "step: {$this->parameters['slider_step']}," : '') . ' slide: function(event, ui) { $("#' . $this->name . '").val(ui.value) $("#' . $this->name . '_value").text(ui.value); } }); }); </script>'; return $slider; } /** * Modifies the default parameters of this Input type based on the authors inputs * If authors input is null, returns the defaults. * * @access public * @param array $param * @return array */ public function getDefaultParam($param=NULL) { if(!empty($param['slider_min'])) { $this->parameters['slider_min']->setSelection($param['slider_min']); } if(!empty($param['slider_max'])) { $this->parameters['slider_max']->setSelection($param['slider_max']); } return $this->parameters; } public static function getOptionsUsed() { return array('teacherAns', 'boxSize', 'studentVerify', 'hideFeedback'); } public static function getOptionDefaults() { return array('boxSize'=>'200', 'studentVerify'=>'false', 'hideFeedback'=>'true'); } } ?> Index: Matrix.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/Matrix.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Matrix.php 9 Feb 2010 10:40:31 -0000 1.11 --- Matrix.php 30 Sep 2010 16:56:13 -0000 1.12 *************** *** 215,219 **** /*echo '<hr>Defaults:<pre>'; var_dump($this->defaults); ! echo '</pre>';*/ } } --- 215,220 ---- /*echo '<hr>Defaults:<pre>'; var_dump($this->defaults); ! echo '</pre>'; ! */ } } *************** *** 320,333 **** } - /** - * Supercedes OLDmodinput_tokenizer() below - */ - /* - private function BROKENmodinput_tokenizer($in) { - $list = new stringUtil($in); - return $list->listToArray(); - } - */ - /** * Takes comma separated list of elements and returns them as an array --- 321,324 ---- *************** *** 414,449 **** public function getTestPostData($value) { - $post_data = array(); ! /* ! $cs = 'matrix_size('.$this->parameters['teacherAns'].')'; ! $matrixSize = new CasString($cs); ! ! $mct = new MultiCasText(array('size' => $matrixSize)); ! $mct->casValidate('t'); ! ! $size = $mct->getRawValues('size'); ! $dimensions = explode(',',$size[$cs]); ! $height = trim($dimensions[0], '[]'); ! $width = trim($dimensions[1], '[]'); ! for($i=0; $i < $height; $i++) { ! for($j=0; $j < $width; $j++) { ! $name = $this->name.'|'.$i.'|'.$j; ! $default = empty($this->defaults) ? '' : $this->defaults[$i][$j]; ! $post_data[$name] = $default; ! } } - */ - - echo "HERE"; - print_r($post_data); ! return $post_data; } ! } ?> \ No newline at end of file --- 405,432 ---- public function getTestPostData($value) { ! $this -> setDefault($value); ! $post_data = array(); ! $height = count($this->defaults); ! if ($height>0) { ! $width = count($this->defaults[1]); ! for($i=0; $i < $height; $i++) { ! for($j=0; $j < $width; $j++) { ! $name = $this->name.'|'.$i.'|'.$j; ! $default = empty($this->defaults) ? '' : $this->defaults[$i][$j]; ! $post_data[$name] = $default; ! } ! } } ! return $post_data; } ! public static function getOptionsUsed() { ! return array('teacherAns', 'informalSyntax', 'insertStars', 'syntaxHint', 'forbid', 'allow', 'floats', 'lowest', 'sameType', 'studentVerify', 'hideFeedback'); ! } } ?> \ No newline at end of file Index: StringIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/StringIT.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StringIT.php 27 Aug 2009 16:23:00 -0000 1.6 --- StringIT.php 30 Sep 2010 16:56:13 -0000 1.7 *************** *** 113,116 **** --- 113,123 ---- } + public static function getOptionsUsed() { + return array('teacherAns', 'forbid', 'allow', 'floats', 'lowest', 'sameType', 'studentVerify', 'hideFeedback'); + } + + public static function getOptionDefaults() { + return array('boxSize'=>20, 'studentVerify'=>'false', 'hideFeedback'=>'true'); + } } Index: AlgebraIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/AlgebraIT.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AlgebraIT.php 27 Aug 2009 16:23:00 -0000 1.7 --- AlgebraIT.php 30 Sep 2010 16:56:13 -0000 1.8 *************** *** 117,120 **** --- 117,138 ---- return $box; } + + public static function getOptionsUsed() { + return parent::getOptionsUsed(); + } + + + /** + * Returns the default options. + * Only need to specify where they differ from QuestionPart defaults, so does not contain all used options (see setOptionsUsed()) + * String keys MUST match QuestionPart variable names. + * + * @param array $param + * @access public + * @return Array(String) + */ + public static function getOptionDefaults() { + return array('boxSize'=>'20'); + } } ?> \ No newline at end of file Index: InputTypeController.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/InputTypeController.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** InputTypeController.php 27 Aug 2009 16:23:00 -0000 1.12 --- InputTypeController.php 30 Sep 2010 16:56:13 -0000 1.13 *************** *** 34,37 **** --- 34,38 ---- require_once $root.'/lib/ui/inputTypes/ListIT.php'; require_once $root.'/lib/ui/inputTypes/TextArea.php'; + require_once $root.'/lib/ui/inputTypes/Slider.php'; class InputTypeController *************** *** 44,48 **** * @access private */ ! private $avaliableTypes; /** --- 45,49 ---- * @access private */ ! private $availableTypes; /** *************** *** 110,125 **** $this->answerBox = new TextArea($name, $width, $default, $maxLength, $height, $param); break; } } //set list of avaliable input types, in a format that can be translated ! $this->avaliableTypes['Algebraic Input'] = get_string('stackInputType_Algebraic', 'stack', ''); ! $this->avaliableTypes['True/False'] = get_string('stackInputType_truefalse', 'stack', ''); ! $this->avaliableTypes['Single Character'] = get_string('stackInputType_singlechar', 'stack', ''); ! $this->avaliableTypes['DropDownList'] = get_string('stackInputType_dropdownlist', 'stack', ''); ! $this->avaliableTypes['Matrix'] = get_string('stackInputType_matrix', 'stack', ''); ! $this->avaliableTypes['List'] = get_string('stackInputType_list', 'stack', ''); ! $this->avaliableTypes['Textarea'] = get_string('stackInputType_Textarea', 'stack', ''); // We currently don't allow strings to be passed to the CAS, so remove this type. ! //$this->avaliableTypes['String'] = get_string('stackInputType_String', 'stack', ''); // Currently there are too many bugs with DragMath - so don't offer it! //$this->avaliableTypes['Dragmath with input box'] = get_string('stackInputType_dragmathInputBox', 'stack', ''); --- 111,131 ---- $this->answerBox = new TextArea($name, $width, $default, $maxLength, $height, $param); break; + + case 'Slider': + $this->answerBox = new Slider($name, $width, $default, $maxLength, $height, $param); + break; } } //set list of avaliable input types, in a format that can be translated ! $this->availableTypes['Algebraic Input'] = get_string('stackInputType_Algebraic', 'stack', ''); ! $this->availableTypes['True/False'] = get_string('stackInputType_truefalse', 'stack', ''); ! $this->availableTypes['Single Character'] = get_string('stackInputType_singlechar', 'stack', ''); ! $this->availableTypes['DropDownList'] = get_string('stackInputType_dropdownlist', 'stack', ''); ! $this->availableTypes['Matrix'] = get_string('stackInputType_matrix', 'stack', ''); ! $this->availableTypes['List'] = get_string('stackInputType_list', 'stack', ''); ! $this->availableTypes['Textarea'] = get_string('stackInputType_Textarea', 'stack', ''); ! $this->availableTypes['Slider'] = get_string('stackInputType_slider', 'stack', ''); // We currently don't allow strings to be passed to the CAS, so remove this type. ! //$this->availableTypes['String'] = get_string('stackInputType_String', 'stack', ''); // Currently there are too many bugs with DragMath - so don't offer it! //$this->avaliableTypes['Dragmath with input box'] = get_string('stackInputType_dragmathInputBox', 'stack', ''); *************** *** 166,170 **** //display a drop down list $widget = '<select name="'.$prefix.'">'; ! foreach($this->avaliableTypes as $key => $val) { //if indexed array of values, use val for both display and return --- 172,176 ---- //display a drop down list $widget = '<select name="'.$prefix.'">'; ! foreach($this->availableTypes as $key => $val) { //if indexed array of values, use val for both display and return *************** *** 222,226 **** return $this->answerBox->transform($in); } - } ?> \ No newline at end of file --- 228,280 ---- return $this->answerBox->transform($in); } + public function getTestPostData($in) + { + return $this->answerBox->getTestPostData($in); + } + + /** + * Return array of arrays for each IT to be used by authoring interface. + */ + public static function getOptionsUsed() + { + // HTML option values mapping to array of options to be shown + $used['Algebraic Input'] = AlgebraIT::getOptionsUsed(); + //$used['DragMathAppletOnly'] = DragMathAppletOnly::getOptionsUsed(); + //$used['DragMathInputBox'] = DragMathInputBox::getOptionsUsed(); + $used['Single Character'] = SingleCharIT::getOptionsUsed(); + //$used['StringIT'] = StringIT::getOptionsUsed(); + $used['True/False'] = TrueFalseIT::getOptionsUsed(); + $used['DropDownList'] = DropDownList::getOptionsUsed(); + $used['Matrix'] = Matrix::getOptionsUsed(); + $used['List'] = ListIT::getOptionsUsed(); + $used['Textarea'] = TextArea::getOptionsUsed(); + $used['Slider'] = Slider::getOptionsUsed(); + + foreach($used as $type => $value) { + $used[$type][] = 'inputType'; // obviously required for all + } + + return $used; + } + + /** + * Return array of arrays for each IT to be used by authoring interface. + */ + public static function getOptionDefaults() { + $defaults['Algebraic Input'] = AlgebraIT::getOptionDefaults(); + //$defaults['DragMathAppletOnly'] = DragMathAppletOnly::getOptionDefaults(); + //$defaults['DragMathInputBox'] = DragMathInputBox::getOptionDefaults(); + $defaults['Single Character'] = SingleCharIT::getOptionDefaults(); + //$defaults['StringIT'] = StringIT::getOptionDefaults(); + $defaults['True/False'] = TrueFalseIT::getOptionDefaults(); + $defaults['DropDownList'] = DropDownList::getOptionDefaults(); + $defaults['Matrix'] = Matrix::getOptionDefaults(); + $defaults['List'] = ListIT::getOptionDefaults(); + $defaults['Textarea'] = TextArea::getOptionDefaults(); + $defaults['Slider'] = Slider::getOptionDefaults(); + + return $defaults; + } + } ?> \ No newline at end of file Index: ListIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/ListIT.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ListIT.php 1 Feb 2010 14:27:05 -0000 1.6 --- ListIT.php 30 Sep 2010 16:56:13 -0000 1.7 *************** *** 274,278 **** foreach($randomSet as $id) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" />'.$displayVals[$id]['list_display']."<br />\n"; } } else { --- 274,278 ---- foreach($randomSet as $id) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" />'.stripslashes($displayVals[$id]['list_display'])."<br />\n"; } } else { *************** *** 282,290 **** if($this->default == $displayVals[$id]['list_label']) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" checked />'.$displayVals[$id]['list_display']."<br />\n"; } else { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" />'.$displayVals[$id]['list_display']."<br />\n"; } } --- 282,290 ---- if($this->default == $displayVals[$id]['list_label']) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" checked />'.stripslashes($displayVals[$id]['list_display'])."<br />\n"; } else { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" />'.stripslashes($displayVals[$id]['list_display'])."<br />\n"; } } *************** *** 402,406 **** foreach ($ans_array as $key=>$val) { ! $post_data[] = array($this->name.'-'.$key=>$val); } } --- 402,406 ---- foreach ($ans_array as $key=>$val) { ! $post_data[$this->name.'-'.$key] = $val; } } *************** *** 447,450 **** --- 447,454 ---- } } + + public static function getOptionsUsed() { + return array('teacherAns', 'studentVerify', 'hideFeedback'); + } } ?> \ No newline at end of file Index: TrueFalseIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/TrueFalseIT.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TrueFalseIT.php 27 Aug 2009 16:23:00 -0000 1.9 --- TrueFalseIT.php 30 Sep 2010 16:56:13 -0000 1.10 *************** *** 124,127 **** --- 124,153 ---- } + + /** + * Returns an array of all options that are relevant to this type (overiding ALL options) + * Used to determine which options to show in authoring, for example. + * String keys MUST match QuestionPart variable names. + * + * @access public + * @return Array(String) + */ + public static function getOptionsUsed() + { + return array('teacherAns', 'studentVerify', 'hideFeedback'); + } + + /** + * Returns the default options. + * Only need to specify where they differ from QuestionPart defaults, so does not contain all used options (see setUsedoptions()) + * String keys MUST match QuestionPart variable names. + * + * @param array $param + * @access public + * @return Array(StackOption) + */ + public static function getOptionDefaults() { + return array('studentVerify'=>'false', 'hideFeedback'=>'true'); + } } |
Update of /cvsroot/stack/stack-dev/lib/reporting In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/reporting Modified Files: StackReport.php ReportWidgets.php MarksAttempt.php UserAttempts.php Added Files: SkillsResources.php json.php DiagnosticReport.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) --- NEW FILE: SkillsResources.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Chris Sangwin (C.J...@bh...) * * @package stackReport */ class SkillsResources { private $stackurl; private $skills; private $skillTags; private $skillMajor; private $resources; private $resourceMap; public function __construct($url) { $this->stackurl = $url; $this->loadSkills(); $this->loadResources(); } private function loadSkills() { $skills = array(); $skills['LOG'] = 'Logic'; $skills['FOR'] = 'Using conventional forms of notation'; $skills['NUM'] = 'Number'; $skills['NUM-REL'] = 'Relative size'; $skills['NUM-RTP'] = 'Ratio / Proportion'; $skills['NUM-FRC'] = 'Fractions'; $skills['NUM-DEC'] = 'Decimals'; $skills['NUM-IND'] = 'Indices'; $skills['NUM-NEG'] = 'Negative Numbers'; $skills['ART'] = 'Arithmetic Operations'; $skills['ART-ADD'] = 'Addition'; $skills['ART-SUB'] = 'Subtraction'; $skills['ART-MUL'] = 'Multiplication'; $skills['ART-DIV'] = 'Division'; $skills['ART-RUL'] = 'Rules'; $skills['ALG'] = 'Algebra'; $skills['ALG-GNO'] = 'Generalised number'; $skills['ALG-VAR'] = 'Variable'; $skills['ALG-FEQ'] = 'Forming Equations'; $skills['ALG-TRN'] = 'Transposition'; $skills['ALG-UNC'] = 'Unclosed Forms'; $skills['ALG-GAT'] = 'Gathering of like terms'; $skills['ALG-SMP'] = 'Simplification'; $skills['ALG-EXB'] = 'Expand Brackets'; $skills['ALG-FAC'] = 'Factorisation'; $skills['ALG-RSD'] = 'Rationalisation of Surds'; $skills['ALG-BEX'] = 'Binomial Expansion'; $skills['ALG-SPF'] = 'Simple Partial Fractions'; $skills['ALG-RPF'] = 'Partial Fractions involving a repeated term'; $skills['ALG-QPF'] = 'Partial Fractions involving a quadratic term'; $skills['ALG-IPF'] = 'Improper Partial Fractions'; $skills['EST'] = 'Estimation'; $skills['EST-EST'] = 'Estimating'; $skills['EST-RND'] = 'Rounding'; $skills['EQN'] = 'Equations'; $skills['EQN-LIN'] = 'Solve Linear Equations'; $skills['EQN-SIM'] = 'Solve Simultaneous Equations'; $skills['EQN-QUD'] = 'Solve Quadratic Equations'; $skills['EQN-INQ'] = 'Solve Inequations'; $skills['WRP'] = 'Analysis of Word Problems'; $skills['FNC'] = 'Functions'; $skills['FNC-EVL'] = 'Evaluate a function'; $skills['FNC-CMP'] = 'Composite Functions'; $skills['FNC-INV'] = 'Inverse Functions'; $skills['FNC-MOD'] = 'Modulus Functions'; $skills['FNC-HYP'] = 'Hyperbolic Functions'; $skills['GEO'] = 'Geometry'; $skills['GEO-CRD'] = 'Coordinates'; $skills['GEO-DST'] = 'Distances'; $skills['GEO-GRD'] = 'Gradients'; $skills['GEO-EQL'] = 'Equations of lines'; $skills['GEO-ANM'] = 'Angular Measure'; $skills['GEO-TRG'] = 'Right-angle Trig'; $skills['GEO-TFN'] = 'Trigonometric Functions'; $skills['GEO-CRC'] = 'Circles'; $skills['GEO-TID'] = 'Trigonometric Identities'; $skills['GRP'] = 'Interpreting Graphs'; $skills['DIG'] = 'Analysis of Diagrams'; $skills['SEQ'] = 'Sequences and Series'; $skills['SEQ-TER'] = 'Terms in Series'; $skills['SEQ-ART'] = 'Arithmetic Series'; $skills['SEQ-ASM'] = 'Partial Sums of arithmetic Series'; $skills['SEQ-GEO'] = 'Geometric Series'; $skills['SEQ-SGM'] = 'Partial Sums of Geometric Series'; $skills['SEQ-SNF'] = 'Sum to Infinity of Geometric Series'; $skills['SEQ-BIS'] = 'Binomial Series'; $skills['LGE'] = 'Logarithms and Exponentials'; $skills['LGE-EXP'] = 'Exponential Function'; $skills['LGE-LWE'] = 'Laws of Exponentials'; $skills['LGE-LOG'] = 'The Logarithmic Function'; $skills['LGE-LLG'] = 'Laws of Logarithms'; $skills['DIF'] = 'Differentiation'; $skills['DIF-CON'] = 'Concept of Differentiation'; $skills['DIF-TAN'] = 'Gradient of Tangent'; $skills['DIF-MON'] = 'Derivative of monomial'; $skills['DIF-POL'] = 'Derivative of Polynomial'; $skills['DIF-MXN'] = 'Maxima and Minima'; $skills['DIF-EXP'] = 'Derivative of Exponential'; $skills['DIF-LOG'] = 'Derivative of Logarithm'; $skills['DIF-TAB'] = 'Table of Derivatives'; $skills['DIF-PRD'] = 'Product Rule'; $skills['DIF-QUT'] = 'Quotient Rule'; $skills['DIF-CHN'] = 'Chain Rule'; $skills['DIF-TRG'] = 'Derivatives of Trig Functions'; $skills['DIF-IMP'] = 'Implicit Differentiation'; $skills['DIF-PRM'] = 'Parametric Differentiation'; $skills['INT'] = 'Integration'; $skills['INT-CON'] = 'Concept and constant of integration'; $skills['INT-DEF'] = 'Definite Integrals'; $skills['INT-MON'] = 'Integrals of monomials'; $skills['INT-POL'] = 'Integrals of polynomials and sums'; $skills['INT-TRG'] = 'Integrals of trig functions'; $skills['INT-EXP'] = 'Integrals of exponential functions'; $skills['INT-XM1'] = 'Integrals of 1/x'; $skills['INT-AUC'] = 'Area under curve'; $skills['INT-ABC'] = 'Area between curves'; $skills['INT-PRT'] = 'Integration by parts'; $skills['INT-SUB'] = 'Integration by substitution'; $skills['INT-VSR'] = 'Volume of Solid of Revolution'; $skills['VEC'] = 'Vectors'; $skills['VEC-ADD'] = 'Vector Addition'; $skills['VEC-SUB'] = 'Vector Subtraction'; $skills['VEC-VXS'] = 'Vector Multiplied by Scalar'; $skills['VEC-PNT'] = 'Vector from point to point'; $skills['VEC-MAG'] = 'Magnitude of Vector'; $skills['VEC-UNT'] = 'Unit Vector'; $skills['VEC-EQL'] = 'Vector Equation of Line'; $skills['VEC-SCP'] = 'Scalar Product'; $skillTags = array_keys($skills); $skillMajor = array(); foreach ($skillTags as $skill) { if (strstr($skill, '-') !== false) { $skillMajor[]=$skill; } } $this->skills = $skills; $this->skillMajor = $skillMajor; $this->skillTags = $skillTags; } // end loadSkills() private function loadResources() { // title // url // skills (as comma separated list) // type, e.g. pdf, video, etc. // $resources[] = $this->constructResource('','','',''); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The Chain Rule','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_5.pdf','DIF-CHN','pdf'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The Chain Rule','','DIF-CHN','pdf'); $resources[] = $this->constructResource('Simultaneous equations','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-simult-2009-1.pdf','EQN-SIM','pdf'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Simultaneous equations','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_13.pdf','EQN-SIM','pdf'); $resources[] = $this->constructResource('Factoring simple expressions','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-factorsimple-2009-1.pdf','ALG-FAC','pdf'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Factoring simple expressions','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_5.pdf','ALG-FAC','pdf'); $resources[] = $this->constructResource('Decimals','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-decimals-2009-1.pdf','NUM-DEC','pdf'); $resources[] = $this->constructResource('Introduction to differentiation','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-introtodiff-2009-1.pdf','DIF-CON','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Introduction to differentiation','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_1.pdf','DIF-CON','PDF'); $resources[] = $this->constructResource('Expanding or removing brackets','http://www.mathcentre.ac.uk/resources/Algebra%20leaflets/mc-expandbrack-2009-1.pdf','ALG-EXB','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The exponential constant e','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/3_4.pdf','LGE-EXP','PDF'); $resources[] = $this->constructResource('The exponential constant e','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-expconstant-2009-1.pdf','LGE-EXP','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The logarithm function','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/3_7.pdf','LGE-LOG','PDF'); $resources[] = $this->constructResource('Factorising quadratics','http://www.mathcentre.ac.uk/resources/Algebra%20leaflets/mc-factorisingquadratics-2009-1.pdf','ALG-FAC','PDF'); $resources[] = $this->constructResource('Fractions','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-fractions-2009-1.pdf','NUM-FRC','PDF'); $resources[] = $this->constructResource('Addition and subtraction of fractions','http://www.mathcentre.ac.uk/resources/leaflets/mathcentre/business/mc-bus-addsub-2009-1.pdf','NUM-FRC','PDF'); $resources[] = $this->constructResource('Multiplication and division of fractions','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-mult-and-div-2009-1.pdf','NUM-FRC','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The hyperbolic functions','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/3_5.pdf','FNC-HYP','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The hyperbolic identities','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/3_6.pdf','FNC-HYP','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Integration as summation','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_12.pdf','INT-CON','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Integration as the reverse of differentiation','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_6.pdf','INT-CON','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Integration by parts','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_10.pdf','INT-PRT','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Integration by substitution','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_11.pdf','INT-SUB','PDF'); $resources[] = $this->constructResource('The equation of a straight line','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-slope-2009-1.pdf','GEO-EQL','PDF'); $resources[] = $this->constructResource('Logarithms','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-logarithms-2009-1.pdf','LGE-LOG','PDF'); $resources[] = $this->constructResource('The laws of logarithms','http://www.mathcentre.ac.uk/resources/Algebra%20leaflets/mc-logs2-2009-1.pdf','LGE-LLG','PDF'); $resources[] = $this->constructResource('Sigma notation','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-sigma-2009-1.pdf','SEQ','PDF'); $resources[] = $this->constructResource('The modulus of a number','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/1_5.pdf','FNC-MOD','PDF'); $resources[] = $this->constructResource('Approaching Numeracy as an Adult','http://www.mathcentre.ac.uk/resources/uploaded/mccp-samuels-refno1.pdf','ART','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Partial Fractions 1','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_23.pdf','ALG-RPF,ALG-QPF,ALG-SPF','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Partial Fractions 2','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_24.pdf','ALG-RPF,ALG-QPF','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Partial Fractions 3','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_25.pdf','ALG-IPF','PDF'); $resources[] = $this->constructResource('Percentages','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-percentage-2009-1.pdf','NUM','PDF'); $resources[] = $this->constructResource('Indices or Powers','http://www.mathcentre.ac.uk/resources/Algebra%20leaflets/mc-indices1-2009-1.pdf','NUM-IND','PDF'); $resources[] = $this->constructResource('Negative and fractional powers','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-negfracpower-2009-1.pdf','NUM-IND','PDF'); $resources[] = $this->constructResource('Laws of indices','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-lawsindices-2009-1.pdf','NUM-IND','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Product and quotient rules','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_4.pdf','DIF-PRD,DIF-QUT','PDF'); $resources[] = $this->constructResource('Pythagoras theorem','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/4_5.pdf','GEO','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Degrees and radians','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/4_1.pdf','GEO-ANM','PDF'); $resources[] = $this->constructResource('Ratios','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-ratios-2009-1.pdf','NUM-RTP','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Addition and subtraction','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-ratios-2009-1.pdf','ART-ADD,ART-SUB','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Multiplication and division','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_9.pdf','ART-MUL,ART-DIV','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Evaluating definite integrals','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_9.pdf','INT-DEF','PDF'); $resources[] = $this->constructResource('What is a function?','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-function-2009-1.pdf','FNC','PDF'); $resources[] = $this->constructResource('x-y plots','http://www.mathcentre.ac.uk/resources/mc-healthsciences/mc-xyplots-2009-1.pdf','FNC','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Inequalities','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_16.pdf','EQN-INQ','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Graphical solution of inequalities','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_18.pdf','EQN-INQ','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Quadratic equations 1','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_14.pdf','EQN-QUD','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Quadratic equations 2','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_15.pdf','EQN-QUD','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Rearranging formulas 1','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_10.pdf','ALG-TRN,EQN-LIN','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Rearranging formulas 2','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_11.pdf','ALG-TRN','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: What is a surd?','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_27.pdf','ALG-RSD','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Scientific notation','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/1_3.pdf','FOR,NUM-DEC,NUM-IND','PDF'); $resources[] = $this->constructResource('Symbols','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-symbols-2009-1.pdf','FOR','PDF'); $resources[] = $this->constructResource('Rearranging formulas 1','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-formulas1-2009-1.pdf','ALG-TRN','PDF'); $resources[] = $this->constructResource('Rearranging formulas 2','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-formulas2-2009-1.pdf','ALG-TRN','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Graphs of the trig functions','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/4_3.pdf','GEO-TFN','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Trigonometrical Identities','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/4_4.pdf','GEO-TID','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Evaluating definite integrals','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_9.pdf','INT-DEF','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Linearity rules of integration','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_8.pdf','INT-POL','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Table of Integrals','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_7.pdf','INT','PDF'); $resources[] = $this->constructResource('Table of derivatives','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-tableofderiv-2009-1.pdf','DIF','PDF'); $resources[] = $this->constructResource('Teach Yourself Workbook: The Chain Rule','http://www.mathcentre.ac.uk/resources/uploaded/mc-ty-chain-2009-1.pdf','DIF-CHN','pdf'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The Chain Rule','http://www.mathcentre.ac.uk/video/405','DIF-CHN','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The Product Rule','http://www.mathcentre.ac.uk/video/404','DIF-PRD','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The Quotient Rule','http://www.mathcentre.ac.uk/video/403','DIF-QUT','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The standard functions','http://www.mathcentre.ac.uk/video/402','DIF','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The derivatives of further functions','http://www.mathcentre.ac.uk/video/409','DIF','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: Parametric Differentiation','http://www.mathcentre.ac.uk/video/406','DIF-PRM','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: Implicit Differentiation','http://www.mathcentre.ac.uk/video/408','DIF-IMP','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: Equation of the tangent line','http://www.mathcentre.ac.uk/video/410','DIF-TAN','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The area under a curve','http://www.mathcentre.ac.uk/video/412','INT-AUC','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The anti-derivative','http://www.mathcentre.ac.uk/video/413','INT-CON','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: Mathematical language','http://www.mathcentre.ac.uk/video/294','FOR','video'); $resourceMap = array(); foreach ($resources as $res) { foreach ($res['skill'] as $tskill) { $resourceMap[$tskill][] = array('title'=>$res['title'],'URL'=>$res['URL'],'type'=>$res['type']); } } $this->resources=$resources; $this->resourceMap=$resourceMap; } // end loadResources() private function constructResource($title,$URL,$skills,$type) { $res['title'] = $title; $res['URL'] = $URL; $skills=explode(',',$skills); foreach ($skills as $skill) { $res['skill'][] = trim(strtoupper($skill)); } $res['type'] = strtoupper($type); return $res; } private function typeToIcon($type) { if ('PDF'==$type) { $icon = 'page_white_acrobat.png'; } else if ('VIDEO'==$type) { $icon = 'page_white_camera.png'; } else { $icon = 'page_white_go.png'; } return $icon; } private function getDiagnosticQuestions($keyword) { $db = new StackDBADOdb(); $db -> connect(); // Ought to go via StackDBItem, really! $sql = "SELECT questionID, questionName FROM stackquestion, question_keyword, keywords, question_lines WHERE (keyword LIKE ".$db->dbSafeString($keyword)." ) AND (question_keyword.kwid = keywords.id) AND (question_keyword.qid = stackquestion.questionID) AND (stackquestion.line = question_lines.id) AND (stackquestion.questionID = question_lines.latestVersion) ORDER BY stackquestion.questionID"; $query = $db->query($sql); $result=array(); foreach($query as $row) { $result[] = array($row[0],$row[1]); } return $result; } private function getDiagnosticStems($keyword) { $db = new StackDBADOdb(); $db -> connect(); // Ought to go via StackDBItem, really! $sql = "SELECT stackquestion.questionID, stackquestion.questionName, display_cache.xhtml FROM question_keyword, keywords, display_cache, display_cache_sequence, question_lines, stackquestion WHERE (keyword LIKE ".$db->dbSafeString($keyword)." ) AND (question_keyword.kwid = keywords.id) AND (stackquestion.line = question_lines.id) AND (stackquestion.questionID = question_keyword.qid) AND (stackquestion.questionID = question_lines.latestVersion) AND (stackquestion.questionID = display_cache.qID) AND (display_cache_sequence.nextNode = display_cache.id) AND (display_cache_sequence.event = 0)"; $query = $db->query($sql); $result=array(); foreach($query as $row) { $result[$row[0]] = array($row[1],$row[2]); } return $result; } private function getQuestionStem($qname) { $db = new StackDBADOdb(); $db -> connect(); $sql = "SELECT stackquestion.questionID,stackquestion.questionName, display_cache.xhtml FROM display_cache, display_cache_sequence, question_lines, stackquestion WHERE (stackquestion.questionName = ".$db->dbSafeString($qname).") AND (stackquestion.line = question_lines.id) AND (stackquestion.questionID = question_lines.latestVersion) AND (stackquestion.questionID = display_cache.qID) AND (display_cache_sequence.nextNode = display_cache.id) AND (display_cache_sequence.event = 0)"; $query = $db->query($sql); $result=array(); foreach($query as $row) { $result = array($row[0],$row[1],$row[2]); } return $result; } private function getSkillsResources($qid){ $kwdb = new StackDBKeywords(); $kwdb->connect(); $keywords = $kwdb->getQuestionsKeywords($qid); $skills = array(); if(!empty($keywords)) { asort($keywords); foreach($keywords as $keyword) { if (in_array($keyword,$this->skillTags)) { $skills[]=$keyword; } } } return $skills; } public function generateSkillsTable(){ $skillsTable="<ol><ol>\n"; foreach ($this->skills as $skill => $name) { $res_links=''; if (array_key_exists($skill,$this->resourceMap)) { foreach($this->resourceMap[$skill] as $res) { $rtitle = $res['title']; $rurl = $res['URL']; $icon = $this->typeToIcon($res['type']); $res_links .= '<a target="_blank" href="'.$rurl.'"><img border=0 alt="'.$rtitle.'" src="'.$icon.'" /></a>'; } } $questions = $this->getDiagnosticQuestions($skill); $qno = count($questions); $links = ''; if (0==$qno) { $col = '#FF3300'; } else { $col = '#000000'; foreach($questions as $question) { $qid = $question[0]; $qname = $question[1]; $links .= ' <a target="_blank" href="'.$this->stackurl.'/lib/ui/questionTest.php?id='.$qid.'"><img border=0 src="'.$this->stackurl.'/pix/eye.png" title="'.$qname.'" alt="'.$qname.'" /></a>'."\n "; } } if (strstr($skill, '-') !== false) { $skillsTable .= " <li><font color='$col'>$name ($skill)</font> $qno $res_links $links</li>\n"; } else { $skillsTable .= "</ol>\n <li><b><font color='$col'>$name ($skill)</font></b> $qno $res_links $links</li>\n<ol>\n"; } } $skillsTable.="</ol></ol>\n\n\n"; return $skillsTable; } public function generateQuiz($quizlist){ $questions = $this->getDiagnosticStems('diagnostic'); $kwdb = new StackDBKeywords(); $kwdb->connect(); $quiz=''; foreach ($questions as $qid => $question) { $quiz.= "<font size=+2><b>($qid) {$question[0]}</b>:</font> <font color=orange>"; $keywords = $kwdb->getQuestionsKeywords($qid); if(!empty($keywords)) { asort($keywords); $firstKeyword = true; foreach($keywords as $keyword) { if(!$firstKeyword) { $quiz.= ', '; } else $firstKeyword = false; $quiz.= $keyword; } } $quiz.= "</font>"; $quiz.= "<p>".$question[1]."</p>"; $quiz.= "<p><hr /></p>"; } return $quiz; } public function generateWikiPage() { $wiki=''; foreach ($this->skills as $skill => $name) { if (strstr($skill, '-') !== false) { $wiki.= "## $name ($skill)\n"; } else { $wiki.= "# $name ($skill)\n"; } } return $wiki; } public function generateLaTeX() { $tot = 0; $toplevelonly = TRUE; $LaTeX="\begin{enumerate}\n"; foreach ($this->skills as $skill => $name) { if (strstr($skill, '-') !== false) { $tot ++; $toplevelonly = TRUE; $LaTeX.= " \item $name ($skill)\n"; } else { if ($toplevelonly) { $tot ++; } $toplevelonly = FALSE; $LaTeX.= "\end{enumerate}\n \item $name ($skill)\n \begin{enumerate}\n"; } } $LaTeX.=" \end{enumerate}\n\end{enumerate}"; return $LaTeX.$tot; } public function generateTestedSkillsPage($test) { $skills_tested=array(); $skillsTable='<h2>Test questions</h2>'; $skillsTable.='<ol>'; foreach ($test as $qname){ $qid = getQuestionID($qname); $qskills = $this->getSkillsResources($qid); $link = ' <a target="_blank" href="'.$this->stackurl.'/lib/ui/questionTest.php?id='.$qid.'"><img border=0 src="'.$this->stackurl.'/pix/eye.png" title="'.$qname.'" alt="'.$qname.'" /></a>'."\n "; $sk = ''; if (empty($qskills)){ $sk = 'NONE! '; } else { foreach($qskills as $qskill){ $skills_tested[$qskill]++; $sk .= $qskill.' '; } } $skillsTable.= '<li>'.$qname.' ('.$qid.') '.$sk.' '.$link.' </li>'; } $skillsTable.='</ol>'; $skillsTable.='<h2>Skills tested</h2>'; $skillsTable.="<ol><ol>\n"; foreach ($this->skills as $skill => $name) { if (array_key_exists($skill,$skills_tested)) { $col = '#000000'; $qnum = $skills_tested[$skill]; } else { $col = '#FF3300'; $qnum = ''; } if (strstr($skill, '-') !== false) { $skillsTable .= " <li><font color='$col'>$name ($skill) $qnum </font></li>\n"; } else { $skillsTable .= "</ol>\n <li><b><font color='$col'>$name ($skill)</b> $qnum </font></li>\n<ol>\n"; } } $skillsTable.="</ol></ol>\n\n\n"; // Generate the text of the quiz. $quiz=''; foreach ($test as $qname){ $question = $this->getQuestionStem($qname); $quiz.= "<h2><b>($question[0]) {$question[1]}</b>:</h2>"; $quiz.= "<p>".$question[2]."</p>"; $quiz.= "<p><hr /></p>"; } $skillsTable .= $quiz; return $skillsTable; } public function getSkills() { return $this->skills; } // return a (ranked?) list of resources for the passed skills public function getResourcesForSkills($skills) { $return = array(); foreach($skills as $skill) { if(!empty($this->resourceMap[$skill])) $return[] = $this->resourceMap[$skill]; } return $return; } } Index: MarksAttempt.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/reporting/MarksAttempt.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MarksAttempt.php 27 Aug 2009 16:23:01 -0000 1.5 --- MarksAttempt.php 30 Sep 2010 16:56:15 -0000 1.6 *************** *** 17,197 **** */ ! /** ! * Class for holding and sorting marks from a report ! * ! * @author ! * @version ! * @copyright ! */ ! class MarksAttempt { ! // Attributes ! /** ! * ! * ! * @var int ! * @access private ! */ ! private $userID; ! ! /** ! * ! * ! * @var int ! * @access private ! */ ! private $questionID; ! ! /** ! * ! * ! * @var array ! * @access private ! */ ! private $attempt; ! ! private $noPartAttempts; ! ! private $noAttempts; ! ! // Associations ! // Operations ! /** ! * ! * ! * @param int $userID ! * @param $questionID ! * @access public ! */ ! public function __construct($userID, $questionID) ! { ! $this->userID = $userID; ! $this->questionID = $questionID; ! $this->noAttempts = 0; ! $this->noPartAttempts = 0; ! } ! ! /** ! * ! * ! * @return array ! * @access public ! */ ! public function getAttempts() ! { ! return $this->attempt; ! } ! ! /** ! * ! * ! * @return array ! * @access public ! */ ! public function getLastAttempt() ! { ! if(!empty($this->attempt)) ! { ! $attemptIds = array_keys($this->attempt); ! rsort($attemptIds); //reverse sort ! $id = $attemptIds[0]; ! $value = $this->attempt[$id]; ! return array($id => $value); ! } ! else ! { ! return NULL; ! } ! } ! ! public function lastAttemptNoParts() ! { ! $last = $this->getLastAttempt(); ! if($last != NULL) ! { ! foreach($last as $l) ! { ! $count = count($l); ! //echo 'COUNT: '.$count; ! return $count; ! } ! ! } ! else ! { ! return NULL; ! } ! ! } ! ! /** ! * ! * ! * @return array ! * @access public ! */ ! public function getFirstAttempt() ! { ! if(!empty($this->attempt)) ! { ! $attemptIds = array_keys($this->attempt); ! sort($attemptIds); ! $id = $attemptIds[0]; ! $value = $this->attempt[$id]; ! return array($id => $value); ! } ! else ! { ! return NULL; ! } ! } ! ! public function firstAttemptNoParts() ! { ! $first = $this->getFirstAttempt(); ! if($first != NULL) ! { ! foreach($first as $f) ! { ! $count = count($f); ! //echo 'COUNT: '.$count; ! return $count; ! } ! ! } ! else ! { ! return NULL; ! } ! ! } ! ! /** ! * ! * ! * @param int $attemptID ! * @param string $PRTName ! * @param float $rawmark ! * @param float $modmark ! * @return void ! * @access public ! */ ! public function addAttempt($attemptID, $PRTName, $rawmark, $modmark) ! { ! $this->attempt[$attemptID][$PRTName] = array('RawMark' => $rawmark, 'ModMark' => $modmark); ! $this->noPartAttempts++; ! } ! ! ! public function noPartAttempts() ! { ! return $this->noPartAttempts; ! } ! ! public function noAttempts() ! { ! return count($this->attempt); ! } ! ! } ?> \ No newline at end of file --- 17,199 ---- */ ! // It is believed that this entire file is legacy code. ! // ! // /** ! // * Class for holding and sorting marks from a report ! // * ! // * @author ! // * @version ! // * @copyright ! // */ ! // class MarksAttempt { ! // // Attributes ! // /** ! // * ! // * ! // * @var int ! // * @access private ! // */ ! // private $userID; ! // ! // /** ! // * ! // * ! // * @var int ! // * @access private ! // */ ! // private $questionID; ! // ! // /** ! // * ! // * ! // * @var array ! // * @access private ! // */ ! // private $attempt; ! // ! // private $noPartAttempts; ! // ! // private $noAttempts; ! // ! // // Associations ! // // Operations ! // /** ! // * ! // * ! // * @param int $userID ! // * @param $questionID ! // * @access public ! // */ ! // public function __construct($userID, $questionID) ! // { ! // $this->userID = $userID; ! // $this->questionID = $questionID; ! // $this->noAttempts = 0; ! // $this->noPartAttempts = 0; ! // } ! // ! // /** ! // * ! // * ! // * @return array ! // * @access public ! // */ ! // public function getAttempts() ! // { ! // return $this->attempt; ! // } ! // ! // /** ! // * ! // * ! // * @return array ! // * @access public ! // */ ! // public function getLastAttempt() ! // { ! // if(!empty($this->attempt)) ! // { ! // $attemptIds = array_keys($this->attempt); ! // rsort($attemptIds); //reverse sort ! // $id = $attemptIds[0]; ! // $value = $this->attempt[$id]; ! // return array($id => $value); ! // } ! // else ! // { ! // return NULL; ! // } ! // } ! // ! // public function lastAttemptNoParts() ! // { ! // $last = $this->getLastAttempt(); ! // if($last != NULL) ! // { ! // foreach($last as $l) ! // { ! // $count = count($l); ! // //echo 'COUNT: '.$count; ! // return $count; ! // } ! // ! // } ! // else ! // { ! // return NULL; ! // } ! // ! // } ! // ! // /** ! // * ! // * ! // * @return array ! // * @access public ! // */ ! // public function getFirstAttempt() ! // { ! // if(!empty($this->attempt)) ! // { ! // $attemptIds = array_keys($this->attempt); ! // sort($attemptIds); ! // $id = $attemptIds[0]; ! // $value = $this->attempt[$id]; ! // return array($id => $value); ! // } ! // else ! // { ! // return NULL; ! // } ! // } ! // ! // public function firstAttemptNoParts() ! // { ! // $first = $this->getFirstAttempt(); ! // if($first != NULL) ! // { ! // foreach($first as $f) ! // { ! // $count = count($f); ! // //echo 'COUNT: '.$count; ! // return $count; ! // } ! // ! // } ! // else ! // { ! // return NULL; ! // } ! // ! // } ! // ! // /** ! // * ! // * ! // * @param int $attemptID ! // * @param string $PRTName ! // * @param float $rawmark ! // * @param float $modmark ! // * @return void ! // * @access public ! // */ ! // public function addAttempt($attemptID, $PRTName, $rawmark, $modmark) ! // { ! // $this->attempt[$attemptID][$PRTName] = array('RawMark' => $rawmark, 'ModMark' => $modmark); ! // $this->noPartAttempts++; ! // } ! // ! // ! // public function noPartAttempts() ! // { ! // return $this->noPartAttempts; ! // } ! // ! // public function noAttempts() ! // { ! // return count($this->attempt); ! // } ! // ! // } ?> \ No newline at end of file --- NEW FILE: DiagnosticReport.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Simon Hammond (s.h...@bh...) * * @package stackReport */ global $config; $root = $config->get('docroot'); //require_once $root.'/lib/dateTime.php'; //require_once $root.'/lib/items/Meta.php'; require_once $root.'/lib/database/StackDBReporting.php'; require_once $root.'/lib/database/MoodleDB.php'; require_once $root.'/lib/database/StackDBAttemptPRTMeta.php'; //require_once 'QuestionFinder.php'; require_once $root . '/lib/Logger.php'; require_once $root.'/opaque/MoodleDisplayItem.php'; require_once $root . '/lib/reporting/SkillsResources.php'; class DiagnosticReport { /* TODO: * - Get distribution of scores and confidences for skills across all attempts * - Reference mapping of weak/unconfident outcomes to external resources * */ private $skill; private $resources; private $student; private $quiz; //private $answerNotes; public function __construct($student = NULL, $quiz = NULL) { $this->logger = new Logger('DiagnosticReport'); $this->student = $student; $this->quiz = $quiz; $reporting = new StackDBReporting(); //$this->answerNotes = $reporting->studentAnswerNotes($this->student, $this->quiz); $this->loadResources(); } /** * one-to-many or many-to-many mapping? Latter would be nice. * Could even rank them then, based on skills profile. * www.123.com will help you with [NUM] numbers */ private function loadResources() { $skillsResources = new SkillsResources(); $this->skill = $skillsResources->getSkills(); // then learning resource links $this->resources = array(); $this->resources[] = array("Sesame Street Learning About Numbers 4", "http://www.youtube.com/watch?v=Qxm6c7U8gxc", "NUM-ADD"); $this->resources[] = array("BBC - KS2 Bitesize: Maths - Fractions - activity", "http://www.bbc.co.uk/schools/ks2bitesize/maths/number/fractions/play.shtml", "NUM-FRC"); $this->resources[] = array("Wikipedia Numbers", "http://en.wikipedia.org/wiki/Number", "NUM-DEC, NUM-REL, NUM-NEG"); } public function resourcesFor($subskills) { $skillsResources = new SkillsResources(); //$this->logger->debug(print_r($skillsResources->getResourcesForSkills(array('EQN-SIM')), 1)); //$subskills = array('EQN-SIM'); $this->logger->debug("subskills:".print_r($subskills,1)); $resources = $skillsResources->getResourcesForSkills($subskills); return $resources; /* foreach($subskills as $subskill) { foreach($this->resources as $resource) { if(strpos($resource[2], $subskill) !== false) { $toReturn[] = $resource; } } } // sort by frequency return $toReturn;*/ } public function getString($key) { return isset($this->skill[$key]) ? $this->skill[$key] : "[$key]"; } public function display() { $reporting = new StackDBReporting(); $out = "";//"<p>This is a report based on your latest attempts for diagnostic questions.</p>"; // link to quiz-specific results $mdb = new MoodleDB(); $mdb->connect(); $attempts = $mdb->getQuizAttempts($this->student); $quizzes = array_keys($attempts); if($attempts) { // links to each and all quizzes $out .= "<b>Show quiz:</b> <a href='soapPage.php?page=diagnostic'>All</a>, "; foreach($quizzes as $quiz) { $out .= "<a href='soapPage.php?page=diagnostic&quiz=$quiz'>$quiz</a> (".count($attempts[$quiz])." attempts), "; } } if($this->quiz !== NULL) { // possibly restrict to a single quiz $a = $attempts[$this->quiz]; unset($attempts); $attempts[$this->quiz] = $a; } $quizzes = array_keys($attempts); // revise quizzes // going and getting those answer notes $answerNotes = $this->traverseAnswerNotes($attempts); //$answerNotes = array(end($answerNotes));// take last answer only //$out .= "<br>Collated answer notes: ".print_r($answerNotes, 1); // get array of skills mapping to array of subskills mapping to scores foreach($answerNotes as $note) { //$out .= "answernote:".print_r($answer,1); //preg_match("|diagnostic:(.*)|sxi", $note, $m); // indentifier now optional $m = preg_replace('|diagnostic:|sxi', '', $note); if(!empty($m)) { $changes = explode(',', $m);//$m[1]); //$this->logger->debug("CHANGES:".print_r($changes,1)); foreach($changes as $change) { // each skill mark $change = strtoupper($change); //$out .= $change.'<br/>'; /* // assuming format aaa-bbb=n if(preg_match("|^([a-z]{3})-([a-z]{3})[:=](-?\d+)|xi", $change, $m)) { $profile[$m[1]][$m[1].'-'.$m[2]] += $m[3]; } */ // assuming format aaa-bbb-[true|false] if(preg_match("/^([a-z]{3})-([a-z]{3})-(true|false)/xi", $change, $m)) { //$this->logger->debug("M:".print_r($m,1)); if($m[3] == 'TRUE') $value = 1; elseif($m[3] == 'FALSE') $value = -1; $profile[$m[1]][$m[1].'-'.$m[2]] += $value; } // assuming format aaa-[true|false] else if(preg_match("/^([a-z]{3})-(true|false)/xi", $change, $m)) { //$this->logger->debug("M:".print_r($m,1)); if($m[2] == 'TRUE') $value = 1; elseif($m[2] == 'FALSE') $value = -1; $profile[$m[1]][$m[1]] += $value; } } } } //$this->logger->debug("PROFILE:".print_r($profile,1)); // for each skill foreach($profile as $skill => $subskill) { $out .= "<div class='skillBox'>"; // container for graphs $out .= "<table><tr><td>"; // include report $out .= "<h1>".$this->getString($skill)."</h1>"; // include graph // get value bounds $max = max(0, max($subskill)); $min = min(0, min($subskill)); $labels = array(); foreach($subskill as $label => $value) { $labels[] = "'".$this->getString($label)."'"; } $out .= "<div id='chart-$skill' style='height:200px;width:300px; '></div> <script type='text/javascript'> line = [".implode(', ',$subskill)."]; conf = [4,3,1]; plot = $.jqplot('chart-$skill', [line, conf], { seriesDefaults:{ renderer:$.jqplot.BarRenderer, fill:true,fillToZero: true, showMarker: true, pointLabel:true}, legend:{show:true, location:'se'}, series:[ {label:'Feedback sum', renderer:$.jqplot.BarRenderer}, {label:'Confidence (dummy)', renderer:$.jqplot.BarRenderer} ], axes: { xaxis:{renderer:$.jqplot.CategoryAxisRenderer, ticks:[".implode(',',$labels)."]}, yaxis:{padMax:1.3, padMin:1.3, autoscale:true, numberTicks:1, showTicks:false, ticks:[-10, 0, 10]} } //,title: { text: '".$this->getString($skill)."' }, }) </script>"; $out .= "</td><td>"; // textual feedback $out .= "<h3>Raw Scores</h3>"; foreach($subskill as $label => $value) { $out .= $this->getString($label).': '.$value.'<br />'; } $out .= "<h3>Recommended Resources</h3>"; $recommendations = $this->resourcesFor(array_keys($subskill)); if(!empty($recommendations)) { //$out .= print_r($recommendations, 1); $out .= "<ul>"; foreach($recommendations[0] as $recommendation) { $out .= "<li><a href='".$recommendation['URL']."'>".$recommendation['title']."</a></li>"; } $out .= "</ul>"; } else { $out .= "<i>No resources to recommend.</i>"; } $out .= "</td></tr></table>"; $out .= "</div>";// close graph container } // Summary feedback and recommendations return $out; } /** * Returns an array of answer notes for specified map for attempts. * * @access public * @param array attempts map of quiz to attempts. * @return array list of answer notes */ public function traverseAnswerNotes($quizAttempts, $latestOnly = false) { // get ALL answernotes if there are no constraints // otherwise constrain by student // and quiz // or just quiz? $out = array(); $mdb = new MoodleDB(); $mdb->connect(); // will need some db objects... $cache = new StackDBCache(); $cache->connect(); $prtMetaDB = new StackDBAttemptPRTMeta(); $prtMetaDB->connect(); // Remember: this is initially a student-centric report card! $this->logger->debug("quizAttempts:".print_r($quizAttempts, 1)); // get all responses // for each quiz that has been attempted, get the response sequence that comprises that attempt foreach($quizAttempts as $quiz => $quizAttempt) { // for each quiz in scope, get attempts foreach($quizAttempt as $questionAttempts) { // for each quiz attempt // $attemptResponses = $mdb->getAttemptResponses($quizAttempt); // $this->logger->debug("attemptResponses:".print_r($attemptResponses, 1)); // $responses[$quizAttempt] = $attemptResponses['responses']; // $versionForAttempt[$quizAttempt] = $attemptResponses['version']; $questionResponses = $mdb->getQuestionAttemptResponses($questionAttempts); // } // } // parse responses for each attempt and use to traverse the cache, collating the answer notes - either last or all - question by question // attemptResponses would be better named questionResponses //$responses $this->logger->debug("questionResponses:".print_r($questionResponses, 1)); foreach($questionResponses as $question => $response) { // get initial state using randomseed and questionid preg_match('|__randomseed-(\d+)|',$response[0]['answer'], $match); $seed = $match[1]; $state = $cache->selectInitialState($seed, $response['version']); $this->logger->debug("init state: $state"); // iterate through sucessive cache states with parsed responses, collating answernotes $seqNumber = 1; while(isset($response[$seqNumber])) {// $state != NULL or isset($response[$seqNumber]) $this->logger->debug("one step beyond:".print_r($response[$seqNumber], 1)); $step = $response[$seqNumber++]; // decode the response into a post $encodedResponse = $step['answer']; $this->logger->debug('encodedResponse = '.$encodedResponse); $encodedArray = preg_split('/(?<!\\\\)\,/', $encodedResponse); // Split the responses on non-backslash-escaped commas. $post = array(); foreach($encodedArray as $e) { // $this->logger->debug("e = $e"); list($key, $value) = explode('-', $e, 2); $post[$key] = str_replace('\\\\,', ',', $value); } // temporarily insert event to map it $post['event'] = $step['event']; $this->logger->debug('moodle event'.$post['event']); $event = MoodleDisplayItem::mapStackEvent($post); $this->logger->debug("mapped post=".print_r($post,1)); unset($post['event']); unset($post['stackaction']); $transition = $cache->nextTransition($state, $post, $event); $oldstate = $state; $state = $cache->nextNode($transition); //if($state === NULL) $this->logger->critical("STATE IS NULL!"); $this->logger->debug("post: ".print_r($post,1)." with event: $event from state: $oldstate goes to state $state"); $details = $prtMetaDB->getAttemptDetails($state); // get the answer notes from potentially more than one PRT unset($notes);// = array(); foreach($details as $detail) { $notes[] = $detail['AnsNote']; $out[] = $detail['AnsNote']; } $this->logger->debug("notes=".print_r($notes, 1)); //$this->logger->debug("$notes=".print_r($notes, 1)); //$merge = array_merge($out, $notes); // assuming ALL results } $merge = array_merge($merge, $notes); $this->logger->debug("merge=".print_r($notes, 1)); } } }//*/ // return array of answernotes return $out; } } ?> Index: ReportWidgets.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/reporting/ReportWidgets.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ReportWidgets.php 27 Aug 2009 16:23:01 -0000 1.7 --- ReportWidgets.php 30 Sep 2010 16:56:15 -0000 1.8 *************** *** 17,114 **** */ ! /** ! * detailed description ! * ! * @author ! * @version ! * @copyright ! */ ! global $config; $root = $config->get('docroot'); require_once $root.'/lib/translator.php'; class ReportWidgets { ! /** ! * ! * ! * @access public */ ! public function __construct() ! { ! } ! /** ! * Returns xhtml for a selector of which attempts to display (all, scored, last...) ! * @access public ! * @return string ! */ ! public function displayAttemptsSelector($selected=NULL, $name='attemptType') ! { ! $options['all'] = get_string('stackReport_allAttempts','stack'); ! $options['last'] = get_string('stackReport_lastAttempt','stack'); ! $options['firstscored'] = get_string('stackReport_firstScoreAttempt','stack'); ! $options['first'] = get_string('stackReport_firstAttempt','stack'); ! return $this->optionSelector($options, $selected, $name); } ! /** ! * As above, but without 'first scored' ! * ! */ ! public function displayPRTAttemptSelector($selected=NULL, $name='attemptType') ! { ! $options['all'] = get_string('stackReport_allAttempts','stack'); ! $options['last'] = get_string('stackReport_lastAttempt','stack'); ! $options['first'] = get_string('stackReport_firstAttempt','stack'); ! return $this->optionSelector($options, $selected, $name); } ! public function displayStatusSelector($selected=NULL, $name='status') ! { ! $options['all'] = get_string('stackReport_all','stack'); ! $options['null'] = get_string('stackReport_null','stack'); ! $options['valid'] = get_string('stackReport_valid','stack'); ! $options['invalid'] = get_string('stackReport_invalid','stack'); ! $options['score'] = get_string('stackReport_score','stack'); ! $options['solutionSeen'] = get_string('stackReport_score','stack'); ! return $this->optionSelector($options, $selected, $name); ! } ! public function displayMarksSelector($selected=NULL, $name='marks') ! { ! $options['any'] = get_string('stackReport_all','stack'); ! $options['zero'] = get_string('stackReport_zeroMarks','stack'); ! $options['notZero'] = get_string('stackReport_notZeroMarks','stack'); ! $options['notFull'] = get_string('stackReport_notFullMarks','stack'); ! $options['full'] = get_string('stackReport_fullMarks','stack'); ! return $this->optionSelector($options, $selected, $name); } ! private function optionSelector($options, $selected, $name) ! { ! $xhtml .= '<select name="'.$name.'">'; ! foreach($options as $value => $text) ! { ! if($value == $selected) ! { ! $xhtml .= '<option value="'.$value.'" selected="selected">'.$text.'</option>'; ! } ! else ! { ! $xhtml .= '<option value="'.$value.'">'.$text.'</option>'; ! } ! } ! $xhtml .= '</select>'; ! return $xhtml; } } ?> \ No newline at end of file --- 17,149 ---- */ ! global $config; $root = $config->get('docroot'); + require_once $root.'/lib/error.php'; require_once $root.'/lib/translator.php'; + require_once $root.'/lib/database/StackDBReporting.php'; class ReportWidgets { ! ! private $errorlog; ! ! public function __construct() { ! $this->errorLog = new error(); ! } ! ! /** ! * Makes an html selector given an array of value : text pairs. */ ! private function selector($options, $name, $selected = null) { ! $sel .= "<select name=\"$name\">"; ! foreach ($options as $value => $text) { ! $sel .= "<option value=\"$value\"" ! . ($value == $selected ? ' selected="selected"' : '') // Makes the option selected if it's got the right value ! . ">$text</option>\n"; ! } ! $sel .= '</select>'; ! return $sel; } + + /** + * Makes an HTML select element with questions as options + */ + public function questionSelector ($selected = null) { + + $db = new StackDBReporting(); + $qs = $db->questionList(); ! if (!isset($qs)) { ! $options['error'] = 'Couldn\'t get questions'; ! } else { ! foreach ($qs as $q) { ! $options[$q[0]] = $q[0] . ' - ' . substr($q[1], 0, 40); // abreviate the name ! } ! } ! return $this->selector($options, 'questionSelector', $selected); } ! /** ! * Makes an HTML select element with questions as options ! */ ! public function studentSelector ($selected = null) { ! ! $db = new StackDBReporting(); ! $students = $db->studentList(); ! if (!isset($students)) { ! $options['error'] = 'Couldn\'t get students'; ! } else { ! foreach ($students as $s) { ! $options[$s[0]] = $s[0] . ' - ' . $s[2] . ' ' . $s[3]; // abreviate the name ! } ! } + return $this->selector($options, 'studentSelector', $selected); + } ! /** ! * Returns xhtml for a selector of which attempts to display (all, scored, last...) ! */ ! public function attemptsSelector ($selected = null) { ! ! $options['all'] = get_string('stackReport_allAttempts', 'stack'); ! $options['last'] = get_string('stackReport_lastAttempt', 'stack'); ! $options['firstScored'] = get_string('stackReport_firstScoreAttempt', 'stack'); ! $options['first'] = get_string('stackReport_firstAttempt', 'stack'); ! return $this->selector($options, 'attemptsSelector', $selected); } + public function statusSelector($selected) { + + $options['all'] = get_string('stackReport_all','stack'); + $options['null'] = get_string('stackReport_null','stack'); + $options['valid'] = get_string('stackReport_valid','stack'); + $options['invalid'] = get_string('stackReport_invalid','stack'); + $options['score'] = get_string('stackReport_score','stack'); + $options['solutionSeen'] = get_string('stackReport_score','stack'); ! return $this->selector($options, 'statusSelector', $selected); } } + + // It is believed that the rest of this file is legacy code + // + // + // + // /** + // * As above, but without 'first scored' + // * + // */ + // public function displayPRTAttemptSelector($selected=N... [truncated message content] |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:55
|
Update of /cvsroot/stack/stack-dev/lib/items In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/items Modified Files: ItemTests.php StudentAns.php ItemOption.php QuestionPart.php InstantiatedItem.php InteractionElement.php CasTextType.php RawKeyVal.php Item.php Meta.php PotentialResponse.php PotentialResponseTree.php QuestionType.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: InteractionElement.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/InteractionElement.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** InteractionElement.php 27 Aug 2009 16:23:00 -0000 1.9 --- InteractionElement.php 30 Sep 2010 16:56:15 -0000 1.10 *************** *** 106,110 **** */ public function getLabel() ! { return $this->label; } --- 106,110 ---- */ public function getLabel() ! { return $this->label; } *************** *** 117,121 **** */ public function getRawAns() ! { //strip $, ;, or : from answer $str = new stringUtil($this->rawAns); --- 117,121 ---- */ public function getRawAns() ! { //strip $, ;, or : from answer $str = new stringUtil($this->rawAns); *************** *** 130,134 **** */ public function getStatus() ! { return $this->status; } --- 130,134 ---- */ public function getStatus() ! { return $this->status; } *************** *** 141,145 **** */ public function getCasAns() ! { return $this->casValue; } --- 141,145 ---- */ public function getCasAns() ! { return $this->casValue; } *************** *** 152,156 **** */ public function getDisplayValue() ! { return $this->displayValue; } --- 152,156 ---- */ public function getDisplayValue() ! { return $this->displayValue; } *************** *** 164,168 **** */ public function setStatus($changedStatus) ! { $nullStatus = array(NULL,'new','solutionSeen'); //changes that are valid if status is Null now $newStatus = array(NULL,'new','valid','invalid'); --- 164,168 ---- */ public function setStatus($changedStatus) ! { $nullStatus = array(NULL,'new','solutionSeen'); //changes that are valid if status is Null now $newStatus = array(NULL,'new','valid','invalid'); *************** *** 241,245 **** */ public function setCasAns($ans) ! { $this->casValue = $ans; } --- 241,245 ---- */ public function setCasAns($ans) ! { $this->casValue = $ans; } *************** *** 253,257 **** */ public function setRawAns($ans) ! { $this->rawAns = $ans; } --- 253,257 ---- */ public function setRawAns($ans) ! { $this->rawAns = $ans; } *************** *** 265,269 **** */ public function setDisplayValue($disp) ! { $this->displayValue = $disp; } --- 265,269 ---- */ public function setDisplayValue($disp) ! { $this->displayValue = $disp; } *************** *** 277,281 **** */ public function getFeedback() ! { return $this->feedback; } --- 277,281 ---- */ public function getFeedback() ! { return $this->feedback; } *************** *** 289,293 **** */ public function setFeedback($feedback) ! { $this->feedback = $feedback; } --- 289,293 ---- */ public function setFeedback($feedback) ! { $this->feedback = $feedback; } Index: QuestionPart.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/QuestionPart.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** QuestionPart.php 27 Aug 2009 16:23:00 -0000 1.32 --- QuestionPart.php 30 Sep 2010 16:56:15 -0000 1.33 *************** *** 129,133 **** private $insertStars; - /** * Whether to enable type checking on students answer or not. --- 129,132 ---- *************** *** 138,141 **** --- 137,155 ---- private $sameType; + /** + * Whether student answer needs to be visually verified by student + * + * @var boolean + * @access private + */ + private $studentVerify; + + /** + * Whether student receives feedback for this question part + * + * @var boolean + * @access private + */ + private $hideFeedback; /** *************** *** 145,148 **** --- 159,163 ---- * @access private */ + private $inputTypeParam; *************** *** 180,185 **** $this->insertStars = new StackOption('list','false',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); $this->sameType = new StackOption('list', 'true', array('true' => get_string('stackOption_checkType','stack',''), 'false' => get_string('stackOption_doNotCheckType','stack',''))); ! //set the default input type paramters for the selected input type $this->loadITDefaults(); } --- 195,202 ---- $this->insertStars = new StackOption('list','false',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); $this->sameType = new StackOption('list', 'true', array('true' => get_string('stackOption_checkType','stack',''), 'false' => get_string('stackOption_doNotCheckType','stack',''))); + $this->studentVerify = new StackOption('list','true',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); + $this->hideFeedback = new StackOption('list','false',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); ! //set the default input type parameters for the selected input type $this->loadITDefaults(); } *************** *** 374,378 **** { $this->inputType->setSelection($inputType); ! } /** --- 391,395 ---- { $this->inputType->setSelection($inputType); ! } /** *************** *** 617,620 **** --- 634,680 ---- } + /** + * Returns the stackoption for controlling whether to check students needs to verify their valid answer + * @access public + * @return stackOption studentVerify + */ + public function getStudentVerify() { + return $this->studentVerify; + } + + /** + * Sets the studentVerify value + * @access public + * @param string new value + * @return void + */ + public function setStudentVerify($val) { + if($this->studentVerify !== NULL) + { + $this->studentVerify->setSelected($val); + } + } + + /* Returns the stackoption for controlling whether to check students needs to verify their valid answer + * @access public + * @return stackOption studentVerify + */ + public function getHideFeedback() { + return $this->hideFeedback; + } + + /** + * Sets the studentVerify value + * @access public + * @param string new value + * @return void + */ + public function setHideFeedback($val) { + if($this->hideFeedback !== NULL) + { + $this->hideFeedback->setSelected($val); + } + } + /** * Sets the sameType value *************** *** 654,658 **** /** ! * set the default input type paramters for the selected input type * * @param array $parameters The set values, if any. --- 714,718 ---- /** ! * set the default input type options and parameters for the selected input type * * @param array $parameters The set values, if any. *************** *** 661,670 **** public function loadITDefaults($parameters=NULL) { ! $inputType = $this->inputType->getSelection(); $iType = new InputTypeController($inputType); $this->inputTypeParam = $iType->getDefaultParam($parameters); } - /** * Updates the Input Type parameters with the passed in values from an associative array. --- 721,729 ---- public function loadITDefaults($parameters=NULL) { ! $inputType = $this->inputType->getSelection(); $iType = new InputTypeController($inputType); $this->inputTypeParam = $iType->getDefaultParam($parameters); } /** * Updates the Input Type parameters with the passed in values from an associative array. *************** *** 685,692 **** if(array_key_exists($label, $this->inputTypeParam)) { - /*echo '<pre>'; - var_dump($this->inputTypeParam); - echo '</pre>';*/ - $this->inputTypeParam[$label]->setSelection($value); } --- 744,747 ---- *************** *** 799,802 **** --- 854,885 ---- } + public function equals($other) { + return $this->allowedWords == $other->allowedWords + && $this->boxSize == $other->boxSize + && $this->forbiddenWords == $other->forbiddenWords + && $this->forbidFloats == $other->forbidFloats + && $this->formalSyntax == $other->formalSyntax + && $this->inputType == $other->inputType + && $this->inputTypeParam == $other->inputTypeParam + && $this->insertStars == $other->insertStars + && $this->lowestTerms == $other->lowestTerms + && $this->qpName == $other->qpName + && $this->sameType == $other->sameType + && $this->studentAnsKey == $other->studentAnsKey + && $this->syntaxHint == $other->syntaxHint + && $this->teacherAns == $other->teacherAns + && $this->studentVerify == $other->studentVerify + && $this->hideFeedback == $other->hideFeedback; + } + + /** + * Ensure this Question Part has all latest options. For legacy Items. + * @param none + * @return none + */ + public function ensureCompleteOptions() { + if(!isset($this->studentVerify)) $this->studentVerify = new StackOption('list','true',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); + if(!isset($this->hideFeedback)) $this->hideFeedback = new StackOption('list','false',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); + } } Index: QuestionType.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/QuestionType.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** QuestionType.php 11 Jan 2010 17:23:36 -0000 1.12 --- QuestionType.php 30 Sep 2010 16:56:15 -0000 1.13 *************** *** 263,267 **** { //display a simple text box ! $widget = '<input type="text" name="'.$name.'" size="'.$size.'" value="'.$this->default.'"'; } else --- 263,267 ---- { //display a simple text box ! $widget = '<input type="text" name="'.$name.'" id="'.$name.'" size="'.$size.'" value="'.$this->default.'"'; } else Index: ItemTests.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/ItemTests.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ItemTests.php 27 Aug 2009 16:23:00 -0000 1.3 --- ItemTests.php 30 Sep 2010 16:56:15 -0000 1.4 *************** *** 218,222 **** --- 218,231 ---- } + public function equals($other) { + if(!empty($this->tests)) { + if(empty($other->tests)) return false; + foreach($this->tests as $key => $val) { + if($val != $other->tests[$key]) return false; + } + } else if(!empty($other->tests)) return false; + return true; + } } Index: PotentialResponse.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/PotentialResponse.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** PotentialResponse.php 27 Jun 2009 08:51:41 -0000 1.48 --- PotentialResponse.php 30 Sep 2010 16:56:15 -0000 1.49 *************** *** 583,586 **** --- 583,608 ---- /** + * Returns the quiet setting. + * + * @access public + * @return string + */ + public function getQuiet() + { + return $this->quiet; + } + + /** + * Returns the teacher note. + * + * @access public + * @return string + */ + public function getTeacherNote() + { + return $this->teacherNote; + } + + /** * Returns the answertest used in this PR. * *************** *** 665,669 **** $form = '<div class="PR">'; $form .= "<strong>".get_string('stack_num','stack','')." $id</strong><br />"; - $form .= '<span style="float: right">'.get_string('stackQuestion_PR_remove','stack','').'<input type="checkbox" name="'.$prefix.'-remove" value="true"></span> '; $form .= get_string('stackQuestion_PR_SAns2','stack','').': <input type="text" size="10" name="'.$prefix.'-sans" value="'.$this->sAns.'" /> '; //sans $form .= get_string('stackQuestion_PR_TAns2','stack','').': <input type="text" size="10" name="'.$prefix.'-tans" value="'.$this->tAns.'" /> '; //tans --- 687,690 ---- *************** *** 704,721 **** } ! ! //True Array ! $form .= '<div class="PRTTrue"><strong>'.get_string('stack_true','stack','').'</strong><br />'; //rawmarkmod dropdown box ! $form .= get_string('stackQuestion_PR_RawMarkMod2','stack','').': <select name="'.$prefix.'-trueModMark">'; - $modOpts = array('=','+','-','=AT'); foreach($modOpts as $mod) { ! if($mod == $this->trueArray['rawModMark']) { ! $form .= "<option value=\"$mod\" selected>$mod</option>"; } else --- 725,743 ---- } + $modOpts = array('=','+','-','=AT'); ! // False PR box output first for rendering reasons ! $form .= "<div>";// container for true/false boxes ! //if false ! $form .= '<div class="PRTFalse"><strong>'.get_string('stack_false','stack','').'</strong><br />'; //rawmarkmod dropdown box ! $form .= get_string('stackQuestion_PR_RawMarkMod2','stack','').': <select name="'.$prefix.'-falseModMark">'; foreach($modOpts as $mod) { ! if($mod == $this->falseArray['rawModMark']) { ! $form .= "<option value=\"$mod\" selected='selected'>$mod</option>"; } else *************** *** 727,740 **** $form .= '</select> '; ! $form .= get_string('Mark','stack','').': <input type="text" size="2" name="'.$prefix.'-trueMark" value="'.$this->trueArray['rawmark'].'" /> '; //mark ! $form .= get_string('ShowAt_Penalty','stack','').': <input type="text" size="2" name="'.$prefix.'-truePenalty" value="'.$this->trueArray['penalty'].'" /> '; //penalty ! $form .= get_string('stackQuestion_PR_nextPR','stack','').' <select name="'.$prefix.'-trueNextPR">'; foreach($potentialPRs as $ppr) { ! if($ppr == $this->nextPRTrue) { ! $form .= "<option value=\"$ppr\" selected>$ppr</option>"; } else --- 749,762 ---- $form .= '</select> '; ! $form .= get_string('Mark','stack','').': <input type="text" size="2" name="'.$prefix.'-falseMark" value="'.$this->falseArray['rawmark'].'" /> '; //mark ! $form .= get_string('ShowAt_Penalty','stack','').': <input type="text" size="2" name="'.$prefix.'-falsePenalty" value="'.$this->falseArray['penalty'].'" /> '; //penalty ! $form .= get_string('stackQuestion_PR_nextPR','stack','').' <select name="'.$prefix.'-falseNextPR">'; foreach($potentialPRs as $ppr) { ! if($ppr == $this->nextPRFalse) { ! $form .= "<option value=\"$ppr\" selected='selected'>$ppr</option>"; } else *************** *** 745,779 **** $form .= '</select>'; $form .= '<br /><br />'; ! $form .= get_string('ShowAt_FeedBack','stack','').': <textarea cols="45" rows="1" name="'.$prefix.'-trueFeedback" >'.$this->trueArray['feedback'].'</textarea>'; //feedback ! //$form .= 'Feedback: '.$this->trueArray['feedback']->editWidget("$prefix-trueFeedback", 45, 1); // CJS 10/10/2008 // If the AnswerNote is empty, we should add something useful. ! $the_an = $this->trueArray['AnsNote']; ! if ('' === $the_an) { ! $the_an = substr($prefix,14).'-T '; } ! $form .= get_string('ShowAt_AnswerNote','stack','').': <textarea cols="45" rows="1" name="'.$prefix.'-trueAnsNote" >'.$the_an.'</textarea>'; //Ansnote ! ! if(!empty($validationErrors['truefeedback'])) { ! $form .= '<p class="error">'.get_string('ShowAt_FeedBack','stack','').': '.$validationErrors['truefeedback'].'</p>'; } - $form .= '</div>'; ! ! //if false ! $form .= '<div class="PRTFalse"><strong>'.get_string('stack_false','stack','').'</strong><br />'; //rawmarkmod dropdown box ! $form .= get_string('stackQuestion_PR_RawMarkMod2','stack','').': <select name="'.$prefix.'-falseModMark">'; foreach($modOpts as $mod) { ! if($mod == $this->falseArray['rawModMark']) { ! $form .= "<option value=\"$mod\" selected='selected'>$mod</option>"; } else --- 767,800 ---- $form .= '</select>'; $form .= '<br /><br />'; ! ! $form .= get_string('ShowAt_FeedBack','stack','').': <textarea cols="40" rows="1" name="'.$prefix.'-falseFeedback" >'.$this->falseArray['feedback'].'</textarea>'; ! //$form .= 'Feedback: '.$this->falseArray['feedback']->editWidget("$prefix-falseFeedback", 45, 1); // CJS 10/10/2008 // If the AnswerNote is empty, we should add something useful. ! $the_an = $this->falseArray['AnsNote']; ! if ('' == $the_an) { ! // knock off "PR-PotResTree_" ! $the_an = substr($prefix,14).'-F '; } + $form .= '<br />'.get_string('ShowAt_AnswerNote','stack','').': <textarea cols="40" rows="1" name="'.$prefix.'-falseAnsNote" >'.$the_an.'</textarea>'; //Ansnote ! if(!empty($validationErrors['falsefeedback'])) { ! $form .= '<p class="error">'.get_string('ShowAt_FeedBack','stack','').': '.$validationErrors['falsefeedback'].'</p>'; } $form .= '</div>'; ! //True Array ! $form .= '<div class="PRTTrue"><strong>'.get_string('stack_true','stack','').'</strong><br />'; //rawmarkmod dropdown box ! $form .= get_string('stackQuestion_PR_RawMarkMod2','stack','').': <select name="'.$prefix.'-trueModMark">'; foreach($modOpts as $mod) { ! if($mod == $this->trueArray['rawModMark']) { ! $form .= "<option value=\"$mod\" selected>$mod</option>"; } else *************** *** 785,798 **** $form .= '</select> '; ! $form .= get_string('Mark','stack','').': <input type="text" size="2" name="'.$prefix.'-falseMark" value="'.$this->falseArray['rawmark'].'" /> '; //mark ! $form .= get_string('ShowAt_Penalty','stack','').': <input type="text" size="2" name="'.$prefix.'-falsePenalty" value="'.$this->falseArray['penalty'].'" /> '; //penalty ! $form .= get_string('stackQuestion_PR_nextPR','stack','').' <select name="'.$prefix.'-falseNextPR">'; foreach($potentialPRs as $ppr) { ! if($ppr == $this->nextPRFalse) { ! $form .= "<option value=\"$ppr\" selected='selected'>$ppr</option>"; } else --- 806,819 ---- $form .= '</select> '; ! $form .= get_string('Mark','stack','').': <input type="text" size="2" name="'.$prefix.'-trueMark" value="'.$this->trueArray['rawmark'].'" /> '; //mark ! $form .= get_string('ShowAt_Penalty','stack','').': <input type="text" size="2" name="'.$prefix.'-truePenalty" value="'.$this->trueArray['penalty'].'" /> '; //penalty ! $form .= get_string('stackQuestion_PR_nextPR','stack','').' <select name="'.$prefix.'-trueNextPR">'; foreach($potentialPRs as $ppr) { ! if($ppr == $this->nextPRTrue) { ! $form .= "<option value=\"$ppr\" selected>$ppr</option>"; } else *************** *** 803,827 **** $form .= '</select>'; $form .= '<br /><br />'; ! ! $form .= get_string('ShowAt_FeedBack','stack','').': <textarea cols="45" rows="1" name="'.$prefix.'-falseFeedback" >'.$this->falseArray['feedback'].'</textarea>'; ! //$form .= 'Feedback: '.$this->falseArray['feedback']->editWidget("$prefix-falseFeedback", 45, 1); // CJS 10/10/2008 // If the AnswerNote is empty, we should add something useful. ! $the_an = $this->falseArray['AnsNote']; ! if ('' == $the_an) { ! // knock off "PR-PotResTree_" ! $the_an = substr($prefix,14).'-F '; } - $form .= get_string('ShowAt_AnswerNote','stack','').': <textarea cols="45" rows="1" name="'.$prefix.'-falseAnsNote" >'.$the_an.'</textarea>'; //Ansnote ! if(!empty($validationErrors['falsefeedback'])) { ! $form .= '<p class="error">'.get_string('ShowAt_FeedBack','stack','').': '.$validationErrors['falsefeedback'].'</p>'; } $form .= '</div>'; $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_teachersNote','stack','').' <br></span><span class="formw"><textarea cols="65" rows="1" name="'.$prefix.'-teacherNotes">'.$this->teacherNote.'</textarea></span></div>'; ! $form .= '<div class="clearer"> </div>'; $form .= '</div>'; --- 824,850 ---- $form .= '</select>'; $form .= '<br /><br />'; ! $form .= get_string('ShowAt_FeedBack','stack','').': <textarea cols="40" rows="1" name="'.$prefix.'-trueFeedback" >'.$this->trueArray['feedback'].'</textarea>'; //feedback ! //$form .= 'Feedback: '.$this->trueArray['feedback']->editWidget("$prefix-trueFeedback", 45, 1); // CJS 10/10/2008 // If the AnswerNote is empty, we should add something useful. ! $the_an = $this->trueArray['AnsNote']; ! if ('' === $the_an) { ! $the_an = substr($prefix,14).'-T '; } ! $form .= '<br />'.get_string('ShowAt_AnswerNote','stack','').': <textarea cols="40" rows="1" name="'.$prefix.'-trueAnsNote" >'.$the_an.'</textarea>'; //Ansnote ! ! if(!empty($validationErrors['truefeedback'])) { ! $form .= '<p class="error">'.get_string('ShowAt_FeedBack','stack','').': '.$validationErrors['truefeedback'].'</p>'; } + $form .= '</div>'; + $form .= '</div>'; // close true/false container $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_teachersNote','stack','').' <br></span><span class="formw"><textarea cols="65" rows="1" name="'.$prefix.'-teacherNotes">'.$this->teacherNote.'</textarea></span></div>'; ! //$form .= '<div class="clearer"> </div>'; ! $form .= '<span style="float: right">'.get_string('stackQuestion_PR_remove','stack','').'<input type="checkbox" name="'.$prefix.'-remove" value="true"></span> '; $form .= '</div>'; Index: Meta.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/Meta.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Meta.php 11 Jan 2010 17:23:36 -0000 1.19 --- Meta.php 30 Sep 2010 16:56:15 -0000 1.20 *************** *** 287,290 **** --- 287,294 ---- return NULL; } + + public function equals($other) { + return $this->forbidFloats == $other->forbidFloats; + } } ?> \ No newline at end of file Index: RawKeyVal.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/RawKeyVal.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** RawKeyVal.php 23 Feb 2010 10:27:10 -0000 1.31 --- RawKeyVal.php 30 Sep 2010 16:56:15 -0000 1.32 *************** *** 79,83 **** public function __construct($rawstring, $required = 'optional', $default = NULL, $values = NULL, $metatag = NULL, $metatype = NULL, $xmlType = NULL) { ! // can we not just invoke the parent contrustor for the below? //generic $this->required = $required; --- 79,83 ---- public function __construct($rawstring, $required = 'optional', $default = NULL, $values = NULL, $metatag = NULL, $metatype = NULL, $xmlType = NULL) { ! // can we not just invoke the parent contructor for the below? //generic $this->required = $required; *************** *** 648,652 **** --- 648,661 ---- } + public function equals($other) { + if(count($other->keyVals) != count($this->keyVals)) return false; + + foreach($this->keyVals as $v) { + // look for keyVal with same key and value in other + } + } + } + ?> \ No newline at end of file Index: PotentialResponseTree.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/PotentialResponseTree.php,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** PotentialResponseTree.php 27 Jun 2009 08:51:41 -0000 1.71 --- PotentialResponseTree.php 30 Sep 2010 16:56:15 -0000 1.72 *************** *** 289,302 **** $preCalcValues = $this->prtPreCalc($preCalcValues, $maximaPreferences, $seed); - //requirements have been met, traverse the tree. - $nextPR = 0; //always start at PR 0 - //find the PR with the lowest id to start with. - $PRkeys = array_keys($this->PResponses); - sort($PRkeys); - $nextPR = $PRkeys[0]; - - //var_dump($this->PResponses); - //echo '<br><br>'; while($nextPR != -1) { --- 289,304 ---- $preCalcValues = $this->prtPreCalc($preCalcValues, $maximaPreferences, $seed); + // Do we have errors from the above? + if (-1==$preCalcValues) { + $nextPR=-1; + } else { + //requirements have been met, traverse the tree. + $nextPR = 0; //always start at PR 0 + //find the PR with the lowest id to start with. + $PRkeys = array_keys($this->PResponses); + sort($PRkeys); + $nextPR = $PRkeys[0]; + } while($nextPR != -1) { *************** *** 1045,1049 **** /** ! * Sends the student & teachers answers from each PR to the cas * @param array $precalc * @return array --- 1047,1051 ---- /** ! * Sends the student & teacher's answers from each PR to the CAS * @param array $precalc * @return array *************** *** 1140,1148 **** if($mconn->displayErrorString() !== NULL) { ! echo '<div class="error">'; ! echo '<p>'.'The Potential response tree caused the following problems:'.'</p>';; ! echo $mconn->displayErrorString(); ! echo '</div>'; ! die(); } else --- 1142,1155 ---- if($mconn->displayErrorString() !== NULL) { ! $err = '<div class="error">'; ! $err .= '<p>'.get_string('PR_ERROR','STACK').'</p>';; ! $err .= $mconn->displayErrorString(); ! $err .= '</div>'; ! $this->ansNote .='|PR_ERROR|'; ! $this->feedback .= $err; ! $this->penalty =0; ! $this->mark =0; ! //die(); ! return -1; } else *************** *** 1386,1389 **** --- 1393,1450 ---- return $node; } + + public function equals($other) { + // test PResponses first + if(!empty($this->PResponses)) + { + if(empty($other->PResponses) + || sizeof($this->PResponses) != sizeof($other->PResponses)) { + return false; + } + + if($this->penalty != $other->penalty) return false; + + foreach($this->PResponses as $name => $pr) + { + $opr = $other->PResponses[$name]; + if(empty($opr)) return false; + if($pr->getAnsTest() != $opr->getAnsTest() + || $pr->getTAns() != $opr->getTAns() + || $pr->getSAns() != $opr->getSAns() + || $pr->getTrueAN() != $opr->getTrueAN() + || $pr->getFalseAN() != $opr->getFalseAN() + || $pr->getTestOp() != $opr->getTestOp() + || $pr->getQuiet() != $opr->getQuiet() + || $pr->getTeacherNote() != $opr->getTeacherNote() + ) return false; + + // compare trueArray and falseArray + foreach($pr->ifTrue() as $key => $val) { + $array = $opr->ifTrue(); + if($array[$key] != $val) return false; + } + + foreach($pr->ifFalse() as $key => $val) { + $array = $opr->ifFalse(); + if($array[$key] != $val) return false; + } + } + + return true; + } + + return $this->ansNote == $other->ansNote + && $this->ansRequirements == $other->ansRequirements + && $this->ansTestError == $other->ansTestError + && $this->autoSimplify == $other->autoSimplify + && $this->description == $other->description + && $this->feedback == $other->feedback + && $this->feedbackVariables == $other->feedbackVariables + && $this->genericFeedback == $other->genericFeedback + && $this->mark == $other->mark + && $this->penalty == $other->penalty + && $this->PRTName == $other->PRTName + && $this->questionValue == $other->questionValue; + } } Index: StudentAns.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/StudentAns.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** StudentAns.php 18 Jan 2010 18:36:19 -0000 1.45 --- StudentAns.php 30 Sep 2010 16:56:15 -0000 1.46 *************** *** 118,122 **** if($ans == '') { - //echo 'here'; $this->studentAnswers[$label]->setRawAns($ans); $this->studentAnswers[$label]->setStatus(NULL); --- 118,121 ---- *************** *** 221,226 **** foreach($this->studentAnswers as $label => $sAns) { - // echo "<hr>Checking $label<br>"; - //override items standard itemOptions with those specified in the question part related to this questionpart. if($questionPart !== NULL && array_key_exists($label, $questionPart)) --- 220,223 ---- *************** *** 398,402 **** { //we only want answers that have passed the syntax checks ! if($sAns->getStatus() == 'valid') { $casText .= '@'; --- 395,399 ---- { //we only want answers that have passed the syntax checks ! if($sAns->getStatus() == 'valid' || $sAns->getStatus() == 'score') { $casText .= '@'; *************** *** 406,410 **** } - /*commands are send with insert stars on and strict syntax off, the least strict settings * this is to allow us to send all students answers through at the same time to the cas --- 403,406 ---- *************** *** 421,426 **** //echo $sAns->getRawAns(); //echo $sAns->getStatus(); ! //echo "<pre>";print_r($questionPart[$label]);echo "</pre>"; ! if($sAns->getStatus() == 'valid') { //create a castext string, for checking float status --- 417,422 ---- //echo $sAns->getRawAns(); //echo $sAns->getStatus(); ! //echo "<pre>";print_r($questionPart[$label]);echo "</pre>"; ! if($sAns->getStatus() == 'valid' || $sAns->getStatus() == 'score') { //create a castext string, for checking float status *************** *** 463,467 **** elseif ($casCommands === NULL) { ! //no cas commands to extract, valid = true, in a manor of thinking. } else --- 459,463 ---- elseif ($casCommands === NULL) { ! //no cas commands to extract, valid = true, in a manner of thinking. } else *************** *** 469,473 **** $displayFormat = $itemOptions->getSelected('Display'); ! //Student answers should not be simplyfied for display. $itemOptions->setSelected('Simplify','false'); --- 465,469 ---- $displayFormat = $itemOptions->getSelected('Display'); ! //Student answers should not be simplified for display. $itemOptions->setSelected('Simplify','false'); *************** *** 481,485 **** //echo "<pre>";print_r($displayResults);echo "</pre>"; - $i = 0; foreach($validLabels as $vLabel) --- 477,480 ---- *************** *** 555,558 **** --- 550,566 ---- } + /** + * Where an IE status can be fastracked from valid to score, do it. + */ + public function scoreIfValid($questionPart = NULL) { + if(!empty($this->studentAnswers)) { + foreach($this->studentAnswers as $label => $sAns) { + if($sAns->getStatus() == 'valid' && $questionPart[$label]->getStudentVerify()->getSelected() == 'false') { + $sAns->setStatus('score'); + } + } + } + } + /** * If casString not set will return null. Index: InstantiatedItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/InstantiatedItem.php,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** InstantiatedItem.php 28 Aug 2009 10:09:23 -0000 1.81 --- InstantiatedItem.php 30 Sep 2010 16:56:15 -0000 1.82 *************** *** 332,336 **** if(!empty($this->PRTrees)) { - $this->updatePreCalc($sAns); //update precalculated values --- 332,335 ---- *************** *** 352,355 **** --- 351,355 ---- if(!empty($prtRequirements)) { + foreach($PRT->getRequirements() as $ansKey) { *************** *** 363,366 **** --- 363,369 ---- $changed = true; } + elseif(isset($previously[$ansKey]) && isset($currently[$ansKey]) && $previously[$ansKey] !== $currently[$ansKey]) { + $changed = true; + } } } Index: CasTextType.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/CasTextType.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CasTextType.php 20 Oct 2009 10:15:28 -0000 1.25 --- CasTextType.php 30 Sep 2010 16:56:15 -0000 1.26 *************** *** 261,265 **** { //display text input ! $widget = '<input type="text" name="'.$name.'" size="'.$size.'" value="'.$this->casText.'"/>'; } else --- 261,265 ---- { //display text input ! $widget = '<input type="text" name="'.$name.'" size="'.$size.'" value="'.stripslashes(htmlspecialchars($this->casText)).'"/>'; } else *************** *** 426,430 **** $selection = $dom->createElement("castext"); ! $selectionText = $dom->createTextNode($this->casText); $selection->appendChild($selectionText); --- 426,430 ---- $selection = $dom->createElement("castext"); ! $selectionText = $dom->createTextNode(utf8_encode($this->casText)); $selection->appendChild($selectionText); Index: ItemOption.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/ItemOption.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ItemOption.php 18 Feb 2010 16:33:33 -0000 1.22 --- ItemOption.php 30 Sep 2010 16:56:15 -0000 1.23 *************** *** 455,458 **** --- 455,469 ---- } } + + public function equals($other) { + if(empty($this->options) != empty($other->options)) return false; + if(!empty($this->options)) + { + foreach($this->options as $optName => $option) { + if($other->options[$optName]->getSelected() != $option->getSelected()) return false; + } + } + return true; + } } ?> \ No newline at end of file Index: Item.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/Item.php,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Item.php 18 Feb 2010 16:33:33 -0000 1.64 --- Item.php 30 Sep 2010 16:56:15 -0000 1.65 *************** *** 53,56 **** --- 53,63 ---- protected $qID; + // Attributes + /** + * @var String + * @access protected + */ + protected $line; + /** * @var Array *************** *** 331,334 **** --- 338,342 ---- $this->questionStatus = $questionVariables['questionStatus']; $this->published = $questionVariables['published']; + $this->line = $questionVariables['line']; } else *************** *** 339,342 **** --- 347,356 ---- } + // handle legacy items + if(NULL !== $this->questionPart) { + foreach($this->questionPart as $qp) { + $qp->ensureCompleteOptions(); + } + } //load in the keywords from the database *************** *** 361,365 **** //$db->connect(); ! //because of how PHP does database connections $db and $kwDB's connections are essencially combinded into one connection. if($itemOpt == NULL) { --- 375,379 ---- //$db->connect(); ! //because of how PHP does database connections $db and $kwDB's connections are essentially combined into one connection. if($itemOpt == NULL) { *************** *** 426,429 **** --- 440,444 ---- global $config; $this->qID = NULL; //not yet been assigned, once stored gets a question ID + //$this->version = 0; // set according to version scheme $this->PRTrees = array(); *************** *** 530,534 **** /** ! * Stores the question in the the database, if $asnew is set to true, adds as a new question. * * @param bool $asNew --- 545,549 ---- /** ! * Stores the question revision in the the database, if $asNew is set to true, adds as a new question line. * * @param bool $asNew *************** *** 538,554 **** public function store($asNew = false) { ! if($asNew == true) ! { ! $this->logger->finest('Storing as a new item'); ! } ! else{ ! $this->logger->finest('Saving item '.$this->qID); ! } ! //to store in the database the item is wrapped up into an array, then serialised. ! //PRTrees are stored in a seperate table. ! ! ! $db = new StackDBItem(); ! $conn = $db->connect(); if(!$conn) --- 553,559 ---- public function store($asNew = false) { ! $this->logger->debug('storing item named:'.$this->questionName->getSelection()); ! // get db connection going ! $db = new StackDBItem(); $conn = $db->connect(); if(!$conn) *************** *** 558,726 **** return false; } else { - //serialize variables - $dbItemOptions = $db->base64_serialize($this->itemOptions); //serialise is in stackDatabase - $dbItemTests = $db->base64_serialize($this->itemTests); ! $questionVariables['qID'] = $this->qID; ! $questionVariables['lastUserEditor'] = $this->lastUserEditor; ! $questionVariables['language'] = $this->language; ! $questionVariables['questionName'] = $this->questionName; ! $questionVariables['questionDescription'] = $this->questionDescription; ! $questionVariables['questionPublisher'] = $this->questionPublisher; ! $questionVariables['questionFormat'] = $this->questionFormat; ! $questionVariables['questionLearningContext'] = $this->questionLearningContext; ! $questionVariables['questionDifficulty'] = $this->questionDifficulty; ! $questionVariables['questionCompetency'] = $this->questionCompetency; ! $questionVariables['questionCompentencyLevel'] = $this->questionCompentencyLevel; ! $questionVariables['questionTimeAllocated'] = $this->questionTimeAllocated; ! $questionVariables['questionRights'] = $this->questionRights; ! $questionVariables['questionExerciseType'] = $this->questionExerciseType; ! $now = date("Y-m-d H:i:s"); ! $this->questionDateLastEdited->setSelection($now); ! $questionVariables['questionDateLastEdited'] = $this->questionDateLastEdited; ! $questionVariables['questionStem'] = $this->questionStem; ! $questionVariables['questionVariables'] = $this->questionVariables; ! $questionVariables['questionPenalty'] = $this->questionPenalty; ! $questionVariables['studentAnsKey'] = $this->studentAnsKey; ! $questionVariables['teacherAns'] = $this->teacherAns; ! $questionVariables['workedSolution'] = $this->workedSolution; ! $questionVariables['questionNote'] = $this->questionNote; ! //$questionVariables['questionAnsTest'] = $this->questionAnsTest; ! $questionVariables['questionPart'] = $this->questionPart; ! $questionVariables['valid'] = $this->valid; ! $questionVariables['questionStatus'] = $this->questionStatus; ! $questionVariables['published'] = $this->published; - //if storing as new, generate new GUID - if($asNew == true) - { - global $config; - $GUID = stack_generate_guid($config->get('weburl')); - $this->questionGUID = new Meta('system',$GUID,NULL,'identifier','dc','string'); - $questionVariables['questionGUID'] = $this->questionGUID; - } - else - { - $questionVariables['questionGUID'] = $this->questionGUID; - } - $dbQuestionVariables = $db->base64_serialize($questionVariables); - unset($questionVariables); - //get metadata for inserting into database - $meta['lastUserEditor'] = $this->lastUserEditor->getSelection(); - $meta['language'] = $this->language->getSelection(); - $meta['questionName'] = $this->questionName->getSelection(); - $meta['questionDescription'] = $this->questionDescription->getSelection(); - $meta['questionKeywords'] = $this->questionKeywords->getSelection(); - $meta['questionPublisher'] = $this->questionPublisher->getSelection(); - $meta['questionFormat'] = $this->questionFormat->getSelection(); - $meta['questionLearningContext'] = $this->questionLearningContext->getSelection(); - $meta['questionDifficulty'] = $this->questionDifficulty->getSelection(); - $meta['questionCompetency'] = $this->questionCompetency->getSelection(); - $meta['questionCompentencyLevel'] = $this->questionCompentencyLevel->getSelection(); - $meta['questionTimeAllocated'] = $this->questionTimeAllocated->getSelection(); - $meta['questionRights'] = $this->questionRights->getSelection(); - $meta['questionGUID'] = $this->questionGUID->getSelection(); - $meta['questionExerciseType'] = $this->questionExerciseType->getSelection(); - $meta['questionDateLastEdited'] = $this->questionDateLastEdited->getSelection(); ! //add to database ! if (($asNew == true) || (empty($this->qID))) ! { ! //add a new question. If qid not set, then not added to db yet. ! $status = $this->questionStatus->getSelection(); ! $published = $this->published->getSelection(); ! $result = $db->addNewItem($dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $this->valid, $status, $published); ! //returned result is either qId of false if failed ! $this->qID = $result; ! //add PRTs ! if(!empty($this->PRTrees)) { ! foreach($this->PRTrees as $PRT) { ! $data = $PRT->toBlob(); ! $name = $PRT->getName(); ! $prtResult = $db->addPRT($this->qID, $name, $data); ! if(!$prtResult) ! { ! $this->errorLog->addError(get_string('stackDatabase_failedAddPRT','stack','')); ! $this->errorLog->addUserError('main', get_string('stackDatabase_failedAddPRT','stack','')); ! } } } - } - else - { - //update currect question - $status = $this->questionStatus->getSelection(); - $published = $this->published->getSelection(); - $result = $db->updateItem($this->qID, $dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $this->valid, $status, $published); - //returned result is either qId of false if failed ! //remove any existing PRTs related to question then add new PRTs. ! $db->removeItemsPRT($this->qID); ! //add back in. ! if(!empty($this->PRTrees)) { ! foreach($this->PRTrees as $PRT) { ! $data = $PRT->toBlob(); ! $name = $PRT->getName(); ! $prtResult = $db->addPRT($this->qID, $name, $data); ! if(!$prtResult) ! { ! $this->errorLog->addError('Could Not add PRT to Database.'); ! $this->errorLog->addUserError('main', get_string('stackDatabase_failedAddPRT','stack','')); ! } } } } ! //add the keywords to the keywords database table ! //Keywords are stored twice, once in the item as a meta object and ! //again raw in the database to allow for searching for questions by keyword ! ! $kwDB = new StackDBKeywords(); ! $kwDB->connect(); ! ! //first remove any existing keywords ! $kwDB->removeKeywords($this->qID); ! ! //now add the keywords ! $keywords = $this->questionKeywords->getSelection(); ! $result = $kwDB->setQuestionKeywordsString($this->qID, $keywords); ! ! if($result == false) ! { ! $this->errorLog->addUserError('Database', 'Could not add keywords to database'); ! echo 'Failed to add keywords to database.'; ! } ! $kwDB->disconnect(); ! if($result === false) ! { ! $this->errorLog->addError('Could not add the Item to the database: '.$db->getErrors()); ! $this->errorLog->addUserError('main', get_string('stackDatabase_failedAddItem','stack','')); ! return false; ! } ! $db->disconnect(); ! }//else conn return true; - } --- 563,766 ---- return false; } + + if($asNew == true || !isset($this->line)) { // need to start a new line + $this->line = $db->newLine(); + $this->logger->debug('Started a new line: '.$this->line); + + } else $line = $this->line; + + + if(!$asNew){ // just saving + // check item has been changed + $prior = new Item(null, $this->qID); + if($this->equals($prior)) { + $this->logger->debug('Item unchanged. No need to store!'); + return false; + } + $this->logger->debug('Saving item '.$this->qID); + } + //to store in the database the item is wrapped up into an array, then serialised. + //PRTrees are stored in a separate table. + + //serialize variables + $dbItemOptions = $db->base64_serialize($this->itemOptions); //serialise is in stackDatabase + $dbItemTests = $db->base64_serialize($this->itemTests); + + $questionVariables['qID'] = $this->qID; + + $questionVariables['line'] = $this->line; + $questionVariables['lastUserEditor'] = $this->lastUserEditor; + $questionVariables['language'] = $this->language; + $questionVariables['questionName'] = $this->questionName; + $questionVariables['questionDescription'] = $this->questionDescription; + $questionVariables['questionPublisher'] = $this->questionPublisher; + $questionVariables['questionFormat'] = $this->questionFormat; + $questionVariables['questionLearningContext'] = $this->questionLearningContext; + $questionVariables['questionDifficulty'] = $this->questionDifficulty; + $questionVariables['questionCompetency'] = $this->questionCompetency; + $questionVariables['questionCompentencyLevel'] = $this->questionCompentencyLevel; + $questionVariables['questionTimeAllocated'] = $this->questionTimeAllocated; + $questionVariables['questionRights'] = $this->questionRights; + $questionVariables['questionExerciseType'] = $this->questionExerciseType; + + $now = date("Y-m-d H:i:s"); + $this->questionDateLastEdited->setSelection($now); + $questionVariables['questionDateLastEdited'] = $this->questionDateLastEdited; + $questionVariables['questionStem'] = $this->questionStem; + $questionVariables['questionVariables'] = $this->questionVariables; + $questionVariables['questionPenalty'] = $this->questionPenalty; + $questionVariables['studentAnsKey'] = $this->studentAnsKey; + $questionVariables['teacherAns'] = $this->teacherAns; + $questionVariables['workedSolution'] = $this->workedSolution; + $questionVariables['questionNote'] = $this->questionNote; + //$questionVariables['questionAnsTest'] = $this->questionAnsTest; + $questionVariables['questionPart'] = $this->questionPart; + $questionVariables['valid'] = $this->valid; + $questionVariables['questionStatus'] = $this->questionStatus; + $questionVariables['published'] = $this->published; + + //if storing as new, generate new GUID + if($asNew == true) + { + global $config; + $GUID = stack_generate_guid($config->get('weburl')); + $this->questionGUID = new Meta('system',$GUID,NULL,'identifier','dc','string'); + $questionVariables['questionGUID'] = $this->questionGUID; + + // avoid obvious duplicate names + $name = $this->questionName->getSelection(); + if($db->nameExists($name)) { + $np = strpos($name," (new:"); + /*if (false!==$np) { + $name = substr($name,0,$np); + } + */ + $name .= " (new: ".stack_dateDisplay().', '.date("h:i:s").")"; // single fork + + } + $this->questionName->setSelection($name); + } else { + $questionVariables['questionGUID'] = $this->questionGUID; + } ! $dbQuestionVariables = $db->base64_serialize($questionVariables); ! unset($questionVariables); ! //get metadata for inserting into database ! $meta['lastUserEditor'] = $this->lastUserEditor->getSelection(); ! $meta['language'] = $this->language->getSelection(); ! $meta['questionName'] = $this->questionName->getSelection(); ! $meta['questionDescription'] = $this->questionDescription->getSelection(); ! $meta['questionKeywords'] = $this->questionKeywords->getSelection(); ! $meta['questionPublisher'] = $this->questionPublisher->getSelection(); ! $meta['questionFormat'] = $this->questionFormat->getSelection(); ! $meta['questionLearningContext'] = $this->questionLearningContext->getSelection(); ! $meta['questionDifficulty'] = $this->questionDifficulty->getSelection(); ! $meta['questionCompetency'] = $this->questionCompetency->getSelection(); ! $meta['questionCompentencyLevel'] = $this->questionCompentencyLevel->getSelection(); ! $meta['questionTimeAllocated'] = $this->questionTimeAllocated->getSelection(); ! $meta['questionRights'] = $this->questionRights->getSelection(); ! $meta['questionGUID'] = $this->questionGUID->getSelection(); ! $meta['questionExerciseType'] = $this->questionExerciseType->getSelection(); ! $meta['questionDateLastEdited'] = $this->questionDateLastEdited->getSelection(); + $meta['line'] = $this->line; + //add to database + //if (($asNew == true) || (empty($this->qID))) + //{ + //add a new question. If qid not set, then not added to db yet. + $status = $this->questionStatus->getSelection(); + $published = $this->published->getSelection(); + $result = $db->addNewItem($dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $this->valid, $status, $published); + //returned result is either qId or false if failed ! $this->qID = $result; ! $db->setLatestVersion($this->line, $this->qID); ! //add PRTs ! if(!empty($this->PRTrees)) ! { ! foreach($this->PRTrees as $PRT) { ! $data = $PRT->toBlob(); ! $name = $PRT->getName(); ! $prtResult = $db->addPRT($this->qID, $name, $data); ! if(!$prtResult) { ! $this->errorLog->addError(get_string('stackDatabase_failedAddPRT','stack','')); ! $this->errorLog->addUserError('main', get_string('stackDatabase_failedAddPRT','stack','')); } } } ! /*} ! else ! { ! //update current question ! $status = $this->questionStatus->getSelection(); ! $published = $this->published->getSelection(); ! $result = $db->updateItem($this->qID, $dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $this->valid, $status, $published); ! $this->qID = $result; ! //returned result is either qId of false if failed ! if(!$result) $this->logger->debug("result of question update is 'false'"); ! ! //remove any existing PRTs related to question then add new PRTs. ! $db->removeItemsPRT($this->qID); ! //add back in. ! if(!empty($this->PRTrees)) ! { ! foreach($this->PRTrees as $PRT) { ! $data = $PRT->toBlob(); ! $name = $PRT->getName(); ! $prtResult = $db->addPRT($this->qID, $name, $data); ! if(!$prtResult) { ! $this->errorLog->addError('Could Not add PRT to Database.'); ! $this->errorLog->addUserError('main', get_string('stackDatabase_failedAddPRT','stack','')); } } } + } + */ + //add the keywords to the keywords database table + //Keywords are stored twice, once in the item as a meta object and + //again raw in the database to allow for searching for questions by keyword ! $kwDB = new StackDBKeywords(); ! $kwDB->connect(); ! //first remove any existing keywords ! $kwDB->removeKeywords($this->qID); ! //now add the keywords ! $keywords = $this->questionKeywords->getSelection(); ! $result = $kwDB->setQuestionKeywordsString($this->qID, $keywords); + if($result == false) + { + $this->errorLog->addUserError('Database', 'Could not add keywords to database'); + echo 'Failed to add keywords to database.'; + } + $kwDB->disconnect(); ! if($result === false) ! { ! $this->errorLog->addError('Could not add the Item to the database: '.$db->getErrors()); ! $this->errorLog->addUserError('main', get_string('stackDatabase_failedAddItem','stack','')); ! return false; ! } ! $db->disconnect(); return true; } *************** *** 745,749 **** $note = trim($this->questionNote->getRawCasText()); ! if(empty($note)) { $toReturn = false; --- 785,789 ---- $note = trim($this->questionNote->getRawCasText()); ! if(empty($note) AND $this->questionVariables->contains_rand()) { $toReturn = false; *************** *** 1028,1031 **** --- 1068,1091 ---- } + /** + * Returns line + * @access public + * @return int + */ + public function getLine() + { + return $this->line; + } + + /** + * Sets line + * @access public + * @return int + */ + public function setLine($line) + { + $this->line = $line; + } + /** * gets a named itemOption *************** *** 1251,1254 **** --- 1311,1473 ---- } } + + /** + * Increments the revision of the Item. + * + * @access public + * @param bool isMinor + * @param bool is a minor revision (depending on revision scheme) +... [truncated message content] |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:53
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/maxima Modified Files: stacktex.lisp initMaxima.php unittests.mac maximafun.php stackmaxima.mac Removed Files: stackmaxima_5.15.0.bat stackmaxima_5.11.0.bat stackmaxima_5.13.0.bat stackmaxima_5.12.0.bat Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stackmaxima.mac,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** stackmaxima.mac 14 May 2010 16:36:00 -0000 1.79 --- stackmaxima.mac 30 Sep 2010 16:56:14 -0000 1.80 *************** *** 74,77 **** --- 74,78 ---- load("format/format.lisp"); load("implicit_plot.lisp"); + load("grobner.lisp"); /* Does not quite work yet ..... */ *************** *** 485,489 **** ); ! /* commonfac(l) returns the hcf of a list of numbers */ commonfaclist(l) := block([i,a,ret], if listp(l) then --- 486,490 ---- ); ! /* commonfac(l) returns the gcd of a list of numbers */ commonfaclist(l) := block([i,a,ret], if listp(l) then *************** *** 589,592 **** --- 590,610 ---- )$ + /* ********************************** */ + /* Parts of expressions */ + /* ********************************** */ + + /* op(ex) is unsafe on atoms: this is a fix. */ + /* This function always returns a string */ + stack_op(ex) := block( + if atom(ex) then return(""), + if op(ex)#"-" then + if stringp(op(ex)) then return(op(ex)) else return(string(op(ex))) + else + if atom(first(ex)) then + return("") + else + if stringp(op(first(ex))) then return(op((first(ex)))) else return(string(op(ex))) + )$ + /* This function takes an expression ex and returns a list of coefficients of v */ coeff_list(ex,v):= block([deg,kloop,cl], *************** *** 628,644 **** )$ - /* Reduces an inequality to either ? > 0 or ? >=0 */ - ineqreduce(ex) := block([op2,ex2], - if atom(ex) then return(ex), - if op(ex)="=" then return(ev(part(ex,1) - part(ex,2),simp,trigreduce) = 0), - if op(ex)=">" then return(ev(part(ex,1) - part(ex,2),simp,trigreduce) > 0), - if op(ex)=">=" then return(ev(part(ex,1) - part(ex,2),simp,trigreduce) >= 0), - if op(ex)="<" then return(ev(part(ex,2) - part(ex,1),simp,trigreduce) > 0), - if op(ex)="<=" then return(ev(part(ex,2) - part(ex,1),simp,trigreduce) >= 0), - ex2:args(ex), - ex2:map(ineqreduce,ex2), - return(apply(op(ex),ex2)) - )$ - expressionp(ex) := block( if matrixp(ex) or listp(ex) or equationp(ex) or inequalityp(ex) or setp(ex) then --- 646,649 ---- *************** *** 806,817 **** )$ /* Two equations are the "same" when they have identical roots with identical multiplicities */ ATEquation(SA,SB):= block([RawMark,SA1,SB1,SB2], RawMark:0, ! SA1:fullratsimp(trigexpand(rhs(SA)-lhs(SA))), ! SB1:fullratsimp(trigexpand(rhs(SB)-lhs(SB))), ! SA1:SA1*denom(SA1), ! SB1:SB1*denom(SB1), if SA1#0 then /* We need a slight hack to turn %i+1 into a number */ --- 811,860 ---- )$ + /* Equationss */ + stack_eqnprepare(ex):=block([ret], + ret:fullratsimp(trigexpand(rhs(ex)-lhs(ex))), + ret:ret*denom(ret), + return(expand(ret)) + )$ + + stack_eqncompare(SA,SB,sl):=block([ret,G0,G1], + G0 :poly_buchberger(SA,sl), + G1 :poly_buchberger(SB,sl), + ret:poly_grobner_equal(G0,G1,sl), + return(ret) + )$ + + stack_assignmentp(ex):=block( + if atom(ex) then return(false) + else if op(ex)#"=" then return(false) + else if atom(lhs(ex)) and not(real_numberp(lhs(ex))) and real_numberp(rhs(ex)) then return(true) + else return(false) + )$ + + stack_assignmentrev(ex):=block( + if atom(ex) then return(ex) + else if op(ex)#"=" then return(ex) + else if real_numberp(lhs(ex)) and not(real_numberp(rhs(ex))) then return(rhs(ex)=lhs(ex)) + else return(ex) + )$ + + /* Take a list of equations, and re-evaluate it in the context of any assignments of the form d=10 + This is needed in practice with systems of equations, as students may write [d=10, d=v*t] */ + stack_eval_assignments(ex):= block([asl,sl], + if not(listp(ex)) then return(ex), + sl:maplist(stack_assignmentrev,ex), + asl:filter(stack_assignmentp,sl), + if not(emptyp(asl)) then + (sl:listify(setdifference(setify(sl),setify(asl))), + sl:ev(sl,asl)), + return(sl) + )$ + /* Two equations are the "same" when they have identical roots with identical multiplicities */ ATEquation(SA,SB):= block([RawMark,SA1,SB1,SB2], RawMark:0, ! SA1:stack_eqnprepare(SA), ! SB1:stack_eqnprepare(SB), if SA1#0 then /* We need a slight hack to turn %i+1 into a number */ *************** *** 822,830 **** )$ ATInequality(SA,SB):= block([RawMark,FeedBack,AnswerNote,SA1,SB1,samex], RawMark:0, FeedBack:"", AnswerNote:"", ! SA:ineqreduce(SA), ! SB:ineqreduce(SB), SA1:ev(part(SA,1),simp), SB1:ev(part(SB,1),simp), --- 865,887 ---- )$ + /* Reduces an inequality to either ? > 0 or ? >=0 */ + stack_ineqprepare(ex) := block([op2,ex2], + if atom(ex) then return(ex), + if op(ex)="=" then return(ev(part(ex,1) - part(ex,2),simp,trigreduce) = 0), + if op(ex)=">" then return(ev(part(ex,1) - part(ex,2),simp,trigreduce) > 0), + if op(ex)=">=" then return(ev(part(ex,1) - part(ex,2),simp,trigreduce) >= 0), + if op(ex)="<" then return(ev(part(ex,2) - part(ex,1),simp,trigreduce) > 0), + if op(ex)="<=" then return(ev(part(ex,2) - part(ex,1),simp,trigreduce) >= 0), + ex2:args(ex), + ex2:map(stack_ineqprepare,ex2), + return(apply(op(ex),ex2)) + )$ + + ATInequality(SA,SB):= block([RawMark,FeedBack,AnswerNote,SA1,SB1,samex], RawMark:0, FeedBack:"", AnswerNote:"", ! SA:stack_ineqprepare(SA), ! SB:stack_ineqprepare(SB), SA1:ev(part(SA,1),simp), SB1:ev(part(SB,1),simp), *************** *** 885,890 **** FeedBack:"", /* Check they are equal */ ! SA:map(ineqreduce,map(trigreduce,SA)), ! SB:map(ineqreduce,map(trigreduce,SB)), if (subsetp(SA,SB) and subsetp(SB,SA)) then return([true,1,AnswerNote,FeedBack]), --- 942,947 ---- FeedBack:"", /* Check they are equal */ ! SA:map(stack_ineqprepare,map(trigreduce,SA)), ! SB:map(stack_ineqprepare,map(trigreduce,SB)), if (subsetp(SA,SB) and subsetp(SB,SA)) then return([true,1,AnswerNote,FeedBack]), --- stackmaxima_5.11.0.bat DELETED --- --- stackmaxima_5.15.0.bat DELETED --- Index: maximafun.php =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/maximafun.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** maximafun.php 3 Oct 2007 12:24:17 -0000 1.6 --- maximafun.php 30 Sep 2010 16:56:14 -0000 1.7 *************** *** 19,22 **** --- 19,25 ---- $maxima_cmd['%enumer']['use'] = 't'; + $maxima_cmd['%f']['urls'][] = 'maxima_16.html#IDX636'; + $maxima_cmd['%f']['use'] = 't'; + $maxima_cmd['%gamma']['urls'][] = 'maxima_31.html#IDX1065'; $maxima_cmd['%gamma']['use'] = 's'; *************** *** 46,49 **** [...13409 lines suppressed...] ! $maxima_cmd['zlabel']['urls'][] = 'maxima_48.html#IDX1868'; ! $maxima_cmd['zlabel']['use'] = ''; ! ! $maxima_cmd['zlange']['urls'][] = 'maxima_58.html#IDX2297'; ! $maxima_cmd['zlange']['use'] = ''; ! ! $maxima_cmd['zrange']['urls'][] = 'maxima_48.html#IDX1855'; $maxima_cmd['zrange']['use'] = ''; ! $maxima_cmd['ztics']['urls'][] = 'maxima_48.html#IDX1873'; $maxima_cmd['ztics']['use'] = ''; + $maxima_cmd['ztics_axis']['urls'][] = 'maxima_48.html#IDX1884'; + $maxima_cmd['ztics_axis']['use'] = ''; + + $maxima_cmd['ztics_rotate']['urls'][] = 'maxima_48.html#IDX1879'; + $maxima_cmd['ztics_rotate']['use'] = ''; ?> \ No newline at end of file Index: initMaxima.php =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/initMaxima.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** initMaxima.php 23 Jun 2009 14:39:36 -0000 1.5 --- initMaxima.php 30 Sep 2010 16:56:14 -0000 1.6 *************** *** 172,175 **** --- 172,182 ---- // Exceptions: Maxima variable names which are allowed to be variable names as part of STACK. + // Enable students to use any Greek letters as part of an answer. + + $greek = array(alpha,nu,beta,xi,gamma,omicron,delta,pi,epsilon,rho,zeta,sigma,eta,tau,theta,upsilon,iota,phi,kappa,chi,lambda,psi,mu,omega); + foreach ($greek as $gl) { + $gl = strtoupper($gl); + $sA .= ", '$gl' "; + } --- stackmaxima_5.12.0.bat DELETED --- Index: stacktex.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stacktex.lisp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** stacktex.lisp 28 Oct 2009 14:03:07 -0000 1.5 --- stacktex.lisp 30 Sep 2010 16:56:14 -0000 1.6 *************** *** 1,13 **** ;; Customize Maxima's TEX() function. To give better control to the output. ! ;; Chris Sangwin 21 Jan 2009. ! ;; Useful files: ! ;; \Maxima-5.9.0\share\maxima\5.9.0\share\utils\mactex-utilities.lisp ! ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ;; Additional mactex utilities taken from the distributed file ;; mactex-utilities.lisp ! ;; Based on code by Richard J. Fateman, copyright 1987. ! ;; Fateman's code was ported to Common Lisp by William ! ;; Schelter. ;; If you want LaTeX style quotients, first load mactex and second --- 1,13 ---- ;; Customize Maxima's TEX() function. To give better control to the output. ! ;; Chris Sangwin 27 Sept 2010. ! ;; Useful files: ! ;; \Maxima-5.21.1\share\maxima\5.21.1\share\utils\mactex-utilities.lisp ! ;; \Maxima-5.21.1\share\maxima\5.21.1\src\mactex.lisp ;; Additional mactex utilities taken from the distributed file ;; mactex-utilities.lisp ! ;; Based on code by Richard J. Fateman, copyright 1987. ! ;; Fateman's code was ported to Common Lisp by William ! ;; Schelter. ;; If you want LaTeX style quotients, first load mactex and second *************** *** 39,46 **** (defun tex-matrix (x l r) ;; matrix looks like ((mmatrix)((mlist) a b) ...) ! (append l `("\\left[\\begin{array}{") (tex-matrix-col-count x "c") ; Replace every column with a "c" `("} ") ! ; Below is the bit we need - forms the array (mapcan #'(lambda(y) (tex-list (cdr y) nil (list " \\\\ ") " & ")) (cdr x)) '("\\end{array}\\right]") r) --- 39,46 ---- (defun tex-matrix (x l r) ;; matrix looks like ((mmatrix)((mlist) a b) ...) ! (append l `("\\left[\\begin{array}{") (tex-matrix-col-count x "c") ; Replace every column with a "c" `("} ") ! ; Below is the bit we need - forms the array (mapcan #'(lambda(y) (tex-list (cdr y) nil (list " \\\\ ") " & ")) (cdr x)) '("\\end{array}\\right]") r) *************** *** 64,68 **** (tex (cadr x) (append l (texsym (caar x))) r 'mparen 'mparen)) ! (defprop &? ("?") texsym) --- 64,68 ---- (tex (cadr x) (append l (texsym (caar x))) r 'mparen 'mparen)) ! (defprop &? ("?") texsym) *************** *** 141,142 **** --- 141,149 ---- ((eql (elt x 0) #\\) x) (t (concatenate 'string "\\mbox{" x "}")))) + + + ;; Sort out display on inequalitis + ;; Chris Sangwin, 21/9/2010 + + (defprop mlessp (" < ") texsym) + (defprop mgreaterp (" > ") texsym) \ No newline at end of file --- stackmaxima_5.13.0.bat DELETED --- Index: unittests.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/unittests.mac,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** unittests.mac 14 May 2010 16:36:00 -0000 1.14 --- unittests.mac 30 Sep 2010 16:56:14 -0000 1.15 *************** *** 167,168 **** --- 167,188 ---- UT('exdowncase(%pi),%pi); + UT('stack_assignmentp(x=1),true); + UT('stack_assignmentp(x=sqrt(2)),true); + UT('stack_assignmentp(3=1),false); + UT('stack_assignmentp(d=v*t),false); + UT('stack_assignmentp(1=x),false); + + UT('stack_op(1),""); + UT('stack_op(x),""); + UT('stack_op(%pi),""); + UT('stack_op(3+z),"+"); + UT('stack_op(3*z),"*"); + UT('stack_op(3^z),"^"); + UT('stack_op(3/z),STACK_DIV_OP); + UT('stack_op(sin(3*z)),"sin"); + UT('stack_op((-1)/(x^2+1)),"/"); + UT('stack_op(1-x),"+"); + UT('stack_op(x-1),"+"); + UT('stack_op("-"(x-1)),"+"); + UT('stack_op("-"(1/(x^2+1))),STACK_DIV_OP); + UT('stack_op("-"(2*x)),"*"); |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:53
|
Update of /cvsroot/stack/stack-dev In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438 Modified Files: Readme.txt styles.css index.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: styles.css =================================================================== RCS file: /cvsroot/stack/stack-dev/styles.css,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** styles.css 27 Jan 2010 18:04:31 -0000 1.41 --- styles.css 30 Sep 2010 16:56:15 -0000 1.42 *************** *** 32,35 **** --- 32,48 ---- /** Generic classes -------------------------------- */ + body, table, td, th, li { + font-family:Arial,Verdana,Helvetica,sans-serif; + padding: 5px; + } + + a { + text-decoration: none; + } + + a:hover { + text-decoration: underline; + } + img{ border:0; *************** *** 222,226 **** padding: 0.4em; margin-bottom: 0.5em; ! margin-left: 140px; } h3.section{ --- 235,239 ---- padding: 0.4em; margin-bottom: 0.5em; ! margin-left: 180px; } h3.section{ *************** *** 258,273 **** } div.PRTTrue{ border: 1px solid #DDFFBA; padding: 0.25em; - margin-top: 1em; background-color: #efe; } div.PRTFalse{ border: 1px dotted #FFA19E; - padding: 0.25em; - margin-top: 1em; background-color: #fee; } --- 271,291 ---- } + div.PRTTrue, div.PRTFalse { + width: 48%; + padding: 0.25em; + margin-top: 1em; + } + div.PRTTrue{ border: 1px solid #DDFFBA; padding: 0.25em; background-color: #efe; + float:left; } div.PRTFalse{ border: 1px dotted #FFA19E; background-color: #fee; + float:right; } *************** *** 277,281 **** text-align: left; width: 95%; ! background-color: #fff; } --- 295,310 ---- text-align: left; width: 95%; ! border: 0; ! } ! ! .interactionElementsTable td, .interactionElementsTable th { ! border-color: #000000; ! border-width: 0 0 0 1px; ! padding: 3px; ! } ! ! .IElabel { ! border:0 none; ! text-align: right; } *************** *** 320,323 **** --- 349,367 ---- } + div.authorMath { + background-color:#FFFFFF; + border:1px dashed; + clear:left; + float:none; + padding:0.2em; + width:505px; + display: none; + } + + div#authoringVersionID { + float:right; + font-size:small; + } + div#authoringControls { background-color:#EEEEEE; *************** *** 325,337 **** padding:5px; position:fixed; ! width:120px; ! left:20px; } div#authoringControls input { ! width: 110px; margin: 1px 5px; } /* Tables --------------------------------------------------------------*/ --- 369,384 ---- padding:5px; position:fixed; ! width:160px; } div#authoringControls input { ! width: 100px; margin: 1px 5px; } + div#authoringControls ul { + + } + /* Tables --------------------------------------------------------------*/ *************** *** 350,353 **** --- 397,409 ---- } + #questionListTable { + border-collapse: collapse; + border-spacing: 0; + } + + #questionListTable th { + background-image: url('pix/gradient.jpg') + } + .reportTable{ text-align: left; *************** *** 376,379 **** --- 432,439 ---- } + td { + vertical-align: top; + } + /* Lists ------------------------------------------------------------------*/ Index: Readme.txt =================================================================== RCS file: /cvsroot/stack/stack-dev/Readme.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Readme.txt 3 Nov 2008 16:34:45 -0000 1.4 --- Readme.txt 30 Sep 2010 16:56:15 -0000 1.5 *************** *** 77,79 **** ------------- ! 2.0: 3rd October 2007, initial Alpha release. --- 77,79 ---- ------------- ! 2.0: 3rd October 2007, initial Alpha release. \ No newline at end of file Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-dev/index.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** index.php 5 Feb 2010 15:52:03 -0000 1.42 --- index.php 30 Sep 2010 16:56:15 -0000 1.43 *************** *** 21,24 **** --- 21,36 ---- session_start(); + /*echo "<pre>"; + print_r($_SESSION); + echo "-------------------"; + print_r($_POST); + echo "-------------------"; + print_r($_GET); + echo "</pre>"; + + unset($_SESSION['S_item']); + unset($_SESSION['authorItem']); + */ + $configFile = 'config.php'; if(!file_exists($configFile)) *************** *** 81,85 **** foreach($selected as $name) { ! $db->removeItem($name); } $msg = '<p>'.get_string('FE_qDeleted','stack').'</p>'; --- 93,97 ---- foreach($selected as $name) { ! $db->removeLineContainingItem($name); } $msg = '<p>'.get_string('FE_qDeleted','stack').'</p>'; *************** *** 181,199 **** <body> ! <div class="section80"> ! <h3 class="section">Administrate STACK</h3> ! <ul class="horizontal"> ! <li><a href="lib/ui/authorTest.php"><?php echo get_string('FE_index_New','stack','') ?></a></li> ! <li><a href="lib/ui/questionImporter.php"><?php echo get_string('FE_index_Import','stack','') ?></a></li> ! <li><a href="chat.php"><?php echo get_string('FE_index_Chat','stack','') ?></a></li> ! <li><a href="lib/ui/search.php"><?php echo get_string('FE_index_search','stack','') ?></a></li> ! <li><a href="lib/ui/report.php"><?php echo get_string('FE_index_Reports','stack','') ?></a></li> ! <li><a href="lib/ui/OptionsEdit.php"><?php echo get_string('FE_index_Options','stack','') ?></a></li> ! <li><a href="http://stack.bham.ac.uk/wiki/"><?php echo get_string('FE_index_Docs','stack','') ?></a></li> ! <li><a href="testsuite.php"><?php echo get_string('FE_index_Test','stack','') ?></a></li> ! <li><a href="<?php echo $hintroot;?>"><?php echo get_string('FE_index_Hints','stack','') ?></a></li> ! <li><a href="index.php?action=logout"><?php echo get_string('FE_index_Logout','stack','') ?></a></li> ! </ul> ! </div> <?php --- 193,206 ---- <body> ! <a href="lib/ui/authorTest.php"><?php echo get_string('FE_index_New','stack','') ?></a> | ! <a href="lib/ui/questionImporter.php"><?php echo get_string('FE_index_Import','stack','') ?></a> | ! <a href="chat.php"><?php echo get_string('FE_index_Chat','stack','') ?></a> | ! <a href="lib/ui/search.php"><?php echo get_string('FE_index_search','stack','') ?></a> | ! <a href="lib/ui/report.php"><?php echo get_string('FE_index_Reports','stack','') ?></a> | ! <a href="lib/ui/OptionsEdit.php"><?php echo get_string('FE_index_Options','stack','') ?></a> | ! <a href="http://stack.bham.ac.uk/wiki/"><?php echo get_string('FE_index_Docs','stack','') ?></a> | ! <a href="testsuite.php"><?php echo get_string('FE_index_Test','stack','') ?></a> | ! <a href="<?php echo $hintroot;?>"><?php echo get_string('FE_index_Hints','stack','') ?></a> | ! <a href="index.php?action=logout"><?php echo get_string('FE_index_Logout','stack','') ?></a> <?php *************** *** 243,296 **** <?php echo '<h3>'.get_string('stackQuestion_filterQuestions','stack','').'</h3>'; ! echo '<p>'.get_string('stackQuestion_filterSearch','stack','').'</p>'; $db = new StackDBItem(); $db->connect(); ! // link all keywords ! $kwdb = new StackDBKeywords(); ! $kwdb->connect(); ! echo '<p>'; ! $keywords = $kwdb->getAllKeywords(true); ! //print_r($keywords); ! // need to sort alphnumerically whilst still respecting case (for now) ! ! if(!empty($keywords)) { ! foreach($keywords as $keyword) { ! $tags[$keyword] = strtolower($keyword); ! } ! ! // sort tags (lowercase keywords) ! asort($tags); ! echo "<b>".get_string('stackQuestion_questionKeywords', 'stack')."</b>: <a href='index.php'>*</a>, "; ! ! $firstTag = true; ! ! foreach($tags as $keyword => $tag) { ! if(!$firstTag) { ! echo ', '; ! } else $firstTag = false; ! echo "<a href='?tagged=$tag'>$keyword</a>"; ! } ! echo '.</p>'; ! } - if(isset($_GET['tagged'])) { - $questions = $db->getQuestionsTagged($_GET['tagged']); - } - else { $filter=array('order1'=>'','order2'=>'','order2'=>''); if (array_key_exists('bank_filter',$_POST)) { ! $filter['order1']=$_POST['bank_filter']['order1']; ! $filter['order2']=$_POST['bank_filter']['order2']; ! $filter['order3']=$_POST['bank_filter']['order3']; } $questions = $db->getListOfQuestions(NULL,true,$filter); ! } ! $no_question = 0; if(!empty($questions)) { ! echo "\n<form name='questionsform' action='index.php' method='POST'>\n"; /************************************************************************************/ --- 250,278 ---- <?php echo '<h3>'.get_string('stackQuestion_filterQuestions','stack','').'</h3>'; ! //echo '<p>'.get_string('stackQuestion_filterSearch','stack','').'</p>'; $db = new StackDBItem(); $db->connect(); ! // get question list $filter=array('order1'=>'','order2'=>'','order2'=>''); if (array_key_exists('bank_filter',$_POST)) { ! $filter['order1']=$_POST['bank_filter']['order1']; ! $filter['order2']=$_POST['bank_filter']['order2']; ! $filter['order3']=$_POST['bank_filter']['order3']; } + $questions = $db->getListOfQuestions(NULL,true,$filter); ! ! // link all keywords ! $kwdb = new StackDBKeywords(); ! $kwdb->connect(); ! // need to sort alphnumerically whilst still respecting case (for now) ! $all_keywords = $kwdb->getAllKeywords(true); if(!empty($questions)) { ! /************************************************************************************/ *************** *** 302,363 **** /************************************************************************************/ ! echo '<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="0">'; stack_questionBank_filter_tablehead($question_bank_filter); ! echo '<tr><td></td>'; ! $fields = array('ID','Name','Description','Valid', 'Status', 'Published','DateLastEdited','NoDeployed'); foreach($fields as $key) { $val = get_string('stackQuestion_question'.$key,'stack',''); echo "<th scope='column'>$val</th>"; } ! echo '<td> </td><td> </td><td> </td></tr>'; for($i=0; $i < count($questions); $i++) { ! if (stack_questionBank_filter_display_question($question_bank_filter,$questions[$i])) { ! echo '<tr> ! <td><input type="checkbox" name="'.$questions[$i]['id'].'" value="selected" /></td> ! <td>'.$questions[$i]['id'].'</td> ! <td>'.$questions[$i]['questionName'].'</td> ! <td>'.$questions[$i]['questionDescription'].'</td> ! <td>'.$questions[$i]['valid'].'</td> ! <td>'.$questions[$i]['status'].'</td> ! <td>'.get_string('stackMetaData_published'.$questions[$i]['published'], 'stack').'</td> ! <td>'.$questions[$i]['questionDateLastEdited'].'</td> <td>'.$questions[$i]['nodeployed'].'</td>'; if($questions[$i]['valid'] == 1) { ! echo '<td><a href="lib/ui/questionTest.php?id='.$questions[$i]['id'].'">'.get_string('stackQuestion_filterLinkTry','stack').'</a></td>'; } else { ! echo '<td>'.get_string('stackQuestion_filterLinkTry', 'stack').'</td>'; } - echo '<td><a href="lib/ui/authorTest.php?id='.$questions[$i]['id'].'">'.get_string('stackQuestion_filterLinkEdit','stack').'</a></td>'; if($questions[$i]['valid'] == 1) { ! echo '<td><a href="lib/ui/questionDeploy.php?id='.$questions[$i]['id'].'">'.get_string('stackQuestion_filterLinkDeploy','stack').'</a></td>'; } else { ! echo '<td>'.get_string('stackQuestion_filterLinkDeploy','stack').'</td>'; } ! echo '<td><a href="lib/ui/questionExporter.php?id='.$questions[$i]['id'].'">'.get_string('stackQuestion_filterLinkXML','stack').'</a></td>'; ! ! echo '</tr>'; ! $no_questions +=1; } } echo "\n</table>\n\n"; ! echo '(# = '.$no_questions.') <input type="radio" name="selectall" onclick="selectAll(this.form,0);" />'.get_string('stackSelectAll','stack').'<input type="radio" name="selectall" onclick="selectAll(this.form,1);" />'.get_string('stackInvertSelection','stack'); echo '<h4>'.get_string('stackQuestion_filterWithSelected','stack','').'</h4>'; $trans_sub = get_string('stackQuestion_filterExportToXML','stack'); --- 284,384 ---- /************************************************************************************/ ! echo "\n<form name='questionsform' action='index.php' method='POST'>\n"; + echo '<table>'; stack_questionBank_filter_tablehead($question_bank_filter); + echo '</table>'; ! echo '<table id="questionListTable">'; ! echo '<tr><th></th>'; ! $fields = array('Header','Valid', 'Status', 'Published','DateLastEdited','NoDeployed'); foreach($fields as $key) { $val = get_string('stackQuestion_question'.$key,'stack',''); echo "<th scope='column'>$val</th>"; } + echo '<th nowrap>'.get_string('stackQuestion_questionActions','stack','').'</th>'; + echo '<td></td></tr>'; ! $kwdb = new StackDBKeywords(); ! $kwdb->connect(); + $no_displayed=0; for($i=0; $i < count($questions); $i++) { ! $keywords = $kwdb->getQuestionsKeywords($questions[$i]['id']); ! if (stack_questionBank_filter_display_question($question_bank_filter,$questions[$i],$keywords)) { ! $no_displayed++; ! ! if($i % 2 == 0) echo '<tr class="even">'; ! else echo '<tr class="odd">'; ! echo '<td><input type="checkbox" name="'.$questions[$i]['id'].'" value="selected" /></td> ! <td><b>'.$questions[$i]['questionName'].'</b> (v.'.$questions[$i]['id'].'): </b>'.$questions[$i]['questionDescription']; ! ! if(!empty($keywords)) { ! echo '<br /><small>'; ! asort($keywords); ! $firstKeyword = true; ! foreach($keywords as $keyword) { ! if(!$firstKeyword) { ! echo ', '; ! } else $firstKeyword = false; ! $kwLink = "<a href='?tagged=$keyword'>".$keyword."</a>"; ! echo $kwLink; ! } ! echo '</small>'; ! } ! echo '</td><td style="text-align: center">'; ! if($questions[$i]['valid'] == 1) ! { ! echo '<img alt="1" src="pix/correct.png" />'; ! } ! else ! { ! echo '<img alt="0" src="pix/incorrect.png" />'; ! } ! echo '</td><td>'.$questions[$i]['status'].'</td>'; ! ! $val = $questions[$i]['published']; ! $aval = get_string('stackMetaData_published'.$questions[$i]['published'], 'stack'); ! echo '<td><img src="'.$config->get('webroot').'/pix/'.$val.'.png" alt="'.$aval.'" /></td>'; ! ! echo '<td>'.$questions[$i]['questionDateLastEdited'].'</td> <td>'.$questions[$i]['nodeployed'].'</td>'; + echo '<td nowrap>'; + echo '<a href="lib/ui/authorTest.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/pencil.png" title="'.get_string('stackIcon_edit','stack').'" alt="'.get_string('stackIcon_edit','stack').'" />'; if($questions[$i]['valid'] == 1) { ! echo '<a href="lib/ui/questionTest.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/eye.png" title="'.get_string('stackIcon_try','stack').'" alt="'.get_string('stackIcon_try','stack').'" /></a> '; } else { ! echo '<a href="lib/ui/questionTest.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/eye.png" title="'.get_string('stackIcon_try','stack').'" alt="'.get_string('stackIcon_try','stack').'" /></a> '; ! //echo get_string('stackQuestion_filterLinkTry', 'stack'); } if($questions[$i]['valid'] == 1) { ! echo ' <a href="lib/ui/questionDeploy.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/arrow_out.png" title="'.get_string('stackIcon_deploy','stack').'" alt="'.get_string('stackIcon_deploy','stack').'" /></a>'; } else { ! echo ' <img src="'.$config->get('webroot').'/pix/transparent16x16.gif" />'; ! //echo get_string('stackQuestion_filterLinkDeploy','stack'); } ! echo ' <a href="lib/ui/questionExporter.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/disk.png" title="'.get_string('stackIcon_xml','stack').'" alt="'.get_string('stackIcon_xml','stack').'" /></a>'; ! echo '</td></tr>'; } } echo "\n</table>\n\n"; ! ! echo '<br />'.$no_displayed.' ('.count($questions).') '.get_string('FE_index_question(s)', 'stack').'. '; ! ! echo ' <input type="radio" name="selectall" onclick="selectAll(this.form,0);" />'.get_string('stackSelectAll','stack').'<input type="radio" name="selectall" onclick="selectAll(this.form,1);" />'.get_string('stackInvertSelection','stack'); echo '<h4>'.get_string('stackQuestion_filterWithSelected','stack','').'</h4>'; $trans_sub = get_string('stackQuestion_filterExportToXML','stack'); *************** *** 374,377 **** --- 395,406 ---- echo '<input type="submit" name="Submit" value="'.get_string('stackQuestionList_Deploy','stack').'" class="stackbutton" /></span>'; echo "\n</form>\n"; + + echo '<table>'; + echo '<tr><th></th><th>'.get_string('stackQuestion_questionActions','stack','').'</th><th width="20"></th><th></th><th>'.get_string('stackQuestion_questionPublished','stack','').'</th></tr>'; + echo '<tr><td><img src="'.$config->get('webroot').'/pix/pencil.png" alt="'.get_string('stackQuestion_filterLinkEdit','stack').'" /></td> <td>'.get_string('stackQuestion_filterLinkEdit', 'stack').'</td><td></td><td><img src="'.$config->get('webroot').'/pix/Unpublished.png" alt="'.get_string('stackMetaData_publishedUnpublished', 'stack').'" /></td> <td>'.get_string('stackMetaData_publishedUnpublished', 'stack').'</td></tr>'; + echo '<tr><td><img src="'.$config->get('webroot').'/pix/eye.png" alt="'.get_string('stackIcon_try','stack').'" /></td> <td>'.get_string('stackQuestion_filterLinkTry', 'stack').'</td><td></td><td><img src="'.$config->get('webroot').'/pix/Published.png" alt="'.get_string('stackMetaData_publishedPublished', 'stack').'" /></td> <td>'.get_string('stackMetaData_publishedPublished', 'stack').'</td></tr>'; + echo '<tr><td><img src="'.$config->get('webroot').'/pix/arrow_out.png" alt="'.get_string('stackQuestion_filterLinkDeploy','stack').'" /></td> <td>'.get_string('stackQuestion_filterLinkDeploy', 'stack').'</td><td></td><td><img src="'.$config->get('webroot').'/pix/Private.png" alt="'.get_string('stackMetaData_publishedPrivate', 'stack').'" /></td> <td>'.get_string('stackMetaData_publishedPrivate', 'stack').'</td></tr>'; + echo '<tr><td><img src="'.$config->get('webroot').'/pix/disk.png" alt="'.get_string('stackQuestion_filterLinkXML','stack').'" /></td> <td>'.get_string('stackQuestion_filterLinkXML', 'stack').'</td></tr>'; + echo '</table>'; } else |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:53
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/stack In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/opaque/moodleModule/stack Modified Files: block_stack.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: block_stack.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/stack/block_stack.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** block_stack.php 23 Jun 2009 16:18:28 -0000 1.8 --- block_stack.php 30 Sep 2010 16:56:15 -0000 1.9 *************** *** 67,70 **** --- 67,76 ---- $this->content->icons[] = '<img src="'.$root.'/pix/i/switch.gif" class="icon" alt="Edit Question Options" />'; } + /* + if (has_capability('moodle/question:viewmine', $context)) { + $this->content->items[] = '<a href="'.$root.'/question/type/opaque/stack/soapPage.php?page=diagnostic">'.get_string('diagnostic', 'block_stack').'</a>'; + $this->content->icons[] = '<img src="'.$root.'/pix/i/outcomes.gif" class="icon" alt="Diagnostic Report" />'; + } + */ } else *************** *** 86,88 **** } ! ?> --- 92,94 ---- } ! ?> \ No newline at end of file |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:53
|
Update of /cvsroot/stack/stack-dev/lib/database In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/lib/database Modified Files: devCache.php StackDBItem.php StackDBAttemptPRTMeta.php StackDBBackup.php StackDBUser.php StackDB.php StackDBADOdb.php MoodleDB.php StackDBMySQL.php StackDBReporting.php StackDBCache.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: MoodleDB.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/MoodleDB.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MoodleDB.php 27 Aug 2009 16:23:00 -0000 1.14 --- MoodleDB.php 30 Sep 2010 16:56:13 -0000 1.15 *************** *** 70,78 **** public function batchAdd($questions, $userID, $engineID, $category='1') { if(!empty($questions)) { foreach($questions as $question) { ! $result = $this->addQuestion($question, $userID, $engineID, $category); if($result == false) --- 70,79 ---- public function batchAdd($questions, $userID, $engineID, $category='1') { + $this->logger->debug("busy: $questions, $userID, $engineID, $category"); if(!empty($questions)) { foreach($questions as $question) { ! $result = $this->addQuestion($question, NULL, $userID, $engineID, $category); // line is unchanged if($result == false) *************** *** 106,118 **** * @return bool $return true if successful */ ! public function addQuestion($stackID, $userID, $engineID, $category='1') { global $config; $moodleEnabled = $config->getMoodle('enabled'); if(($moodleEnabled == 'true') && ($engineID != NULL)) //if moodle config is setup { //load up the question from the stack db & grab its name, grade & guid. ! $item = new Item(NULL, $stackID); $itemName = $item->questionName->getSelection(); --- 107,120 ---- * @return bool $return true if successful */ ! public function addQuestion($id, $line, $userID, $engineID, $category='1') { global $config; $moodleEnabled = $config->getMoodle('enabled'); + $this->logger->debug("mycat:".$category." and userid:".$userID); if(($moodleEnabled == 'true') && ($engineID != NULL)) //if moodle config is setup { //load up the question from the stack db & grab its name, grade & guid. ! $item = new Item(NULL, $id); $itemName = $item->questionName->getSelection(); *************** *** 134,144 **** //check whether the question is already in the moodle question bank. ! $inQBank = $this->inMoodleQuestionBank($stackID, $engineID); if($inQBank === false) { //add the question ! return $this->newQuestion($engineID, $userID, $category, $itemID, $itemName, $itemMaxMark, $itemGUID); } else { //update the question(s) return $this->updateQuestion($inQBank, $engineID, $userID, $category, $itemID, $itemName, $itemMaxMark, $itemGUID); } --- 136,149 ---- //check whether the question is already in the moodle question bank. ! $inQBank = $this->inMoodleQuestionBank($id, $engineID); ! $this->logger->debug("tap"); if($inQBank === false) { + $this->logger->debug("noob q"); //add the question ! return $this->newQuestion($engineID, $userID, $category, $itemID, $line, $itemName, $itemMaxMark, $itemGUID); } else { //update the question(s) + $this->logger->debug("updating q in $inQBank"); return $this->updateQuestion($inQBank, $engineID, $userID, $category, $itemID, $itemName, $itemMaxMark, $itemGUID); } *************** *** 163,167 **** protected function updateQuestion($qID, $engineID, $userID, $category, $stackID, $qName, $qMaxMark, $qGUID) { ! $this->logger->finer("Updating item $stackID to Moodles database"); global $config; $prefix = $config->getMoodle('prefix'); --- 168,173 ---- protected function updateQuestion($qID, $engineID, $userID, $category, $stackID, $qName, $qMaxMark, $qGUID) { ! $this->logger->debug("Updating item $stackID to Moodles database"); ! global $config; $prefix = $config->getMoodle('prefix'); *************** *** 188,191 **** --- 194,209 ---- $result = false; } + + $sql = "UPDATE {$prefix}question_opaque SET + remoteid = ".$this->dbSafeString('q'.$stackID).", + WHERE questionid = $id"; + + $result = $this->query($sql); + if(!$result){ + $this->logger->error("Failed to add the question to the opaque_questions table"); + } + else{ + $this->logger->finer("Added to opaque_questions table"); + } } return true; *************** *** 203,210 **** * @return bool */ ! protected function newQuestion($engineID, $userID, $category, $stackID, $qName, $qMaxMark, $qGUID) { ! $this->logger->finer("Adding item $stackID to Moodles database"); ! $stackID = 'q'.$stackID; global $config; $prefix = $config->getMoodle('prefix'); --- 221,232 ---- * @return bool */ ! protected function newQuestion($engineID, $userID, $category, $versionID, $lineID, $qName, $qMaxMark, $qGUID) { ! if($lineID == NULL) $lineID = 12345; ! ! $this->logger->debug("Adding item $versionID (line $lineID) to Moodles database by user: $userID"); ! ! ! global $config; $prefix = $config->getMoodle('prefix'); *************** *** 235,239 **** $category, 0, ".$this->dbSafeString($qName)." , ".$this->dbSafeString('').", 0, ".$this->dbSafeString('').", ".$this->dbSafeString('').", $qMaxMark, 0,".$this->dbSafeString(QTYPE).", 1, ".$this->dbSafeString($qGUID).", ".$this->dbSafeString($timestamp).", 0, $timestamp, $timestamp, $userID );"; ! $this->connectMoodleDB(); $added = $this->query($sql); --- 257,261 ---- $category, 0, ".$this->dbSafeString($qName)." , ".$this->dbSafeString('').", 0, ".$this->dbSafeString('').", ".$this->dbSafeString('').", $qMaxMark, 0,".$this->dbSafeString(QTYPE).", 1, ".$this->dbSafeString($qGUID).", ".$this->dbSafeString($timestamp).", 0, $timestamp, $timestamp, $userID );"; ! $this->logger->finer("trying adding to moodle question bank with sql: $sql"); $this->connectMoodleDB(); $added = $this->query($sql); *************** *** 253,257 **** remoteversion ) ! VALUES ( $qid, $engineID, ".$this->dbSafeString($stackID).", ".$this->dbSafeString('1.0').");"; $result = $this->query($sql); --- 275,279 ---- remoteversion ) ! VALUES ( $qid, $engineID, ".$this->dbSafeString('q'.$versionID).", ".$this->dbSafeString($lineID.'.'.$versionID).");"; // some redundancy for now until versioning get more sophisticated, e.g. with milestones $result = $this->query($sql); *************** *** 594,597 **** --- 616,706 ---- } } + + /** + * PROBABLY NOT NEEDED + * Return an mapping from the quizzes the student has taken to the attempts made. + * @access public + * @param int $student + * @return array $attempts + */ + public function getQuizAttempts($student, $course = NULL) { + global $config; + $prefix = $config->getMoodle('prefix'); + if(NULL == $course) { // irrespective of course + $sql = "SELECT quiz, {$prefix}quiz_attempts.id FROM {$prefix}quiz_attempts WHERE userid = ".$this->dbSafeString($student); + } else { // course specific + $sql = "SELECT quiz, {$prefix}quiz_attempts.id FROM {$prefix}quiz_attempts, {$prefix}quiz " . + "WHERE userid = ".$this->dbSafeString($student). + " AND course =".$this->dbSafeString($course). + " AND {$prefix}quiz.id = quiz"; + } + //$this->logger->debug($sql); + $result = $this->query($sql); + $attempts = NULL; + if($result) { + for($i = 0; $i < $this->noRows(); $i++) { + $attempts[$this->result($i, 'quiz')][] = $this->result($i, 'id'); // NOT result($i, 'attempt')! + } + } + return $attempts; + } + + /** + * Return an mapping from the questions the student has attempted to the attempt. + * @access public + * @param int $student + * @return array $attempts + */ + public function getQuestionAttempts($student, $course = NULL) { + global $config; + $prefix = $config->getMoodle('prefix'); + if(NULL == $course) { // irrespective of course + $sql = "SELECT quiz, {$prefix}quiz_attempts.id FROM {$prefix}quiz_attempts WHERE userid = ".$this->dbSafeString($student); + } else { // course specific + $sql = "SELECT quiz, {$prefix}quiz_attempts.id FROM {$prefix}quiz_attempts, {$prefix}quiz " . + "WHERE userid = ".$this->dbSafeString($student). + " AND course =".$this->dbSafeString($course). + " AND {$prefix}quiz.id = quiz"; + } + //$this->logger->debug($sql); + $result = $this->query($sql); + $attempts = NULL; + if($result) { + for($i = 0; $i < $this->noRows(); $i++) { + $attempts[$this->result($i, 'quiz')][] = $this->result($i, 'id'); // NOT result($i, 'attempt')! + } + } + return $attempts; + } + + /** + * Return all the responses from the student for the given attempt, in order, as well as (Moodle) question id + * @access public + * @param int $attempt + * @return array $responses + */ + public function getQuestionAttemptResponses($attempt) { + global $config; + $prefix = $config->getMoodle('prefix'); + + $sql = "SELECT seq_number, answer, event, question, remoteid" . + " FROM {$prefix}question_states, {$prefix}question_opaque" . + " WHERE attempt = ".$this->dbSafeString($attempt). + " AND {$prefix}question_opaque.questionid = {$prefix}question_states.question". + " ORDER BY seq_number"; + + $result = $this->query($sql); + // $responses = NULL; + if($result) { + for($i = 0; $i < $this->noRows(); $i++) { + $q = $this->result($i, 'question'); + $s = $this->result($i, 'seq_number'); + $return[$q]['version'] = substr($this->result($i, 'remoteid'), 1); // strip off 'q' + $return[$q][$s]['answer'] = $this->result($i, 'answer'); + $return[$q][$s]['event'] = $this->result($i, 'event'); + } + } + return $return; + } } Index: StackDBAttemptPRTMeta.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBAttemptPRTMeta.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** StackDBAttemptPRTMeta.php 29 Jan 2010 11:03:08 -0000 1.8 --- StackDBAttemptPRTMeta.php 30 Sep 2010 16:56:13 -0000 1.9 *************** *** 114,120 **** } } - - - } --- 114,117 ---- Index: StackDB.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDB.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StackDB.php 27 Aug 2009 16:23:00 -0000 1.5 --- StackDB.php 30 Sep 2010 16:56:13 -0000 1.6 *************** *** 78,81 **** --- 78,83 ---- public function allResults($field = NULL); + + //public function last_insert_id(); } Index: StackDBADOdb.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBADOdb.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** StackDBADOdb.php 27 May 2010 11:10:09 -0000 1.9 --- StackDBADOdb.php 30 Sep 2010 16:56:13 -0000 1.10 *************** *** 349,354 **** } ! public function insert_id() { ! return Insert_ID(); // PO_Insert_ID() is a more portable but untested alternative. } --- 349,354 ---- } ! public function last_insert_id() { ! return $this->conn->Insert_ID(); // PO_Insert_ID() is a more portable but untested alternative. } Index: StackDBUser.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBUser.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StackDBUser.php 27 Aug 2009 16:23:00 -0000 1.7 --- StackDBUser.php 30 Sep 2010 16:56:13 -0000 1.8 *************** *** 157,160 **** --- 157,179 ---- /** + * Returns a count of moodle users + * @param int $userid + * @return int $number + */ + public function countUsers() + { + global $config; + $prefix = $config->getMoodle('prefix'); + $sql = 'SELECT COUNT(id) as count + FROM '.$prefix.'user'; + + $this->connect(); + $this->query($sql); + $this->disconnect(); + + return $this->result(0, 'count'); + } + + /** * Returns a list of a user's moodle capabilities. (NOTE: Does not take context into account). * *************** *** 231,235 **** } } - } --- 250,253 ---- Index: StackDBCache.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBCache.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** StackDBCache.php 27 May 2010 15:34:14 -0000 1.21 --- StackDBCache.php 30 Sep 2010 16:56:13 -0000 1.22 *************** *** 50,57 **** // add a transition using the new state id ! $transition = $this->addTransition($lastNode, $stateID, $post, $event); ! // add attempt_meta information ! if($userEvent) $this->addMeta($stateID, $state); } --- 50,59 ---- // add a transition using the new state id ! if($stateID !== NULL) { // state added successfully: go ahead and reference it! ! $transition = $this->addTransition($lastNode, $stateID, $post, $event); ! // add attempt_meta information ! if($userEvent) $this->addMeta($stateID, $state); ! } } *************** *** 59,63 **** $this->query("UNLOCK TABLES"); ! return $transition; // either the new or recent prior one } --- 61,65 ---- $this->query("UNLOCK TABLES"); ! return $transition; // either the new or recent prior one (or NULL on failure) } *************** *** 78,88 **** ", NOW())"; ! $this->query($sql); ! // NOTE: if this fails it will mess the transition table because of 'last index' method below. ! $this->logger->debug("SQL debug: ".$sql); ! // would be nice to be able to obtain the index for the last insert (like mysql_insert_id) without this extra call but would require extending the StackDB interface ! $this->query("SELECT id FROM display_cache ORDER BY id DESC LIMIT 1"); // safe for multi-threading? if($this->noRows()<=0) { // no rows in display_cache? --- 80,92 ---- ", NOW())"; ! //$this->logger->debug("SQL:".$sql); ! $result = $this->query($sql); ! if(empty($result)) { // insert failed! ! $this->logger->critical("Failed to store a question state!"); ! return NULL; // don't add a transition! ! } // would be nice to be able to obtain the index for the last insert (like mysql_insert_id) without this extra call but would require extending the StackDB interface ! $this->query("SELECT id FROM display_cache ORDER BY id DESC LIMIT 1"); // safe for multi-threading if higher-level lock maintained if($this->noRows()<=0) { // no rows in display_cache? *************** *** 227,231 **** */ public function nextNode($transition) { - // takes current node and posted answers // returns next node id (used for obtaining cache state) $sql = "SELECT nextNode FROM display_cache_sequence " . --- 231,234 ---- *************** *** 327,330 **** --- 330,353 ---- } + /* + * Determines whether a question can be changed without fear. + * i.e. even if it has available initial states, these have not been processed. + */ + public function hasActiveStates($qID) { + // initial states have a transition from a state id of 0 + + // get all starting configs for given question + $sql = "SELECT display_cache.id, display_cache.state FROM display_cache_sequence, display_cache " . + "LEFT JOIN display_cache_sequence AS successor " . + "ON successor.currentNode = $qID ". + "WHERE display_cache.qID = $qID " . + "AND display_cache_sequence.currentNode = 0 " . + "AND display_cache_sequence.nextNode = display_cache.id"; + $this->query($sql); + + // return 0 if question not deployed + return ($this->noRows() === 0); + } + /** * Empties the entire cache *************** *** 384,388 **** $this->query($sql); - //echo "<pre>";print_r($this); echo"</pre>"; $xhtml = '<table id="transitionstable" border=1>'; --- 407,410 ---- *************** *** 446,450 **** public function showInitialStates($qid) { - //$sql .= "SELECT * FROM display_cache WHERE qID=".$qid." ORDER BY id"; $sql = "SELECT display_cache.* FROM display_cache_sequence, display_cache " . "WHERE display_cache.qID = $qid " . --- 468,471 ---- *************** *** 453,461 **** $this->query($sql); //echo "<pre>";print_r($this); echo"</pre>"; ! $xhtml = "<h2>Initial states for question #$qid</h2>"; $xhtml .= '<table id="statestable" border=1>'; ! $xhtml .= '<tr><th>id</th><th>answers</th><th>current / total mark</th><th>exp.</th><th>questionNote</th><th>xhtml</th></tr>'; for ($i=0; $i<$this->noRows(); $i++) { $post = $this->base64_unserialize($this->result($i, 'post')); --- 474,538 ---- $this->query($sql); + //echo $this->noRows(); + + // store these initial states since we'll need to use the connection for finding successive states + for ($i=0; $i<$this->noRows(); $i++) { + $id = $this->result($i,'id'); + $initials[$id]['id'] = $id; + $initials[$id]['post'] = $this->base64_unserialize($this->result($i, 'post')); + $initials[$id]['state'] = $this->base64_unserialize($this->result($i, 'state')); + $initials[$id]['answers'] = $this->pretty_post($this->base64_unserialize($this->result($i, 'answers')), true); + $initials[$id]['currentTotalMark'] = $this->result($i, 'currentTotalMark'); + $initials[$id]['totalPossibleMarks'] = $this->result($i, 'totalPossibleMarks'); + $initials[$id]['expired'] = $this->result($i, 'expired'); + $initials[$id]['questionNote'] = $this->result($i, 'questionNote'); + $initials[$id]['xhtml'] = $this->result($i,'xhtml'); + } //echo "<pre>";print_r($this); echo"</pre>"; ! $xhtml .= '<table id="statestable" border=1>'; ! $xhtml .= '<tr><th>id</th><th>answers</th><th>current / total mark</th><th>exp.</th><th>questionNote</th><th>xhtml</th><th>transitions</th></tr>'; ! ! foreach($initials as $i) { ! $xhtml .= '<td>'.$i['id'].'</td>'; ! $xhtml .= '<td>'.$i['answers'].'</td>'; ! $xhtml .= '<td>'.$i['currentTotalMark'].' / '.$i['totalPossibleMarks'].'</td>'; ! $xhtml .= '<td>'.$i['expired'].'</td>'; ! $xhtml .= '<td>'.$i['questionNote'].'</td>'; ! $xhtml .= '<td>'.$i['xhtml'].'</td>'; ! ! $xhtml .= '<td>'.$this->innerTransitionsTable($i['id']).'</td></tr>'; ! } ! $xhtml .= '</table>'; ! return $xhtml; ! } ! ! private function innerTransitionsTable($id) { ! $transitions = $this->stateTransitions($id); ! $xhtml = ''; ! if($transitions) { ! $xhtml .= '<table>'; // start inner table ! foreach($transitions as $t) { ! if($t['previous'] !== null) { ! if($t['previous'] > 0) $xhtml .= '<tr><td><a href="?sid='.$t['previous'].'">« back to '.$t[previous].'</a></td></tr>'; ! } ! else if($t['nextNode'] != $id) $xhtml .= ! '<tr><td><a href="?sid='.$t['nextNode'].'">» '.$this->pretty_post($this->base64_unserialize($t['post'])).'</a> ('.$t['event'].')</td></tr>'; ! else $xhtml .= '(loopback) '.$this->pretty_post($this->base64_unserialize($t['post'])); ! } ! $xhtml .= '</table>'; // end inner table ! } ! return $xhtml; ! } ! ! public function showCacheState($id) { ! $sql .= "SELECT * FROM display_cache WHERE id=".$id; ! ! $this->query($sql); ! ! //echo "<pre>";print_r($this); echo"</pre>"; ! $xhtml .= '<table id="statestable" border=1>'; ! $xhtml .= '<tr><th>id</th><th>answers</th><th>current / total mark</th><th>exp.</th><th>questionNote</th><th>xhtml</th><th>transitions</th></tr>'; for ($i=0; $i<$this->noRows(); $i++) { $post = $this->base64_unserialize($this->result($i, 'post')); *************** *** 468,503 **** $xhtml .= '<td>'. $this->result($i, 'questionNote') .'</td>'; $xhtml .= '<td>'. $this->result($i,'xhtml').'</td>'; ! $xhtml .= '</tr>'; } - - $xhtml .= '</table>'; return $xhtml; } ! public function showCacheState($id) { ! $sql .= "SELECT * FROM display_cache WHERE id=".$id; ! ! //$this->query($sql); $this->query($sql); ! //echo "<pre>";print_r($this); echo"</pre>"; ! $xhtml = '<table id="statestable" border=1>'; ! $xhtml .= '<tr><th>id</th><th>qID</th><th>answers</th><th>current total mark</th><th>total possible marks</th><th>exp.</th><th>questionNote</th><th>xhtml</th></tr>'; ! ! $post = $this->base64_unserialize($this->result(0, 'post')); ! $state = $this->base64_unserialize($this->result(0, 'state')); ! $xhtml .= '<tr><td>'. $this->result(0,'id').'</td>'; ! $xhtml .= '<td>'. $this->result(0,'qID') .'</td>'; ! //$xhtml .= '<td>'.$this->elementsToHTML($state).'</td>'; ! $xhtml .= '<td>'. $this->pretty_post($this->base64_unserialize($this->result($i, 'answers')), true) .'</td>'; ! $xhtml .= '<td>'. $this->result(0, 'currentTotalMark') .'</td>'; ! $xhtml .= '<td>'. $this->result(0, 'totalPossibleMarks') .'</td>'; ! $xhtml .= '<td>'. $this->result(0, 'expired') .'</td>'; ! $xhtml .= '<td>'. $this->result(0, 'questionNote') .'</td>'; ! $xhtml .= '<td>'. $this->result(0,'xhtml').'</td>'; ! $xhtml .= '</tr>'; ! ! $xhtml .= '</table>'; ! return $xhtml; } --- 545,572 ---- $xhtml .= '<td>'. $this->result($i, 'questionNote') .'</td>'; $xhtml .= '<td>'. $this->result($i,'xhtml').'</td>'; ! $xhtml .= '<td>'; ! $xhtml .= $this->innerTransitionsTable($this->result($i,'id')); ! $xhtml .= '</td></tr>'; } return $xhtml; } ! private function stateTransitions($id) ! { ! $sql = "SELECT * FROM display_cache_sequence WHERE currentNode=$id OR nextNode=$id"; $this->query($sql); + for ($i=0; $i<$this->noRows(); $i++) { + $tid = $this->result($i,'id'); + if($this->result($i, 'currentNode') == $id) { // transition FROM this node + $transitions[$tid]['nextNode'] = $this->result($i, 'nextNode'); + $transitions[$tid]['post'] = $this->result($i, 'post'); + $transitions[$tid]['event'] = $this->result($i, 'event'); + } else { // transition TO this node + $transitions[$tid]['previous'] = $this->result($i, 'currentNode'); + } + } ! //print_r($transitions); ! return $transitions; } *************** *** 542,546 **** } // potentially costly item deserialisation but can we justify an extra field for reversion? ! $item = $this->base64_unserialize($this->result($i, 'state')); //$array['version'] = $item->getVersion(); --- 611,615 ---- } // potentially costly item deserialisation but can we justify an extra field for reversion? ! //$item = $this->base64_unserialize($this->result($i, 'state')); //$array['version'] = $item->getVersion(); *************** *** 616,620 **** /** ! * Effectively 'undeploys' a question instance without removing it (and it's sucessors) from * the cache as dropState() does. */ --- 685,689 ---- /** ! * Effectively 'undeploys' a version instance without removing it (and it's sucessors) from * the cache as dropState() does. */ *************** *** 622,625 **** --- 691,702 ---- $this->query("DELETE FROM display_cache_sequence WHERE currentNode=0 AND nextNode=$id"); } + + // checks whether a version is deployed, i.e. has instances which are initial states + // return number of insances deployed + public function instancesDeployed($id) { + $this->query("SELECT * FROM display_cache, display_cache_sequence " . + "WHERE display_cache.qID=$id AND currentNode=0 AND nextNode=display_cache.id"); + return $this->noRows(); + } } ?> \ No newline at end of file Index: devCache.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/devCache.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** devCache.php 24 May 2010 16:44:42 -0000 1.13 --- devCache.php 30 Sep 2010 16:56:13 -0000 1.14 *************** *** 26,32 **** $cache->connect(); ! $qidfilter = $_GET['qid']; ! $startrow = isset($_GET['startrow']) ? $_GET['startrow'] : 0; ! $rowcount = isset($_GET['rowcount']) ? $_GET['rowcount'] : 10; // process button presses --- 26,30 ---- $cache->connect(); ! $qid = $_GET['qid']; // process button presses *************** *** 42,46 **** ?> <head> ! <title>Direct Cache Access</title> <style> .box { --- 40,44 ---- ?> <head> ! <title>CAS Cache Admin</title> <style> .box { *************** *** 61,107 **** } </style> </head> ! <div class="box"> ! <?php if(isset($qidfilter)) ! echo $qidfilter == '*' ? $cache->dumpCacheSequence() : $cache->dumpCacheSequence($qidfilter); ! ?> ! </div> ! <div class="box"> <?php ! $allQs = $cache->getQuestionIDs(); if(NULL !== $allQs) { ! echo "Show question: "; ! if($quidfilter !== '*') echo "<a href='devCache.php?qid=*'>All</a> "; ! else echo "All "; ! foreach($allQs as $qid) { ! if($qid == $qidfilter) echo $qid." "; ! else echo "<a href='?qid=".$qid."'>$qid</a> "; } } else echo "Cache is completely empty."; - ?> - <form method="POST" action="devCache.php"> - <input type="submit" value="Refresh"> - <input type="submit" name="op" value="clear successive states"> - <input type="submit" name="op" onClick="return confirm('Are you sure you want to clear the ENTIRE cache?')" value="clear ENTIRE cache"> - </form> - </div> - <br clear="left" /> - <?php /*$cache->cacheStatePager();*/ ?> - <br clear="left" /> <?php ! if(isset($qidfilter)) ! echo $qidfilter == '*' ? $cache->dumpCacheState(null, $rowcount, $startrow) : $cache->dumpCacheState($qidfilter, $rowcount, $startrow); ?> <script> $(document).ready(function() { ! $('table#statestable td:last-child') .wrapInner('<div class="hidden">') .mouseover(function(x) {$(this).children('.hidden').slideDown('fast').next().remove()}) ! .append('<p>hover over to view</p>'); $('tr:odd').css('background-color', '#e6e6e6'); }); ! </script> \ No newline at end of file --- 59,113 ---- } + .freq { + color: #ccc; + font-size: small; + } + </style> </head> ! <body> ! <form method="POST" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> ! <input type="submit" name="op" value="clear non-initial states"> ! <input type="submit" name="op" onClick="return confirm('Are you sure you want to clear the ENTIRE cache?')" value="clear ENTIRE cache"> ! <b>Note:</b> Initial states represent deployed questions. ! </form> ! ! ! <h2>Questions with cached states</h2> <?php ! $allQs = $cache->getQuestionFreqs(); if(NULL !== $allQs) { ! echo "Questions: "; ! foreach($allQs as $id => $freq) { ! if($id == $qid) echo $id."<span class='freq'>×$freq</span> "; ! else echo "<a href='?qid=".$id."'>$id</a><span class='freq'>×$freq</span> "; } } else echo "Cache is completely empty."; ?> <?php ! //var_dump($qid); ! if(isset($_GET['sid'])) { ! echo "<h2>State #$_GET[sid]</h2>"; ! echo $cache->showCacheState($_GET['sid']); ! } ! ! if(!empty($qid)) { ! echo "<h2>Initial states for question #$qid</h2>"; ! echo $cache->showInitialStates($qid); ! } ! ! //echo $cache->dumpCacheSequence($qid); ?> <script> $(document).ready(function() { ! /* $('table#statestable td:last-child') .wrapInner('<div class="hidden">') .mouseover(function(x) {$(this).children('.hidden').slideDown('fast').next().remove()}) ! .append('<p>hover over to view</p>');*/ $('tr:odd').css('background-color', '#e6e6e6'); + $('tr:even').css('background-color', '#ffffff'); }); ! </script> ! </body> \ No newline at end of file Index: StackDBReporting.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBReporting.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** StackDBReporting.php 16 Sep 2009 12:04:22 -0000 1.27 --- StackDBReporting.php 30 Sep 2010 16:56:13 -0000 1.28 *************** *** 26,30 **** * Provides the database functions for reporting students answers. * - * */ class StackDBReporting extends StackDBADOdb { --- 26,29 ---- *************** *** 43,593 **** } [...1354 lines suppressed...] + // { + // $attemptId = $this->result($i, 'AttemptID'); + // $questionId = $this->result($i, 'QuestionID'); + // $userId = $this->result($i, 'UserID'); + // $PRTName = $this->result($i, 'PRTName'); + // $RawMark = $this->result($i, 'RawMark'); + // $ModMark = $this->result($i, 'ModMark'); + // + // if(!array_key_exists($questionId, $resultsArray) || !array_key_exists($userId, $resultsArray[$questionId])) + // { + // $resultsArray[$questionId][$userId] = new MarksAttempt($userId, $questionId); + // } + // $resultsArray[$questionId][$userId]->addAttempt($attemptId, $PRTName, $RawMark, $ModMark); + // } + // + // return $resultsArray; + // } + // } Index: StackDBBackup.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBBackup.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StackDBBackup.php 27 Aug 2009 16:23:00 -0000 1.5 --- StackDBBackup.php 30 Sep 2010 16:56:13 -0000 1.6 *************** *** 19,25 **** * Database backup functions */ ! require_once 'StackDBMySQL.php'; ! class StackDBBackup extends StackDBMySQL { // Attributes --- 19,25 ---- * Database backup functions */ ! require_once 'StackDBADOdb.php'; ! class StackDBBackup extends StackDBADOdb { // Attributes Index: StackDBItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBItem.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** StackDBItem.php 5 Feb 2010 15:52:07 -0000 1.35 --- StackDBItem.php 30 Sep 2010 16:56:13 -0000 1.36 *************** *** 71,74 **** --- 71,75 ---- questionKeywords , questionUserLastEdited , + line , questionPublisher , questionFormat , *************** *** 90,96 **** ) VALUES ( ! $meta[questionGUID], $meta[questionName], $meta[questionDescription], $meta[questionKeywords], $meta[lastUserEditor], $meta[questionPublisher], $meta[questionFormat], $meta[language], $meta[questionRights], $meta[questionLearningContext], $meta[questionDifficulty], $meta[questionCompetency], $meta[questionCompentencyLevel], $meta[questionTimeAllocated], $meta[questionExerciseType], ".$this->conn->sysTimeStamp." , ".$this->dbSafeString($dbQuestionVariables).", ".$this->dbSafeString($dbItemOptions).", ".$this->dbSafeString($dbItemTests)." , ".$this->dbSafeString($valid==1?1:0)." , ".$this->dbSafeString($status)." , ".$this->dbSafeString($published).");"; ! $added = $this->query($sql); if($added) --- 91,97 ---- ) VALUES ( ! $meta[questionGUID], $meta[questionName], $meta[questionDescription], $meta[questionKeywords], $meta[lastUserEditor], $meta[line], $meta[questionPublisher], $meta[questionFormat], $meta[language], $meta[questionRights], $meta[questionLearningContext], $meta[questionDifficulty], $meta[questionCompetency], $meta[questionCompentencyLevel], $meta[questionTimeAllocated], $meta[questionExerciseType], ".$this->conn->sysTimeStamp." , ".$this->dbSafeString($dbQuestionVariables).", ".$this->dbSafeString($dbItemOptions).", ".$this->dbSafeString($dbItemTests)." , ".$this->dbSafeString($valid==1?1:0)." , ".$this->dbSafeString($status)." , ".$this->dbSafeString($published).");"; + $this->logger->debug($sql); $added = $this->query($sql); if($added) *************** *** 98,103 **** //get question id for newly added item & return. //$result = $this->query("SELECT `questionID` FROM `stackQuestion` WHERE `questionGUID` = '$meta[questionGUID]'"); ! $result = $this->query("SELECT max(questionId) FROM stackquestion"); ! $result = $this->result(0,0); //echo 'Last inserted: '.$result; } --- 99,104 ---- //get question id for newly added item & return. //$result = $this->query("SELECT `questionID` FROM `stackQuestion` WHERE `questionGUID` = '$meta[questionGUID]'"); ! $result = $this->query("SELECT questionID FROM stackquestion ORDER BY questionID desc limit 1"); ! $result = $this->result(0,'questionID'); //echo 'Last inserted: '.$result; } *************** *** 117,123 **** * @return int * @access public ! */ public function updateItem($id, $dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $valid, $status, $published) { //make meta db safe foreach($meta as $label => $val) --- 118,128 ---- * @return int * @access public ! * public function updateItem($id, $dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $valid, $status, $published) { + return addNewItem($dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $valid, $status, $published); + + //update line + /* //make meta db safe foreach($meta as $label => $val) *************** *** 142,146 **** //build query - $sql = "UPDATE stackquestion SET questionGUID = $meta[questionGUID], questionName = $meta[questionName], --- 147,150 ---- *************** *** 148,151 **** --- 152,156 ---- questionKeywords = $meta[questionKeywords], questionUserLastEdited = $meta[lastUserEditor], + line = $meta[line], questionPublisher = $meta[questionPublisher], questionFormat = $meta[questionFormat], *************** *** 167,185 **** WHERE questionID = $id;"; ! $updated = $this->query($sql); ! if($updated) ! { ! return $id; ! } ! else ! { ! $this->errorLog->addError('Could not update Item'); ! $this->logger->critical('Failed to save item id '.$id); ! return false; ! } } /** --- 172,211 ---- WHERE questionID = $id;"; ! }*/ ! + /** + + * @param + * @return bool + * @access public + */ + public function newLine() + { + $sql = "INSERT INTO question_lines() VALUES()"; + $this->logger->debug($sql); + $this->query($sql); + + $this->query("SELECT id FROM question_lines ORDER BY id DESC LIMIT 1"); + return $this->result(0,'id'); } + public function setLatestVersion($line, $version) { + $sql = "UPDATE question_lines SET latestVersion=$version WHERE id=$line"; + $this->logger->debug("trying to set latest version with sql:$sql"); + $this->query($sql); + } + public function getLatestVersion($qid) { + $sql = "SELECT latestVersion FROM question_lines, stackquestion WHERE questionID=$qid AND line=question_lines.id"; + $this->logger->debug("trying to get latest version with sql:$sql"); + $this->query($sql); + return $this->result(0, 'latestVersion'); + } + + public function nameExists($name) { + $this->query("SELECT * FROM stackquestion WHERE questionName='$name'"); + return $this->noRows() > 0; + } /** *************** *** 207,210 **** --- 233,270 ---- } + /** + * Removes a line of items, their PRTrees and keywords + * + * @param int $id + * @return bool + * @access public + */ + public function removeLineContainingItem($id) + { + // get line from item id + $sql = "SELECT line FROM stackquestion WHERE questionID = $id"; + $result = $this->query($sql); + $line = $this->result(0, 'line'); + $this->logger->finer('Removing line '.$line); + + // get all question IDs + $sql = "SELECT questionID from stackquestion WHERE line = $line"; + $result = $this->query($sql); + if($result !== false) { + foreach($result as $row) { + $toRemove[] = $row['questionID']; + } + } + + foreach($toRemove as $id) { + $this->removeItem($id); + } + + // finally, remove line record + $sql = "DELETE FROM question_lines WHERE id = $line"; + $result = $this->query($sql); + return $result; + } + /** * Removes an items PRTrees. *************** *** 417,420 **** --- 477,518 ---- } + /** + * Returns the line that contains this Item version + * + * @param int $id + * @return int version + **/ + public function getLine($id) { + $sql = "SELECT line FROM stackquestion WHERE questionID = $id"; + //echo $sql; + $result = $this->query($sql); + if(!$result) + { + $this->logger->critical('No line recorded for item with id '.$id); + return false; + } + else + { + $toReturn = $this->result(0,'line'); + return $toReturn; + } + + } + + // returned in descending order + public function getVersions($line) { + if(!is_numeric($line)) { + $this->logger->critical("line not defined!"); + } + $sql = "SELECT questionID, questionDateLastEdited from stackquestion WHERE line=$line ORDER BY questionID DESC"; + //echo $sql; + $result = $this->query($sql); + if($result !== false) { + foreach($result as $row) { + $history[$row['questionDateLastEdited']] = $row['questionID']; + } + } + return $history; + } /** *************** *** 426,430 **** * @return array */ ! public function getListOfQuestions($userID=NULL,$public=false,$filter=NULL,$tags=NULL) { $this->logger->finest('getListOfQuestions, userID='.$userID); --- 524,528 ---- * @return array */ ! public function getListOfQuestions($userID=NULL,$public=false,$filter=NULL) { $this->logger->finest('getListOfQuestions, userID='.$userID); *************** *** 433,441 **** $qList = NULL; ! $dateFormat = stack_sqlDateFormat(true); //uses to date format in the config file to give a sql date format. ! $dateQuery = $this->conn->SQLDate($dateFormat,'questionDateLastEdited'); ! $OrderBy = ' ORDER BY questionID'; ! /* // First level if (NULL != $filter) { --- 531,538 ---- $qList = NULL; ! //$dateFormat = stack_sqlDateFormat(true); //uses to date format in the config file to give a sql date format. ! //$dateQuery = $this->conn->SQLDate($dateFormat,'questionDateLastEdited'); ! $OrderBy = ' ORDER BY questionID DESC'; // First level if (NULL != $filter) { *************** *** 456,490 **** } } - */ ! $sql = "SELECT questionID, questionName, questionDescription, valid, published, status, $dateQuery AS dateEdited " . ! "FROM stackquestion "; if(!empty($tags)) $sql .= ", question_keyword, keywords "; // tbc if($userID !== NULL) { if ($public) { ! $sql .= "WHERE (questionUserLastEdited = $userID or published=".$this->dbSafeString('Published').")"; } else { ! $sql .= "WHERE (questionUserLastEdited = $userID)"; } } ! if(!empty($tags)) { ! if($userID !== NULL) $sql .= " AND "; ! //echo '('; // create multi-keyword conditions foreach(explode(' ', $tags) as $tag) { ! $cond[] = "keywords.keyword = ".$this->dbSafeString($tag); } ! $sql .= '('.implode($cond, ' OR ').')'; ! /* ! $sql .= "keywords.keyword = ".$this->dbSafeString($tags)." " . ! "AND keywords.id = kwid " . ! "AND qid = stackquestion.questionID";*/ ! $sql .= " AND keywords.id = kwid " . ! "AND qid = stackquestion.questionID"; ! //$sql .= '('.implode($cond, ' OR ').')'; } $sql .= $OrderBy; --- 553,667 ---- } } ! $sql = "SELECT questionID, line, questionName, questionDescription, valid, published, status, questionDateLastEdited AS dateEdited " . ! "FROM stackquestion, question_lines"; if(!empty($tags)) $sql .= ", question_keyword, keywords "; // tbc if($userID !== NULL) { if ($public) { ! $sql .= " WHERE (questionUserLastEdited = $userID or published=".$this->dbSafeString('Published').")"; } else { ! $sql .= " WHERE (questionUserLastEdited = $userID)"; } } ! if($userID !== NULL) $sql .= " AND "; ! else $sql .= " WHERE "; ! $sql .= "question_lines.latestVersion = stackquestion.questionID"; ! // filter ! //if($filter !== NULL) $sql .= " AND questionName LIKE '%$filter%' "; ! ! $sql .= $OrderBy; ! ! $this->logger->debug('getListOfQuestions, sql='.$sql); ! $result = $this->query($sql); ! //print_r($sql); ! ! if($result === false) ! { ! $this->logger->error('getListOfQuestions: Failed to load question list'); ! return false; ! } ! else ! { ! global $config; ! ! $i=0; ! if($this->noRows()>0) ! { ! $dbc = new StackDBCache(); ! $dbc->connect(); ! foreach($result as $row) ! { ! $qList[$i]['id'] = $this->result($i,'questionID'); ! $qList[$i]['line'] = $this->result($i,'line'); ! $qList[$i]['questionName'] = $this->result($i,'questionName'); ! $qList[$i]['questionDescription'] = $this->result($i, 'questionDescription'); ! $qList[$i]['valid'] = $this->result($i,'valid'); ! $qList[$i]['questionDateLastEdited'] = $this->result($i,'dateEdited'); ! $qList[$i]['published'] = $this->result($i,'published'); ! $qList[$i]['status'] = $this->result($i,'status'); ! $qList[$i]['nodeployed'] = $dbc->countInstances($qList[$i]['id']); ! ! $i++; ! } ! $dbc->disconnect(); ! ! $moodleEnabled = $config->getMoodle('enabled'); ! if('true' === $moodleEnabled) ! { ! $mdb = new MoodleDB(); ! $mdb->connect(); ! foreach($qList as $key => $val){ ! $qList[$key]['moodleCategories'] = $mdb->getQuestionCategoryName($val['id']); ! } ! $mdb->disconnect(); ! } ! ! } ! return $qList; ! } ! } ! ! public function getLines($userID=NULL,$public=false,$filter=NULL,$tags=NULL) ! { ! $this->logger->finest('getLines, userID='.$userID); ! $this->logger->debug('getLines, filter='.print_r($filter, 1)); ! ! $qList = NULL; ! ! //$dateFormat = stack_sqlDateFormat(true); //uses to date format in the config file to give a sql date format. ! //$dateQuery = $this->conn->SQLDate($dateFormat,'questionDateLastEdited'); ! ! $OrderBy = ' ORDER BY questionID DESC'; ! ! $sql = "SELECT questionID, line, questionName, questionDescription, valid, published, status, questionDateLastEdited AS dateEdited " . ! "FROM stackquestion, question_lines "; ! if(!empty($tags)) $sql .= ", question_keyword, keywords "; ! if($userID !== NULL) { ! if ($public) { ! $where[] = "(questionUserLastEdited = $userID or published=".$this->dbSafeString('Published').")"; ! } else { ! $where[] = "(questionUserLastEdited = $userID)"; ! } ! } ! ! if(!empty($tags)) { // create multi-keyword conditions foreach(explode(' ', $tags) as $tag) { ! $or[] = "keywords.keyword = ".$this->dbSafeString($tag); } ! $where[] = '('.implode($or, ' OR ').')'; ! $where[] = "keywords.id = kwid AND qid = stackquestion.questionID"; } + + $where[] = "question_lines.latestVersion = stackquestion.questionID"; + + // filter + if($filter !== NULL) $where[] = "(questionName LIKE '%$filter%' OR questionDescription LIKE '%$filter%')"; + + $sql .= ' WHERE '.implode($where, ' AND '); // stitch conditions together + $sql .= $OrderBy; *************** *** 509,512 **** --- 686,690 ---- { $qList[$i]['id'] = $this->result($i,'questionID'); + $qList[$i]['line'] = $this->result($i,'line'); $qList[$i]['questionName'] = $this->result($i,'questionName'); $qList[$i]['questionDescription'] = $this->result($i, 'questionDescription'); *************** *** 515,519 **** $qList[$i]['published'] = $this->result($i,'published'); $qList[$i]['status'] = $this->result($i,'status'); - $qList[$i]['nodeployed'] = $dbc->countInstances($qList[$i]['id']); --- 693,696 ---- *************** *** 532,536 **** $mdb->disconnect(); } - } return $qList; --- 709,712 ---- *************** *** 538,547 **** } public function getQuestionsTagged($tagLine, $userID=NULL,$public=false) { $tag = $tagLine; // to explode ! $sql = "SELECT stackquestion.* from stackquestion, question_keyword, keywords " . "WHERE keywords.keyword = ".$this->dbSafeString($tag)." " . "AND keywords.id = kwid " . ! "AND qid = stackquestion.questionID"; $result = $this->query($sql); --- 714,725 ---- } + public function getQuestionsTagged($tagLine, $userID=NULL,$public=false) { $tag = $tagLine; // to explode ! $sql = "SELECT stackquestion.* from stackquestion, question_keyword, keywords, question_lines " . "WHERE keywords.keyword = ".$this->dbSafeString($tag)." " . "AND keywords.id = kwid " . ! "AND qid = stackquestion.questionID " . ! "AND qid = latestVersion"; $result = $this->query($sql); *************** *** 566,570 **** $qList[$i]['questionDescription'] = $this->result($i, 'questionDescription'); $qList[$i]['valid'] = $this->result($i,'valid'); ! $qList[$i]['questionDateLastEdited'] = $this->result($i,'dateEdited'); $qList[$i]['published'] = $this->result($i,'published'); $qList[$i]['status'] = $this->result($i,'status'); --- 744,748 ---- $qList[$i]['questionDescription'] = $this->result($i, 'questionDescription'); $qList[$i]['valid'] = $this->result($i,'valid'); ! $qList[$i]['questionDateLastEdited'] = $this->result($i,'questionDateLastEdited'); $qList[$i]['published'] = $this->result($i,'published'); $qList[$i]['status'] = $this->result($i,'status'); *************** *** 659,663 **** } } - } --- 837,840 ---- Index: StackDBMySQL.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBMySQL.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** StackDBMySQL.php 27 Aug 2009 16:23:00 -0000 1.17 --- StackDBMySQL.php 30 Sep 2010 16:56:13 -0000 1.18 *************** *** 21,25 **** /** * MySQL connection class ! * Depricated in favour of ADOdb database connection * * @author Jonathan Hart (j.p...@bh...) --- 21,25 ---- /** * MySQL connection class ! * Deprecated in favour of ADOdb database connection * * @author Jonathan Hart (j.p...@bh...) |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:52
|
Update of /cvsroot/stack/stack-dev/install/update In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/install/update Modified Files: Updater.php index.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: Updater.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/update/Updater.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Updater.php 27 Aug 2009 16:22:48 -0000 1.6 --- Updater.php 30 Sep 2010 16:56:14 -0000 1.7 *************** *** 21,25 **** require_once($root.'/lib/database/StackDBBackup.php'); ! define(STACK_CURRENT, 'STACK 2.0 alpha 2'); //The latest version of STACK. class Updater{ --- 21,25 ---- require_once($root.'/lib/database/StackDBBackup.php'); ! define(STACK_CURRENT, 'STACK 2.2'); //The latest version of STACK. class Updater{ *************** *** 63,68 **** unset($update); ! case 'STACK 2.0 alpha 2': ! //nothing yet } --- 63,73 ---- unset($update); ! // bit of a jump!? ! ! case 'STACK 2.0 beta': ! require_once('updates/TwoPointTwo.php'); //load the code to update STACK to 2.2 ! $update = new TwoPointTwo($this->errorLog); ! $update->performUpdate(); ! unset($update); } Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/update/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 14 Nov 2008 19:05:59 -0000 1.4 --- index.php 30 Sep 2010 16:56:14 -0000 1.5 *************** *** 17,21 **** */ session_start(); ! define(STACK_CURRENT, 'STACK 2.0 beta'); //The latest version of STACK. $configFile = '../../config.php'; if(!file_exists($configFile)) --- 17,21 ---- */ session_start(); ! define(STACK_CURRENT, 'STACK 2.2'); //The latest version of STACK. $configFile = '../../config.php'; if(!file_exists($configFile)) |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:33
|
Update of /cvsroot/stack/stack-dev/maxima/gendocs In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/maxima/gendocs Modified Files: genmaximadata.php Removed Files: maximafun-stack-1-0.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) Index: genmaximadata.php =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/gendocs/genmaximadata.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** genmaximadata.php 18 Sep 2007 16:23:07 -0000 1.1 --- genmaximadata.php 30 Sep 2010 16:56:22 -0000 1.2 *************** *** 20,2386 **** <tr><td></td><th align="left">Index Entry</th><th align="left"> Section</th></tr> <tr><td colspan="3"> <hr></td></tr> ! <tr><th><a name="SEC300_0">!</a></th><td></td><td></td></tr> ! <tr><td></td><td valign="top"><a href="maxima_5.html#IDX67"><code>!</code></a></td><td valign="top"><a href="maxima_5.html#SEC19">5.7 General operators</a></td></tr> ! <tr><td></td><td valign="top"><a href="maxima_5.html#IDX68"><code>!!</code></a></td><td valign="top"><a href="maxima_5.html#SEC19">5.7 General operators</a></td></tr> ! <tr><td colspan="3"> <hr></td></tr> ! <tr><th><a name="SEC300_1">"</a></th><td></td><td></td></tr> ! <tr><td colspan="3"> <hr></td></tr> ! <tr><th><a name="SEC300_2">#</a></th><td></td><td></td></tr> ! <tr><td></td><td valign="top"><a href="maxima_5.html#IDX69"><code>#</code></a></td><td valign="top"><a href="maxima_5.html#SEC19">5.7 General operators</a></td></tr> [...2444 lines suppressed...] echo "\n"; } *************** *** 2421,2427 **** } ! echo "</pre>"; ! ?> --- 84,91 ---- } ! //print_r($out[2]); ! //print_r($maxima_cmd); + echo "</pre>"; ?> --- maximafun-stack-1-0.php DELETED --- |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:33
|
Update of /cvsroot/stack/stack-dev/sample_questions/diagnostictests In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/sample_questions/diagnostictests Added Files: FormulaSheet.tex DiagnosticTests.xml ReadMe.txt Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) --- NEW FILE: DiagnosticTests.xml --- <?xml version="1.0" encoding="UTF-8"?> <mathQuiz version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><assessmentItem version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><questionCasValues><questionStem type="CasText"><castext>In a railway journey of \(90km\) an increase of \(5\) kilometers per hour in the speed decreases the time taken by \(15\) minutes. <p>Write a system of equations (one equation per line) to represent this situation using \(v\) as the speed of the train and \(t\) as the time. <br /> #asys# <IEfeedback>asys</IEfeedback> <PRTfeedback>1</PRTfeedback> <p>Eliminate \(t\) from your equations, writing a single equation only in \(v\) which represents this situation. <br /> #veqn# <IEfeedback>veqn</IEfeedback> <PRTfeedback>2</PRTfeedback> <p>What is the velocity? #ansv# <IEfeedback>ansv</IEfeedback> <PRTfeedback>3</PRTfeedback> <p>How confident are you (as a %)? #con1# <IEfeedback>con1</IEfeedback></p></castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionStem><questionVariables type="RawKeyVal"><rawKeyVals>ta = [v*t=90 , (v+5)*(t-15/60)=90]; tsys = maplist(stack_eqnprepare,ta); tsys1 = maplist(stack_eqnprepare,[v*t=90 , (v+5)*(t-15)=90])</rawKeyVals><forbidFloats>false</forbidFloats><simplify>true</simplify></questionVariables><workedSolution type="CasText"><castext>Let \(v\) be the speed of the train, \(d\) the distance travelled and \(t\) time. If \(t\) is the time (in hours) then \(15\) minutes is \(\frac{1}{4}\) hour. [...1545 lines suppressed...] </castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionStem><questionVariables type="RawKeyVal"><rawKeyVals>a = rand(9)+1; mag_b = rand(9)+1; sign_b = 2*rand(2)-1; b = mag_b*sign_b; c = 2*rand(2)-1; mag_d = rand(8)+2; sign_d = 2*rand(2)-1; d = mag_d*sign_d; numerat = a*x+b; den1 = x+c; den2 = x+d; den2_squared = den2^2; Aden2_squared = A * den2_squared; Bden1_den2 = B * den1 * den2; Cden1 = C * den1; den = den1 * den2_squared; f = numerat/den; c_minus_d = c-d; mc = -c; md = -d; Aval = (b-a*c)/c_minus_d^2; Cval = (b-a*d)/c_minus_d; Bval = (b - Aval*d^2 - c*Cval)/(c*d); answer = partfrac(f,x)</rawKeyVals><forbidFloats>false</forbidFloats><simplify>true</simplify></questionVariables><workedSolution type="CasText"><castext>The basic partial fraction information is:<hint>alg_partial_fractions</hint> So, given \[ @f@=\frac{A}{@den1@} + \frac{B}{@den2@} + \frac{C}{@den2_squared@},\] then multiplying through by the denominator @den@ we have that \[ @numerat@ = @Aden2_squared@ + @Bden1_den2@+@Cden1@. \] Setting \(x = @mc@\) we see that \(A = @Aval@\) and letting \(x = @md@\) we find that \(C = @Cval@\). Putting \(x = 0\) we can also see that \(B = @Bval@\). Therefore \[ @f@=@answer@.\]</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></workedSolution><questionNote type="CasText"><castext>\[ @f@=@answer@.\]</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionNote></questionCasValues><questionparts><questionpart><name>ans1</name><inputType type="Meta"><selection>Algebraic Input</selection><default>Algebraic Input</default><values/></inputType><boxsize>20</boxsize><teachersAns type="CasString"><casString>answer</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans1</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/></questionpart><questionpart><name>con1</name><inputType type="Meta"><selection>Slider</selection><default>Algebraic Input</default><values/></inputType><boxsize>200</boxsize><teachersAns type="CasString"><casString>0</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>con1</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/></questionpart></questionparts><PotentialResponseTrees><PotentialResponseTree><prtname>PotResTree_Result</prtname><questionValue>1</questionValue><autoSimplify>true</autoSimplify><feedbackVariables></feedbackVariables><description type="Meta"><selection></selection><default></default><values/></description><PotentialResponses><PR id="0"><answerTest>PartFrac</answerTest><teachersAns>answer</teachersAns><studentAns>ans1</studentAns><testoptions>x</testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>1</rawMark><feedback></feedback><ansnote>ALG-RPF-TRUE</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>ALG-RPF-FALSE</ansnote><nextPR>1</nextPR></false><teacherNote></teacherNote></PR><PR id="1"><answerTest>AlgEquiv</answerTest><teachersAns>answer</teachersAns><studentAns>ans1</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>ALG-RPF-1-FALSE</ansnote><nextPR>2</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>ALG-RPF-2-FALSE</ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR><PR id="2"><answerTest>Equal_Com_Ass</answerTest><teachersAns>f</teachersAns><studentAns>ans1</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback><p>This seems to be the same expression that you started with.</p></feedback><ansnote>NO-CHANGE</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback><p>Although your expression is algebraically equal to the correct answer, it is not in partial fractions form.</p></feedback><ansnote>NOT-PARTIAL</ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>Diagnostic_ALG-RPF_2</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection>Expand a rational function with repeated factors in denominator as a sum of partial fractions.</selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://130.88.73.28/stack-1-0/</selection><default>http://matsrv6.bham.ac.uk/stem</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2010-09-01 11:10:54</selection><default>2010-08-31 14:20:41</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>Manchester, partial, fractions, diagnostic, A48I, ALG-RPF, A2</selection><default>Manchester, partial, fractions, diagnostic, A48I, ALG-RPF, A2</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>i</default><values><value>i</value><value>j</value><value>symi</value><value>symj</value></values><casKey>make_complexJ</casKey><casType>fun</casType><selected>i</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>SqrtSign</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>sqrtdispflag</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>Simplify</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>simp</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>MarkModMethod</name><type>list</type><default>Penalty</default><values><value>Penalty</value><value>First Answer</value><value>Last Answer</value></values><casKey></casKey><casType></casType><selected>Penalty</selected></stackoption><stackoption><name>AssumePos</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey>assume_pos</casKey><casType>ex</casType><selected>false</selected></stackoption><stackoption><name>TeacherEmail</name><type>string</type><default>s.h...@bh...</default><casKey></casKey><casType></casType><selected>Nie...@ma...</selected></stackoption><stackoption><name>Feedback</name><type>list</type><default>TGS</default><values><value>TGS</value><value>TG</value><value>GS</value><value>T</value><value>G</value><value>S</value><value>none</value></values><casKey></casKey><casType></casType><selected>G</selected></stackoption><stackoption><name>FeedbackGenericCorrect</name><type>html</type><default><span class='correct'>Correct answer, well done.</span></default><casKey></casKey><casType></casType><selected><span class='correct'>Correct answer, well done.</span></selected></stackoption><stackoption><name>FeedbackGenericIncorrect</name><type>html</type><default><span class='incorrect'>Incorrect answer.</span></default><casKey></casKey><casType></casType><selected><span class='incorrect'>Incorrect answer.</span></selected></stackoption><stackoption><name>FeedbackGenericPCorrect</name><type>html</type><default><span class='partially'>Your answer is partially correct.</span></default><casKey></casKey><casType></casType><selected><span class='partially'>You may have made a common error.</span></selected></stackoption><stackoption><name>OptWorkedSol</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption></ItemOptions><ItemTests><test><col><key>IE_ans1</key><value>answer</value></col><col><key>PRT_PotResTree_Result</key><value>ALG-RPF-TRUE</value></col><col><key>IE_con1</key><value></value></col></test><test><col><key>IE_ans1</key><value>7*x</value></col><col><key>PRT_PotResTree_Result</key><value>ALG-RPF-2-FALSE</value></col><col><key>IE_con1</key><value></value></col></test><test><col><key>IE_ans1</key><value>f</value></col><col><key>PRT_PotResTree_Result</key><value>NO-CHANGE</value></col><col><key>IE_con1</key><value></value></col></test></ItemTests></assessmentItem></mathQuiz> --- NEW FILE: FormulaSheet.tex --- \documentclass{article} \usepackage{amsmath,amssymb,latexsym,a4wide,times} \usepackage{epsfig} \usepackage{graphicx} \parindent=0pt \parskip=2mm \columnsep=1cm \newcommand{\R}{{\mathbb R}} \newcommand{\N}{{\mathbb N}} \newcommand{\Z}{{\mathbb Z}} \newcommand{\Q}{{\mathbb Q}} \newcommand{\C}{{\mathbb C}} \renewcommand{\d}{\mathrm{d}} \pagestyle{empty} \begin{document} \begin{center} {\Large\bf Facts and formulae} \end{center} Indices: \[ a^ma^n = a^{m+n},\quad \frac{a^m}{a^n} = a^{m-n},\quad (a^m)^n = a^{mn}\] \[ a^0 = 1,\quad a^{-m} = \frac{1}{a^m},\quad a^{\frac{1}{n}} = \sqrt[n]{a},\quad a^{\frac{m}{n}} = \left(\sqrt[n]{a}\right)^m.\] Logarithms: for any $b>0$, $b \neq 1$: $\log_b(a) = c$, means $a = b^c$. \[\log_b(a) + \log_b(b) = \log_b(ab),\quad \log_b(a) - \log_b(b) = \log_b\left(\frac{a}{b}\right),\quad n\log_b(a) = \log_b\left(a^n\right)\] \[\log_b(1) = 0,\quad \log_b(b) = 1,\quad \log_a(x) = \frac{\log_b(x)}{\log_b(a)}\] Natural logarithms use base $e\approx 2.718$, and are denoted $\log_e$ or alternatively $\ln$. Standard Trigonometric Values \[ \sin(45^\circ)={1\over \sqrt{2}}, \qquad \cos(45^\circ) = {1\over \sqrt{2}},\qquad \tan( 45^\circ)=1 \] \[ \sin (30^\circ)={1\over 2}, \qquad \cos (30^\circ)={\sqrt{3}\over 2},\qquad \tan (30^\circ)={1\over \sqrt{3}}\] \[ \sin (60^\circ)={\sqrt{3}\over 2}, \qquad \cos (60^\circ)={1\over 2},\qquad \tan (60^\circ)={ \sqrt{3}} \] Standard Trigonometric Identities \[\sin(a\pm b)\ = \ \sin(a)\cos(b)\ \pm\ \cos(a)\sin(b)\] \[\cos(a\ \pm\ b)\ = \ \cos(a)\cos(b)\ \mp \sin(a)\sin(b)\] \[\tan (a\ \pm\ b)\ = \ {\tan (a)\ \pm\ \tan (b)\over1\ \mp\ \tan (a)\tan (b)}\] \[2\sin(a)\cos(b)\ = \ \sin(a+b)\ +\ \sin(a-b)\] \[2\cos(a)\cos(b)\ = \ \cos(a-b)\ +\ \cos(a+b)\] \[2\sin(a)\sin(b) \ = \ \cos(a-b)\ -\ \cos(a+b)\] \[\sin^2(a)+\cos^2(a)\ = \ 1\] \[1+{\rm cot}^2(a)\ = \ {\rm cosec}^2(a),\quad \tan^2(a) +1 \ = \ \sec^2(a)\] \[\cos(2a)\ = \ \cos^2(a)-\sin^2(a)\ = \ 2\cos^2(a)-1\ = \ 1-2\sin^2(a)\] \[\sin(2a)\ = \ 2\sin(a)\cos(a)\] \[\sin^2(a) \ = \ {1-\cos (2a)\over 2}, \qquad \cos^2(a)\ = \ {1+\cos(2a)\over 2}\] Hyperbolic Functions \[\cosh(x) = \frac{e^x+e^{-x}}{2}, \qquad \sinh(x)=\frac{e^x-e^{-x}}{2}\] \[\tanh(x) = \frac{\sinh(x)}{\cosh(x)} = \frac{{e^x-e^{-x}}}{e^x+e^{-x}}\] \[{\rm sech}(x) ={1\over \cosh(x)}={2\over {\rm e}^x+{\rm e}^{-x}}, \qquad {\rm cosech}(x)= {1\over \sinh(x)}={2\over {\rm e}^x-{\rm e}^{-x}}\] \[{\rm coth}(x) ={\cosh(x)\over \sinh(x)} = {1\over {\rm tanh}(x)} ={{\rm e}^x+{\rm e}^{-x}\over {\rm e}^x-{\rm e}^{-x}}\] Hyperbolic Identities \[{\rm e}^x=\cosh(x)+\sinh(x), \quad {\rm e}^{-x}=\cosh(x)-\sinh(x)\] \[\cosh^2(x) -\sinh^2(x) = 1$$ $$1-{\rm tanh}^2(x)={\rm sech}^2(x)\] \[{\rm coth}^2(x)-1={\rm cosech}^2(x)$$ $$\sinh(x\pm y)=\sinh(x)\ \cosh(y)\ \pm\ \cosh(x)\ \sinh(y)\] \[\cosh(x\pm y)=\cosh(x)\ \cosh(y)\ \pm\ \sinh(x)\ \sinh(y)\] \[\sinh(2x)=2\,\sinh(x)\cosh(x)\] \[\cosh(2x)=\cosh^2(x)+\sinh^2(x)\] \[\cosh^2(x)={\cosh(2x)+1\over 2}\] \[\sinh^2(x)={\cosh(2x)-1\over 2}\] Inverse Hyperbolic Functions \[\cosh^{-1}(x)=\ln\left(x+\sqrt{x^2-1}\right) \quad \mbox{ for } x\geq 1\] \[ \sinh^{-1}(x)=\ln\left(x+\sqrt{x^2+1}\right)\] \[\tanh^{-1}(x) = \frac{1}{2}\ln\left({1+x\over 1-x}\right) \quad \mbox{ for } -1< x < 1\] Calculus rules The Product Rule: \[\frac{\mathrm{d}}{\mathrm{d}{x}} \big(f(x)g(x)\big) = f(x) \cdot \frac{\mathrm{d} g(x)}{\mathrm{d}{x}} + g(x)\cdot \frac{\mathrm{d} f(x)}{\mathrm{d}{x}}.\] The Quotient Rule: \[\frac{d}{dx}\left(\frac{f(x)}{g(x)}\right)=\frac{g(x)\cdot\frac{df(x)}{dx}\ \ - \ \ f(x)\cdot \frac{dg(x)}{dx}}{g(x)^2}. \] The Chain Rule \[\frac{df(g(x))}{dx} = \frac{dg(x)}{dx}\cdot\frac{df(u)}{du}.\] Integration by Substitution: \[\int f(u){{\rm d}u\over {\rm d}x}{\rm d}x=\int f(u){\rm d}u \quad\hbox{and}\quad \int_a^bf(u){{\rm d}u\over {\rm d}x}\,{\rm d}x = \int_{u(a)}^{u(b)}f(u){\rm d}u.\] Integration by Parts: \[\int_a^b u{{\rm d}v\over {\rm d}x}{\rm d}x=\left[uv\right]_a^b- \int_a^b{{\rm d}u\over {\rm d}x}v\,{\rm d}x.\] \begin{center} \begin{tabular}{ll} $f(x)$ & $f'(x)$\\ $k$, constant & $0$ \\ $x^n$, any constant $n$ & $nx^{n-1}$\\ $e^x$ & $e^x$\\ $\ln(x)=\log_{\rm e}(x)$ & $\frac{1}{x}$ \\ $\sin(x)$ & $\cos(x)$ \\ $\cos(x)$ & $-\sin(x)$ \\ $\tan(x) = \frac{\sin(x)}{\cos(x)}$ & $\sec^2(x)$ \\ $\mbox{cosec}(x)=\frac{1}{\sin(x)}$ & $-\mbox{cosec}(x)\cot(x)$ \\ $\sec(x)=\frac{1}{\cos(x)}$ & $\sec(x)\tan(x)$ \\ $\cot(x)=\frac{\cos(x)}{\sin(x)}$ & $-\mbox{cosec}^2(x)$ \\ $\cosh(x)$ & $\sinh(x)$ \\ $\sinh(x)$ & $\cosh(x)$ \\ $\tanh(x)$ & $\mbox{sech}^2(x)$ \\ $\mbox{sech}(x)$ & $-\mbox{sech}sech(x)\tanh(x)$ \\ $\mbox{cosech}(x)$ & $-\mbox{cosech}(x)\coth(x)$ \\ $coth(x)$ & $-\mbox{cosech}^2(x)$ \\ \end{tabular} \end{center} \[\frac{d}{dx}\left(\sin^{-1}(x)\right) = \frac{1}{\sqrt{1-x^2}},\quad \frac{d}{dx}\left(\cos^{-1}(x)\right) = \frac{-1}{\sqrt{1-x^2}},\quad \frac{d}{dx}\left(\tan^{-1}(x)\right) = \frac{1}{1+x^2} \] \[\frac{d}{dx}\left(\cosh^{-1}(x)\right) = \frac{1}{\sqrt{x^2-1}},\quad \frac{d}{dx}\left(\sinh^{-1}(x)\right) = \frac{1}{\sqrt{x^2+1}},\quad \frac{d}{dx}\left(\tanh^{-1}(x)\right) = \frac{1}{1-x^2}\] \begin{center} \begin{tabular}{lll} $f(x)$ & $\int f(x)\ dx$\\ $e^x$ & $e^x+c$ & \\ $\cos(x)$ & $\sin(x)+c$ & \\ $\sin(x)$ & $-\cos(x)+c$ & \\ $\tan(x)$ & $\ln(\sec(x))+c$ & $-\frac{\pi}{2} < x < \frac{\pi}{2}$\\ $\sec x$ & $\ln (\sec(x)+\tan(x))+c$ & $-{\pi\over 2}< x < {\pi\over 2}$\\ cosec$\, x$ & $\ln ($cosec$(x)-\cot(x))+c$ & $0 < x < \pi$\\ cot$\,x$ & $\ln(\sin(x))+c$ & $0< x< \pi$ \\ $\cosh(x)$ & $\sinh(x)+c$ & \\ $\sinh(x)$ & $\cosh(x) + c$ & \\ $\tanh(x)$ & $\ln(\cosh(x))+c$ & \\ coth$(x)$ & $\ln(\sinh(x))+c $ & $x>0$\\ ${1\over x^2+a^2}$ & ${1\over a}\tan^{-1}{x\over a}+c$ & $a>0$\\ [2pt] ${1\over x^2-a^2}$ & ${1\over 2a}\ln{x-a\over x+a}+c$ & $|x|>a>0$\\ [2pt] ${1\over a^2-x^2}$ & ${1\over 2a}\ln{a+x\over a-x}+c$ & $|x|<a$\\ [3pt] ${1\over \sqrt{x^2+a^2}}$ & $\sinh^{-1}\left(\frac{x}{a}\right) + c$ & $a>0$ \\ ${1\over \sqrt{x^2-a^2}}$ & $\cosh^{-1}\left(\frac{x}{a}\right) + c$ & $x\geq a > 0$ \\ ${1\over \sqrt{x^2+k}}$ & $\ln (x+\sqrt{x^2+k})+c$ & \\ ${1\over \sqrt{a^2-x^2}}$ & $\sin^{-1}\left(\frac{x}{a}\right)+c$ & $-a\leq x\leq a$ \end{tabular} \end{center} \vfill {\scriptsize C J Sangwin, \verb$C.J...@bh...$, \today. This formula sheet is released under Creative Commons Attribution-Share Alike.\\ \includegraphics[width=1.5cm]{88x31.png}} \end{document} --- NEW FILE: ReadMe.txt --- Stimulating Techniques in Entry-level Mathematics with the STACK CAA system In April 2010 the National HE STEM Programme (http://www.stemprogramme.com) funded a mini-project stimulating Techniques in Entry-level Mathematics (STEM) with the STACK computer aided assessment (CAA) system}. The aims of this project are to take existing diagnostic tests in core mathematics and develop similar automatic tests for the STACK computer aided assessment system. The outcome of these tests will be a user profile which links outcomes to existing online learning materials. See http://web.mat.bham.ac.uk/C.J.Sangwin/projects/2010STEM/ The questions in this folder are the results of this project. These questions files are released under Creative Commons Attribution-Share Alike. http://creativecommons.org/licenses/by-sa/2.0/uk/ |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:33
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/stack_diagnostic/lang/en_utf8 In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/opaque/moodleModule/stack_diagnostic/lang/en_utf8 Added Files: block_stack_diagnostic.php Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) --- NEW FILE: block_stack_diagnostic.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Jonathan Hart (j.p...@bh...) * * @package stackBlock * * Language files for stack's moodle block */ $string['title'] = 'Stack Diagnostic Reporting'; $string['reports'] = 'Reports'; $string['questions'] = 'Stack Questions'; $string['new'] = 'New Question'; $string['import'] = 'Import Question'; $string['caschat'] = 'CasChat'; $string['report'] = 'Stack Reports'; $string['editOpt'] = 'Edit Question Options'; $string['stack_not_installed'] = 'Please install STACK question type.'; $string['settings'] = 'STACK Diagnostic Reporting Settings'; $string['noSettings'] = 'The STACK Diagnostic Reporting block has no configuration options.'; ?> |
From: Simon H. <sim...@us...> - 2010-09-30 16:56:32
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/opaque In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/opaque/moodleModule/opaque Modified Files: questiontype.php Added Files: styles.css Log Message: Merging 2.2 branch (with some additional fixes to ensure seamless updating for version lines) --- NEW FILE: styles.css --- /** Fonts --------------------------------------- */ h1.section{ font-family: Lucida Sans, serif; text-align: center; } /** Spans --------------------------------------- */ span.correct{ color: green; } span.partially{ color: orange; } span.incorrect{ color: red; background-color: transparent; } div.displayedEq{ text-align: center; padding: 0.2em; } /** Generic classes -------------------------------- */ img{ border:0; margin-left: 0.1em; margin-right: 0.1em; } .warning{ color: orange; } .icon{ float:right; margin-top: -35px; margin-bottom: -60px; padding: 1.0em; /*background: yellow;*/ } .SyntaxExample1{ border: 1px dotted #333; padding: 0.2em; color: blue; background-color: #eee; font-family: monospace; font-size: 120%; font-weight: bold; } .SyntaxExample2{ color: blue; font-family: monospace; font-size: 100%; font-weight: bold; } /* No dashed box, for inclusion inside other error message boxes*/ .errorMsg{ color: #ff0000; } .error{ color: #ff0000; } p.error{ } .feedback{ } .solutionButton{ } .removeButton{ float:right; } .tableTitle{ font-weight: bold; } .centre{ text-align: center; } .quote{ font-style: italic; text-align: center; width: 80%; } .small{ font-size: 80%; } .relatedBox{ border: 1px dotted #333; padding: 0.2em; margin-left: 1em; margin-right: 1em; } .stackbutton{ margin-left: 0em; margin-right: 1.5em; } .logs{ font-family: monospace; } /** Structural DIVs ----------------------------------------------*/ div.error{ min-width: 30em; color: red; font-weight: bold; font-size: 90%; background-color: #fff; border: 1px dashed #c12926; text-align: left; padding: 0.2em; margin: 1em; } div.clearer{ clear: both; display: inline-block; } /*secondary information to the student, */ /* request feedback, resubmit etc. Netural feedback */ div.secondaryFeedback{ border: 1px solid #e1e1e1; background-color: #eee; padding: 0.2em; margin-bottom: 0.2em; width: 80%; margin-left: auto; margin-right: auto; margin-top: 0.2em; } h3.secondaryFeedback{ font-weight: normal; border-bottom: 1px solid #ccc; } /*feedback to student */ div.InteractionElementFeedback{ background-color: #FFFF99; border: 1px solid #EEEE66; margin-left: auto; margin-right: auto; padding: 0.2em; width: 80%; margin-top: 0.2em; margin-bottom: 0.2em; } /*Make the paragraph have only a single line break between paragraphs*/ p.studentFeedback{ margin: 0em; } /*PRT feedback */ div.PRTFeedback{ border: 1px solid #ccf; background-color: #ddf; width: 80%; margin-left: auto; margin-right: auto; margin-bottom: 0.2em; padding-left: 0.2em; padding-right: 0.2em; padding-bottom: 0.2em; /*Top has enough padding with the <h3>tag */ } h3.PRTFeedback{ font-weight: normal; border-bottom: 1px solid #bbf; } .PRTScore{ float: right; } /*Authoring layout */ div.requirements{ border: 1px solid #000; padding: 0.4em; background-color: #fff; } div.section { border: 1px solid #e1e1e1; background-color: #eee; padding: 0.4em; margin-bottom: 0.5em; margin-left: 140px; } h3.section{ font-weight: normal; border-bottom: 1px solid #aaa; } div.section80{ border: 1px solid #e1e1e1; background-color: #eee; padding: 0.4em; margin-bottom: 0.5em; width: 80%; margin-right: auto; margin-left: auto; } h3.section80{ font-weight: normal; border-bottom: 1px solid #aaa; } div.PRT{ /*border: 1px solid #222;*/ padding: 1.0em; margin: 1em; background-color: #ddd; } div.PR{ border: 1px solid #000; background-color: #fff; margin-top: 1em; margin-bottom: 0.5em; padding: 1em; } div.PRTTrue{ border: 1px solid #DDFFBA; padding: 0.25em; margin-top: 1em; background-color: #efe; } div.PRTFalse{ border: 1px dotted #FFA19E; padding: 0.25em; margin-top: 1em; background-color: #fee; } .interactionElementsTable, .deploymentTable { margin-right: auto; margin-left: auto; text-align: left; width: 95%; background-color: #fff; } div.row { clear: both; padding-top: 0.1em; padding-bottom: 0.1em; min-height: 2em; height: 1%; } div.row span.error { min-width: 30em; color: red; font-weight: bold; font-size: 90%; background-color: #fee; border: 1px dashed #c12926; float: left; text-align: left; padding: 0.2em; } div.row span.label { float: left; width: 250px; text-align: right; padding: 0.25em; } div.row span.formw { float: left; text-align: left; padding: 0.2em; /*width: 300px;*/ } div.row span.full{ float: left; text-align: left; padding: 0.2em; } div.authorMath { background-color:#FFFFFF; border:1px dashed; clear:left; float:none; padding:0.2em; width:505px; display: none; } div#authoringControls { background-color:#EEEEEE; border:1px solid #E1E1E1; padding:5px; position:fixed; width:120px; left:20px; } div#authoringControls input { width: 110px; margin: 1px 5px; } /* Tables --------------------------------------------------------------*/ .tableHeader{ font-weight: bold; background-color: #ddd; } tr.light{ } tr.dark{ background-color: #eee; } .reportTable{ text-align: left; width: 100%; } .reportsStatsTable{ text-align: left; width: 60%; } .optionEditor{ background-color: white; } .matrixTable td { border: 0px solid black; } tr.odd { background-color: #eee; } tr.even { background-color: #fff; } td { vertical-align: top; } /* Lists ------------------------------------------------------------------*/ .horizontal li{ display: inline; list-style-type: none; margin-right: 2em; } /* Searching -------------------------------------------------------------*/ .over80pc{ background-color: #CCFF99; } .over60pc{ background-color: #FFFF99; } .over30pc{ background-color: #FFCC99; } .lower30pc{ background-color: #FF9999; } /* Moodle -------------------------------------------------------------------*/ /*Turn off moodle grading*/ div.grading{ display: none; } /* hide review all questions on one page */ div.controls a{ display: none; } Index: questiontype.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/questiontype.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** questiontype.php 23 Sep 2009 13:20:05 -0000 1.9 --- questiontype.php 30 Sep 2010 16:56:24 -0000 1.10 *************** *** 73,80 **** $contributions = array('<link rel="stylesheet" type="text/css" href="' . $this->plugin_baseurl() . '/styles.css" />'); ! /* TODO: remove this nasty hardwired hack */ ! $contributions[] = "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://stack.bham.ac.uk/stack-dev/styles.css\" />"; ! $contributions[] = "<script type=\"text/javascript\" src=\"http://stack.bham.ac.uk/stack-dev/lib/ui/inputTypes/dragmath/dragmath.php\"></script>"; ! $contributions[] = "<script type=\"text/javascript\" src=\"http://stack.bham.ac.uk/stack-dev/lib/ui/helpPopup.js\"></script>"; return $contributions; --- 73,79 ---- $contributions = array('<link rel="stylesheet" type="text/css" href="' . $this->plugin_baseurl() . '/styles.css" />'); ! /* TOFIX: references to the STACK base below */ ! //$contributions[] = "<script type=\"text/javascript\" src=\"http://stack.bham.ac.uk/stack-dev/lib/ui/inputTypes/dragmath/dragmath.php\"></script>"; ! //$contributions[] = "<script type=\"text/javascript\" src=\"http://stack.bham.ac.uk/stack-dev/lib/ui/helpPopup.js\"></script>"; return $contributions; *************** *** 226,229 **** --- 225,231 ---- } + function print_question_grading_details(&$question, &$state, $cmoptions, $options) { + // No output in STACK, thanks. + } } |