Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 1432... Línea 1432...
1432
    if (is_numeric($questionorid)) {
1432
    if (is_numeric($questionorid)) {
1433
        $questionid = (int)$questionorid;
1433
        $questionid = (int)$questionorid;
1434
    } else if (is_object($questionorid)) {
1434
    } else if (is_object($questionorid)) {
1435
        // All we really need in this function is the contextid and author of the question.
1435
        // All we really need in this function is the contextid and author of the question.
1436
        // We won't bother fetching other details of the question if these 2 fields are provided.
1436
        // We won't bother fetching other details of the question if these 2 fields are provided.
1437
        if (isset($questionorid->contextid) && isset($questionorid->createdby)) {
1437
        if (isset($questionorid->contextid) && property_exists($questionorid, 'createdby')) {
1438
            $question = $questionorid;
1438
            $question = $questionorid;
1439
        } else if (!empty($questionorid->id)) {
1439
        } else if (!empty($questionorid->id)) {
1440
            $questionid = $questionorid->id;
1440
            $questionid = $questionorid->id;
1441
        }
1441
        }
1442
    }
1442
    }
Línea 1463... Línea 1463...
1463
                      JOIN {question_categories} qc
1463
                      JOIN {question_categories} qc
1464
                        ON qc.id = qbe.questioncategoryid
1464
                        ON qc.id = qbe.questioncategoryid
1465
                     WHERE q.id = :id';
1465
                     WHERE q.id = :id';
Línea 1466... Línea 1466...
1466
 
1466
 
1467
            // Well, at least we tried. Seems that we really have to read from DB.
1467
            // Well, at least we tried. Seems that we really have to read from DB.
1468
            $question = $DB->get_record_sql($sql, ['id' => $questionid]);
1468
            $question = $DB->get_record_sql($sql, ['id' => $questionid], MUST_EXIST);
1469
        }
1469
        }
Línea 1470... Línea 1470...
1470
    }
1470
    }
1471
 
1471