瀏覽代碼

删除没用的 学生,老师视图

yourname 6 月之前
父節點
當前提交
d47cb3c2af
共有 2 個文件被更改,包括 0 次插入138 次删除
  1. 0 58
      client/mobile/components/Classroom/StudentView.tsx
  2. 0 80
      client/mobile/components/Classroom/TeacherView.tsx

+ 0 - 58
client/mobile/components/Classroom/StudentView.tsx

@@ -1,58 +0,0 @@
-import React, { useState } from 'react';
-import { useClassroomContext } from './ClassroomProvider.tsx';
-import { ClassStatus } from './useClassroom.ts';
-
-export const StudentView = () => {
-  const {
-    handUp,
-    sendQuestion,
-    classStatus,
-    isJoinedClass
-  } = useClassroomContext();
-  const [questionText, setQuestionText] = useState('');
-
-  const handleSendQuestion = () => {
-    if (questionText.trim()) {
-      sendQuestion(questionText);
-      setQuestionText('');
-    }
-  };
-
-  return (
-    <div className="space-y-4">
-      {isJoinedClass && (
-        <div className="mt-4 p-4 bg-white rounded-md shadow">
-          <h4 className="text-lg font-medium mb-2">互动功能</h4>
-          <div className="space-y-3">
-            <button
-              type="button"
-              className="w-full px-3 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 disabled:bg-gray-400"
-              onClick={() => handUp()}
-              disabled={classStatus !== ClassStatus.IN_PROGRESS}
-            >
-              {classStatus === ClassStatus.IN_PROGRESS ? '举手' : '课堂未开始'}
-            </button>
-            <div className="flex space-x-2">
-              <input
-                type="text"
-                placeholder="输入问题..."
-                className="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
-                value={questionText}
-                onChange={(e) => setQuestionText(e.target.value)}
-                onKeyPress={(e) => e.key === 'Enter' && handleSendQuestion()}
-              />
-              <button
-                type="button"
-                className="px-3 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:bg-gray-400"
-                onClick={handleSendQuestion}
-                disabled={!questionText.trim() || classStatus !== ClassStatus.IN_PROGRESS}
-              >
-                提问
-              </button>
-            </div>
-          </div>
-        </div>
-      )}
-    </div>
-  );
-};

+ 0 - 80
client/mobile/components/Classroom/TeacherView.tsx

@@ -1,80 +0,0 @@
-import React from 'react';
-import { useClassroomContext } from './ClassroomProvider.tsx';
-import { ClassStatus } from './useClassroom.ts';
-
-export const TeacherView = () => {
-  const {
-    startClass,
-    endClass,
-    muteStudent,
-    kickStudent,
-    handUpList,
-    questions,
-    classStatus
-  } = useClassroomContext();
-
-  return (
-    <div className="space-y-4">
-
-      <div className="flex space-x-2">
-        <button
-          onClick={startClass}
-          disabled={classStatus === ClassStatus.IN_PROGRESS}
-          className="px-4 py-2 bg-blue-500 text-white rounded disabled:bg-gray-400"
-        >
-          {classStatus === ClassStatus.IN_PROGRESS ? '课堂已开始' : '开始课堂'}
-        </button>
-        <button
-          onClick={endClass}
-          disabled={classStatus !== ClassStatus.IN_PROGRESS}
-          className="px-4 py-2 bg-red-500 text-white rounded disabled:bg-gray-400"
-        >
-          结束课堂
-        </button>
-      </div>
-
-      {handUpList.length > 0 && (
-        <div className="bg-yellow-50 p-3 rounded">
-          <h3 className="font-bold mb-2">举手列表</h3>
-          <ul className="space-y-1">
-            {handUpList.map((student, i) => (
-              <li key={i} className="flex justify-between items-center">
-                <span>{student.studentName || student.studentId}</span>
-                <div className="space-x-2">
-                  <button
-                    onClick={() => muteStudent(student.studentId)}
-                    className="text-xs px-2 py-1 bg-gray-200 rounded"
-                  >
-                    静音
-                  </button>
-                  <button
-                    onClick={() => kickStudent(student.studentId)}
-                    className="text-xs px-2 py-1 bg-red-200 rounded"
-                  >
-                    移出
-                  </button>
-                </div>
-              </li>
-            ))}
-          </ul>
-        </div>
-      )}
-
-      {questions.length > 0 && (
-        <div className="bg-blue-50 p-3 rounded">
-          <h3 className="font-bold mb-2">学生提问</h3>
-          <ul className="space-y-2">
-            {questions.map((q, i) => (
-              <li key={i} className="border-b pb-2">
-                <p className="font-medium">{q.studentName || q.studentId}: {q.question}</p>
-                <p className="text-sm text-gray-600">
-                  {new Date(q.timestamp).toLocaleTimeString()}
-                </p>
-              </li>
-            ))}
-          </ul>
-        </div>
-      )}
-    </div>
-  );
-};