45 lines
1.3 KiB
JSON
45 lines
1.3 KiB
JSON
{
|
|
"db_name": "SQLite",
|
|
"query": "SELECT\n q.id as question_id,\n q.text as question_text,\n q.section,\n COUNT(sa.id) as \"total_count: i64\",\n SUM(CASE WHEN sa.correct = 1 THEN 1 ELSE 0 END) as \"correct_count: i64\"\n FROM questions q\n LEFT JOIN student_answers sa ON sa.question_id = q.id\n LEFT JOIN submissions s ON s.id = sa.submission_id AND s.quiz_id = ?\n WHERE q.quiz_id = ?\n GROUP BY q.id\n ORDER BY q.position",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"name": "question_id",
|
|
"ordinal": 0,
|
|
"type_info": "Integer"
|
|
},
|
|
{
|
|
"name": "question_text",
|
|
"ordinal": 1,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "section",
|
|
"ordinal": 2,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "total_count: i64",
|
|
"ordinal": 3,
|
|
"type_info": "Integer"
|
|
},
|
|
{
|
|
"name": "correct_count: i64",
|
|
"ordinal": 4,
|
|
"type_info": "Integer"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Right": 2
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
false
|
|
]
|
|
},
|
|
"hash": "062cb95763326b6381b2d63523c5256a246a127d68829b94954782ac635ca256"
|
|
}
|