Error with module displaying exam grades

Error with module displaying exam grades

Elijah Skorup發表於
Number of replies: 1

Hi,

TQCSI has been using the moodle in order to manage exams.

often, we will check on the folder for a specific standard and use this to check the grades of people who have taken the exam.

I'm no developer so i am not sure why we have begun encountering database errors, this seems to only be occuring for 2 exams, despite nothing being done differently from other exams.

When putting the website into debug menu, the section that is meant to be displaying staff member grades, displays the following:


Error reading from database

More information about this error

Debug info: SQLState: 42000<br>
Error Code: 701<br>
Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]There is insufficient system memory in resource pool 'internal' to run this query.<br>

SELECT TOP 1000
CAST(u.id AS NVARCHAR(255)) + CAST('#' AS NVARCHAR(255)) + CAST(COALESCE(quiza.attempt, 0) AS NVARCHAR(255)) AS uniqueid,
(CASE WHEN (quiza.state = 'finished' AND NOT EXISTS (
SELECT 1 FROM mdl_quiz_attempts qa2
WHERE qa2.quiz = quiza.quiz AND
qa2.userid = quiza.userid AND
qa2.state = 'finished' AND (
COALESCE(qa2.sumgrades, 0) > COALESCE(quiza.sumgrades, 0) OR
(COALESCE(qa2.sumgrades, 0) = COALESCE(quiza.sumgrades, 0) AND qa2.attempt < quiza.attempt)
))) THEN 1 ELSE 0 END) AS gradedattempt,
quiza.uniqueid AS usageid,
quiza.id AS attempt,
u.id AS userid,
u.idnumber, u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.firstname,u.lastname,
u.picture,
u.imagealt,
u.institution,
u.department,
u.email,
quiza.state,
quiza.sumgrades,
quiza.timefinish,
quiza.timestart,
CASE WHEN quiza.timefinish = 0 THEN null
WHEN quiza.timefinish > quiza.timestart THEN quiza.timefinish - quiza.timestart
ELSE 0 END AS duration, COALESCE((
SELECT MAX(qqr.regraded)
FROM mdl_quiz_overview_regrades qqr
WHERE qqr.questionusageid = quiza.uniqueid
), -1) AS regraded
FROM 
mdl_user u
LEFT JOIN mdl_quiz_attempts quiza ON
quiza.userid = u.id AND quiza.quiz = '7'
WHERE u.id IN ('70','71','75','78','82','83','86','89','93','97','98','102','115','123','124','125','126','127','128','130','131','133','120','121','143','144','146','148','149','151','158','159','162','165','166','168','170','174','175','176','178','179','181','183','189','191','193','200','201','202','197','205','206','212','213','214','215','216','217','209','219','220','222','225','227','232','233','238','240','241','245','248','250','253','256','257','258','259','260','261','264','272','274','275','283','284','286','295','296','297','298','300','301','304','307','308','309','311','312','314','316','318','323','330','332','334','335','343','351','352','347','348','359','360','363','364','365','369','370','371','372','356','357','378','379','383','384','388','392','393','394','399','403','404','405','406','408','412','413','415','417','420','422','423','425','428','429','430','439','440','441','444','445','446','447','449','452','453','462','463','464','465','455','456','458','459','460','436','475','481','484','488','489','490','491','492','493','502','508','511','107','76','471','208','268','110','112','474','336','167','198','345','122','466','398','411','293','326','224','516','228','435','358','437','432','169','163','180','177','278','310','276','327','325','476','81','355','337','94','518','289','277','247','161','270','315','105','290','265','242','251','137','210','153','246','207','234','252','152','279','199','407','254','255','226','267','506','114','509','499','503','306','505','507','496','495','504','118','184','287','510','160','211','135','269','285','145','164','431','454','313','487','461','389','291','196','341','571','235','139','374','375','243','377','376','400','322','498','601','60','397','361','362','598','172','448','194','353','244','338','467','473','478','366','157','544','480','477','442','438','427','479','141','426','483','582','109','173','443','140','613','69','616','572','401','501','188','354','294','155','192','186','396','497','239','541','642','230','154','570','116','569','568','402','147','434','129','424','142','421','350','263','494','468','469','218','119','185','223','236','237','117','597','390','340','339','414','416','273','281','331','282','346','64','599','187','418','419','531','136','519','150','305','472','486','395','529','485','410','171','367','292','80','104','61','280','138','231','229','100','111','553','74','321','249','595','324','368','203','221','409','596','67','66','65','623','108','204','500','745','266','72','79','349','391','134','328','333','387','91','57','299','182','195','96','190','77','95','555','382','381','380','106','63','385','59','90','303','73') AND quiza.preview = 0 AND quiza.id IS NOT NULL
ORDER BY quiza.id ASC
[array (
0 => '7',
1 => 70,
2 => 71,
3 => 75,
4 => 78,
5 => 82,
6 => 83,
7 => 86,
8 => 89,
9 => 93,
10 => 97,
11 => 98,
12 => 102,
13 => 115,
14 => 123,
15 => 124,
16 => 125,
17 => 126,
18 => 127,
19 => 128,
20 => 130,
21 => 131,
22 => 133,
23 => 120,
24 => 121,
25 => 143,
26 => 144,
27 => 146,
28 => 148,
29 => 149,
30 => 151,
31 => 158,
32 => 159,
33 => 162,
34 => 165,
35 => 166,
36 => 168,
37 => 170,
38 => 174,
39 => 175,
40 => 176,
41 => 178,
42 => 179,
43 => 181,
44 => 183,
45 => 189,
46 => 191,
47 => 193,
48 => 200,
49 => 201,
50 => 202,
51 => 197,
52 => 205,
53 => 206,
54 => 212,
55 => 213,
56 => 214,
57 => 215,
58 => 216,
59 => 217,
60 => 209,
61 => 219,
62 => 220,
63 => 222,
64 => 225,
65 => 227,
66 => 232,
67 => 233,
68 => 238,
69 => 240,
70 => 241,
71 => 245,
72 => 248,
73 => 250,
74 => 253,
75 => 256,
76 => 257,
77 => 258,
78 => 259,
79 => 260,
80 => 261,
81 => 264,
82 => 272,
83 => 274,
84 => 275,
85 => 283,
86 => 284,
87 => 286,
88 => 295,
89 => 296,
90 => 297,
91 => 298,
92 => 300,
93 => 301,
94 => 304,
95 => 307,
96 => 308,
97 => 309,
98 => 311,
99 => 312,
100 => 314,
101 => 316,
102 => 318,
103 => 323,
104 => 330,
105 => 332,
106 => 334,
107 => 335,
108 => 343,
109 => 351,
110 => 352,
111 => 347,
112 => 348,
113 => 359,
114 => 360,
115 => 363,
116 => 364,
117 => 365,
118 => 369,
119 => 370,
120 => 371,
121 => 372,
122 => 356,
123 => 357,
124 => 378,
125 => 379,
126 => 383,
127 => 384,
128 => 388,
129 => 392,
130 => 393,
131 => 394,
132 => 399,
133 => 403,
134 => 404,
135 => 405,
136 => 406,
137 => 408,
138 => 412,
139 => 413,
140 => 415,
141 => 417,
142 => 420,
143 => 422,
144 => 423,
145 => 425,
146 => 428,
147 => 429,
148 => 430,
149 => 439,
150 => 440,
151 => 441,
152 => 444,
153 => 445,
154 => 446,
155 => 447,
156 => 449,
157 => 452,
158 => 453,
159 => 462,
160 => 463,
161 => 464,
162 => 465,
163 => 455,
164 => 456,
165 => 458,
166 => 459,
167 => 460,
168 => 436,
169 => 475,
170 => 481,
171 => 484,
172 => 488,
173 => 489,
174 => 490,
175 => 491,
176 => 492,
177 => 493,
178 => 502,
179 => 508,
180 => 511,
181 => 107,
182 => 76,
183 => 471,
184 => 208,
185 => 268,
186 => 110,
187 => 112,
188 => 474,
189 => 336,
190 => 167,
191 => 198,
192 => 345,
193 => 122,
194 => 466,
195 => 398,
196 => 411,
197 => 293,
198 => 326,
199 => 224,
200 => 516,
201 => 228,
202 => 435,
203 => 358,
204 => 437,
205 => 432,
206 => 169,
207 => 163,
208 => 180,
209 => 177,
210 => 278,
211 => 310,
212 => 276,
213 => 327,
214 => 325,
215 => 476,
216 => 81,
217 => 355,
218 => 337,
219 => 94,
220 => 518,
221 => 289,
222 => 277,
223 => 247,
224 => 161,
225 => 270,
226 => 315,
227 => 105,
228 => 290,
229 => 265,
230 => 242,
231 => 251,
232 => 137,
233 => 210,
234 => 153,
235 => 246,
236 => 207,
237 => 234,
238 => 252,
239 => 152,
240 => 279,
241 => 199,
242 => 407,
243 => 254,
244 => 255,
245 => 226,
246 => 267,
247 => 506,
248 => 114,
249 => 509,
250 => 499,
251 => 503,
252 => 306,
253 => 505,
254 => 507,
255 => 496,
256 => 495,
257 => 504,
258 => 118,
259 => 184,
260 => 287,
261 => 510,
262 => 160,
263 => 211,
264 => 135,
265 => 269,
266 => 285,
267 => 145,
268 => 164,
269 => 431,
270 => 454,
271 => 313,
272 => 487,
273 => 461,
274 => 389,
275 => 291,
276 => 196,
277 => 341,
278 => 571,
279 => 235,
280 => 139,
281 => 374,
282 => 375,
283 => 243,
284 => 377,
285 => 376,
286 => 400,
287 => 322,
288 => 498,
289 => 601,
290 => 60,
291 => 397,
292 => 361,
293 => 362,
294 => 598,
295 => 172,
296 => 448,
297 => 194,
298 => 353,
299 => 244,
300 => 338,
301 => 467,
302 => 473,
303 => 478,
304 => 366,
305 => 157,
306 => 544,
307 => 480,
308 => 477,
309 => 442,
310 => 438,
311 => 427,
312 => 479,
313 => 141,
314 => 426,
315 => 483,
316 => 582,
317 => 109,
318 => 173,
319 => 443,
320 => 140,
321 => 613,
322 => 69,
323 => 616,
324 => 572,
325 => 401,
326 => 501,
327 => 188,
328 => 354,
329 => 294,
330 => 155,
331 => 192,
332 => 186,
333 => 396,
334 => 497,
335 => 239,
336 => 541,
337 => 642,
338 => 230,
339 => 154,
340 => 570,
341 => 116,
342 => 569,
343 => 568,
344 => 402,
345 => 147,
346 => 434,
347 => 129,
348 => 424,
349 => 142,
350 => 421,
351 => 350,
352 => 263,
353 => 494,
354 => 468,
355 => 469,
356 => 218,
357 => 119,
358 => 185,
359 => 223,
360 => 236,
361 => 237,
362 => 117,
363 => 597,
364 => 390,
365 => 340,
366 => 339,
367 => 414,
368 => 416,
369 => 273,
370 => 281,
371 => 331,
372 => 282,
373 => 346,
374 => 64,
375 => 599,
376 => 187,
377 => 418,
378 => 419,
379 => 531,
380 => 136,
381 => 519,
382 => 150,
383 => 305,
384 => 472,
385 => 486,
386 => 395,
387 => 529,
388 => 485,
389 => 410,
390 => 171,
391 => 367,
392 => 292,
393 => 80,
394 => 104,
395 => 61,
396 => 280,
397 => 138,
398 => 231,
399 => 229,
400 => 100,
401 => 111,
402 => 553,
403 => 74,
404 => 321,
405 => 249,
406 => 595,
407 => 324,
408 => 368,
409 => 203,
410 => 221,
411 => 409,
412 => 596,
413 => 67,
414 => 66,
415 => 65,
416 => 623,
417 => 108,
418 => 204,
419 => 500,
420 => 745,
421 => 266,
422 => 72,
423 => 79,
424 => 349,
425 => 391,
426 => 134,
427 => 328,
428 => 333,
429 => 387,
430 => 91,
431 => 57,
432 => 299,
433 => 182,
434 => 195,
435 => 96,
436 => 190,
437 => 77,
438 => 95,
439 => 555,
440 => 382,
441 => 381,
442 => 380,
443 => 106,
444 => 63,
445 => 385,
446 => 59,
447 => 90,
448 => 303,
449 => 73,
)] 
Error code: dmlreadexception
Stack trace:
  • line 443 of \lib\dml\moodle_database.php: dml_read_exception thrown
  • line 250 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
  • line 357 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
  • line 792 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
  • line 840 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
  • line 1475 of \lib\tablelib.php: call to sqlsrv_native_moodle_database->get_records_sql()
  • line 542 of \mod\quiz\report\attemptsreport_table.php: call to table_sql->query_db()
  • line 298 of \mod\quiz\report\overview\overview_table.php: call to quiz_attempts_report_table->query_db()
  • line 1495 of \lib\tablelib.php: call to quiz_overview_table->query_db()
  • line 230 of \mod\quiz\report\overview\report.php: call to table_sql->out()
  • line 96 of \mod\quiz\report.php: call to quiz_overview_report->display()
Please advise on further action.


評比平均分數: -
In reply to Elijah Skorup

Re: Error with module displaying exam grades

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片

I don't use Microsoft products but did you Google the error it's giving you "There is insufficient system memory in resource pool 'internal' to run this query"?  That's an error from the SQL server, not Moodle. 

There seems to be loads of information online that might help you. 

For example, https://support.microsoft.com/en-gb/help/982854/fix-error-there-is-insufficient-system-memory-in-resource-pool-interna