Project

General

Profile

1 4235 leinfelder
<%@ page    language="java" %>
2
<%
3 5031 daigle
	/**
4 4235 leinfelder
 *
5
 * '$RCSfile$'
6
 * Copyright: 2008 Regents of the University of California and the
7
 *             National Center for Ecological Analysis and Synthesis
8
 *    '$Author$'
9
 *      '$Date$'
10
 * '$Revision$'
11
 *
12
 * This program is free software; you can redistribute it and/or modify
13
 * it under the terms of the GNU General Public License as published by
14
 * the Free Software Foundation; either version 2 of the License, or
15
 * (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU General Public License for more details.
21
22
 * You should have received a copy of the GNU General Public License
23
 * along with this program; if not, write to the Free Software
24
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25 5031 daigle
 */
26 4235 leinfelder
%>
27
28
<%@ include file="../../common/common-settings.jsp"%>
29
<%@ include file="../../common/configure-check.jsp"%>
30
31 3510 leinfelder
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
32
<html>
33
<head>
34
<title>FIRST Assessment Metadata Repository</title>
35
<link rel="stylesheet" type="text/css"
36 4235 leinfelder
	href="<%=STYLE_SKINS_URL%>/first/first.css">
37 3510 leinfelder
<script language="JavaScript" type="text/JavaScript"
38 4235 leinfelder
	src="<%=STYLE_SKINS_URL%>/first/first.js"></script>
39 3510 leinfelder
<script language="JavaScript" type="text/JavaScript"
40 4290 leinfelder
	src="<%=STYLE_SKINS_URL%>/first/search.js"></script>
41
<script language="JavaScript" type="text/JavaScript"
42 4235 leinfelder
	src="<%=STYLE_COMMON_URL%>/branding.js"></script>
43 4290 leinfelder
<script language="Javascript" type="text/JavaScript"
44
	src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js">
45 4388 leinfelder
</script>
46
<script language="Javascript" type="text/JavaScript"
47
	src="<%=STYLE_COMMON_URL%>/effects.js">
48
</script>
49 3510 leinfelder
<script language="Javascript">
50
51 4364 leinfelder
		function browseAll() {
52
			document.getElementById("searchBox").value = "%";
53 5058 leinfelder
			searchAssessments(false);
54 4364 leinfelder
		}
55
56 5058 leinfelder
		function searchAssessments(includeItems) {
57 4364 leinfelder
			var searchString = document.getElementById("searchBox").value;
58
			var institution = document.getElementById("institution").value;
59
			var instructor = document.getElementById("instructor").value;
60
			var course = document.getElementById("course").value;
61
			var year = document.getElementById("year").value;
62 4562 leinfelder
			var otherField = document.getElementById("otherField").value;
63
			var otherValue = document.getElementById("otherValue").value;
64 4932 leinfelder
			//keywords
65
			var keywordThesaurus1 = document.getElementById("keywordThesaurus1").value;
66
			var keyword1 = document.getElementById("keyword1").value;
67
68
69 4364 leinfelder
			var searchTerms = new Object();
70
			searchTerms["anyValue"] = searchString;
71
			searchTerms["institution/organizationName"] = institution;
72
			searchTerms["instructor/individualName/surName"] = instructor;
73
			searchTerms["course/lom/general/title/string"] = course;
74
			searchTerms["course/year"] = year;
75 4562 leinfelder
			searchTerms[otherField] = otherValue;
76 4932 leinfelder
			//TODO: implement thesaurus matching (compound INTERSECTION)
77
			searchTerms["keyword"] = keyword1;
78 3550 leinfelder
79 4364 leinfelder
			var operator = "UNION";
80
			if (document.getElementById("all").checked) {
81
				operator = "INTERSECT";
82 3510 leinfelder
			}
83 5058 leinfelder
			if (document.getElementById("includeItems").checked) {
84
				includeItems = true;
85
			} else {
86
				includeItems = false;
87
			}
88 3550 leinfelder
89 4290 leinfelder
			var metacatURL = "<%=CONTEXT_URL%>/metacat";
90
91 5058 leinfelder
			//generate the query for items
92
			var itemQueryString =
93 4290 leinfelder
				generateSearchString(
94 4364 leinfelder
					searchTerms,
95 5058 leinfelder
					null,
96 4364 leinfelder
					operator,
97 5058 leinfelder
					false,
98
					true);
99 4364 leinfelder
100 5058 leinfelder
			//alert("itemQueryString=" + itemQueryString);
101
102
			loadAssessments = function(transport) {
103
104
				//harvest the itemIds
105
				var itemIds = new Object();
106
				var itemIdForm = document.getElementById("itemIdForm");
107
				if (itemIdForm) {
108
					var itemIdObj = itemIdForm.itemIds;
109
					//alert("itemIdObj=" + itemIdObj);
110
111
					if (itemIdObj.length > 1) {
112
						for (var i=0; i < itemIdObj.length; i++) {
113
							itemIds[i] = itemIdObj[i].value;
114
						}
115
					} else {
116
						itemIds[0] = itemIdObj.value;
117
					}
118
				}
119
120
				//generate the assessment query with item ids included
121
				var queryString =
122
					generateSearchString(
123
							searchTerms,
124
							itemIds,
125
							operator,
126
							true,
127
							false);
128
129
				//alert("queryString=" + queryString);
130
131
				//load the assessments
132
				callAjax(metacatURL, queryString, "first-assessment", "ajaxSearchResults", null);
133
				Effect.Appear('ajaxSearchResults', {duration: 1.5});
134
			};
135
136
			//do we search using the items or not?
137
			if (includeItems) {
138
				//load the items (which calls the function above)
139
				callAjax(metacatURL, itemQueryString, "first-item", "itemSearchResults", loadAssessments);
140
			} else {
141
				//generate the assessment query with item ids included
142
				var queryString =
143
					generateSearchString(
144
							searchTerms,
145
							null,
146
							operator,
147
							true,
148
							false);
149
				// just load the assessments
150
				callAjax(metacatURL, queryString, "first-assessment", "ajaxSearchResults", null);
151
				Effect.Appear('ajaxSearchResults', {duration: 1.5});
152
			}
153 4290 leinfelder
		}
154 3510 leinfelder
   </script>
155
</head>
156
<body>
157
<script language="JavaScript">
158 4235 leinfelder
          insertTemplateOpening("<%=CONTEXT_URL%>");
159
          insertSearchBox("<%=CONTEXT_URL%>");
160 3510 leinfelder
      </script>
161
162 4386 leinfelder
<table width="100%" border="0" cellspacing="20" cellpadding="0">
163 3510 leinfelder
	<tr>
164 4388 leinfelder
		<th colspan="2">
165
			Search
166
		</th>
167
	</tr>
168
	<tr>
169 3510 leinfelder
		<td>
170 4364 leinfelder
			<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="searchForm">
171 3510 leinfelder
172
			<table class="tables" cellpadding="8" cellspacing="0">
173
				<tr class="sectheader">
174 4388 leinfelder
175 4364 leinfelder
					<td class="borderbottom" align="left" colspan="2">
176 4388 leinfelder
						Any field:
177
						<input size="30" name="searchstring" type="text" value="" id="searchBox">
178 3510 leinfelder
					</td>
179 4388 leinfelder
180 4364 leinfelder
				</tr>
181 3510 leinfelder
				<tr>
182 4932 leinfelder
					<td valign="top" align="left" class="borderbottom">
183 4362 leinfelder
184 4364 leinfelder
						<input name="query" type="hidden">
185
						<input name="qformat" value="first" type="hidden">
186
						<input type="hidden" name="action" value="squery">
187 4305 leinfelder
188 4364 leinfelder
						<table>
189
							<tr>
190 4932 leinfelder
								<td nowrap="nowrap">Question contains: </td>
191
								<td><input disabled="disabled" readonly="readonly" name="question" id="question" type="text" size="14"/></td>
192
							</tr>
193
							<tr>
194 4364 leinfelder
								<td>Institution: </td>
195
								<td><input name="institution" id="institution" type="text" size="14"/></td>
196
							</tr>
197
							<tr>
198
								<td>Course: </td>
199
								<td><input name="course" id="course" type="text" size="14"/></td>
200
							</tr>
201
							<tr>
202
								<td>Instructor: </td>
203
								<td><input name="instructor" id="instructor" type="text" size="14"/></td>
204
							</tr>
205
							<tr>
206
								<td>Year: </td>
207
								<td><input name="year" id="year" type="text" size="4"/></td>
208
							</tr>
209 4932 leinfelder
210
						</table>
211
					</td>
212
					<td valign="top" class="borderbottom">
213
						<table>
214 4562 leinfelder
							<tr>
215
								<td>
216 4997 leinfelder
									<select id="otherField" name="otherField">
217 4636 leinfelder
										<option value="assessment/title">Assessment Title</option>
218
										<option value="assessment/type">Assessment Type</option>
219 4562 leinfelder
										<option value="assessment/duration">Assessment Duration</option>
220 4932 leinfelder
										<option value="assessment/grading/@group">Group Grading</option>
221
										<option value="assessment/grading/@size">Group Size</option>
222
										<option value="assessment/grading">Group Grading Approach</option>
223
224
										<option value="course/lom/general/identifier/entry">Course Id</option>
225
										<option value="course/lom/general/title/string">Course Title</option>
226
										<option value="course/lom/general/description/string">Course Description</option>
227 4562 leinfelder
										<option value="course/term">Course Term</option>
228 4932 leinfelder
										<option value="course/year">Course Year</option>
229
										<option value="course/coverage/rangeOfDates/beginDate/calendarDate">Course Start Date</option>
230
										<option value="course/coverage/rangeOfDates/endDate/calendarDate">Course End Date</option>
231
232
										<option value="institution/organizationName">Institution Name</option>
233
										<option value="instructor/individualName/surName">Instructor Surname</option>
234
										<option value="instructor/organizationName">Instructor Organization</option>
235
236 4562 leinfelder
									</select>
237
								</td>
238
								<td><input name="otherValue" id="otherValue" type="text" size="14"/></td>
239
							</tr>
240 4932 leinfelder
							<tr>
241
								<td colspan="2"><input type="button" value="+"/></td>
242
							</tr>
243
							<tr>
244
								<td colspan="2">Keywords</td>
245
							</tr>
246
							<tr>
247
								<td>
248
									<select id="keywordThesaurus1" name="keywordThesaurus1">
249
										<option value=""></option>
250
										<option value="keywordThesaurus">NBII</option>
251
										<option value="keywordThesaurus">Bloom</option>
252
									</select>
253
								</td>
254
								<td><input name="keyword1" id="keyword1" type="text" size="14"/></td>
255
							</tr>
256
							<tr>
257
								<td colspan="2"><input type="button" value="+"/></td>
258
							</tr>
259
260 4364 leinfelder
						</table>
261 3510 leinfelder
					</td>
262 4932 leinfelder
				</tr>
263
				<tr>
264
					<td valign="top" class="borderbottom">
265
						<table>
266 4364 leinfelder
							<tr>
267
								<td nowrap="nowrap">
268
									<input name="anyAll" id="any" value="UNION" type="radio" checked="checked"/>
269
								</td>
270
								<td nowrap="nowrap">Match any</td>
271
							</tr>
272
							<tr>
273
								<td nowrap="nowrap">
274
									<input name="anyAll" id="all" value="INTERSECT" type="radio"/>
275
								</td>
276
								<td nowrap="nowrap">Match all</td>
277
							</tr>
278 5058 leinfelder
							<tr>
279
								<td nowrap="nowrap">
280
									<input name="includeItems" id="includeItems" checked="checked" type="checkbox"/>
281
								</td>
282
								<td nowrap="nowrap">Search across Items</td>
283
							</tr>
284 4932 leinfelder
						</table>
285
					</td>
286
					<td valign="bottom" class="borderbottom">
287
						<table>
288 4364 leinfelder
							<tr>
289 4388 leinfelder
								<td colspan="2">
290 5058 leinfelder
									<input type="button" onclick="javascript:searchAssessments(true)" value="Search"/>
291 4388 leinfelder
								</td>
292
							</tr>
293 4364 leinfelder
						</table>
294
					</td>
295 3510 leinfelder
				</tr>
296
			</table>
297 4364 leinfelder
			</form>
298
299 3510 leinfelder
		</td>
300 4364 leinfelder
		<td colspan="1" valign="top">
301 4388 leinfelder
			<div align="left">
302 4364 leinfelder
				<p align="left">This tool allows you to search for Assessments either by keyword,
303
				or with a structured search that targets particular facets of an assessment.
304
				<br />
305
				<br />
306
				You can use the '%' character as a wildcard in your searches (e.g.,
307
				'%biology%' would locate any phrase with the word biology embedded within it).
308
				</p>
309 4388 leinfelder
				<a href="javascript:browseAll()">Browse All Assessments...</a>
310 4364 leinfelder
			</div>
311
		</td>
312 3510 leinfelder
	</tr>
313 4364 leinfelder
	<tr>
314
		<td valign="top" colspan="2">
315 4393 leinfelder
			<div id="ajaxSearchResults" style="display:none;">
316
				Loading search results
317
				<img src="<%=CONTEXT_URL%>/style/images/spinner.gif" border="none"/>
318
			</div>
319 4364 leinfelder
		</td>
320
	</tr>
321 5058 leinfelder
	<tr>
322
		<td valign="top" colspan="2">
323
			<div id="itemSearchResults" style="display:none;">
324
				Loading Assessment Item results
325
				<img src="<%=CONTEXT_URL%>/style/images/spinner.gif" border="none"/>
326
			</div>
327
		</td>
328
	</tr>
329 3510 leinfelder
</table>
330
331
<script language="JavaScript">
332 4235 leinfelder
    insertTemplateClosing("<%=CONTEXT_URL%>");
333 3510 leinfelder
</script>
334
</body>
335
</html>