Project

General

Profile

« Previous | Next » 

Revision 3550

include both assessments and questions in the results of a search (driven by option in search form)

View differences:

lib/style/skins/first/first-resultset.xsl
1 1
<?xml version="1.0"?>
2 2
<!--
3
*  '$RCSfile$'
4
*      Authors: Matt Jones, CHad Berkley
5
*    Copyright: 2000 Regents of the University of California and the
6
*               National Center for Ecological Analysis and Synthesis
7
*  For Details: http://www.nceas.ucsb.edu/
8
*
9
*   '$Author$'
10
*     '$Date$'
11
* '$Revision$'
12
*
13
* This program is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.
17
*
18
* This program is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
* GNU General Public License for more details.
22
*
23
* You should have received a copy of the GNU General Public License
24
* along with this program; if not, write to the Free Software
25
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
*
27
* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
* convert an XML file showing the resultset of a query
29
* into an HTML format suitable for rendering with modern web browsers.
3
	*  '$RCSfile$'
4
	*      Authors: Matt Jones, CHad Berkley
5
	*    Copyright: 2000 Regents of the University of California and the
6
	*               National Center for Ecological Analysis and Synthesis
7
	*  For Details: http://www.nceas.ucsb.edu/
8
	*
9
	*   '$Author$'
10
	*     '$Date$'
11
	* '$Revision$'
12
	*
13
	* This program is free software; you can redistribute it and/or modify
14
	* it under the terms of the GNU General Public License as published by
15
	* the Free Software Foundation; either version 2 of the License, or
16
	* (at your option) any later version.
17
	*
18
	* This program is distributed in the hope that it will be useful,
19
	* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
	* GNU General Public License for more details.
22
	*
23
	* You should have received a copy of the GNU General Public License
24
	* along with this program; if not, write to the Free Software
25
	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
	*
27
	* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
	* convert an XML file showing the resultset of a query
29
	* into an HTML format suitable for rendering with modern web browsers.
30 30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
32
	version="1.0">
32 33

  
33
  <xsl:output method="html"/>
34
  <xsl:param name="sessid"/>
35
  <xsl:param name="qformat">default</xsl:param>
36
  <xsl:param name="enableediting">false</xsl:param>
37
  <xsl:template match="/">
38
   <html>
39
      <head>
40
      	<title>Search Results</title>
41
        <link rel="stylesheet" type="text/css" 
42
              href="/knb/style/skins/{$qformat}/{$qformat}.css" />
43
        <script language="Javascript" type="text/JavaScript"
44
                src="/knb/style/skins/{$qformat}/{$qformat}.js" />
45
        <script language="Javascript" type="text/JavaScript"
46
                src="/knb/style/common/branding.js" />
47
        <script language="JavaScript">
48
          <![CDATA[
49
          function submitform(action,form_ref) {
50
              form_ref.action.value=action;
51
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
52
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
53
              form_ref.submit();
54
          }
34
	<xsl:output method="html" />
35
	<xsl:param name="sessid" />
36
	<xsl:param name="qformat">default</xsl:param>
37
	<xsl:param name="enableediting">false</xsl:param>
38
	<xsl:template match="/">
39
		<html>
40
			<head>
41
				<title>Search Results</title>
42
				<link rel="stylesheet" type="text/css"
43
					href="/knb/style/skins/{$qformat}/{$qformat}.css" />
44
				<script language="Javascript" type="text/JavaScript"
45
					src="/knb/style/skins/{$qformat}/{$qformat}.js" />
46
				<script language="Javascript" type="text/JavaScript"
47
					src="/knb/style/common/branding.js" />
48
				<script language="JavaScript">
49
					<![CDATA[
50
					function submitform(action,form_ref) {
51
						form_ref.action.value=action;
52
						form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
53
						form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
54
						form_ref.submit();
55
					}
56
					]]>
57
				</script>
58
			</head>
55 59

  
56
          ]]>
57
        </script>
58
      </head>
60
			<body leftmargin="0" topmargin="0" marginwidth="0"
61
				marginheight="0">
62
				<script language="JavaScript">
63
					insertTemplateOpening(); insertSearchBox();
64
				</script>
59 65

  
60
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
61
      <script language="JavaScript">
62
          insertTemplateOpening();
63
          insertSearchBox();
64
      </script>
65
        <table width="100%" align="center" border="0" cellpadding="5" cellspacing="0">
66
           <tr>
67
             <td align="left"><br></br><p class="emphasis"><xsl:number value="count(resultset/document)" /> records found</p></td>
68
           </tr></table>
69
<!-- This tests to see if there are returned documents,
70
            if there are not then don't show the query results -->
66
				<table style="width:100%;" align="center" border="0"
67
					cellpadding="5" cellspacing="0">
68
					<tr>
69
						<td align="left">
70
							<br />
71
							<p class="emphasis">
72
								<xsl:number
73
									value="count(resultset/document)" />
74
								total records found
75
							</p>
76
						</td>
77
					</tr>
78
				</table>
71 79

  
72
      <xsl:if test="count(resultset/document) &gt; 0">
80
				<table align="center" border="0"
81
					cellpadding="0" cellspacing="0" style="width:98%;">
82
					<tr valign="top">
83
						<!-- ASSESSMENTS HERE  -->
84
						<xsl:if test="count(resultset/document[docname='edml']) &gt; 0">
85
							<td>
86
								<xsl:call-template name="assessmentResults"/>
87
							</td>	
88
						</xsl:if>
89
						
90
						<!-- QUESTIONS HERE  -->
91
						<xsl:if test="count(resultset/document[docname!='edml']) &gt; 0">
92
							<td>
93
								<xsl:call-template name="questionResults"/>
94
							</td>	
95
						</xsl:if>
96
					</tr>	
97
				</table>
98
				
99
				<script language="JavaScript">
100
					insertTemplateClosing();
101
				</script>
102
			</body>
103
		</html>
104
	</xsl:template>
105
	
106
	<xsl:template name="assessmentResults">
107
		<table style="width:95%;" align="center" border="0"
108
			cellpadding="0" cellspacing="0">
109
			<tr>
110
				<th class="tablehead" colspan="5">
111
					Assessments
112
				</th>
113
			</tr>	
114
			<tr>
115
				<th	style="text-align: left">
116
					Assessment
117
				</th>
118
				<th	style="text-align: left">
119
					Course
120
				</th>
121
				<th	style="text-align: left">
122
					Instructor[s]
123
				</th>
124
				<th	style="text-align: left">
125
					Organization[s]
126
				</th>
127
				<th	style="text-align: left">
128
					Keywords
129
				</th>
130
			</tr>
131
	
132
			<xsl:for-each
133
				select="resultset/document[docname='edml']">
134
				<xsl:sort
135
					select="./param[@name='dataset/title']" />
136
				<tr valign="top" class="subpanel">
137
					<xsl:attribute name="class">
138
	              			<xsl:choose>
139
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
140
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
141
						</xsl:choose>
142
					</xsl:attribute>
143
	
144
					<td class="text_plain">
145
						<form action="/knb/metacat"
146
							method="POST">
147
							<xsl:attribute name="name">
148
								<xsl:value-of select="translate(./docid, '()-.', '____')" />
149
							</xsl:attribute>
150
	
151
							<input type="hidden"
152
								name="qformat" />
153
							<input type="hidden"
154
								name="sessionid" />
155
							<input type="hidden"
156
								name="action" value="read" />
157
							<input type="hidden"
158
								name="docid">
159
								<xsl:attribute name="value">
160
									<xsl:value-of select="./docid" />
161
								</xsl:attribute>
162
							</input>
163
							<xsl:for-each
164
								select="./relation">
165
								<input type="hidden"
166
									name="docid">
167
									<xsl:attribute name="value">
168
										<xsl:value-of select="./relationdoc" />
169
									</xsl:attribute>
170
								</input>
171
							</xsl:for-each>
172
	
173
							<a>
174
								<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of	select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
175
								<xsl:text>&#187;&#160;</xsl:text>
176
								<xsl:value-of select="./param[@name='assessment/@assessmentTitle']"/>
177
							</a>
178
							<br />
179
							<br />
180
							<p>
181
								<pre>ID: <xsl:value-of select="./docid" /></pre>
182
							</p>
183
	
184
						</form>
185
					</td>
186
	
187
					<td class="text_plain">
188
						<xsl:value-of
189
							select="./param[@name='lom/general/title/string']" />
190
						<xsl:value-of
191
							select="./param[@name='lom/general/description/string']" />
192
					</td>
193
					<td class="text_plain">
194
						<xsl:for-each
195
							select="./param[@name='individualName/surName']">
196
							<xsl:value-of select="." />
197
							<br />
198
						</xsl:for-each>
199
					</td>
200
					<td class="text_plain">
201
						<xsl:for-each
202
							select="./param[@name='organizationName']">
203
							<xsl:value-of select="." />
204
							<br />
205
						</xsl:for-each>
206
					</td>
207
	
208
					<td class="text_plain">
209
						<xsl:for-each
210
							select="./param[@name='keyword']">
211
							<xsl:value-of select="." />
212
							<br />
213
						</xsl:for-each>
214
						<xsl:for-each
215
							select="./param[@name='lom/general/keyword/string']">
216
							<xsl:value-of select="." />
217
							<br />
218
						</xsl:for-each>
219
	
220
					</td>
221
	
222
				</tr>
223
				<tr class="searchresultsdivider">
224
					<td colspan="5">
225
						<img
226
							src="/knb/style/skins/default/images/transparent1x1.gif"
227
							width="1" height="1" />
228
					</td>
229
				</tr>
230
	
231
			</xsl:for-each>
232
		</table>
233
	</xsl:template>
234
	
235
	<xsl:template name="questionResults">
236
		<table style="width:95%;" align="left" border="0" cellpadding="0"
237
			cellspacing="0">
238
			
239
			<tr>
240
				<th class="tablehead" colspan="3">
241
					Questions
242
				</th>
243
			</tr>	
244
			<tr>
245
				<th	style="text-align: left">
246
					Identifier
247
				</th>
248
				<th	style="text-align: left">
249
					Content
250
				</th>
251
				<th	style="text-align: left">
252
					Metadata/Keywords
253
				</th>
254
			</tr>
73 255

  
74
         <table width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
75
           <tr>
76
             <th class="tablehead" style="text-align: left">Course Title</th>
77
             <th class="tablehead" style="text-align: left">Assessment Title</th>
78
             <th width="15%" class="tablehead" style="text-align: left">Instructor[s]</th>
79
             <th width="15%" class="tablehead" style="text-align: left">Organization[s]</th>
80
             <th width="15%" class="tablehead" style="text-align: left">Keywords</th>
81
             <xsl:if test="$enableediting = 'true'">
82
               <th width="10%" class="tablehead" style="text-align: middle">Actions</th>
83
             </xsl:if>
84
           </tr>
256
			<xsl:for-each select="resultset/document[docname!='edml']">
257
				<xsl:sort select="./param[@name='item/@title']" />
258
				<tr valign="top">
259
					<xsl:attribute name="class">
260
						<xsl:choose>
261
							<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
262
							<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
263
						</xsl:choose>
264
					</xsl:attribute>
85 265

  
86
         <xsl:for-each select="resultset/document">
87
           <xsl:sort select="./param[@name='dataset/title']"/>
88
           <tr valign="top" class="subpanel">
89
             <xsl:attribute name="class">
90
               <xsl:choose>
91
                 <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
92
                 <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
93
               </xsl:choose>
94
             </xsl:attribute>
266
					<td class="text_plain">
267
						<a>
268
							<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
269
							<xsl:text>&#187;&#160;</xsl:text>
270
							<xsl:value-of select="./param[@name='item/@title']" />
271
							<!-- <xsl:value-of select="./param[@name='item/@ident']" />-->
272
						</a>
273
						(<xsl:value-of select="./docid" />)
274
						<form action="/knb/metacat" method="POST">
275
							<xsl:attribute name="name">
276
								<xsl:value-of select="translate(./docid, '()-.', '____')" />
277
							</xsl:attribute>
95 278

  
96
             <td class="text_plain">
97
               <form action="/knb/metacat" method="POST">
98
                 <xsl:attribute name="name">
99
                   <xsl:value-of select="translate(./docid, '()-.', '____')" />
100
                 </xsl:attribute>
279
							<input type="hidden" name="qformat" value="first"/>
280
							<input type="hidden" name="sessionid" />
281
							<xsl:if	test="$enableediting = 'true'">
282
								<input type="hidden"
283
									name="enableediting" value="{$enableediting}" />
284
							</xsl:if>
285
							<input type="hidden" name="action" value="read" />
286
							<input type="hidden" name="docid">
287
								<xsl:attribute name="value">
288
									<xsl:value-of select="./docid" />
289
								</xsl:attribute>
290
							</input>
291
							<xsl:for-each select="./relation">
292
								<input type="hidden" name="docid">
293
									<xsl:attribute name="value">
294
										<xsl:value-of select="./relationdoc" />
295
									</xsl:attribute>
296
								</input>
297
							</xsl:for-each>
298
						</form>	
299
					</td>
300
					
301
					<td class="text_plain">
302
						<xsl:value-of select="./param[@name='presentation/flow/material/mattext']"/>
303
						
304
						<ul>
305
						<xsl:for-each
306
							select="./param[@name='response_label/flow_mat/material/mattext']">
307
							<li>
308
								<xsl:value-of select="." />
309
							</li>	
310
						</xsl:for-each>
311
						</ul>
312
					</td>
313
					
314
					<td>
315
						<table>
316
							<tr>
317
								<td class="text_plain" colspan="2">
318
									Metadata:
319
								</td>
320
							</tr>
321
							<tr>
322
								<td class="text_plain">
323
									<xsl:for-each
324
										select="./param[@name='fieldlabel']">
325
										<xsl:value-of select="." />
326
										<br />
327
									</xsl:for-each>
328
								</td>
329
								
330
								<td class="text_plain">
331
									<xsl:for-each
332
										select="./param[@name='fieldentry']">
333
										<xsl:value-of select="." />
334
										<br />
335
									</xsl:for-each>
336
								</td>
337
							</tr>
338
						</table>
339
					</td>
101 340

  
102
                 <input type="hidden" name="qformat" />
103
                 <input type="hidden" name="sessionid" />
104
                 <xsl:if test="$enableediting = 'true'">
105
	 	           <input type="hidden" name="enableediting" value="{$enableediting}"/>
106
                 </xsl:if>
107
                 <input type="hidden" name="action" value="read"/>
108
                 <input type="hidden" name="docid">
109
                   <xsl:attribute name="value">
110
                     <xsl:value-of select="./docid"/>
111
                   </xsl:attribute>
112
                 </input>
113
                 <xsl:for-each select="./relation">
114
                   <input type="hidden" name="docid">
115
                     <xsl:attribute name="value" >
116
                       <xsl:value-of select="./relationdoc" />
117
                     </xsl:attribute>
118
                   </input>
119
                 </xsl:for-each>
341
				</tr>
342
				<!-- 
343
				<tr>
344
					<td class="text_plain">
345
						<xsl:for-each
346
							select="./param[@name='objectives/material/mattext']">
347
							<xsl:value-of select="." />
348
							<br />
349
						</xsl:for-each>
350
					</td>
351
				</tr>
352
				-->
353
				<tr class="searchresultsdivider">
354
					<td colspan="3">
355
						<img
356
							src="/knb/style/skins/default/images/transparent1x1.gif"
357
							width="1" height="1" />
358
					</td>
359
				</tr>
120 360

  
121
                 <a>
122
                   <xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')"/>)</xsl:attribute>
123
                   <xsl:text>&#187;&#160;</xsl:text>
124
                   <xsl:choose>
125
                     <xsl:when test="./param[@name='dataset/title']!=''">
126
                        <xsl:value-of select="./param[@name='dataset/title']"/>
127
                     </xsl:when>
128
                     <xsl:otherwise>			
129
                       <xsl:value-of select="./param[@name='lom/general/title/string']"/>
130
                       <xsl:value-of select="./param[@name='lom/general/description/string']"/>
131
                     </xsl:otherwise>
132
                   </xsl:choose>
133
                 </a><br />
134
                 <br/>
135
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
361
			</xsl:for-each>
362
		</table>
363
	
364
	</xsl:template>
136 365

  
137
               </form>
138
             </td>
139

  
140
	     <td class="text_plain">
141
               <xsl:for-each select="./param[@name='assessment/@assessmentTitle']" >
142
                 <xsl:value-of select="." />
143
                 <br/>
144
                </xsl:for-each>
145
             </td>
146
             <td class="text_plain">
147
               <xsl:for-each select="./param[@name='individualName/surName']" >
148
                 <xsl:value-of select="." />
149
                 <br/>
150
                </xsl:for-each>
151
             </td>
152
             <td class="text_plain">
153
             	<xsl:for-each select="./param[@name='organizationName']" >
154
					<xsl:value-of select="." />
155
					<br/>
156
				</xsl:for-each>	
157
             </td>
158

  
159
             <td class="text_plain">
160
               <xsl:for-each
161
                select="./param[@name='keyword']">
162
                 <xsl:value-of select="." />
163
                 <br/>
164
               </xsl:for-each>
165
               <xsl:for-each
166
                select="./param[@name='lom/general/keyword/string']">
167
                 <xsl:value-of select="." />
168
                 <br/>
169
               </xsl:for-each>
170

  
171
             </td>
172
	   
173
             <xsl:if test="$enableediting = 'true'">
174
               <td class="text_plain">
175
	       <form action="/knb/metacat" method="POST">
176
	               <input type="hidden" name="action" value="read"/>
177
	 	       <input type="hidden" name="qformat" value="{$qformat}"/>
178
				<input type="hidden" name="sessionid"  value="{$sessid}"/>
179
                       <input type="hidden" name="docid">
180
                       <xsl:attribute name="value">
181
                          <xsl:value-of select="./docid"/>
182
                       </xsl:attribute>
183
                       </input>
184
                       <center>
185
		       <input type="SUBMIT"  value=" View " name="View">
186
 	               </input>
187
	               </center>
188
	             </form>
189
                 <form action="@cgi-prefix@/cgi-bin/register-dataset.cgi" 
190
                       method="POST">
191
	               <input type="hidden" name="stage" value="modify"/>	
192
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
193
					<input type="hidden" name="sessionid"  value="{$sessid}"/>
194
                   <input type="hidden" name="docid">
195
                     <xsl:attribute name="value">
196
                       <xsl:value-of select="./docid"/>
197
                     </xsl:attribute>
198
                   </input>
199
                   <center>
200
		             <input type="SUBMIT"  value=" Edit " name="Edit">
201
 	                 </input>
202
	               </center>
203
	             </form>
204
                 <form action="@cgi-prefix@/cgi-bin/register-dataset.cgi" 
205
                       method="POST">
206
	               <input type="hidden" name="stage" value="delete"/>	
207
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
208
					<input type="hidden" name="sessionid"  value="{$sessid}"/>
209
                   <input type="hidden" name="docid">
210
                     <xsl:attribute name="value">
211
                       <xsl:value-of select="./docid"/>
212
                     </xsl:attribute>
213
                   </input>
214
                   <center>
215
		             <input type="SUBMIT"  value="Delete" name="Delete">
216
 	                 </input>
217
	               </center>
218
	             </form>
219
	           </td>	  
220
             </xsl:if>
221
             </tr>
222
             <tr class="searchresultsdivider">
223
             	<td colspan="5"><img src="/knb/style/skins/default/images/transparent1x1.gif" width="1" height="1" /></td>
224
             </tr>
225

  
226
          </xsl:for-each>
227
          </table>
228

  
229
       </xsl:if>
230
      <script language="JavaScript">
231
          insertTemplateClosing();
232
      </script>
233
    </body>
234
    </html>
235
    </xsl:template>
236

  
237 366
</xsl:stylesheet>
lib/style/skins/first/index.html
42 42

  
43 43
        function checkSearch(submitFormObj) {
44 44
			var searchString = trim(submitFormObj.searchstring.value);
45
 			var checkBox = document.getElementById("searchAll");
45
 			var searchAssessmentsCheckBox = document.getElementById("searchAssessments");
46
 			var searchQuestionsCheckBox = document.getElementById("searchQuestions");
46 47

  
48
			//check the doctype checkboxes for at least one
49
			if ( !(searchAssessmentsCheckBox.checked || searchQuestionsCheckBox.checked) ) {
50
				alert("Please select at least one item type for your search");
51
				searchAssessmentsCheckBox.focus();
52
				return false;
53
			}
54
			
47 55
			if (searchString=="") {
48
				if (confirm("Show *all* data?")) {
56
				if (confirm("No search terms were entered.\nContinue with a wildcardsearch?")) {
49 57
					searchString = "%";
50 58
				} 
51 59
				else {
52 60
          			return false;
53 61
				}
54 62
			}
55

  
56
			if(!checkBox.checked && searchString!="%"){
57
				submitFormObj.query.value = "<pathquery version=\"1.2\">"
58
                                                      +"<querytitle>Web-Search</querytitle>"
63
			
64
			var queryString = 
65
				"<pathquery version=\"1.2\">"
66
					+"<querytitle>Web-Search</querytitle>";
67
					
68
					/** assessments **/
69
					if (searchAssessmentsCheckBox.checked == true) {
70
						queryString +=
71
							"<returndoctype>edml://ecoinformatics.org/edml</returndoctype>"
72
							
73
							//assessment fields
74
			                +"<returnfield>assessment/duration</returnfield>"
75
			                +"<returnfield>assessment/@assessmentTitle</returnfield>"
76
			                +"<returnfield>assessment/@assessmentId</returnfield>"
77
			                +"<returnfield>lom/general/title/string</returnfield>"
78
			                +"<returnfield>lom/general/keyword/string</returnfield>"
79
			                +"<returnfield>individualName/surName</returnfield>"
80
			                +"<returnfield>organizationName</returnfield>";
81
					}
82
										
83
					/** questions **/
84
					if (searchQuestionsCheckBox.checked == true) {
85
						queryString +=
86
							"<returndoctype>http://www.imsglobal.org/xsd/ims_qtiasiv1p2</returndoctype>"
87
							
88
							//question (qti) fields
89
							+"<returnfield>item/@title</returnfield>"
90
							+"<returnfield>item/@ident</returnfield>"
91
			                +"<returnfield>qtimetadata/qtimetadatafield/fieldlabel</returnfield>"
92
			                +"<returnfield>qtimetadata/qtimetadatafield/fieldentry</returnfield>"
93
							//classification
94
							+"<returnfield>fieldlabel</returnfield>"
95
							+"<returnfield>fieldentry</returnfield>"
96
							+"<returnfield>objectives/material/mattext</returnfield>"
97
							//question content
98
							+"<returnfield>presentation/flow/material/mattext</returnfield>"
99
							+"<returnfield>response_label/@ident</returnfield>"
100
							+"<returnfield>response_label/flow_mat/material/mattext</returnfield>";
101
					}		
59 102
                                                      
60
                                                      +"<returndoctype>edml://ecoinformatics.org/edml</returndoctype>"
61
                                                      
62
                                                      +"<returnfield>qtimetadata/qtimetadatafield/fieldlabel</returnfield>"
63
                                                      +"<returnfield>qtimetadata/qtimetadatafield/fieldentry</returnfield>"
64
                                                      +"<returnfield>assessment/duration</returnfield>"
65
                                                      +"<returnfield>assessment/@assessmentTitle</returnfield>"
66
                                                      +"<returnfield>assessment/@assessmentId</returnfield>"
67
                                                      +"<returnfield>lom/general/title/string</returnfield>"
68
                                                      +"<returnfield>lom/general/keyword/string</returnfield>"
69
                                                      +"<returnfield>individualName/surName</returnfield>"
70
                                                      +"<returnfield>organizationName</returnfield>"
71
                                                      
72
                                                      +"<querygroup operator=\"INTERSECT\">"
73
                                                           +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
74
                                                                   +"<value>%</value>"
75
                                                                   +"<pathexpr>organizationName</pathexpr>"
76
                                                           +"</queryterm>"
77
                                                           +"<querygroup operator=\"UNION\">"
78
                                                                   +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
79
                                                                           +"<value>" + searchString + "</value>"
80
                                                                           +"<pathexpr>assessment/@title</pathexpr>"
81
                                                                   +"</queryterm>"
82
                                                                   +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
83
                                                                           +"<value>" + searchString + "</value>"
84
                                                                           +"<pathexpr>surName</pathexpr>"
85
                                                                   +"</queryterm>"
86
                                                                   +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
87
                                                                           +"<value>" + searchString + "</value>"
88
                                                                           +"<pathexpr>givenName</pathexpr>"
89
                                                                   +"</queryterm>"
90
                                                                   +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
91
                                                                           +"<value>" + searchString + "</value>"
92
                                                                           +"<pathexpr>lom/general/keyword/string</pathexpr>"
93
                                                                   +"</queryterm>"
94
                                                           +"</querygroup>"
95
                                                     +"</querygroup>"
96
                                             +"</pathquery>";
97
                } else {
98
                        queryTermString = "";
99
                        if(searchString != "%"){
100
							queryTermString = "<queryterm searchmode=\"contains\" casesensitive=\"false\">"
101
								+"<value>" + searchString + "</value>"
102
								+"</queryterm>";
103
                        }
104
                        submitFormObj.query.value = "<pathquery version=\"1.2\">"
105
                                                           +"<querytitle>Web-Search</querytitle>"
106
                                                                                                                      
107
                                                           +"<returndoctype>edml://ecoinformatics.org/edml</returndoctype>"
108
                                                           
109
                                                           +"<returnfield>qtimetadata/qtimetadatafield/fieldlabel</returnfield>"
110
                                                           +"<returnfield>qtimetadata/qtimetadatafield/fieldentry</returnfield>"
111
                                                           +"<returnfield>assessment/duration</returnfield>"
112
                                                           +"<returnfield>assessment/@assessmentTitle</returnfield>"
113
                                                           +"<returnfield>assessment/@assessmentId</returnfield>"
114
                                                           +"<returnfield>lom/general/title/string</returnfield>"
115
                                                           +"<returnfield>lom/general/keyword/string</returnfield>"
116
                                                           +"<returnfield>individualName/surName</returnfield>"
117
                                                           +"<returnfield>organizationName</returnfield>"
118
                                                           
119
                                                           +"<querygroup operator=\"INTERSECT\">"
120
                                                                +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
121
                                                                        +"<value>%</value>"
122
                                                                        +"<pathexpr>organizationName</pathexpr>"
123
                                                                +"</queryterm>"
124
                                                                + queryTermString
125
                                                           +"</querygroup>"
126
                                                    +"</pathquery>";
127

  
128
                }
129
                return true;
103
			queryString +=
104
                    "<querygroup operator=\"UNION\">"
105
                            +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
106
                                    +"<value>" + searchString + "</value>"
107
                            +"</queryterm>"
108
                    +"</querygroup>"
109
				+"</pathquery>";
110
				
111
			//set the form value	
112
    		submitFormObj.query.value = queryString;
113
    		//alert(submitFormObj.query.value);	
114
			return true;
130 115
        }
131 116

  
132
        function searchAll(){
133
                var checkBox = document.getElementById("searchCheckBox");
134
                if(checkBox.checked == true){
135
                        alert("You have selected to search all possible existing fields. This search will take longer.");
136
                }
137
        }
117
		function browseAll(){
118
			var submitFormObj = document.getElementById("searchForm");
119
			var searchAssessmentsCheckBox = document.getElementById("searchAssessments");
120
			var searchQuestionsCheckBox = document.getElementById("searchQuestions");
121
			
122
			searchAssessmentsCheckBox.checked = true;
123
			searchQuestionsCheckBox.checked = true;
124
			
125
			if (checkSearch(submitFormObj)) {
126
				submitFormObj.submit();
127
			}
128
		}
138 129
   </script>
139 130
</head>
140 131
<body>
......
180 171
			<table class="tables" cellpadding="8" cellspacing="0">
181 172
				<tr class="sectheader">
182 173
					<td class="borderbottom" align="left">
183
						<p align="center">Search assessments and courses</p>
174
						<p align="center">Search Assessments and Questions</p>
184 175
					</td>
185 176
				</tr>
186 177
				<tr class="sectbody"></tr>
......
188 179
				<tr>
189 180
					<td colspan="2" align="left">
190 181
						<form method="POST" action="@servlet-path@" target="_top"
191
							onSubmit="return checkSearch(this)">
182
							onSubmit="return checkSearch(this)" id="searchForm">
192 183
							<span class="searchresultsdividerPale"> 
193 184
								<input value="UNION" name="operator" type="hidden"> &nbsp; 
194 185
								<input size="14" name="searchstring" type="text" value="" id="searchBox"> 
......
200 191
							</span>
201 192
						</form>
202 193
						<form>
203
							<input name="search" type="radio" checked>
204
							Search Titles, Keywords, Instructors (Quicker) 
194
							<input name="search" type="checkbox" id="searchAssessments" checked="checked">
195
							<label for="searchAssessments">Include Assessments</label>
205 196
							<br/>
206
							<input name="search" type="radio" id="searchAll"> 
207
							Search all fields (Slower) 
197
							<input name="search" type="checkbox" id="searchQuestions"> 
198
							<label for="searchQuestions">Include Questions</label>
208 199
							<br />
209 200
						</form>
210 201
						<div align="center">
211
							<p align="left">This tool allows you to search for assessments.
212
							When you type text in the box and click on
213
							the "Search" button, the search will only be conducted within the
202
							<p align="left">This tool allows you to search for Assessments and Questions.
203
							By default, the search will be conducted over all Assessment fields.
204
							These include (but are not limited to):
214 205
							course and assessment titles and descriptions, instructor name, and keyword fields. 
215
							Checking the "Search All Fields" box will search on these and all other existing fields. 
206
							Expanding the search to include Questions will include additional results for question matches
207
							(much like a question bank). 
216 208
							<br />
217 209
							<br />
218 210
							You can use the '%' character as a wildcard in your searches (e.g.,
......
224 216
				<tr>
225 217
					<td class="borderbottom">
226 218
						<div align="center">
227
							<a href="@servlet-path@?action=query&amp;operator=INTERSECT&amp;anyfield=%25&amp;organizationName=%25&amp;qformat=first&amp;enableediting=false&amp;returndoctype=edml://ecoinformatics.org/edml&amp;returnfield=assessment/@assessmentTitle&amp;returnfield=assessment/@assessmentTitle&amp;returnfield=lom/general/title/string&amp;returnfield=lom/general/keyword/string&amp;returnfield=individualName/surName&amp;returnfield=organizationName">
228
							Browse existing FIRST assessments
219
							<a href="javascript:browseAll()">
220
							Browse All FIRST items
229 221
							</a> 
230 222
							<br />
231 223
						</div>

Also available in: Unified diff