From: Chris S. <san...@us...> - 2010-09-01 11:56:42
|
Update of /cvsroot/stack/diag In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv32269 Modified Files: SkillsResources.php index.php Log Message: Index: SkillsResources.php =================================================================== RCS file: /cvsroot/stack/diag/SkillsResources.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SkillsResources.php 1 Sep 2010 11:54:22 -0000 1.4 --- SkillsResources.php 1 Sep 2010 11:56:34 -0000 1.5 *************** *** 308,312 **** $db -> connect(); ! $sql = "SELECT questionID,questionName FROM stackquestion,question_keyword, keywords, question_lines WHERE (keyword LIKE ".$db->dbSafeString($keyword)." ) AND (question_keyword.kwid = keywords.id) AND --- 308,312 ---- $db -> connect(); ! $sql = "SELECT questionID, questionName FROM stackquestion, question_keyword, keywords, question_lines WHERE (keyword LIKE ".$db->dbSafeString($keyword)." ) AND (question_keyword.kwid = keywords.id) AND *************** *** 459,462 **** --- 459,482 ---- } + 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) { *************** *** 513,515 **** } ! } \ No newline at end of file --- 533,536 ---- } ! ! } \ No newline at end of file Index: index.php =================================================================== RCS file: /cvsroot/stack/diag/index.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** index.php 1 Sep 2010 11:54:22 -0000 1.8 --- index.php 1 Sep 2010 11:56:34 -0000 1.9 *************** *** 55,59 **** echo "<p>This page gives an inventory of questions associated with the STEM project <a href=\"http://stack.bham.ac.uk/wiki/index.php/Diagnostic_tests\">Stimulating Techniques in Entry-level Mathematics (STEM) with the STACK computer aided assessment (CAA) system</a>.</p>"; ! echo "<ul><li>Generate the <a href='index.php?q=wiki'>wiki page</a> code (view source).</li><li>See a list of all deployed <a href='index.php?q=stem'>question stems</a>. Useful for putting questions into quizzes.</ul><hr />"; echo $skills->generateSkillsTable(); --- 55,59 ---- echo "<p>This page gives an inventory of questions associated with the STEM project <a href=\"http://stack.bham.ac.uk/wiki/index.php/Diagnostic_tests\">Stimulating Techniques in Entry-level Mathematics (STEM) with the STACK computer aided assessment (CAA) system</a>.</p>"; ! echo "<ul><li>Generate the <a href='index.php?q=wiki'>wiki page</a> code or <a href='index.php?q=LaTeX'>LaTeX</a> (view source).</li><li>See a list of all deployed <a href='index.php?q=stem'>question stems</a>. Useful for putting questions into quizzes.</ul><hr />"; echo $skills->generateSkillsTable(); *************** *** 66,69 **** --- 66,73 ---- break; + case ($action === 'LaTeX'): + echo $skills->generateLaTeX(); + break; + case ($action === 'stem'): |